Here's a map I have:
const Map = {
key1: 'value1',
key2: 'value2'
}
I'm looking to create a type value1 | value2
using the object above. Is there a way to do this without repeating the values?
I attempted
type MyType = Map.key1 | Map.key2
, but it resulted in the following error message:
Cannot find namespace 'Map'