Emulate enum-like behavior using string literal types in TypeScript
May 31, 2020 — Sometimes, all you want to do is a custom type populated with a set of predefined strings which can be used to restrict a variable to only have values from this set of strings.