I am working with a type that is a combination of strings:
type MatchType =
| "first"
| "second"
| "third"
My goal is to create a map that uses this type as an index and returns a corresponding number:
let numValue = 3
let myMap: NumberMap = {
"first": numValue,
"second": numValue,
"third": numValue
}
What is the proper way to declare this NumberMap
so I can implement the following function:
function getNumber(key: MatchType): number {
return myMap[key]
}