Course contentsShow
← TypeScript
Lesson 359 of 1,7968. Interfaces vs Type AliasesFree lesson

Multiple Interface Extension

Extending multiple interfaces at once to compose types from several sources.

Multiple Interface Extension

What you'll learn: How to build a new interface that inherits properties from several parent interfaces at once.

What Is Multiple Interface Extension?

You've learned that an interface can extend one other interface to inherit all its properties. But what if you need to combine properties from several interfaces? TypeScript allows you to extend multiple interfaces simultaneously by listing them after extends, separated by commas.

Think of it like combining different instruction manuals into one master guide — each manual adds its own section, and the final document contains everything.

The Syntax

interface HasName {
  name: string;
}

interface HasAge {
  age: number;
}

interface HasEmail {
  email: string;
}

// Combine all three interfaces into one
interface User extends HasName, HasAge, HasEmail {
  id: string;
}

// Now User has ALL four properties
const user: User = {
  id: "123",
  name: "Alice",
  age: 30,
  email: "alice@example.com"
};

The User interface now requires name, age, and email from its parent interfaces, plus its own id property.

Why This Matters

Multiple extension lets you compose complex types from smaller, reusable pieces. Instead of duplicating properties across interfaces, you build them modularly:

interface Timestamped {
  createdAt: string;
  updatedAt: string;
}

interface AdminUser extends HasName, HasEmail, Timestamped {
  role: string;
}

This approach keeps interfaces focused and makes your type definitions easier to maintain.

Key Takeaway: You can extend multiple interfaces at once using extends Interface1, Interface2, Interface3, creating a new interface that combines all their properties — a powerful way to compose types from several sources.