What is the Difference Between "interface" and "type" in TypeScript?

In TypeScript, both interface and type can define object shapes, but they have key differences:

In summary, use interfaces for defining object shapes and when declaration merging is beneficial. Use type aliases for primitives, unions, and when needing advanced type compositions.