typescript - typescript 类型定义的版本控制 (@types/)

标签 typescript typescript-typings type-definition

是否有关于基础包的版本如何与来自 @types 的版本相关的文档?在 typescript 中使用?

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

最佳答案

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

I saw that they are not 1:1 and f.eg. for react 15.4.2 what @types/react should I use?

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

根据我的经验,如果您使用最新版本的图书馆,在大多数情况下,将 * 指定为 package.json 中的输入版本是可行的。

关于typescript - typescript 类型定义的版本控制 (@types/),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47532407/

相关文章:

javascript - 我们可以将 Angular FormArray 与 angular2-multiselect 下拉菜单一起使用吗?

extjs - TypeScript 中的类型化文字对象

sharepoint - Angular2 @types/sharepoint/index.d.ts' 不是模块

typescript - 如何将 png 文件导入我的 typescript 文件?

reactjs - [SPLoaderError.loadComponentError] : ***Failed to load component

javascript - 在 Angular 应用程序中使用 AngularJS 组件时出错 : "Error: Trying to get the AngularJS injector before it being set."

visual-studio - 更新 Angular2 项目中的 Typescript

typescript - Vue + TypeScript 覆盖 `export default Vue`

函数参数中的TypeScript Array Union Type