type alias

A name given to any type with the type keyword, such as type HttpMethod = "GET" | "POST".

In more detail

Unlike interfaces, type aliases can name unions, tuples, primitives, mapped types and conditional types. They are closed: declaring the same name twice is an error. A common rule is interfaces for public object contracts and type aliases for everything else.

Related terms

Taught in

References