My query is reminiscent of a post on Stack Overflow titled Get all value types of a double-nested object in TypeScript
However, my specific requirement involves extracting union types from the values of a designated property.
const tabsEnum = {
IDCardReview: {
label: 'ID Card',
key: '1',
},
PrescriptionReview: {
label: 'Prescription Review',
key: '2',
}
} as const;
I am aiming to generate a union type such as type Key = '1' | '2'
. This entails utilizing the values stored in the key
property within each object.