import type IndexStoragePort from '../../../ports/IndexStoragePort.ts';
import type LoggerPort from '../../../ports/LoggerPort.ts';
import type CodecPort from '../../../ports/CodecPort.ts';
/**
 * Service for querying a loaded bitmap index.
 *
 * Provides O(1) lookups for parent/child relationships by lazily loading
 * sharded CBOR bitmap data from storage. Shards are cached after first access.
 *
 * Shard format: plain CBOR (no envelopes). git-cas handles integrity
 * at the storage layer.
 *
 * @example
 * const reader = new BitmapIndexReader({ storage });
 * reader.setup(shardOids);
 * const parents = await reader.getParents('abc123...');
 */
export default class BitmapIndexReader {
    private readonly storage;
    private readonly strict;
    private readonly logger;
    private readonly _codec;
    readonly maxCachedShards: number;
    private shardOids;
    private readonly loadedShards;
    private _idToShaCache;
    constructor(options: {
        storage: IndexStoragePort;
        strict?: boolean;
        logger?: LoggerPort;
        maxCachedShards?: number;
        codec?: CodecPort;
    });
    private static _assertStorage;
    /**
     * Configures the reader with shard OID mappings for lazy loading.
     */
    setup(shardOids: Record<string, string>): void;
    /**
     * Looks up the numeric ID for a SHA.
     */
    lookupId(sha: string): Promise<number | undefined>;
    /**
     * Gets parent SHAs for a node (O(1) via reverse bitmap).
     */
    getParents(sha: string): Promise<string[]>;
    /**
     * Gets child SHAs for a node (O(1) via forward bitmap).
     */
    getChildren(sha: string): Promise<string[]>;
    private _getEdges;
    private _deserializeBitmapIds;
    private _buildIdToShaMapping;
    private _warnLargeIdCache;
    private _getOrLoadShard;
    private _resolveShardPaths;
    private _decodeAndCacheShard;
    private _handleDecodeError;
    private _handleInvalidShardShape;
    private _handleInvalidBitmapValue;
    private _loadShardBuffer;
}
