import type { BreakpointWaitResult } from "../types.js"; import type { BreakpointBackend } from "../backend.js"; import { ServerClient } from "./server-client.js"; /** * Options for waiting for an answer via the client-side poller. */ export interface PollerWaitForAnswerOptions { /** Maximum time to wait in milliseconds. Defaults to DEFAULT_TIMEOUT_MS (30 min). */ timeoutMs?: number; /** Polling interval in milliseconds when using HTTP polling. Defaults to DEFAULT_POLL_INTERVAL_MS (3s). */ pollIntervalMs?: number; /** Whether to use SSE for real-time updates. Falls back to polling if false or on error. */ useSSE?: boolean; /** AbortSignal for external cancellation. */ signal?: AbortSignal; } /** * Waits for answers to breakpoints using either SSE streaming or HTTP polling. * * Accepts either a ServerClient (legacy) or a BreakpointBackend. * When a BreakpointBackend is passed, delegates to its waitForAnswer method. * When a ServerClient is passed, uses the existing SSE/polling logic. */ export declare class AnswerPoller { private readonly client; private readonly backend; constructor(clientOrBackend: ServerClient | BreakpointBackend); /** * Wait for an answer to a breakpoint. * * Resolves when: * - An answer is received (status becomes "answered" or "completed") * - The breakpoint expires or is cancelled * - The timeout is reached * - The operation is aborted via AbortSignal */ waitForAnswer(breakpointId: string, options?: PollerWaitForAnswerOptions): Promise; /** * Wait for an answer using SSE streaming. */ private waitViaSSE; /** * Wait for an answer using HTTP polling. */ private waitViaPolling; /** * Fetch the current breakpoint state and build a BreakpointWaitResult. */ private buildResult; private breakpointToResult; } //# sourceMappingURL=answer-poller.d.ts.map