【问题标题】:How to add declaration file to package that depends on external declaration file如何将声明文件添加到依赖于外部声明文件的包中
【发布时间】:2016-09-03 21:02:12
【问题描述】:

我正在编写一个依赖于另一个包的库,该包的 npm 包中没有声明文件。因此,我安装了正确的带有类型的声明文件,一切都很好。

但是,如何发布我的库以便任何安装它的人都不必担心类型依赖关系?

如果您在 Typings 注册表上发布声明,这不是问题,因为 Typings 会生成一个新的声明文件来为您处理依赖关系。

举个例子。我想将 typescript typings of react-notification-system 移动到 react-notification-system 存储库。但是,类型取决于已安装的 react 类型。我将如何将这些类型添加到 repo 中?

【问题讨论】:

    标签: typescript typescript-typings


    【解决方案1】:

    经过一番研究,我想我是用typings bundle 弄明白的。完整的解释可以在this answer找到。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-17
      • 2019-03-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多