It seems the situation is changing again. As far as I understand, Typescript 2.0 will use npm (Node Package Manager) to manage Typescript declarations for existing JavaScript libraries.
The above example is what you can do:
npm install --save @types/lodash
What will two things do then:
- It captures the declaration files for lodash and saves them in a directory named @ types / lodash in our node_modules package.
- Saves this as a dependency in our package. json
For more information, see this announcement from Microsoft: The Future of Declaration Files
And also this Github question: Improve the receipt of the declaration file .
Blake mumford
source share