-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Infer the other way. #1159
Comments
Very cool idea, I'd be open to a pull request that implements this! Feel free to talk through the implementation here too to see if it will work or what the gotchas might be. |
Sadly I'm just learning typescript, so I'm not sure if I can be much help atm. (This might change in the future XD) |
@ianstormtaylor I took a stab at this here: #1181 It's probably not mergeable as-is, but lmk what you think. |
Cool work @ziad-saab 👍. @ianstormtaylor What do you think? |
Bump, would like this change to be added in. Have you had a change to look? @ianstormtaylor |
The Infer function is great because it allows us to get the output types of a given struct.
However, it would also be great to be able to get the input types of a given struct.
I'll give an example of the difference:
The following struct will always output a number.
However, it can accept numbers & strings.
So the input type would be:
I need a way to
Infer
the input type of a struct.Also, I think this would be a great addition to the already great lib.
The text was updated successfully, but these errors were encountered: