我试过了 const arr=["foo", "bar"][key in arr]:string
} 我尝试了很多方法,但没有得到预期的答案,我认为这是不可能的。期望输出一个带有arr的键的接口,有没有可能有值?我怎么才能做这样的事情?这就是typescript所说的 A computed property name in an interface must refer
我有一个这样的TypeScript接口: export interface Foo {} 这将编译成一个空的.js文件。因此,当在ES6节点模块中使用TypeScript接口时,我会得到以下错误: TypeError: Class extends value undefined is not a function ornull 解决方法是创建一个类 export class BaseFoo {