Logos DX
    Preparing search index...

    Interface FetchStreamPromise<H, P, RH>

    A stream-mode FetchPromise that also supports async iteration over chunks.

    Returned by .stream() to signal that the caller wants raw streaming access to the response body as Uint8Array chunks.

    interface FetchStreamPromise<H, P, RH> {
        "[toStringTag]": string;
        get directive(): ResponseDirective | undefined;
        get isAborted(): boolean;
        get isFinished(): boolean;
        get isStream(): boolean;
        "[asyncIterator]"(): AsyncIterator<Uint8Array<ArrayBufferLike>>;
        abort(reason?: string): void;
        arrayBuffer(): FetchPromise<ArrayBuffer, H, P, RH>;
        blob(): FetchPromise<Blob, H, P, RH>;
        catch<TResult = never>(
            onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
        ): Promise<FetchResponse<Response, H, P, RH> | TResult>;
        finally(
            onfinally?: (() => void) | null,
        ): Promise<FetchResponse<Response, H, P, RH>>;
        formData(): FetchPromise<FormData, H, P, RH>;
        json(): FetchPromise<Response, H, P, RH>;
        raw(): FetchPromise<Response, H, P, RH>;
        stream(): FetchStreamPromise<H, P, RH>;
        text(): FetchPromise<string, H, P, RH>;
        then<TResult1 = FetchResponse<Response, H, P, RH>, TResult2 = never>(
            onfulfilled?:
                | ((value: FetchResponse) => TResult1 | PromiseLike<TResult1>)
                | null,
            onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
        ): Promise<TResult1 | TResult2>;
    }

    Type Parameters

    • H
    • P
    • RH

    Hierarchy (View Summary)

    Index

    Properties

    "[toStringTag]": string

    Accessors

    • get directive(): ResponseDirective | undefined

      The active response directive, if any.

      Returns ResponseDirective | undefined

    • get isAborted(): boolean

      Whether the request was aborted, either via abort() or an external signal on the controller.

      Returns boolean

    • get isFinished(): boolean

      Whether the executor has resolved or rejected (without abort).

      Returns boolean

    • get isStream(): boolean

      Whether stream mode is active.

      Returns boolean

    Methods

    • Abort the in-flight request.

      Sets isAborted and delegates to the stored AbortController. Safe to call even when no controller is present (plain constructor).

      Parameters

      • Optionalreason: string

      Returns void

    • Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

      Parameters

      • Optionalonfinally: (() => void) | null

        The callback to execute when the Promise is settled (fulfilled or rejected).

      Returns Promise<FetchResponse<Response, H, P, RH>>

      A Promise for the completion of the callback.