My question is similar with Get all value types of a double-nested object in TypeScript
But the difference is, I want to get union types from the value of a specific property.
const tabsEnum = {
IDCardReview: {
label: 'ID Card',
key: '1',
},
PrescriptionReview: {
label: 'Prescription Review',
key: '2',
}
} as const;
I want to get a union types like type Key = '1' | '2'
. Which means use the value of the key
property in the each object.