TypeScript · Lesson 24 of 120
Aliases or Interfaces
How to choose.
Aliases and interfaces overlap a lot, so which should you use? For objects, either works. But each can do a few things the other can't.

- They overlap
- Either works
- Small differences
The differences
Only aliases can name unions, tuples, and simple types. Only interfaces can be reopened, to add more properties later. Both can be extended. For everyday objects, pick one style, and stay consistent.
| Feature | type | interface |
|---|---|---|
| Object shapes | yes | yes |
| Unions, tuples | yes | no |
| Reopen to add | no | yes |
| Extend | with & | with extends |
A simple rule
Use interfaces for object shapes, especially in libraries. Use aliases for everything else, like unions. The most important thing is being consistent across your project.
| key | value |
|---|---|
| Objects | interface |
| Unions | type |
| Libraries | interface |
| Most important | consistency |
Summary
Use interfaces for objects, aliases for unions and the rest, and be consistent. Next, extending interfaces.
Key takeaways- Objects: interface
- Unions: type
- Be consistent
Next up: Extending Interfaces — build on a shape