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

Community Conventions: Object Shapes Use Interfaces

Many style guides and teams prefer interface for object shapes and reserve type for unions, intersections, and utilities.

Community Conventions: Object Shapes Use Interfaces

What you'll learn: How the TypeScript community has settled on a conventional split between when to use interfaces versus type aliases.

The Convention

Even though interfaces and type aliases can often do the same thing (as you've learned), the TypeScript community has developed a widely-adopted guideline:

Use interface for object shapes.
Use type for everything else — unions, intersections, primitives, literals, and utility transformations.

This isn't enforced by the compiler; it's a human convention that makes codebases more predictable and easier to navigate.

Why This Convention Emerged

Think of it like organizing a toolbox: you could use a screwdriver to hammer small nails, but keeping screwdrivers for screws and hammers for nails makes your work faster and clearer.

Since interfaces were specifically designed for describing object contracts and support features like declaration merging and faster type-checking, teams found it natural to reserve them for that role.

Type aliases, being more flexible with unions and intersections, became the go-to for composing complex types that aren't simple object shapes.

What This Looks Like

// ✓ Community convention: interface for object shapes
interface User {
  id: number;
  name: string;
}

// ✓ Type alias for unions
type Status = 'active' | 'inactive' | 'pending';

// ✓ Type alias for intersections
type Admin = User & { permissions: string[] };

Following this convention signals your intent: when someone sees interface, they know it's an object contract. When they see type, they look for unions, intersections, or transformations.

Key Takeaway: While both work for objects, the community prefers interface for object shapes and type for unions, intersections, and utilities — treating them as tools with distinct conventional roles rather than interchangeable alternatives.