introspection on custom typescript type

Viewed 4561

I define a custom type in typescript

type MyType = 'left' | 'right';

How can I check a variable match with this type? How can I iterate on the possible values of this type? (to create a corresponding select element for example)

3 Answers
Related