打字 vs @types NPM 范围 [英] typings vs @types NPM scope

查看:51
本文介绍了打字 vs @types NPM 范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些情况下,typings 用于处理 TypeScript 定义(例如 angular/angular2-seed).

In some cases typings is used for handling TypeScript definitions (e.g. angular/angular2-seed).

在其他情况下,使用作用域 NPM @types 包而不涉及 typings(例如 AngularClass/angular2-webpack-starter).

In other cases scoped NPM @types packages are used with no typings involved (e.g. AngularClass/angular2-webpack-starter).

它们之间的实际区别是什么?它们中的一个是否为 TypeScript 开发提供了另一个没有的好处?

What are the practical differences between them? Does one of them offer benefits for TypeScript development that the other doesn't?

推荐答案

@types 是在 typescript 2.0 中安装定义的新方法.它统一了定义和包的管理.这样您就不需要多个工具和配置文件.只需要 npm 和 package.json 而不是必须有 npm、package.json、typings、typings.json.它基本上使安装和管理定义更容易,但它与类型相同.

@types is the new way to install the definitions in 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. It basically makes installing and managing definitions easier but it is the same as typings.

您可以在此处阅读更多相关信息:https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/

You can read more about it here: https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/

这篇关于打字 vs @types NPM 范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆