import type { FetchLike, OnEvent, CapturedSent } from './types.js'; export interface DeferredOptions { signedFetch: FetchLike; locationUrl: string; interactionUrl?: string; interactionCode?: string; onInteraction?: (url: string, code: string) => void; onClarification?: (question: string) => Promise; onEvent?: OnEvent; maxPollDuration?: number; /** Shared sent-request tracker; see TokenExchangeOptions. */ sentTracker?: { latest?: CapturedSent; }; } export interface AAuthError { error: string; error_description?: string; error_uri?: string; } export interface DeferredResult { response: Response; error?: AAuthError; } /** * Poll a 202 Location URL until a terminal response is received. * * Terminal: 200, 400, 401, 403, 408, 410, 500 * Transient: 202 (continue polling), 503 (backoff then retry) * * On 202 with clarification body: calls onClarification, POSTs response back. * On 202 with AAuth-Requirement: requirement=interaction header: calls onInteraction. */ export declare function pollDeferred(options: DeferredOptions): Promise; //# sourceMappingURL=deferred.d.ts.map