What is the key difference between `interface` and `type` regarding declaration merging?

TypeScript Professional Hard

TypeScript Professional — Hard

What is the key difference between `interface` and `type` regarding declaration merging?

Key points

  • Interfaces in TypeScript allow for merging declarations
  • Type aliases do not support declaration merging
  • Merging interfaces is useful for extending existing interfaces
  • Type aliases are more limited in this aspect

Ready to go further?

Related questions