enum ENUM_POSITION_TYPE {
LEFT = 1,
RIGHT = 2
}
// type PositionType = 1 | 2
type PositionType = ???
export let a1: PositionType = ENUM_POSITION_TYPE.RIGHT //correct
export let a2: PositionType = 1 as const //correct
export let a3: PositionType = 3 //typescript error
I prefer not to have the type definition explicitly in my code like type PositionType = 1 | 2
. I want to avoid having to manually update the type when adding new values to the enum.