← All notes

TypeScript mapped types

Short answer

Mapped types build new object types by iterating keys, usually with keyof. They extend index-signature syntax and can add readonly or optional modifiers. [S1]

Sketch

type Partial<T> = { [K in keyof T]?: T[K] };

Points

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

Source notice: TypeScript Handbook / Website docs © Microsoft. Licensed under Creative Commons Attribution 4.0 International (https://github.com/microsoft/TypeScript-Website/blob/v2/LICENSE).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Microsoft (TypeScript Handbook), TypeScript: Documentation - Mapped Types, CC BY 4.0 (microsoft/TypeScript-Website); TypeScript (Microsoft), Keyof Type Operator, CC BY 4.0 (microsoft/TypeScript-Website).

Cite this

Permanent ID: iil:note:b03fsfwj

iinventedlight. 2026. "TypeScript mapped types: build one type from another." iinventedlight Library, iil:note:b03fsfwj, version of 2026-11-04. https://iinventedlight.com/library/notes/typescript-mapped-types/. License: CC-BY-4.0.

@misc{iil_note_b03fsfwj,
  author = {{iinventedlight}},
  title = {{TypeScript mapped types: build one type from another}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/typescript-mapped-types/},
  note = {Permanent ID iil:note:b03fsfwj. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/typescript-mapped-types.md.