Building Mapped Types and Utility Types
Learn how to use mapped types and utility types in this lesson.
We'll cover the following...
In addition to limiting variables to a set of specific literal values and defining enums, TypeScript allows you to define types that are based on other types, kind of like super-powered generics. These are called mapped types. TypeScript also has a bunch of predefined mapped types that it calls utility types.
So, let’s say we have our existing type TicketData
:
interface TicketData {
id: number
row: number
number:
...