T402 API Reference - v2.8.0
    Preparing search index...

    Type Alias WithExtensions<T, E>

    WithExtensions: T extends { extensions: infer Existing }
        ? Omit<T, "extensions"> & { extensions: Existing & E }
        : T & { extensions: E }

    Type utility to merge extensions properly when chaining. If T already has extensions, merge them; otherwise add new extensions.

    Type Parameters

    • T
    • E
    // Chaining multiple extensions preserves all types:
    const client = withBazaar(withOtherExtension(new HTTPFacilitatorClient()));
    // Type: HTTPFacilitatorClient & { extensions: OtherExtension & BazaarExtension }