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?
Asked
Active
Viewed 9,332 times
3 Answers
22
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

Martin
- 15,820
- 4
- 47
- 56
-
1@jesuslopez, you have the option to not use a package manager. – Martin Apr 21 '15 at 15:31
-
I'm currently using npm, bower and NuGet. Why we need another package manager? It just complicate things. – Jesús López Apr 22 '15 at 07:04
-
The original question was about how to install definitions on platforms where Nuget is not available. – Martin Apr 22 '15 at 07:08
-
1You can use bower -install DefinitelyTyped – Jesús López Apr 22 '15 at 10:54
-
1It seems like a waste of time using two JavaScript package managers. – Martin Mar 11 '16 at 16:28
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

Roel van Lisdonk
- 680
- 6
- 7
-
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. – Sean Hederman Jan 08 '16 at 08:50
-
Note that this will get *all* TypeScript definitions available from DefinitelyTyped. – Chris Halcrow Dec 18 '17 at 05:38
-1
They can be installed via nuget e.g. https://www.nuget.org/packages/jquery.TypeScript.DefinitelyTyped/
This also may be of use:

mbx-mbx
- 1,765
- 11
- 23
-
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. – kOssi Feb 19 '15 at 09:44
-
Your question is not clear enough, it sounds like you are asking if you can install them via nuget. – mbx-mbx Feb 19 '15 at 09:44
-
Ok, a common task to get libraries and other dependencies for frontend developing is to use [bower](http://bower.io/). It would be nice to get TypeScript type definitions also via bower. – kOssi Feb 19 '15 at 09:48