export type TimeoutHandle = unknown;
export type EventBatcherRuntime = {
    now(): number;
    setTimeout(fn: () => void, ms: number): TimeoutHandle;
    clearTimeout(handle: TimeoutHandle): void;
};
export declare class EventBatcher<TEvent> {
    private outbox;
    private outboxCursor;
    private draining;
    private txnEventSink;
    private debounceState;
    private readonly runtime;
    private readonly emit;
    constructor(options: {
        runtime: EventBatcherRuntime;
        emit: (source: string, events: TEvent[]) => void;
    });
    handleCommitEvents(source: string, events: TEvent[], bufferable: boolean): void;
    beforeImport(): void;
    txn<T>(callback: () => Promise<T>): Promise<T>;
    isInTxn(): boolean;
    autoDebounceCommit(timeout: number, options?: {
        maxDebounceTime?: number;
    }): void;
    disableAutoDebounceCommit(): void;
    commit(): void;
    isAutoDebounceActive(): boolean;
    close(): void;
    private enqueueBatch;
    private drainOutbox;
    private deliverBatch;
    private bufferLocalEvents;
    private scheduleDebounceFlush;
    private takeDebouncedEvents;
    private flushDebouncedEvents;
}
