import type { Repo } from "../api/repo.ts"; export type WatchEvent = { type: "objects-arrived"; count: number; } | { type: "head-advanced"; view: string; head: string; } | { type: "foreign-op-hot-key"; key: string; op: string; actor: string; } | { type: "conflict-opened"; key: string; id: string; }; export interface WatcherOpts { /** This client's actor id — its own operations are never a "foreign op" alert. */ selfActor?: string; /** Views whose head to watch; default ["main"]. */ views?: string[]; } export declare class RepoWatcher { #private; constructor(repo: Repo, opts?: WatcherOpts); /** Keys this client is working on; a foreign op on one of them is worth interrupting for. */ trackKeys(keys: string[]): void; /** * Compare current state against the baseline and return what changed. The first call * only primes. Never throws: a watcher that takes the server down with it when the repo * is deleted or mid-write is worse than one that misses a tick. */ poll(): Promise; } /** Poll interval from the environment. 0 disables the watcher entirely. */ export declare function watchIntervalMs(): number; //# sourceMappingURL=watch.d.ts.map