import { RetryEvent } from '../Event.js'; import type { IEventEmitter } from '../interface/event.js'; import { ExError } from './ExError.js'; export declare class RetryError extends ExError { constructor(code: string, message: string); } export type RetryFunc = (err: Error) => Promise; export type RetryExecutor = () => Promise; interface IErrorEvent { [RetryEvent.Error]: (err: Error, nextRetry: number) => void; [RetryEvent.MaxRetryTime]: () => void; } export interface IRetryOptionsBase { maxRetryTimes: number; } export interface IRetryIncrementIntervalOptions extends IRetryOptionsBase { incrementInterval: true; maxRetryIntervalMS: number; minIntervalMS: number; } export interface IRetryFixedIntervalOptions extends IRetryOptionsBase { incrementInterval: false; intervalMS: number; } export type IRetryOptions = IRetryIncrementIntervalOptions | IRetryFixedIntervalOptions; export declare const defaultRetryOptions: IRetryOptions; declare class Retry { constructor(executor: RetryExecutor, options?: IRetryOptions); doJob(): Promise; get errorEmitter(): IEventEmitter; private maxRetryTimes_; private incrementInterval_; private intervalMS_?; private maxRetryIntervalMS_?; private currentInterval_; private count_; private errorEmitter_; private executor_; } export { Retry }; //# sourceMappingURL=Retry.d.ts.map