@neosjs/request
Version:
NeosJS Request
47 lines (41 loc) • 1.05 kB
TypeScript
// Generated by dts-bundle-generator v7.1.0
import { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
export interface Fn<T = any, R = T> {
(...arg: T[]): R;
}
export interface PromiseFn<T = any, R = T> {
(...arg: T[]): Promise<R>;
}
export interface IRequestConfig extends AxiosRequestConfig {
retry?: number;
retryDelay?: number;
cancelRequest?: boolean;
cacheMaxAge?: number;
forceUpdate?: boolean;
cache?: boolean;
before?: Function;
after?: Function;
success?: Function;
fail?: Function;
complete?: Function;
[key: string]: any;
}
export interface IAxiosResponse<T = any> extends IRequestConfig {
config?: T;
}
export interface IAxiosError extends AxiosError {
config: IRequestConfig;
}
export interface IResponse<T = any, D = any> {
data?: T;
status?: number;
config?: AxiosRequestConfig<D>;
}
export declare const request: PromiseFn;
export declare const requestAll: PromiseFn;
export declare const requestInstance: AxiosInstance;
export {
request as default,
};
export as namespace NeosRequest;
export {};