Reputation: 13
I want to use .d.ts files for intellisense in javascript using VScode. For example, I have an angular js file comments.js, In this file, I want to use the type definitions from utilities.d.ts which exports a namespace "Utilities".
So typing Utilties. would trigger intellisense for the methods in utilities.d.ts.
Is this possible in a javascript application without using reference path? /// ?
Upvotes: 1
Views: 4158
Reputation: 14017
You can create a separate folder for your typings and reference them in the tsconfig.json file:
{
"include": [
"src/typings/**/*.d.ts"
],
}
According to the official documentation you can also use the compilerOptions/typeRoots
section, but I use include
to reference my typings and it works fine.
Upvotes: 3