typescript - 如何在打字稿中编辑界面?
问题描述
bind():any
我通过在IGunChainReference
in 中添加自定义函数来修复类型错误@types/gun/index.ts
。如何将其添加到我的项目文件之一?
我在网上找不到任何答案,除了使用interface ... extends ...
which
interface IGunChainReference extends IGunChainReference
不起作用,因为它是一个循环。
换句话说:
声明后如何更改更改类型?
解决方案
我想我可能已经解决了
interface CustomChain extends IGunChainReference {
bind(): any
}
let gun: CustomChain = GUN<AppState>(['https://gun-manhattan.herokuapp.com/gun'])
推荐阅读
- css - iOS 上的滚动捕捉 - 但保留地址栏的自动缩小和工具栏的隐藏
- javascript - VueJS $refs 在 :src 更改后未定义
- mysql - 是否可以将视图中的列结构从 varchar 更改为 date
- xslt - 需要根据输入的xml文件格式化日期
- django - models.py 中的 ValueError
- c++ - 为什么我的纹理没有在我的 DirectX11 游戏中更详细地渲染?
- python - 如何在数据框中使用 math.modf?
- javascript - 在 .bat 文件中执行多个更简洁的命令(压缩/修改)
- angular - 扩展 FormGroup 并在内部处理订阅
- android - 反应原生字母快速滚动