/**
 * WarpStateIndexBuilder - Builds bitmap index from materialized WARP state.
 *
 * This builder creates adjacency indexes from WarpState.edgeAlive OR-Set,
 * NOT from Git commit DAG topology. This is the correct WARP architecture
 * as specified in the historical index-builder technical spec.
 *
 * The index supports O(1) neighbor lookups by node ID.
 *
 * @module domain/services/index/WarpStateIndexBuilder
 */
import BitmapIndexBuilder from './BitmapIndexBuilder.ts';
import WarpState from '../state/WarpState.ts';
import type CryptoPort from '../../../ports/CryptoPort.ts';
import type StateSession from '../../orset/session/StateSession.ts';
/**
 * Builds a bitmap index from materialized WARP state.
 *
 * This is the compliant index builder that operates on logical graph edges
 * from the edgeAlive OR-Set, not Git commit parents.
 *
 * @example
 * const state = await graph.materialize();
 * const builder = new WarpStateIndexBuilder();
 * const indexData = builder.buildFromState(state);
 */
export default class WarpStateIndexBuilder {
    private readonly _builder;
    constructor(_options?: {
        crypto?: CryptoPort;
    });
    /**
     * Builds an index from materialized WARP state.
     *
     * Iterates over edgeAlive OR-Set and creates forward/reverse adjacency
     * bitmaps for each node. Only includes edges where both endpoints are
     * visible (exist in nodeAlive).
     *
     * @returns The populated builder and stats
     * @throws {IndexError} If state is null or missing nodeAlive/edgeAlive fields
     */
    buildFromState(state: WarpState | null | undefined): {
        builder: BitmapIndexBuilder;
        stats: {
            nodes: number;
            edges: number;
        };
    };
    buildFromSession(session: StateSession): Promise<{
        builder: BitmapIndexBuilder;
        stats: {
            nodes: number;
            edges: number;
        };
    }>;
    private _registerNodes;
    private _indexEdges;
    private _registerNodeIds;
    private _indexVisibleEdges;
    /**
     * Serializes the index to a tree structure of buffers.
     */
    serialize(): Record<string, Uint8Array>;
    /**
     * Gets the underlying BitmapIndexBuilder.
     */
    get builder(): BitmapIndexBuilder;
}
/**
 * Convenience function to build and serialize a WARP state index.
 */
export declare function buildWarpStateIndex(state: WarpState | null | undefined, options?: {
    crypto?: CryptoPort;
}): {
    tree: Record<string, Uint8Array>;
    stats: {
        nodes: number;
        edges: number;
    };
};
export declare function buildWarpStateIndexFromSession(session: StateSession, options?: {
    crypto?: CryptoPort;
}): Promise<{
    tree: Record<string, Uint8Array>;
    stats: {
        nodes: number;
        edges: number;
    };
}>;
