typescript interface Значение свойства объекта как ключ (имя свойства) для интерфейса
Primary tabs
A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type
Минимальный пример демонстрации проблемы:
const myobj: Record<string, number> = { a: 1, b: 2, } interface myinter { [myobj.a]: string, // problem here }
- Log in to post comments
- 1047 reads