Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

typescript typings, whats the typings folder

I am trying to wrap my head around typings and have the following questions

  1. What is the typings folder that you find under the node_modules root folder of the project. Is this the default place tsc looks for .d.ts files and how do I use them in the source files.
  2. Some of the node_modules contains the .d.ts files in them. Does tsc look in here by default again?
like image 252
user3547774 Avatar asked Dec 20 '16 22:12

user3547774


Video Answer


1 Answers

  1. When you install typings with npm install @types/my-favorite-library, they are inserted by default into the @types/ folder. This is the default place for TypeScript to search for definition files.
  2. Yep, so long as you have "moduleResolution": "node", in your tsconfig.json file. This is the default value unless you have your "module" set to "amd", "System" or "ES2015".
like image 182
thedayturns Avatar answered Sep 18 '22 18:09

thedayturns