I have two sets of string values that I want to map from one to the other as a constant object. I want to generate two types from that map:
const KeyToVal = {
MyKey1: 'myValue1',
MyKey2: 'myValue2',
};
The keys are working well
type Keys = keyof typeof KeyToVal;
But I am having trouble with the compile-time type for values.
All of these converted my Values to string. I also tried referring How to infer typed mapValues using lookups in typescript?, but I either got my adaptations wrong, or the answers didn't fit my problem.