import type { ConnectorChangeEvent } from "@skaile/workspaces/connectors"; /** Tuning for {@link FileChangedCoalescer}. */ export interface CoalesceOptions { /** * Burst window in ms. Events within this gap of each other (per mount) are * considered part of the same burst. Default: 1000. */ windowMs?: number; /** * Number of events within a window that flips a mount into "burst mode". * At/under this count events pass through individually; above it the rest of * the burst is coalesced by directory. Default: 50. */ threshold?: number; /** * Cap on the number of per-directory representative events emitted per burst. * If a burst touches more distinct directories than this, the representatives * for the first `maxDirs` directories are emitted plus a single root-level * fallback event so nothing is silently missed. Default: 256. */ maxDirs?: number; } /** * Per-mount burst detector. Feed it watcher events via {@link push}; it calls * `emit` either with the original event (normal traffic) or with one * representative event per affected directory (when a burst is detected). * Quiescence is detected with a timer so representatives fire shortly after the * last file in the burst settles. * * Stateful and not thread-safe — one instance per `startWatching` lifetime. */ export declare class FileChangedCoalescer { private readonly windowMs; private readonly threshold; private readonly maxDirs; private readonly emit; private readonly now; private readonly log; private readonly states; constructor(emit: (mountId: string, event: ConnectorChangeEvent) => void, options?: CoalesceOptions, now?: () => number, log?: (msg: string) => void); push(mountId: string, event: ConnectorChangeEvent): void; /** Cancel timers and emit any pending representatives. Call on watcher teardown. */ dispose(): void; private recordDir; private armFlush; private flush; } //# sourceMappingURL=file-changed-coalescer.d.ts.map