/** Internal liveness loop for User_Input polling. */ type PollPass = () => Promise; export type SyncPollingWait = (durationMs: number) => Promise; export interface SyncPollingSupervisorOptions { readonly runPass: PollPass; readonly intervalMs?: number; readonly errorBackoffInitialMs?: number; readonly errorBackoffMaxMs?: number; readonly wait?: SyncPollingWait; /** * Deferral gate applied ONLY to the loop's FIRST pass (default: no gate). * * The first scheduled pass waits for this promise before any remote * read starts, so a host can keep the first polling pass out of an * initial drain on a shared request limiter. The gate is consulted once: * after it resolves, passes keep the normal interval cadence. A gate * that throws surfaces through the normal polling error path and is * retried (with backoff) before any pass runs. Manual `runOnce()` calls * are deliberately NOT gated: they are explicit caller-driven passes. */ readonly waitForFirstPass?: () => Promise; readonly onReport?: (report: Report) => void; readonly onError?: (error: unknown) => void; } /** * Coalesces polling passes and stops only after an active provider call returns. * The service can therefore close the shared SQLite adapter safely. */ export declare class SyncPollingSupervisor { private readonly runPass; private readonly intervalMs; private readonly errorBackoffInitialMs; private readonly errorBackoffMaxMs; private readonly wait; private readonly waitForFirstPass; private firstPassPending; private readonly onReport; private readonly onError; private running; private acceptingPasses; private loopPromise; private inFlight; private stopPromise; private wakeWaiter; constructor(options: SyncPollingSupervisorOptions); /** Starts the immediate-then-periodic polling loop. */ start(): void; /** Returns whether a stop has been requested; used to interrupt gates. */ isStopping(): boolean; /** Runs one pass or joins the pass already in flight. */ runOnce(): Promise; /** Stops scheduling new polls and waits for the current remote read. */ stop(): Promise; private runLoop; private waitWhileRunning; private clearInFlight; private notifyReport; private notifyError; } export {}; //# sourceMappingURL=SyncPollingSupervisor.d.ts.map