/**
 * Reads a serialized logical bitmap index from a tree (in-memory buffers)
 * or lazily from OID→blob storage, and produces a LogicalIndex interface.
 *
 * Extracted from test/helpers/fixtureDsl.js so that production code can
 * hydrate indexes stored inside checkpoints (Phase 3).
 *
 * @module domain/services/index/LogicalIndexReader
 */
import type CodecPort from '../../../ports/CodecPort.ts';
import type IndexStorePort from '../../../ports/IndexStorePort.ts';
import type { IndexShard } from '../../artifacts/IndexShard.ts';
import { type LogicalIndex } from './logicalIndexHelpers.ts';
export type { LogicalIndex } from './logicalIndexHelpers.ts';
export default class LogicalIndexReader {
    private _codec;
    private _indexStore;
    private _nodeToGlobal;
    private _globalToNode;
    private _aliveBitmaps;
    private _labelRegistry;
    private _idToLabel;
    private _edgeFwd;
    private _edgeRev;
    private _edgeByOwnerFwd;
    private _edgeByOwnerRev;
    /**
     * Constructs a LogicalIndexReader with an optional CBOR codec override
     * and/or an IndexStorePort for codec-free reads.
     */
    constructor(options?: {
        codec?: CodecPort;
        indexStore?: IndexStorePort;
    });
    /**
     * Eagerly decodes all shards from an in-memory tree (Record<path, Uint8Array>).
     */
    loadFromTree(tree: Record<string, Uint8Array>): this;
    /**
     * Loads all shards from OID→blob storage (async).
     */
    loadFromOids(shardOids: Record<string, string>, storage: {
        readBlob(oid: string): Promise<Uint8Array>;
    }): Promise<this>;
    /**
     * Populates the reader directly from IndexShard domain objects.
     *
     * This is the codec-free alternative to loadFromTree() and loadFromOids().
     * No CBOR decoding is needed — the shards already carry decoded data.
     */
    loadFromShards(shards: Iterable<IndexShard>): this;
    /**
     * Loads all shards from an IndexStorePort via scanShards (codec-free).
     *
     * The adapter reads, decodes, and classifies blobs into IndexShard
     * domain objects. The reader consumes them without touching any codec.
     */
    loadFromStore(treeOid: string): Promise<this>;
    /**
     * Returns a LogicalIndex interface object backed by the decoded shard data.
     */
    toLogicalIndex(): LogicalIndex;
    /** Processes classified shards in deterministic order (codec path). */
    private _processShards;
    /**
     * Loads classified decoded data into the reader's maps.
     *
     * Shared by both the codec path (_processShards) and the
     * port path (_processDecoded). No codec interaction here.
     */
    private _loadClassified;
    /** Processes pre-decoded shards (port path — no codec needed). */
    private _processDecoded;
    /** Populates node-to-global and alive bitmap maps from decoded meta data. */
    private _loadDecodedMeta;
    /** Loads an alive bitmap from decoded meta data if present and non-empty. */
    private _loadAliveBitmap;
    /** Populates label maps from decoded label data. */
    private _loadDecodedLabels;
    /** Clears all decoded state so the reader can be reused safely. */
    private _resetState;
    /** Populates edge stores from decoded edge shard data. */
    private _loadDecodedEdges;
    /**
     * Adds a bitmap entry to the per-owner secondary index (non-'all' buckets only).
     */
    private _indexByOwner;
    /** Loads a MetaShard's data into the reader's maps. */
    private _loadMetaShard;
    /** Loads a LabelShard's data into the reader's label maps. */
    private _loadLabelShard;
    /** Loads an EdgeShard's bitmap data into the reader's edge stores. */
    private _loadEdgeShard;
}
