Wednesday 28 March 2018

TypeScript - Importing jQuery TypeScript Definitions (d.ts) for Visual Studio 2017

TypeScript is building in popularity and JQuery is remains one of the most popular JavaScript frameworks. Consequently you will typically want to use them together in the same project at one stage or another.
If you do want to use JQuery within your TypeScript files in Visual Studio 2017, you need a "DefinitelyTyped" definition specifically for jQuery. This will allow Visual Studio to correctly recognise jQuery objects when validating and compiling (or transpiling based on your preferred terminology).


To do this, just download the TypeScript definitions (d.ts) for jQuery through the Nuget Package Manager (npm) UI or with the Nuget package manager console, use the following command:

Install-Package jquery.TypeScript.DefinitelyTyped

Now the typescript compiler will recognise your jQuery calls:


DDK

4 comments:

Unknown said...

Thanks for giving great kind of information. So useful and practical for me. Thanks for your excellent blog, nice work keep it up thanks for sharing the knowledge.
Tourist visa provider in Delhi

hookstefan said...

Great data on your Article, thank you for setting aside the effort to impart to us such a pleasant article. Astonishing understanding you have on this present, it's decent to discover a site that subtleties such a great amount of data about various specialists.
my assignment help

Bhavana said...


You really make it look so natural with your exhibition however I see this issue as really something which I figure I could never understand. It appears to be excessively entangled and incredibly expansive for me.
360DigiTMG Artificial intelligence Malaysia

Veterinary Prescriber said...

I really like this article and how you make it interesting!veterinary prescriber