I\'m trying to limit some string fields to be only of certain values at compile time. The problem is that those values should be extendable. Here\'s a simplified example:
To achieve what you need, you can use intersection via the & symbol.
&
type Foobar = 'FOO' | 'BAR'; type FoobarBaz = Foobar | & 'BAZ'; // or: 'BAZ' | & Foobar