/**
 * Builder for constructing CBOR-based bitmap indexes over the logical graph.
 *
 * Produces sharded index with stable numeric IDs, append-only label registry,
 * per-label forward/reverse bitmaps, and alive bitmaps per shard.
 *
 * Shard output:
 *   meta_XX.cbor   — nodeId → globalId mappings, nextLocalId, alive bitmap
 *   labels.cbor    — label registry (append-only)
 *   fwd_XX.cbor    — forward edge bitmaps (all + byLabel)
 *   rev_XX.cbor    — reverse edge bitmaps (all + byLabel)
 *   receipt.cbor   — build metadata
 *
 * @module domain/services/index/LogicalBitmapIndexBuilder
 */
import type { IndexShard } from '../../artifacts/IndexShard.ts';
type NodeToGlobalArray = Array<[string, number]>;
type NodeToGlobalRecord = Record<string, number>;
type MetaInput = {
    nodeToGlobal: NodeToGlobalArray | NodeToGlobalRecord;
    nextLocalId: number;
};
export default class LogicalBitmapIndexBuilder {
    private readonly _nodeToGlobal;
    private readonly _globalToNode;
    private readonly _shardNextLocal;
    private readonly _aliveBitmaps;
    private readonly _labelToId;
    private _nextLabelId;
    private readonly _fwdBitmaps;
    private readonly _revBitmaps;
    private readonly _shardNodes;
    constructor();
    /**
     * Registers a node and returns its stable global ID.
     * GlobalId = (shardByte << 24) | localId.
     *
     * @throws {ShardIdOverflowError} If the shard is full
     */
    registerNode(nodeId: string): number;
    /**
     * Marks a node as alive in its shard's alive bitmap.
     */
    markAlive(nodeId: string): void;
    /**
     * Registers a label and returns its append-only labelId.
     */
    registerLabel(label: string): number;
    /**
     * Adds a directed edge, populating forward/reverse bitmaps
     * for both the 'all' bucket and the per-label bucket.
     */
    addEdge(fromId: string, toId: string, label: string): void;
    /**
     * Seeds ID mappings from a previously built meta shard for ID stability.
     */
    loadExistingMeta(shardKey: string, metaShard: MetaInput): void;
    /**
     * Seeds the label registry from a previous build for append-only stability.
     */
    loadExistingLabels(registry: Record<string, number> | Array<[string, number]>): void;
    /**
     * Yields IndexShard instances without encoding.
     *
     * Pipe the output through the adapter's encode → blobWrite → treeAssemble
     * pipeline to persist.
     */
    yieldShards(): Generator<IndexShard>;
    private _yieldEdgeShards;
    private _addToBitmap;
}
export {};
