- For JS libraries being consumed in TS, you need to download the type definitions of the JS library else the Intellisense won’t work and TS build will fail.
- For NodeJS apps, using require won’t work as TS doesn’t understand it, so you’ll have to install Type Definitions for NodeJS using
npm install @types/node -D
- For intellisense to work for third party modules like lodash after having their types installed using
npm install @types/lodash -D, use ES 6 import statement instead of require in your TS NodeJS apps
- Some libraries like angular and firebase come with the type definitions out of the box, and so for these you don’t need to install @types/<library> to use the library in ts project and to have intellisense working