import type CodecPort from '../../../ports/CodecPort.ts';
import type { RoaringBitmapSubset } from '../../utils/roaring.ts';
/**
 * Builder for constructing bitmap indexes in memory.
 *
 * Pure domain class with no infrastructure dependencies. Delegates ID
 * allocation and bitmap accumulation to BitmapAccumulator. Serializes
 * to CBOR shard format (no envelopes — git-cas handles integrity).
 *
 * @example
 * const builder = new BitmapIndexBuilder();
 * builder.addEdge(parentSha, childSha);
 * const tree = await builder.serialize();
 */
export default class BitmapIndexBuilder {
    private readonly _codec;
    private readonly _accumulator;
    /**
     * Creates a new BitmapIndexBuilder instance.
     */
    constructor(options?: {
        codec?: CodecPort;
    });
    /** SHA→numeric-ID forward mapping. */
    get shaToId(): Map<string, number>;
    /** Numeric-ID→SHA reverse mapping. */
    get idToSha(): string[];
    /** Active bitmap map keyed by `{dir}_{sha}`. */
    get bitmaps(): Map<string, RoaringBitmapSubset>;
    /**
     * Registers a node without adding edges.
     * @returns The assigned numeric ID
     */
    registerNode(sha: string): number;
    /**
     * Adds a directed edge from source to target node.
     */
    addEdge(srcSha: string, tgtSha: string): void;
    /**
     * Serializes the index to a tree structure of CBOR buffers.
     *
     * Output structure (sharded by SHA prefix):
     * - `meta_XX.cbor`: {sha: id, ...} for SHAs with prefix XX
     * - `shards_fwd_XX.cbor`: {sha: Uint8Array(bitmap), ...} for forward edges
     * - `shards_rev_XX.cbor`: {sha: Uint8Array(bitmap), ...} for reverse edges
     */
    serialize(options?: {
        frontier?: Map<string, string>;
    }): Record<string, Uint8Array>;
}
