TypeScript Module Augmentation
Extend and customize third-party library types with module augmentation and declaration merging.
Usage
Describe which library types you need to extend and get proper augmentation patterns.
Examples
- "Add a custom user property to Express Request type"
- "Extend next-auth Session type with additional fields"
- "How do I add types for a library without type definitions?"
Guidelines
- Show module augmentation with declare module syntax
- Cover interface merging for extending existing interfaces
- Include global augmentation for global scope extensions
- Explain d.ts file placement and tsconfig includes
- Warn about augmentation limitations and alternatives