kinetex - v0.0.2
    Preparing search index...

    Interface KinetexInstance

    interface KinetexInstance {
        defaults: Partial<RequestConfig>;
        interceptors: (...args: unknown[]) => unknown & {
            request: {
                eject(id: number): void;
                use(
                    fn: (
                        config: RequestConfig,
                    ) => RequestConfig<unknown> | Promise<RequestConfig<unknown>>,
                ): number;
            };
            response: {
                eject(id: number): void;
                use(
                    fn: (
                        response: KinetexResponse<unknown>,
                    ) => KinetexResponse<unknown> | Promise<KinetexResponse<unknown>>,
                ): number;
            };
        };
        callback(url: string, config: RequestConfig, cb: CallbackFn): void;
        cancelAll(): void;
        chain(url: string): RequestChain;
        create(config: Partial<RequestConfig>): KinetexInstance;
        delete<T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
        exportHAR(): {
            log: {
                creator: { name: string; version: string };
                entries: HarEntry[];
                version: string;
            };
        };
        extend(middleware: Middleware): KinetexInstance;
        get<T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
        head<T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
        off(
            event: "request" | "response" | "error",
            listener: (arg: any) => void,
        ): this;
        on(
            event: "request" | "response" | "error",
            listener: (arg: any) => void,
        ): this;
        options<T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
        patch<T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
        post<T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
        put<T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
        use(middleware: Middleware): this;
        <T = unknown>(
            url: string,
            config?: Omit<RequestConfig<T>, "url" | "method">,
        ): Promise<KinetexResponse<T>>;
    }
    Index

    Properties

    defaults: Partial<RequestConfig>

    Access defaults

    interceptors: (...args: unknown[]) => unknown & {
        request: {
            eject(id: number): void;
            use(
                fn: (
                    config: RequestConfig,
                ) => RequestConfig<unknown> | Promise<RequestConfig<unknown>>,
            ): number;
        };
        response: {
            eject(id: number): void;
            use(
                fn: (
                    response: KinetexResponse<unknown>,
                ) => KinetexResponse<unknown> | Promise<KinetexResponse<unknown>>,
            ): number;
        };
    }

    Axios-compatible interceptors — callable function with .request/.response sub-objects

    Methods

    • Cancel all in-flight requests on this instance

      Returns void

    • Export all recorded HAR entries

      Returns {
          log: {
              creator: { name: string; version: string };
              entries: HarEntry[];
              version: string;
          };
      }

    • Parameters

      • event: "request" | "response" | "error"
      • listener: (arg: any) => void

      Returns this

    • Subscribe to instance-level lifecycle events. Events: 'request', 'response', 'error'

      Parameters

      • event: "request" | "response" | "error"
      • listener: (arg: any) => void

      Returns this

    post