| ▲ | solidsnack9000 a year ago | |||||||
It seems like the author is looking for the ability to specify types as `typeof <function>:arguments` and `typeof <function>:return`. I can see how this could make prototyping easier. It is also helpful for cases (not uncommon in Python) where you're just proxying another function. | ||||||||
| ▲ | throwitaway1123 a year ago | parent | next [-] | |||||||
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:
[1] https://www.typescriptlang.org/docs/handbook/utility-types.h...[2] https://www.typescriptlang.org/docs/handbook/utility-types.h... | ||||||||
| ||||||||
| ▲ | a year ago | parent | prev | next [-] | |||||||
| [deleted] | ||||||||
| ▲ | 1_1xdev1 a year ago | parent | prev [-] | |||||||
Like `ParamSpec`? | ||||||||
| ||||||||