Get typescript definition files via bower?

爷,独闯天下 提交于 2020-01-01 04:19:25

问题


Are there any other possibilities to get TypeScript type definitions then copy from the useful DefinitelyTyped Repo or using NuGet? Maybe bower or something like that?


回答1:


It is possible with bower.

First install bower by using npm:

npm install -g bower

Then install DefinitelyTyped by using bower:

bower install DefinitelyTyped



回答2:


The best option is to use tsd. It is like npm or bower, but for typescript definitions

 npm install tsd@next -g

 cd path/to/your/project
 tsd init

Then

 tsd install jQuery --save

That's it.

EDIT

There is a new TypeScript definition manager, typings, with the goal of non-ambient type definitions used by external modules.

EDIT

With the future TypeScript 2, you will be able to install type definitions with npm install @types/jQuery




回答3:


They can be installed via nuget e.g. https://www.nuget.org/packages/jquery.TypeScript.DefinitelyTyped/

This also may be of use:

https://github.com/DefinitelyTyped/tsd



来源:https://stackoverflow.com/questions/28602879/get-typescript-definition-files-via-bower

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!