WebStorm utilizes libraries configured in
Settings | Languages & Frameworks | JavaScript | Libraries
solely for code completion and navigation purposes, but they are not accessible to the TypeScript compiler.
When Typescript stubs are downloaded through
Settings | Languages & Frameworks | JavaScript | Libraries
, they are stored in
<webStorm configuration directory>/javascript/extLibs/
. WebStorm does not require these library files to be placed directly in the project folder, as their primary function is to enable the use of external files for code completion without cluttering the project directory. However, the tsc compiler requires the d.ts files to be located within the project directory and referenced using
///<reference>
comments or import statements.
To make the downloaded stubs accessible to the typescript compiler, it is necessary to copy or move them to your project directory (and possibly rename them for better readability). This will make them available to both WebStorm and the compiler.
We are considering adding an option to download files directly to the project folder (instead of system/extLibs/
) in future releases - refer to WEB-9237 and linked tickets for updates.