I have a getter function. This getter function returns a generic function. I can obtain the type of this generic function as follows:
type GenericFunctionType = ReturnType<typeof getterFunction>;
Above, GenericFunctionType has the type <T>(arg0: whatever, arg1: whatever) => Promise<SomeGenericType<T>>.
Now, I would like to be able to manipulate the type parameter T here. That is, for example I would like GenericFunctionType's type to be <T>(arg0: whatever, arg1: whatever) => Promise<SomeGenericType<{ payload: T }>> instead.
To do so, I've tried type GenericFunctionType<T> = ReturnType<typeof getterFunction><{ payload: T }>; but this is not working.
Is it possible to achieve what I like?