@types/axios-concurrency
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Installation

npm install --save @types/axios-concurrency

Summary

This package contains type definitions for axios-concurrency (https://www.npmjs.com/package/axios-concurrency).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/axios-concurrency.

index.d.ts

import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";

type RequestHandler = (req: AxiosRequestConfig) => Promise<void>;
type ResponseHandler = (res: AxiosResponse) => AxiosResponse;
type ResponseErrorHandler = (res: AxiosResponse) => Promise<AxiosResponse>;
interface Task {
    request: AxiosRequestConfig;
    resolver: (value: AxiosRequestConfig) => void;
}

interface ConcurrencyManagerInstance {
    queue: Task[];
    running: Task[];
    shiftInitial: () => void;
    push: (reqHandler: RequestHandler) => void;
    shift: () => void;
    requestHandler: RequestHandler;
    responseHandler: ResponseHandler;
    responseErrorHandler: ResponseErrorHandler;
    interceptors: {
        request: number | null;
        response: number | null;
    };
    detach: () => void;
}

declare function ConcurrencyManager(axios: AxiosInstance, MAX_CONCURRENT?: number): ConcurrencyManagerInstance;

export { ConcurrencyManager, ConcurrencyManagerInstance, RequestHandler, ResponseErrorHandler, ResponseHandler };

Additional Details

  • Last updated: Wed, 22 Nov 2023 09:07:17 GMT
  • Dependencies: axios

Credits

These definitions were written by POWFIX.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/axios-concurrency

Weekly Downloads

671

Version

1.0.0

License

MIT

Unpacked Size

4.71 kB

Total Files

5

Last publish

Collaborators

  • types