/** * Optional timer settings used by polling delays. */ export interface TimerOptions { /** * Whether the timer should keep the event loop active. */ ref?: boolean; /** * Optional signal used to abort timer waits. */ signal?: AbortSignal; } export interface PollingOptionsConstructor { initialDelaySec?: number; delaySec?: number; maxRetries?: number; initialTimerOptions?: TimerOptions; recurringTimerOptions?: TimerOptions; } /** * Parameters for the internal polling loop in `enqueueAndGetInference()`. * * Default behavior: * - `initialDelaySec` = 2 * - `delaySec` = 1.5 * - `maxRetries` = 80 * * Validation rules: * - `initialDelaySec` >= 1 * - `delaySec` >= 1 * - `maxRetries` >= 2 * * The `initialTimerOptions` and `recurringTimerOptions` objects let you pass an * `AbortSignal` or make the timer `ref`-ed to the `setTimeout()`. * * @category ClientV2 * @example * ``` * const pollingOptions = { * initialDelaySec: 4, * delaySec: 2, * maxRetries: 50 * }; * * const inference = await client.enqueueAndGetInference( * inputDoc, params, pollingOptions * ); * ``` */ export declare class PollingOptions { /** * Number of seconds to wait *before the first poll*. */ initialDelaySec: number; /** * Interval in seconds between two consecutive polls. */ delaySec: number; /** * Maximum number of polling attempts (including the first one). */ maxRetries: number; /** * Options passed to the initial `setTimeout()`. */ initialTimerOptions?: TimerOptions; /** * Options passed to every recurring `setTimeout()`. */ recurringTimerOptions?: TimerOptions; constructor(params?: PollingOptionsConstructor); /** * Validates polling options against minimum accepted values. */ validateSettings(): void; /** * Returns a compact string representation of the polling options. */ toString(): string; }