I have an enum and I want to add its values to an interface, but getting this error:
A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.(1169)
How could I use enum values as interface properties without having to create a second enum with the reverse key/values?
enum Fields {
'name' = 'field1',
'age' = 'field2',
'custom field' = 'field3',
}
interface Person {
id: string;
[Fields['custom field']]?: string;
}