【发布时间】:2018-06-22 05:17:40
【问题描述】:
我有来自 npm/@types 类型的 javascript 库。
我需要对@types 进行两个修复,这两个修复仅适用于我的应用程序,因此我无法将它们合并到DefinitelyTyped 存储库中。
我需要:
-
从界面中删除其中一个字段。示例:
// before changes: interface A { a?:string; b?:string; c?:string; } // after changes: interface A { a?:string; c?:string; } -
为界面中的一个字段添加更多类型。示例:
// before changes: interface B { a?: C; } // after changes: interface B { a?: C | D; }
我还想从外部存储库下载主要的@types 定义。
实现这一目标的最佳方法是什么?
【问题讨论】:
标签: typescript typescript-typings definitelytyped typescript-types