Use function interface to ensure parameters but infer more specific return type
问题 I have a function signature that I need a bunch of functions to follow which is something like this: type ActionCallback<R = any> = (param1: SpecificType, param2: OtherType) => Promise<R> Basically the types for the parameters are well defined and it must return a promise but what that promise resolves to is up to the function. Instead of having to specify the type of both arguments in every callback I'd like to just specify the variable conforms to ActionCallback so the parameters types are