I’m not sure this is possible, and it’s kind of difficult to explain.
I have a generic function foo<T> where the return type depends on the generic parameter type. I am trying to build a utility type similar to ReturnType except that the value of T in foo is specified as a separate parameter. So instead of ReturnType<typeof foo<number>>, it would be ReturnTypeOf<typeof foo, number>, which would return the same thing. Is this (or something similar) possible?
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.