ENGLISH
REFERENCE

declaration file

compound.
C1 Advanced Programming
Definition

compound. a special computer file in programming that explains what code exists in another place. It tells the computer what names and types of data to expect so that it can catch mistakes early.

compound. a source file, typically with a .d.ts extension in TypeScript, that provides type information for existing JavaScript code. It describes the shape of an API or library without containing the actual implementation logic.


SIMPLE

The developer added a declaration file to fix the type errors.

CONTEXTUAL

When using a third-party library that lacks built-in types, you often need to install a separate declaration file to enable autocompletion in your editor.

COMPLEX

By maintaining a precise declaration file, the team ensured that any breaking changes in the underlying module would be immediately flagged by the compiler during the build process.

Origin

A compound of the noun declaration, derived from the Latin declarare meaning to make clear, and the noun file. The term emerged as a standard descriptor within the development of the TypeScript language to distinguish metadata files from executable source code.

Etymology adapted from Wiktionary, available under CC BY-SA 4.0.

Usage

Commonly used in the context of TypeScript and C++ development; often referred to as a 'header file' in other languages.

Related words

Last updated July 22, 2026