javascript - 仅在界面中使用 Record 而不是 TypeScript 中的动态键
问题描述
在type
我可以写两种方式:
type someType = {[key: string]: any}
type someType = Record<string, any>
我想对interface
bu 做同样的事情,而不是:interface someInter {[key: string]: any}
我希望能够做类似的事情:interface someInter Record<string, any>
..
有可能吗?以任何方式?