import type { Repo } from "../api/repo.ts"; export type SyncWatchEvent = { type: "started"; remote: string; url: string; legacyPolling: boolean; } | { type: "synced"; pulled: number; pushed: number; } | { type: "heartbeat"; cursor: number; } | { type: "head"; view: string; checkpoint: string; } | { type: "contention"; key: string; incomingOp: string; incomingActor: string; localOps: { op: string; actor: string; purpose: string; }[]; } | { type: "error"; error: string; backoffMs: number; } | { type: "stopped"; reason: "aborted" | "loop-exit"; }; export interface SyncWatchOpts { /** Remote name (or literal hub URL); default "origin". */ remote?: string; /** Actor identity used to sign pushes (same as `avcs sync --as`). */ as?: string; /** Long-poll parking time per round (also the legacy polling period). */ timeoutMs?: number; minBackoffMs?: number; maxBackoffMs?: number; /** Abort to stop the daemon; runSyncWatch resolves after the loop exits. */ signal?: AbortSignal; /** Structured event callback (the CLI prints these; tests observe them). Every event * is also emitted on repo.logger as `watch.`. */ onEvent?: (ev: SyncWatchEvent) => void; } /** * Run the live-convergence loop until `opts.signal` aborts. Throws immediately when * another watcher already holds this repo's "syncd" lock — one instance per repo. */ export declare function runSyncWatch(repo: Repo, opts?: SyncWatchOpts): Promise; //# sourceMappingURL=syncWatch.d.ts.map