首页 > 解决方案 > 如何在打字稿中编辑界面?

问题描述

bind():any我通过在IGunChainReferencein 中添加自定义函数来修复类型错误@types/gun/index.ts。如何将其添加到我的项目文件之一?

我在网上找不到任何答案,除了使用interface ... extends ...which interface IGunChainReference extends IGunChainReference不起作用,因为它是一个循环。

换句话说:

声明后如何更改更改类型?

标签: typescriptgun

解决方案


我想我可能已经解决了

interface CustomChain extends IGunChainReference {
  bind(): any
}
let gun: CustomChain = GUN<AppState>(['https://gun-manhattan.herokuapp.com/gun'])


推荐阅读