TypeScript Syntax and Type Operators
extends — interface and class heritage
In a heritage clause, extends builds a derived contract from a base type or class. An interface may extend multiple suitable object types, but inherited properties must be compatible. A class extends a runtime base constructor and inherits its prototype behavior; this differs from interface extension, which is erased. Generic constraints and conditional-type extends use the same keyword for separate type relationships. Example output: "7 open". Tested in the strict TypeScript 5.8.3 / ES2022 baseline; the example is not a runtime type validator.
Formal Syntax & Structure
typescript syntaxtypescript
interface Child extends Parent { label: string; }Working Example
Example Snippettypescript
interface Base { id: number; }interface Ticket extends Base { label: string; }const ticket: Ticket = { id: 7, label: "open" };console.log(ticket.id, ticket.label);