type declaration file
A TypeScript file ending in .d.ts that describes the types of JavaScript code without containing the code itself.
In more detail
Libraries compile to JavaScript and ship .d.ts files so consumers still get type checking and autocomplete. The types export condition points at them.
Related terms
- TypeScript — JavaScript with added type annotations, checked by a compiler before the code runs.
- export condition — A key inside an exports entry, such as types, import, require or default, that says which environment should get which file.
Taught in
- Component Packaging: Dual ESM/CJS Builds & Package Exports — Design Systems & Component Engineering