enum in type typescript code example
Example 1: typescript type from enum values
enum Weekday {
MONDAY = 'mon',
TUESDAY = 'tue',
WEDNESDAY = 'wed'
}
type WeekdayType = `${Weekday}`;
Example 2: enums in typescript
enum Direction {
Up = 1,
Down,
Left,
Right,
}