declaration file

A file ending in .d.ts that contains only type information describing JavaScript that exists elsewhere, with no runnable code.

In more detail

tsc can generate them next to your JavaScript so other projects get your types. Packages written in plain JavaScript get theirs from @types packages. They are where ambient declarations and module augmentation usually live.

Related terms

Taught in

References