I have the following object
export const tokenStatus = {
active: {
status: 'ENABLED',
label: 'Active',
type: 'success'
},
suspended: {
status: 'DISABLED',
label: 'Suspended',
type: 'warning'
},
deleted: {
status: 'DELETED',
label: 'Deleted',
type: 'error'
},
}
I would like to assign the types of status'es into another interface.
What I mean is,
I want to have an Interface called ITokenStatus
whose type is ENABLED | DISABLED | DELETED
I achieved it using typeof tokenStatus[keyof typeof tokenStatus]['status']
But the type of it is just a string
not ENABLED | DISABLED | DELETED