A union combines several types with |: the value is one of them. A literal type restricts a value to a specific constant, such as 'ok' or 404. Together, they model a closed set of possible values and let the compiler check every case.
Example
type Statut = 'brouillon' | 'publie' | 'archive';
let s: Statut = 'publie';