extends

A keyword with three jobs in TypeScript: a class inheriting from another, a limit on a generic type parameter, and a tsconfig.json inheriting a base file.

In more detail

class HttpError extends Error makes a subclass. In generics, K extends keyof T means K must be one of T's keys, and in a conditional type T extends U ? X : Y asks whether T is assignable to U. In tsconfig.json, "extends" loads another configuration file and lets you override parts of it.

Related terms

Taught in

References