4 ms·
TypeScript has the equivalent of what you're describing via the `Parameters` and `ReturnType` utility types [1][2], and I've found these types indispensable. So
by throwitaway1123 2y ago
TypeScript has the equivalent of what you're describing via the `Parameters` and `ReturnType` utility types [1][2], and I've found these types indispensable. So you can do the following:
type R = ReturnType<typeof someFunction>
type P = Parameters<typeof someFunction>
[1] https://www.typescriptlang.org/docs/handbook/utility-types.html#parameterstype https://www.typescriptlang.org/docs/handbook/utility-types.h...
[2] https://www.typescriptlang.org/docs/handbook/utility-types.html#returntypetype https://www.typescriptlang.org/docs/handbook/utility-types.h...
- solidsnack9000 2y agoYeah, now that you mention it, I remember using it a lot when I worked more in that language.