Type flattening
The process of "type flattening" is technically called indexed access on a mapped type.
The indexed access type [keyof T]
accesses the union of all value types for the mapped object type T
. The keyof
operator is widely used for accessing both the key types and value types of an object type.