I have a map:
const Map = {
key1: 'value1',
key2: 'value2'
}
I want to create a type value1 | value2 using the above object. Is it possible without repeating the values?
I tried type MyType = Map.key1 | Map.key2, but it throws the following error:
Cannot find namespace 'Map'