Search code examples
javascripttypescriptwebstorm

intellisense and code complete for DefinitelyTyped (TypeScript type definitions) on WebStorm IDE


How can I get WebStorm IDE to give me code completion for libraries that I've downloaded.

JavaScript Libraries

As you can see angularjs-DefinitelyTyped and jQuery-DefinitelyTyped have been downloaded.

Now I believe that I have to reference the definition file in my .ts files.

Code

But, where WebStorm saves the definition files so I can reference them in my code?

Thank you!


Solution

  • That dialog is for JavaScript scope, not TypeScript scope (e.g. see mocha demo http://youtu.be/4mKiGkokyx8?t=1m19s). That is, Webstorm is using TypeScript definitions to give intellisence for JavaScript.

    For TypeScript itself you need to include the definitions into your project manually (https://github.com/borisyankov/DefinitelyTyped/blob/master/angularjs/angular.d.ts) and reference them like you always have.