Declaration File

Noun · Development

Definitions

  1. A TypeScript file with a .d.ts extension that provides type information for JavaScript code without containing implementation. Declaration files enable IDE autocompletion and type checking for untyped JS libraries. DefinitelyTyped hosts community-maintained declarations for thousands of packages.

    In plain English: A file that describes the shape and types of a JavaScript library so TypeScript can check your code for mistakes without rewriting the library.

Related Terms