export interface PollOptions<T = unknown> {
    /**
     * Resource ID to poll (e.g., agent ID, version ID)
     */
    resourceId: string;
    /**
     * API endpoint to poll (e.g., `/agents/{id}`)
     */
    endpoint: string;
    /**
     * Function to check if the operation is complete
     * Returns true when done, false to continue polling
     */
    isComplete: (response: T) => boolean;
    /**
     * Message to display while polling
     * @default "Waiting for operation to complete..."
     */
    message?: string;
    /**
     * Maximum number of poll attempts
     * @default 60
     */
    maxAttempts?: number;
    /**
     * Delay between poll attempts in milliseconds
     * @default 1000
     */
    delayMs?: number;
    /**
     * Message to display on success
     * @default "Operation complete"
     */
    successMessage?: string;
    /**
     * Message to display on timeout
     * @default "Operation timed out"
     */
    timeoutMessage?: string;
    /**
     * Optional callback invoked after each poll when the operation is not yet
     * complete. Return a non-null string to override the default spinner text
     * (`${message} (${attempts}/${maxAttempts})`). Return null to keep the
     * default. Errors thrown by the callback are silently ignored.
     */
    onPoll?: (response: T, attempts: number) => Promise<string | null>;
}
export interface PollResult<T = unknown> {
    /**
     * Whether the operation completed successfully
     */
    success: boolean;
    /**
     * Final response from the polled endpoint (if available)
     */
    response?: T;
    /**
     * Number of attempts made
     */
    attempts: number;
}
/**
 * Poll an endpoint until a condition is met or timeout occurs
 *
 * @example
 * ```typescript
 * const result = await pollUntilComplete({
 *   resourceId: agentId,
 *   endpoint: `/agents/${agentId}`,
 *   isComplete: (response) => response.status === 'READY',
 *   message: 'Waiting for agent initialization...',
 *   successMessage: 'Agent initialization complete'
 * });
 *
 * if (result.success) {
 *   console.log('Agent is ready:', result.response);
 * }
 * ```
 */
export declare function pollUntilComplete<T = unknown>(options: PollOptions<T>): Promise<PollResult<T>>;
//# sourceMappingURL=polling.d.ts.map