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`.
Glossary: TypeScript Beyond the Basics
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`.