4 ms·
I believe you could have a Protocol that requires the property and that the object is Callable.
by dataangel 3y ago
I believe you could have a Protocol that requires the property and that the object is Callable.
- c-hendricks 3y agoAh, that's not really that different than in TypeScript then. There you have to define a callable interface, and can add whatever properties you want interface SomethingCallableWithAnExtraProperty { // This means you can call it like a function. (args: Whatever): SomethingReturned // And since it's an interface, you can still do interface-y things anotherProperty: string }