javascript - How do I generate TypeScript definition files that are picked up automatically by VS Code? -


i have typescript project used in node.js, , have decided add type definitions intellisense can pick in visual studio code. on tsconfig.json, have enabled definitions produced alongside compiled js, don't know other setup need make when project downloaded using npm, types appear on intellisense without other setup. have idea how can done? tsconfig.json file:

{     "compileroptions": {         "target": "es5",         "lib":["es2016","es2016.array.include","dom"],         "noimplicitany":false,         "noemitonerror":true,         "removecomments": true,         "declaration": true     },     "include": [         "src/ts/**/*"     ],     "exclude": [         "node_modules",         "**/*.spec.ts"     ] } 

set types property in package.json file point definitions file, (assuming declarations in src/ts/main.d.ts):

{    "types": "./src/ts/main.d.ts"  } 

see typescript docs details.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -