axios-queue-js
Version:
axios-queue-js is a lightweight wrapper of axios that enables you to make requests using a queue
19 lines (18 loc) • 890 B
TypeScript
import { AxiosRequestConfig, AxiosResponse } from 'axios';
export declare type IAxiosConfig = AxiosRequestConfig | undefined;
export declare type IHttpMethod = 'get' | 'post' | 'patch' | 'put' | 'delete';
export interface IRequestData {
onResolve: (value: any | PromiseLike<any>) => void;
onReject: (reason?: any) => void;
url: string;
method: IHttpMethod;
data?: any;
config?: IAxiosConfig;
}
export interface IAxiosQueueManager {
get: (url: string, config?: IAxiosConfig) => Promise<AxiosResponse<any>>;
delete: (url: string, config?: IAxiosConfig) => Promise<AxiosResponse<any>>;
post: (url: string, data?: any, config?: IAxiosConfig) => Promise<AxiosResponse<any>>;
patch: (url: string, data?: any, config?: IAxiosConfig) => Promise<AxiosResponse<any>>;
put: (url: string, data?: any, config?: IAxiosConfig) => Promise<AxiosResponse<any>>;
}