Because enums are just objects under the hood, you can iterate over all possible values of an enum using a for...in loop. Since string literal unions are only types, this isn't possible. However, it's possible to define the set of possible of values first and then derive a union type from it, like this: