Configure Typescript for Jquery

By default, jquery will not be recognized in typescript files you create. This means that any jquery code you use will show up as erroneous and you can't make use of the auto-complete functionality. However, this is easy enough to remedy as shown below.

Steps

Copy the typescript declaration file into your project from here. Unfortunately the download links do not appear to work so you have to manually copy/paste.

Place the content into a file called jquery.d.ts in your project.

Add a relative path link to that file at the very top of your typescript files that require jquery. For example:

/// <reference path="../../jquery.d.ts" />

References

Author

Programster

Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites. More info.