Search⌘ K

The Differences between Type Aliases and Interfaces

Explore the distinctions between TypeScript type aliases and interfaces. Understand how interfaces support implementation by classes, their ability to extend other interfaces without union type restrictions, and their unique feature of accumulating properties across declarations, which type aliases do not allow. This lesson helps you decide when to use interfaces for flexibility and code expansion.

As TypeScript evolved, the differences between type aliases and interfaces have diminished. Nevertheless, few differences are worth pointing out.

Difference with classes

It is only ever possible to implement an interface on a class, but never a type. At any time, an interface is implementable, but a type cannot have a union.

This makes the type a little more tricky to reuse in some patterns. The following example works because there is no union on line 1. Thus, ...