Pretty<T>: {
    [K in keyof T]: T[K]
} & unknown

Combines members of an intersection into a readable type.

Type Parameters

  • T

Link

https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg

Example

type Result = Pretty<{ a: string } | { b: string } | { c: number, d: bigint }>
// ^? type Result = { a: string; b: string; c: number; d: bigint }

Generated using TypeDoc