Mapped types in TypeScript

A mapped type is a loop over keys that produces an object or tuple type and looks as follows:
{[PropKey in PropKeyUnion]: PropValue}

In this blog post, we examine how mapped types work and see examples of using them. Their most importing use cases are…


This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer

A mapped type is a loop over keys that produces an object or tuple type and looks as follows:

{[PropKey in PropKeyUnion]: PropValue}

In this blog post, we examine how mapped types work and see examples of using them. Their most importing use cases are transforming objects and mapping tuples.


This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer


Print Share Comment Cite Upload Translate Updates
APA

Dr. Axel Rauschmayer | Sciencx (2025-02-14T00:00:00+00:00) Mapped types in TypeScript. Retrieved from https://www.scien.cx/2025/02/14/mapped-types-in-typescript-2/

MLA
" » Mapped types in TypeScript." Dr. Axel Rauschmayer | Sciencx - Friday February 14, 2025, https://www.scien.cx/2025/02/14/mapped-types-in-typescript-2/
HARVARD
Dr. Axel Rauschmayer | Sciencx Friday February 14, 2025 » Mapped types in TypeScript., viewed ,<https://www.scien.cx/2025/02/14/mapped-types-in-typescript-2/>
VANCOUVER
Dr. Axel Rauschmayer | Sciencx - » Mapped types in TypeScript. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/02/14/mapped-types-in-typescript-2/
CHICAGO
" » Mapped types in TypeScript." Dr. Axel Rauschmayer | Sciencx - Accessed . https://www.scien.cx/2025/02/14/mapped-types-in-typescript-2/
IEEE
" » Mapped types in TypeScript." Dr. Axel Rauschmayer | Sciencx [Online]. Available: https://www.scien.cx/2025/02/14/mapped-types-in-typescript-2/. [Accessed: ]
rf:citation
» Mapped types in TypeScript | Dr. Axel Rauschmayer | Sciencx | https://www.scien.cx/2025/02/14/mapped-types-in-typescript-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.