Type Alias (TypeScript)
A type alias gives a name to any type using the `type` keyword, so you can reuse it. Unlike an interface, it can name unions, tuples, primitives, and more — not just object shapes.
TypeScript
Type aliases and interfaces overlap heavily for describing objects. The practical difference: a type alias can name any type (like `type ID = string | number`), while interfaces are limited to object shapes but support declaration merging.
Aliases are especially handy for shortening complex union or function types so they read cleanly throughout your code.
Syntax
type Name = type;Examples
TypeScript
type ID = string | number;
type Point = { x: number; y: number };
const p: Point = { x: 1, y: 2 };
const id: ID = "abc";