/**
 * Shared polling/retry utility for async operations.
 */
export type PollResult<T> = {
    done: true;
    value: T;
} | {
    done: false;
};
export interface PollOptions<T> {
    /** Async function called each iteration. Return {done: true, value} when complete, {done: false} to keep polling. */
    fn: () => Promise<PollResult<T>>;
    /** Max number of attempts before throwing PollExhaustedError. */
    maxAttempts?: number;
    /** Max total time in ms before throwing PollTimeoutError. */
    timeoutMs?: number;
    /** Delay between iterations in ms. Default 5000. */
    delayMs?: number;
    /** Multiply delay by this factor each iteration. Default 1 (fixed). */
    backoffFactor?: number;
    /** Cap on delay in ms. */
    maxDelayMs?: number;
    /** Abort after this many consecutive errors. */
    maxConsecutiveErrors?: number;
    /** Called when fn throws. Return 'retry' to continue or 'abort' to rethrow. Default: 'retry'. */
    onError?: (err: unknown) => 'retry' | 'abort';
}
export declare function poll<T>(options: PollOptions<T>): Promise<T>;
/** Check if an error is an AWS throttling/rate-limit error. */
export declare function isThrottlingError(err: unknown): boolean;
//# sourceMappingURL=polling.d.ts.map