Is there a way in TypeScript to use the lower case of an enum as an index key type? I have an enum defined as:
export enum NameSet {
Taxi = 'Taxi',
Bus = 'Bus',
Empty = '',
}
I want to define an object with keys based on the lower case values of NameSet like this:
type ITraffic = {
[K in NameSet.toLowerCase()]?: string
}
But it seems that this is not correct. Is there a way to achieve this?