import type { OdsClient } from '../../clients/ods.js';
export type SandboxState = 'deleted' | 'failed' | 'started' | 'stopped' | (string & {});
export declare class SandboxPollingTimeoutError extends Error {
    readonly sandboxId: string;
    readonly targetState: SandboxState;
    readonly timeoutSeconds: number;
    readonly lastState?: SandboxState | undefined;
    constructor(sandboxId: string, targetState: SandboxState, timeoutSeconds: number, lastState?: SandboxState | undefined);
}
export declare class SandboxPollingError extends Error {
    readonly sandboxId: string;
    readonly message: string;
    constructor(sandboxId: string, message: string);
}
export declare class SandboxTerminalStateError extends Error {
    readonly sandboxId: string;
    readonly targetState: SandboxState;
    readonly state: SandboxState;
    constructor(sandboxId: string, targetState: SandboxState, state: SandboxState);
}
export interface WaitForSandboxPollInfo {
    sandboxId: string;
    elapsedSeconds: number;
    state: SandboxState;
}
export interface WaitForSandboxOptions {
    sandboxId: string;
    targetState: SandboxState;
    pollIntervalSeconds: number;
    timeoutSeconds: number;
    onPoll?: (info: WaitForSandboxPollInfo) => void;
    sleep?: (ms: number) => Promise<void>;
}
/**
 * Waits for a sandbox to reach a target state by polling its status.
 *
 * This function polls the ODS API at regular intervals until the sandbox reaches the desired state,
 * times out, or enters a terminal error state (failed/deleted).
 *
 * @param client - ODS client for API calls
 * @param options - Polling configuration options
 * @param options.sandboxId - ID of the sandbox to monitor
 * @param options.targetState - Desired sandbox state (e.g., 'started', 'stopped', 'deleted')
 * @param options.pollIntervalSeconds - Seconds between status checks
 * @param options.timeoutSeconds - Maximum seconds to wait (0 = no timeout)
 * @param options.onPoll - Optional callback invoked on each poll with current state
 * @param options.sleep - Optional custom sleep function (primarily for testing)
 *
 * @throws {SandboxPollingTimeoutError} If the timeout is exceeded before reaching target state
 * @throws {SandboxPollingError} If the API request fails
 * @throws {SandboxTerminalStateError} If the sandbox enters a terminal error state
 *
 * @example
 * ```typescript
 * await waitForSandbox(odsClient, {
 *   sandboxId: 'abc-123',
 *   targetState: 'started',
 *   pollIntervalSeconds: 5,
 *   timeoutSeconds: 300,
 *   onPoll: (info) => console.log(`State: ${info.state} (${info.elapsedSeconds}s)`),
 * });
 * ```
 */
export declare function waitForSandbox(client: OdsClient, options: WaitForSandboxOptions): Promise<void>;
