【问题标题】:Versioning for typescript type definitions (@types/)打字稿类型定义的版本控制 (@types/)
【发布时间】:2018-05-11 23:01:24
【问题描述】:

是否有任何文档说明基础包的版本如何与 @types 中的版本相关,以便在 Typescript 中使用?

我看到他们不是 1:1 和 f.eg.对于 react 15.4.2 我应该使用什么 @types/react?

【问题讨论】:

    标签: typescript typescript-typings type-definition


    【解决方案1】:

    There is open issue about that on DefinitelyTyped。到目前为止,no one was able to do anything about it

    我看到他们不是 1:1 和 f.eg.对于 react 15.4.2 我应该使用什么 @types/react?

    找到与库的特定版本兼容的类型版本的唯一方法是反复试验。

    根据我的经验,如果您使用最新版本的图书馆,将 * 指定为在 package.json 中输入的版本大部分时间都有效。

    【讨论】:

      猜你喜欢
      • 2015-01-01
      • 2020-05-07
      • 2022-08-11
      • 2019-06-15
      • 2018-01-16
      • 2020-07-07
      • 2018-12-03
      • 2019-02-10
      • 2016-07-07
      相关资源
      最近更新 更多