Conditional Type
Is it possible to have a type which resolves between two types with a conditional whether a field on an object exists or not.
I want to achieve something like this
I know the example can be resolved with another way but my use case is more complex. I just want the type to be resolved like that. How do you go about this?
2 Replies
the only way if extending a type would be like
Documentation - Conditional Types
Create types which act like if statements in the type system.