I have one enum that I would like to do reverse mapping so eventually I have one object with key as enum.value and value as enum's key I can hardcode all key-value pair but how can I write something more dynamic?
export declare enum SAMPLE {
AIR = 0,
EARTH = 1,
WATER = 2
}
REVERSESAMPLE {
SAMPLE.AIR = 'Air',
SAMPLE.EARTH = 'Earth',
SAMPLE.WATER = 'Water',
}
"AIR"and"Air"are different strings; is that case difference intentional or a typo? Are you intending todeclarethe enum instead of actually emitting it? If so, how does it work?undefinedfrom SAMPLE[Object.type]