npm类型或键入或@type还是什么? [英] npm types or typings or @type or what?

查看:354
本文介绍了npm类型或键入或@type还是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS 2015 Update 3,Angular 2.1.2,Typescript 2.0.6

I'm using VS 2015 update 3, Angular 2.1.2, Typescript 2.0.6

有人可以说明本月有什么类型与npm @types以及其他难以找到的文档有关吗?

Can someone please clarify what typings versus npm @types versus whatever other hard to find documentation on something there is this month?

或者只是指出有关如何使用这些东西以及如何使用这些东西的文档.最好文档应该是最新的.

Or just point the way to documentation on what and how to use these things. Preferably the docs should be up to date.

从某种意义上说,一个如何卸载.我到处都可以找到有用的扩展来安装软件包,但至少可以告诉我卸载的余地.我安装了Package Installer扩展程序,但似乎很有限.

Also, in a related sense, how does one uninstall. Everywhere I look there are helpful extensions to install packages, but nothing to uninstall that I can tell at least. I installed the Package Installer extension, but it seems rather limited.

在Visual Studio中使用这些内容的痛苦在于使人们想离开并再次执行MVC.也许只有我一个人,但似乎并没有那么困难.

The pain of using this stuff in Visual Studio is making want to walk away and do MVC again. Maybe it's just me, but it doesn't seem like it ought be this difficult.

推荐答案

使用@types(不要使用类型)

Use @types ( don't use typings )

优点:

  • 在package.json下(通过npm update完成)
  • 不需要单独的程序包(类型),文件(inputs.json)...
  • 在node_modules下(更干净的目录结构)

简化的申报文件(.d.ts)获取

https://blogs.msdn .microsoft.com/typescript/2016/09/22/announcing-typescript-2-0/

这篇关于npm类型或键入或@type还是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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