Intersection Types

Intersection types allow combining multiple types into one.

Snippet:

type Employee = { name: string }; type Worker = { id: number }; type WorkerEmployee = Employee & Worker;

Example:

type Admin = { permissions: string[] }; type SuperAdmin = Admin & { superUser: boolean };