Reputation: 100322
I want to create a type that needs to be a function that when called will always return an object that has the property type: string
, but I don't care about the parameters passed to this function.
So for example:
foo(1, 'bar'); // returns { type: '', etc: 1 }
baz('bar', new Date()); // returns { type: '', xyz: 2 }
bar(); // returns { type: '', etc: 3, so: 10 }
All of these should be valid for this type, because I don't care about the parameters I'm using to call the function, all I care is that it returns the property type: string
when called.
How can I setup a type like this?
Upvotes: 2
Views: 55