I have an enum
export enum FloorTypeEnum {
ENGINEERED_HARDWOOD = 'engineered_hardwood',
SOLID_HARDWOOD = 'solid_hardwood',
LAMINATE = 'laminate',
LVT_VINYL = 'vinyl',
CARPET = 'carpet',
RUG = 'rug',
CERAMIC = 'ceramic',
CONCRETE = 'concrete',
EPOXY = 'epoxy',
FLOOR = 'floor', // deprecated value for backward compatibility
}
So at one place, I want to use this enum but remove the deprecated value (Floor).
Is there any way we can do?
I have tried below
export type NewFloorTypeEnum = {
[key in Exclude<FloorTypeEnum , FloorTypeEnum .Floor> ]?: string
};
I'm also maintaining an legacy enum
export enum LegacyFloorTypeEnum {
FLOOR = 'floor'
}
But I'm confused on how to use that type. I want to use the key and value of the enum and return to frontend.
Ultimate requirement is to get an enum which is equivalent to FloorTypeEnum - LegacyFloorTypeEnum. I don't want to create a new enum for new floor values.
Thanks