-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Labels
Description
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.
const MyNumber = coerce(number(), string(), (value) => parseFloat(value))
type OutputType = number // generated by InferHowever, it can accept numbers & strings.
So the input type would be:
type InputType = string | numberI 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.
vtrushin, weewoo64 and amok