import { type AbsolutePath } from "../utils/path-utils"; /** * 파일 변경 이벤트를 batch로 모아 한 번에 처리하는 throttler를 만듭니다. * * 동작: * - 같은 path가 여러 번 push되면 마지막 event로 dedupe됩니다. * - 마지막 push 후 `delayMs` 동안 추가 push가 없으면 한 번에 flush됩니다 (trailing debounce). * - flush 도중 들어오는 push는 다음 batch로 큐잉됩니다. * - 한 시점에 onFlush는 단 하나만 진행됩니다 — 이로써 onFlush 내부에서 일어나는 * 작업이 다른 onFlush 호출과 인터리브되지 않음을 보장합니다. * * 호출자는 push만 하면 됩니다. 내부 큐/타이머 상태는 캡슐화되어 있고, onFlush가 * 받는 fileEvents는 dedupe된 Map입니다. * * @example * const push = createFileEventBatcher({ * delayMs: 100, * onFlush: (fileEvents) => handleBatch(fileEvents), * }); * push("/path/a.ts" as AbsolutePath, "change"); * push("/path/b.ts" as AbsolutePath, "change"); // 100ms 후 둘 다 한 번에 onFlush로 */ export declare function createFileEventBatcher(options: { delayMs: number; onFlush: (fileEvents: Map) => Promise; }): (path: AbsolutePath, event: FileEventT) => void; //# sourceMappingURL=event-batcher.d.ts.map