Javascript 重写类型脚本模块导出定义
我已经安装了带有类型定义的插件Javascript 重写类型脚本模块导出定义,javascript,typescript,typescript-typings,Javascript,Typescript,Typescript Typings,我已经安装了带有类型定义的插件 declare module 'autobind-decorator' { const autobind: ClassDecorator & MethodDecorator; export default autobind; } 但是,我认为类型定义是错误的。我需要换成这个 declare module 'autobind-decorator' { const autobind: ClassDecorator & MethodDeco
declare module 'autobind-decorator' {
const autobind: ClassDecorator & MethodDecorator;
export default autobind;
}
但是,我认为类型定义是错误的。我需要换成这个
declare module 'autobind-decorator' {
const autobind: ClassDecorator & MethodDecorator;
export = autobind;
}
我该怎么做
我该怎么做
分叉项目并发布(直到原始项目得到修复)
更多
这本质上就是如果作者发布了一个坏的JS库,我该如何修复它。你可以用叉子把它修好。TypeScript在这里没有什么魔力
理由
如果TypeScript提供了一种覆盖它的方法,它只会导致使用哪种定义的混淆。1)为什么您认为该定义是错误的?2) 联系作者/发送请求…?类型错误。作者正在更新其repo中的类型,但忘记发布到NPM。谢谢,到目前为止,这是我能接受的最好的答案