Answer the question
In order to leave comments, you need to log in
Is it possible to take a type from a union?
Tell me, is there a similar type,
is it possible to somehow pull out one of the subtypes by passing the type number as a generic? To work like this?
type Union = { type: 1 } | { type: 2 };
type Result = PickType<Union, 1> // result = { type: 1 }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question