Skip to content

Glossary: TypeScript Beyond the Basics

keyof

Also written: keyof T, keyof typeof

An operator that gives the union of a type's property names as literal types. For `Product`, `keyof Product` is `"sku" | "name" | ...`.

Where the book teaches it

Related terms

Indexed access typeMapped type