I am struggling to create an interface that uses values from an Enum.
enum TestEnum {
'VAL1' = 'TEST1',
'VAL2' = 'TEST2'
}
interface IMyInterface {
[TestEnum[key in TestEnum]]: {
// some code
}
}
const objToType: IMyInterface = {
TEST1: { / ** \ }
TEST2: { / ** \ }
}
It throws an error
A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.
What's the problem here?