- There are two main ways to get declarations for a library: Bundled and DefinitelyTyped.
- Bundled - The library bundles its own declaration file. To check if a library has bundled types, look for an index.d.ts file in the project. Some libraries will have it specified in their package.json under the typings or types field.
- DefinitelyTyped is a huge repository of declarations for libraries that don’t bundle a declaration file. To get declaration file from DefinitelyTyped run: 'yarn add --dev @types/react' or 'npm i --save-dev @types/react'.
- TypeScript with React: Adding TypeScript to a Project
- TypeScript with React: Configuring the TypeScript Compiler
- TypeScript with React: File extensions in TypeScript
- TypeScript with React: Running TypeScript
- TypeScript with React: Using TypeScript with Create React App
- TypeScript with React
- TypeScript: Type Definitions