kinetex - v0.0.2
    Preparing search index...

    Interface RequestChain<T>

    interface RequestChain<T = unknown> {
        "[toStringTag]": string;
        accept(type: string): this;
        as<U>(): RequestChain<U>;
        auth(value: string): this;
        basic(user: string, pass: string): this;
        bearer(token: string): this;
        cancel(): AbortController;
        catch<TResult = never>(
            onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
        ): Promise<KinetexResponse<T> | TResult>;
        finally(onfinally?: (() => void) | null): Promise<KinetexResponse<T>>;
        form(data: Record<string, string | number | boolean>): this;
        header(name: string, value: string): this;
        headers(h: Record<string, string>): this;
        json<U>(data: unknown): RequestChain<U>;
        method(m: string): this;
        multipart(data: FormData | Record<string, string | Blob | File>): this;
        onDownload(fn: (e: ProgressEvent) => void): this;
        onUpload(fn: (e: ProgressEvent) => void): this;
        query(params: Record<string, string | number | boolean>): this;
        retry(count: number): this;
        schema<U>(validator: AnyValidator<U>): RequestChain<U>;
        send(body: BodyInit): this;
        signal(s: AbortSignal): this;
        then<TResult1 = KinetexResponse<T>, TResult2 = never>(
            onfulfilled?:
                | ((value: KinetexResponse) => TResult1 | PromiseLike<TResult1>)
                | null,
            onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
        ): Promise<TResult1 | TResult2>;
        timeout(ms: number): this;
        type(contentType: string): this;
    }

    Type Parameters

    • T = unknown

    Hierarchy

    Index

    Properties

    "[toStringTag]": string

    Methods

    • Parameters

      • user: string
      • pass: string

      Returns this

    • Cancel this request immediately. Returns the AbortController.

      Returns AbortController

    • Attaches a callback for only the rejection of the Promise.

      Type Parameters

      • TResult = never

      Parameters

      • Optionalonrejected: ((reason: any) => TResult | PromiseLike<TResult>) | null

        The callback to execute when the Promise is rejected.

      Returns Promise<KinetexResponse<T> | TResult>

      A Promise for the completion of the callback.

    • 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<KinetexResponse<T>>

      A Promise for the completion of the callback.

    • Parameters

      • data: Record<string, string | number | boolean>

      Returns this

    • Parameters

      • name: string
      • value: string

      Returns this

    • Parameters

      • h: Record<string, string>

      Returns this

    • Parameters

      • data: FormData | Record<string, string | Blob | File>

      Returns this

    • Parameters

      • params: Record<string, string | number | boolean>

      Returns this

    • Attaches callbacks for the resolution and/or rejection of the Promise.

      Type Parameters

      Parameters

      • Optionalonfulfilled: ((value: KinetexResponse) => TResult1 | PromiseLike<TResult1>) | null

        The callback to execute when the Promise is resolved.

      • Optionalonrejected: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null

        The callback to execute when the Promise is rejected.

      Returns Promise<TResult1 | TResult2>

      A Promise for the completion of which ever callback is executed.