Using JS GreenSock library with Webstorm

I am creating a website with HTML5 in JetBrains Webstorm 6.0.2 I want to use the GreenSock JS library for this, but it doesn't work for me. I have included the GreenSock.js files in external libraries, but I still cannot use them, for example I got this error: "Uncaught ReferenceError: TimeLineLite is not defined".

This is how I wanted to use the constructor for TimelineLite:

var tl = new TimelineLite();

      

Here is an image from my IDE

enter image description here Why can't I use this? Or does it not work with Webstorm?

+3


source to share


1 answer


This is how you add autocomplete, code hint, etc. for JS libraries that don't provide enough information for WebStorm (this is not a library bug, this is just the way JS works):

Downloading libraries in WebStorm



A "TypeScript stub" is a way to define the API of the library and really helps WebStorm understand the library better: https://github.com/borisyankov/DefinitelyTyped/blob/master/greensock/greensock.d.ts

Also, WebStorm doesn't include this stub file in your project, it stores it in the WebStorm cache so you don't need to worry about it.

+20


source







All Articles