TypeScript by EezyTutorials
Home iOS
Tutorials
HTML CSS C++ Java Python C Programming SQL TypeScript Go Machine Learning React Redux
Tools
  • Getting Started
  • TypeScript - Introduction
  • TypeScript - Installation & Toolchain
  • TypeScript - First Program
  • Language Basics
  • TypeScript - Basic Types
  • TypeScript - Type Inference
  • TypeScript - Literal, Union & Intersection Types
  • TypeScript - any, unknown, never
  • TypeScript - Arrays & Tuples
  • TypeScript - Enums
  • Functions & Objects
  • TypeScript - Functions, Parameters, Overloads, this
  • TypeScript - Objects, Interfaces & Type Aliases
  • TypeScript - Classes, Access Modifiers, Getters/Setters, Abstract
  • Advanced Types
  • TypeScript - Narrowing & Type Guards
  • TypeScript - Generics: Basics, Constraints & Defaults
  • TypeScript - Type Manipulation: keyof, Indexed & Mapped Types
  • TypeScript - Conditional Types & infer
  • TypeScript - Template Literal Types & satisfies
  • TypeScript - Utility Types
  • TypeScript - Assertion Functions & asserts
  • TypeScript - Structural Typing & Variance
  • Modules, Config & Interop
  • TypeScript - Modules: import/export
  • TypeScript - Namespaces (Legacy)
  • TypeScript - tsconfig Deep Dive
  • TypeScript - Node Interop: ESM/CJS
  • TypeScript - DOM & Node lib types
  • TypeScript - Declaration Files (.d.ts)
  • TypeScript - Ambient & Module Augmentation
  • TypeScript - Project References & Monorepos
  • Tooling & Quality
  • TypeScript - Build & Tooling
  • TypeScript - Testing (Jest/Vitest)
  • TypeScript - Linting & Formatting (ESLint & Prettier)
  • Patterns & Advanced
  • TypeScript - Error Handling & Exhaustive Checks
  • TypeScript - Patterns & Best Practices
  • TypeScript - Iterators, Iterables & Async Iterators
  • TypeScript - Maps, Sets & Records
  • TypeScript - Symbols & BigInt
  • TypeScript - Decorators (TS 5.x)
  • TypeScript - JSX & React Basics
  • Publishing, Migration & Performance
  • TypeScript - Migrating from JavaScript
  • TypeScript - Performance & Compiler Speed
  • TypeScript - Publishing Types & DefinitelyTyped

TypeScript - Ambient & Module Augmentation

On this page
    Back to top ↑

    Ambient globals

    // globals.d.ts
    declare global {
      interface Window { __APP_VERSION__: string }
    }
    export {};
    

    Module augmentation

    // augment-express.d.ts
    import 'express';
    declare module 'express' {
      interface Request { userId?: string }
    }
    

    Ensure your declaration files are included by tsconfig include or referenced via types.

    « Prev: TypeScript - Declaration Files (.d.ts) Next: TypeScript - Project References & Monorepos »

    ★ EezyTutorials

    • ℹAbout
    • ✉Contact
    • 📢Advertise
    • 🔒Privacy Policy

    Connect

    🗨 🐦 ▶️
    © 2014–2025 Eezy Tutorials
    Up ↑