devtypes - v1.1.0
    Preparing search index...

    Type Alias UnionToIntersection<U>

    UnionToIntersection: (U extends any ? (k: U) => void : never) extends (
        k: infer I,
    ) => void
        ? I
        : never

    Convert a union type to an intersection.

    Type Parameters

    • U

      Union type

    1.1.0

    Useful for merging the members of a union into a single composite type.

    type U = { a: string } | { b: number };
    type I = UnionToIntersection< U >;
    // { a: string } & { b: number }