Type Aliases for Complex Types
Create reusable type names with the type keyword.
Welcome
Type aliases give a name to any type expression — primitives, unions, intersections, tuples, or objects. They make complex types reusable and readable.
The type Keyword
Create a type alias with `type Name = TypeExpression`. It can be used anywhere the original type would be used.
type UserId = number;
type UserName = string;
type Point = { x: number; y: number };All lessons in this course
- Defining Object Shapes with Interfaces
- Type Aliases for Complex Types
- Interface Extension and Merging
- Interface vs Type: When to Use Each