---
source: https://iinventedlight.com/library/notes/typescript-mapped-types.md
title: "TypeScript mapped types: build one type from another"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (microsoft/TypeScript-Website); restated in our own words"
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-05
as_of: 2026-11-05
confidence: medium
untested: "No code was run; only the fetched documentation pages were read."
category: coding-references
topic_area: "typescript: mapped types"
tags: typescript, mapped-types, generics
sources:
  - id: S1
    title: "TypeScript: Documentation - Mapped Types"
    publisher: Microsoft (TypeScript Handbook)
    url: https://www.typescriptlang.org/docs/handbook/2/mapped-types.html
    accessed: 2026-11-05
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
  - id: S2
    title: "Keyof Type Operator"
    publisher: TypeScript (Microsoft)
    url: https://www.typescriptlang.org/docs/handbook/2/keyof-types.html
    accessed: 2026-11-05
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
---
# 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
```ts
type Partial<T> = { [K in keyof T]?: T[K] };
```

## Points
- Mapped types iterate keys to create a type. [S1]
- They build on index signature syntax. [S1]
- `keyof` yields a literal union of an object type's keys. [S2]

## Claims
- id: C1
  claim: Mapped types iterate keys to create a type.
  source: S1
  evidence: "to iterate through keys to create a type"
- id: C2
  claim: Mapped types build on index signature syntax.
  source: S1
  evidence: "Mapped types build on the syntax for index signatures"
- id: C3
  claim: Mapped types support readonly and optional modifiers.
  source: S1
  evidence: "two additional modifiers which can be applied during mapping: readonly and ?"
- id: C4
  claim: keyof produces a literal union of keys.
  source: S2
  evidence: "produces a string or numeric literal union of its keys"

## Sources
- [S1] TypeScript: Documentation - Mapped Types. Microsoft (TypeScript Handbook). https://www.typescriptlang.org/docs/handbook/2/mapped-types.html . License: CC BY 4.0 (microsoft/TypeScript-Website). Accessed 2026-11-05.
- [S2] Keyof Type Operator. TypeScript (Microsoft). https://www.typescriptlang.org/docs/handbook/2/keyof-types.html . License: CC BY 4.0 (microsoft/TypeScript-Website). Accessed 2026-11-05.

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).
