import { ResponseCodeError } from './fetch';
import 'element-plus/es/components/message-box/style/css';
interface ErrorHandler {
    (err: any): boolean;
}
export type PromiseWithErrorHandler<T> = Promise<T> & ErrorHandlerReceiver<T>;
interface ErrorHandlerReceiver<T> {
    onError(handler: ErrorHandler): PromiseWithErrorHandler<T>;
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
}
export declare function defaultErrorHandling(err: any): boolean;
export declare class ResponseError extends Error {
    readonly cause: ResponseCodeError;
    readonly error?: string;
    readonly errorCode?: string;
    readonly message: string;
    readonly path?: string;
    readonly status?: string;
    readonly timestamp?: string;
    constructor(cause: ResponseCodeError);
}
interface DefaultErrorHandler {
    (err: any): boolean;
}
interface fetchConfigProps {
    handler: DefaultErrorHandler;
}
export declare const createFetchInstance: (defaultConfig?: fetchConfigProps) => <T>(input: RequestInfo, init?: RequestInit) => PromiseWithErrorHandler<T>;
declare const fetchInstance: <T>(input: RequestInfo, init?: RequestInit) => PromiseWithErrorHandler<T>;
export { fetchInstance as fetch };
