import type { AxiosError } from "axios";
import { EitherAsync } from "purify-ts";
export declare const isAxios4xxError: (error: unknown) => error is AxiosError<unknown, any>;
export declare const shouldRetryRequest: (error: AxiosError) => boolean;
/**
 *
 * @summary Retry with exponential backoff. Fire once + retry times
 */
export declare const withRequestErrorRetry: <T, E = unknown>({ fn, retryTimes, shouldRetry, retryWaitForMs, }: {
    fn: () => Promise<T>;
    retryTimes?: number | undefined;
    shouldRetry?: ((error: unknown, retryCount: number) => boolean) | undefined;
    retryWaitForMs?: (() => number) | undefined;
}) => EitherAsync<E, T>;
