TypeScript Definitions (d.ts)?

Hey I've just started developing a HTML5 game using WebStorm and I want to use TypeScript as my JavaScript preprocessor.

I've got it all setup so that my TypeScript files have Watchers on them so they'll compile the JavaScript files everytime I save the file (and there are no syntax errors).

However I want to use the EaselJS from the CreateJS library.

How do I go about using this existing JavaScript library through TypeScript in WebStorm?

I read somewhere you need to use TypeScript definition files, I found the one for EaselJS here.

How do I go about using it in my WebStorm project?

Thanks in advance,

I <3 WebStorm :D

3 comments

Hello!

just put these .d.ts files into your project folder - they will be available both to WebStorm typescript parser and ts compiler configured as a file watcher

0

So this isn't required?

/// <reference path="createjs/soundjs/soundjs.d.ts" />

?

0

TypeScript parser in WebStorm can do without reference path comments (it will resolve the types). But the compiler still needs them. So, yes - it's required

0

Please sign in to leave a comment.