const obj = {
a: 122,
b: 456,
c: '123',
};
// Keys = "a" | "b" | "c"
type Keys = keyof typeof obj;
// Values = string | number"
type Values = typeof obj[Keys];
const a: Values = '1234'; // => should throw an error
I am looking for a way to get a union type like so: 123 | 456 | '123'