2ality | JavaScript and more
Follow
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 transforming objects and mapping tuples.