DefinitelyTyped
The repository for high quality TypeScript type definitions.
A giant shared library of TypeScript type definitions for thousands of JavaScript libraries, so TypeScript can catch bugs when you use them.
Definitely Typed
Definitely Typed is a shared library of type definitions for JavaScript libraries. When you use a JavaScript library with TypeScript, TypeScript needs to know what functions and properties that library provides and what types they accept and return. This repository collects and maintains those definitions for thousands of popular libraries.
Think of it like a translation layer. Many JavaScript libraries were written before TypeScript existed, so they don't include type information built-in. Definitely Typed volunteers write and maintain small files that describe the "shape" of each library—what you can call, what arguments it expects, what it returns. These definitions let TypeScript catch bugs before you run your code, by warning you if you're using a library incorrectly.
When you install types via npm (for example, npm install --save-dev @types/react), you're pulling from this repository. The types are automatically published and updated, so when a library gets a new version, the types usually get updated too. The repository handles thousands of packages, from small utilities to huge frameworks like React and Angular. If you can't find types for a library you're using, TypeSearch is a search tool that checks what's available.
Contributing is straightforward: you test your type definitions locally, create a pull request with your changes, and the repository's automated bot handles validation and publishing. The project maintains a support window (currently TypeScript 3.7 and newer), so it doesn't try to work with extremely old versions of TypeScript, but older versions of individual type packages are tagged and available if you need them. Everything is checked automatically for quality—the types are validated against TypeScript's compiler and linted for consistency.
Where it fits
- Install @types packages for a JavaScript library to get TypeScript autocomplete and error checking.
- Search TypeSearch to check if types already exist for a library you're using.
- Contribute a new or fixed type definition via pull request for a library missing accurate types.