/**
 * Orchestrator for incremental bitmap index updates.
 *
 * Delegates node/edge mutations to IndexNodeUpdater and IndexEdgeUpdater.
 * Owns shard caches and adjacency state. Reuse one instance per linear
 * state stream; create a new instance to reset cache state.
 *
 * @module domain/services/index/IncrementalIndexUpdater
 */
import type CodecPort from '../../../ports/CodecPort.ts';
import type ORSet from '../../crdt/ORSet.ts';
import type { PatchDiff } from '../../types/PatchDiff.ts';
/** Shape of the WarpState fields consumed by the updater. */
type WarpStateLike = {
    nodeAlive: {
        contains(key: string): boolean;
    };
    edgeAlive: ORSet;
};
export default class IncrementalIndexUpdater {
    private readonly _codec;
    private readonly _edgeAdjacencyCache;
    private readonly _nodeUpdater;
    private readonly _edgeUpdater;
    /**
     * Cached next label ID — avoids O(L) max-scan per new label.
     * Initialized lazily from existing labels on first _ensureLabel call.
     */
    private _nextLabelId;
    constructor(options?: {
        codec?: CodecPort;
    });
    /**
     * Computes only the dirty shards from a PatchDiff.
     *
     * @returns Dirty shard buffers (path -> Uint8Array).
     */
    computeDirtyShards({ diff, state, loadShard }: {
        diff: PatchDiff;
        state: WarpStateLike;
        loadShard: (path: string) => Uint8Array | undefined;
    }): Record<string, Uint8Array>;
    private _collectDirtyShardKeys;
    /**
     * Ensures a label exists in the registry; returns true if newly added.
     */
    private _ensureLabel;
    private _handleProps;
    private _getOrLoadMeta;
    private _loadMeta;
    private _flushMeta;
    private _getOrLoadEdgeShard;
    private _loadEdgeShard;
    private _flushEdgeShards;
    private _loadLabels;
    private _saveLabels;
    private _loadProps;
    private _saveProps;
    private _collectReaddedEdgeKeys;
    private _getOrBuildAliveEdgeAdjacency;
    private _addEdgeKeyToAdjacency;
    private _removeEdgeKeyFromAdjacency;
}
export {};
