import { type BatchJobState } from '../types/batch.js'; /** How a batch, or any job with a status, is waited on. */ export interface BatchPollOptions { /** The first wait between polls, in milliseconds. */ intervalMs: number; /** The longest wait, once backoff has grown it. */ maxIntervalMs: number; /** Stops waiting. The provider-side batch keeps running. */ signal: AbortSignal; /** Called with each state that is not yet final. */ onState?: (state: State) => void; /** Whether a state is final. Defaults to a batch's terminal statuses. */ settled?: (state: State) => boolean; } /** * Polls a batch until it reaches a status it never leaves. A batch measured in hours does not deserve * a fixed short interval: the wait grows by half each time up to the maximum, which keeps the poll * count sane without delaying a fast batch, which the first few short polls still catch. */ export declare function pollUntilSettled(poll: () => Promise, options: BatchPollOptions): Promise;