I want to type a function that takes in something OR nothing in typescript. How do I do that?
I've tried:
interface TestFn {
(props: any | void): string
}
const thing: TestFn = (props) => 'whoo';
thing('something'); // this line is fine
thing(); // this is not okay