nicecode-v2/packages/request/es/index.d.ts

31 lines
912 B
TypeScript

export interface ReqConfigProps {
timeout?: number;
baseURL?: string;
errorConfig?: {
errorHandler?: (error: any, opts: any) => void;
errorThrower?: (err: any) => void;
};
authorization?: string;
showMsg?: boolean;
onError: (error?: any) => void;
}
export declare const reqConfig: (config: ReqConfigProps) => {
timeout: number;
baseURL: string;
errorConfig: {
errorHandler?: ((error: any, opts: any) => void) | undefined;
errorThrower?: ((err: any) => void) | undefined;
};
authorization?: string | undefined;
showMsg?: boolean | undefined;
onError: (error?: any) => void;
requestInterceptors: (((url: any, options: any) => {
url: any;
options: any;
}) | ((error: any) => Promise<never>))[][];
responseInterceptors: ((response: {
status: number;
data: any;
}) => any)[][];
};