devtypes - v2.0.0
    Preparing search index...

    Type Alias UnionIntersect<A, B>

    UnionIntersect: A extends B ? A : never

    Get the intersection of two union types.

    Type Parameters

    • A

      First union type

    • B

      Second union type

    Produces a union of types that are present in both A and B.

    type A = 'a' | 'b' | 'c';
    type B = 'a' | 'x';
    type C = UnionDifference< A, B >; // 'a'