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