简体   繁体   English

NVS作用域

[英]typings vs @types NPM scope

In some cases typings is used for handling TypeScript definitions (eg angular/angular2-seed ). 在某些情况下, typings用于处理TypeScript定义(例如angular / angular2-seed )。

In other cases scoped NPM @types packages are used with no typings involved (eg AngularClass/angular2-webpack-starter ). 在其他情况下作用域NPM @types包与没有使用typings涉及(例如AngularClass / angular2-的WebPack起动 )。

What are the practical differences between them? 它们之间的实际区别是什么? Does one of them offer benefits for TypeScript development that the other doesn't? 它们之一为TypeScript开发提供了其他没有的好处吗?

@types is the new way to install the definitions in typescript 2.0. @types是在Typescript 2.0中安装定义的新方法。 It unifies the management of definitions and packages. 它统一了定义和包的管理。 So that you do not need multiple tools and config files. 这样就不需要多个工具和配置文件。 Only going to need npm and package.json instead of having to have npm, package.json, typings, typings.json. 只需要npm和package.json即可,而不必拥有npm,package.json,typesings,types.json。 It basically makes installing and managing definitions easier but it is the same as typings. 基本上,它使安装和管理定义更加容易,但与键入相同。

You can read more about it here: https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/ 您可以在此处了解更多信息: https : //blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM