TS-Scribe - v0.6.2
    Preparing search index...

    Type Alias OverloadUnion<TypedOverload>

    OverloadUnion: Exclude<
        OverloadUnionHelper<() => never & TypedOverload>,
        TypedOverload extends () => never ? never : () => never,
    >

    Converts a function overload (an intersection of function signatures) into a union of those signatures. This is useful when you want to handle multiple function signatures as separate types, rather than a single intersection of them.

    Type Parameters

    • TypedOverload extends (...args: any[]) => any

    The function overload type, typically an intersection of function signatures.

    type U = OverloadUnion<(() => 1) & ((a: 2) => 2)>;
    type U = (() => 1) | ((a: 2) => 2);