'Is it possible to create an enum type from a union type with TypeScript
I have this union type:
export type MyType = 'value_one' | 'value_two' | 'value_three';
Is it possible to create an enum out of this and use above values so I don't have to hardcode them again?
enum NewType {
ValueOne = // ??,
ValueTwo = // ??,
ValueThree = // ??,
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
