Skip to content

Glossary: TypeScript Beyond the Basics

Constraint

Also written: constraints, extends (generic constraint)

`extends` after a type parameter limits which types are allowed. `T extends { sku: string }` accepts any type that has a string `sku`.

Where the book teaches it

Related terms

GenericType parameter