A lot of the time, you want to define union types in typescript, and you would set it up like this by default for a small collection of enumerated values-as-types:
|
|
A better way to scale this with more value options, is to use an array index as a type, and have that array contain your options:
|
|
This would do the same thing but it is way less annoying to deal with when you end up with a lot of options.