Skip to main content

Declaration Files

Learning TypeScript's Declaration Files chapter describes how to use declaration files and value declarations to inform TypeScript about modules and values not declared in your source code:

  • Creating declaration files with .d.ts
  • Declaring types and values with the declare keyword
  • Changing global types using global values, global interface merges, and global augmentations
  • Configuring and using TypeScript's built-in target, library, and DOM declarations
  • Declaring types of modules, including wildcard modules
  • How TypeScript picks up types from packages
  • Using DefinitelyTyped to acquire types for packages that don't include their own