TYPESCRIPTChapter 2 · TS Unions & Enums
Type Aliases vs Interfaces
Type Aliases (type) name any type, including primitives, unions, and tuples. Interfaces (interface) describe object structures and support declaration merging. Use interfaces for objects and type aliases for unions/primitives.
Worked example
How it reads
- type ID defines a name for a union or generic type
- interface Coordinate is strictly for object shapes

Cloud tip: Interfaces can be extended using the extends keyword, making them great for class descriptions.


