import type { LinearModel, LinearPath, ScalarKind } from '../linearization/ipld.js'; import type { MergeFn, WitnessElement, MerkleTree } from './merkle-tree.js'; import type { NonEmptyArray, Opaque } from 'ts-essentials'; /** * Hash function over an IPLD scalar kind. */ type ScalarHashFn = (input: ScalarKind) => TDigest; export type Element = { scalar: ScalarKind; labelDigest: TDigest; digest: TDigest; index: number; }; export type MerkleMapWitness = NonEmptyArray>; export type WitnessLength = Opaque; export declare class MerkleMap { #private; readonly tree: MerkleTree; constructor(inner: Map>, tree: MerkleTree); get witnessLength(): WitnessLength; get height(): number; get root(): TDigest; witness(path: LinearPath): MerkleMapWitness; inner(path: LinearPath): Element | undefined; digestOrThrow(path: LinearPath): TDigest; digest(path: LinearPath): TDigest | undefined; get(path: LinearPath): ScalarKind | undefined; } export declare class MerkleMapFactory { private readonly hashFn; private readonly merkleTreeFactory; constructor(hashFn: ScalarHashFn, zero: TDigest, mergeFn: MergeFn); fromLinearModel(linearModel: LinearModel): MerkleMap; } export {};