Since TS 3.4 you can have enum-like behaviour by using the `as const` annotation on object and array literals.
const types = ['x', 'y', 'z'] as const;
const a: typeof types[number] = 'a'; // not ok
const b: typeof types[number] = 'z'; // ok