/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import type { ClientNode } from "#node/ClientNode.js";
import { Duration, StorageDriver } from "@matter/general";
import type { ClientNodeStore } from "./ClientNodeStore.js";
import type { DatasourceCache } from "./DatasourceCache.js";
/**
 * Buffers client cache writes and flushes them periodically in a single storage transaction.
 *
 * Instead of persisting every attribute change immediately, dirty caches are tracked and flushed together.  This
 * allows WAL-based storage drivers to coalesce all dirty data into a single log entry.
 */
export declare class ClientCacheBuffer {
    #private;
    constructor(storageDriver: StorageDriver, flushInterval: Duration);
    /**
     * If buffering is configured on the parent ServerNode, set up the buffer on the store.  The first call creates
     * the buffer and starts the timer; subsequent calls reuse it.
     */
    static configure(node: ClientNode, store: ClientNodeStore): void;
    /**
     * Mark a cache as having dirty data that needs flushing.
     */
    markDirty(cache: DatasourceCache): void;
    /**
     * Remove a cache from the dirty set (e.g. on erase or reclaim).
     */
    removeDirty(cache: DatasourceCache): void;
    /**
     * Schedule a flush.  The flush runs serialized through the mutex; the promise is tracked internally.  Safe to
     * call from sync contexts.
     */
    initiateFlush(): void;
    /**
     * Flush all dirty caches to storage in a single transaction.  Awaits completion.
     */
    flush(): Promise<void>;
    /**
     * Stop the timer and flush any remaining dirty data.
     */
    close(): Promise<void>;
}
//# sourceMappingURL=ClientCacheBuffer.d.ts.map