Interfaces and type aliases

An interface and a type alias (type) describe the shape of an object: its properties and their types. An interface can be extended with extends and merged through successive declarations; an alias can name any type, including unions. They serve as a contract between the parts of a program.

Example

interface Utilisateur {
  id: number;
  nom: string;
  email?: string;
}

Related concepts

The whole glossary