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?
3 Answers
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
-
1
-
I'm currently using npm, bower and NuGet. Why we need another package manager? It just complicate things. Apr 22, 2015 at 7:04
-
The original question was about how to install definitions on platforms where Nuget is not available.– MartinApr 22, 2015 at 7:08
-
1
-
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
-
6I would not reccommend this option. DefinitelyTyped in VS brings the IDE to a screaming flaming halt. Pegs my CPU near 100% even when doing nothing, with all editor windows closed for several minutes. Jan 8, 2016 at 8:50
-
Note that this will get all TypeScript definitions available from DefinitelyTyped. Dec 18, 2017 at 5:38
They can be installed via nuget e.g. https://www.nuget.org/packages/jquery.TypeScript.DefinitelyTyped/
This also may be of use:
-
As my question explains I know there is the possibility to get definitions via NuGet. I am developing on Ubuntu/Mac OS where NuGet is not the best solution.– kOssiFeb 19, 2015 at 9:44
-
Your question is not clear enough, it sounds like you are asking if you can install them via nuget.– mbx-mbxFeb 19, 2015 at 9:44
-
-