4 ms·
I think the idea is that it lets you provide type definitions for external libraries. I've never used TypeScript before, but I've heard from friends who use it
by saghm 5y ago
I think the idea is that it lets you provide type definitions for external libraries. I've never used TypeScript before, but I've heard from friends who use it that sometimes people will write type definitions for third-party libraries whose original authors might not have the time or interest to do it themselves. Basically, it lets you use an arbitrary JS library as though it's properly typed, as long as the maintainer of the type definitions keeps them up to date.
- billybones123 5y agoThis is the use case that I'm familiar with. For packages that don't bundle types, type definitions are often available through DefinitelyTyped[0]. npm install --save-dev @types/node > The types should then be automatically included by the compiler [0] https://github.com/DefinitelyTyped/DefinitelyTyped https://github.com/DefinitelyTyped/DefinitelyTyped