I've got an object like this
interface MY_OBJECT_INTERFACE {
[key: string]: string
}
const MY_OBJECT: MY_OBJECT_INTERFACE = {
'key': 'key val',
'anotherKey': 'anotherKey val',
};
Is there a way to extract from this object 'key' | 'anotherKey' type ?
"keyof typeof MY_OBJECT" didn't works.
related question: How to extract exact union type from object key strings in typescript?