Lesson 3.2

Mapped types and key remapping

Mapped types transform every property of a type at once, which is where Partial, Readonly, and their friends come from.

Duration
7m
Level
Intermediate
Students
14k students

Overview

Mapped types transform every property of a type at once, which is where Partial, Readonly, and their friends come from.

In this lesson you will:

  • Transform every property of an existing type
  • Add or strip optional and readonly modifiers
  • Remap keys with an as clause

Resources

TypeScript handbook

The official reference for the tools used in this lesson.