How can I create a function in typescript that accepts either something or nothing as input?
I attempted the following:
interface TestFn {
(input: any | void): string
}
const operation: TestFn = (input) => 'result';
operation('some data'); // this works
operation(); // this will throw an error