0Pricing
TypeScript Academy · Lesson

Interface Extension and Merging

Extend interfaces and understand declaration merging.

Welcome

Interfaces can extend other interfaces to build on existing shapes, and TypeScript merges multiple declarations of the same interface automatically.

Extending an Interface

Use the `extends` keyword to create a new interface that includes all properties from the parent.
interface Animal { name: string; }
interface Dog extends Animal {
  breed: string;
}
const rex: Dog = { name: 'Rex', breed: 'Labrador' };

All lessons in this course

  1. Defining Object Shapes with Interfaces
  2. Type Aliases for Complex Types
  3. Interface Extension and Merging
  4. Interface vs Type: When to Use Each
← Back to TypeScript Academy