//#region src/node-key.d.ts /** * NodeKey represents a key of a node in the database. * Based on the Go iavl node.go NodeKey implementation. * * Format: 12 bytes total * - Bytes 0-7: version (int64, big-endian) * - Bytes 8-11: nonce (uint32, big-endian) */ /** * NodeKey represents a unique identifier for a node in the IAVL tree. * * The NodeKey consists of: * - version: The tree version when this node was created * - nonce: A unique nonce to distinguish multiple nodes in the same version * * The root node of each version has nonce = 1. */ declare class NodeKey { /** Tree version when this node was created */ private readonly _version; /** Unique nonce for this node within the version */ private readonly _nonce; /** * Creates a new NodeKey. * * @param version - Tree version (int64) * @param nonce - Unique nonce (uint32) */ constructor(version: bigint | number, nonce: number); /** * Gets the version. */ get version(): bigint; /** * Gets the nonce. */ get nonce(): number; /** * Serializes the NodeKey to a 12-byte Uint8Array. * * Format: * - Bytes 0-7: version (big-endian uint64) * - Bytes 8-11: nonce (big-endian uint32) * * @returns 12-byte representation of the NodeKey */ toBytes(): Uint8Array; /** * Deserializes a NodeKey from a 12-byte Uint8Array. * * @param bytes - 12-byte array containing the serialized NodeKey * @returns A new NodeKey instance * @throws {Error} If bytes is not exactly 12 bytes */ static fromBytes(bytes: Uint8Array): NodeKey; /** * Creates a root node key for a given version. * Root nodes always have nonce = 1. * * @param version - Tree version * @returns A new NodeKey for the root node */ static rootKey(version: bigint | number): NodeKey; /** * Compares this NodeKey with another for equality. * * @param other - Another NodeKey to compare * @returns true if both version and nonce are equal */ equals(other: NodeKey): boolean; /** * Compares this NodeKey with another for ordering. * * @param other - Another NodeKey to compare * @returns negative if this < other, 0 if equal, positive if this > other */ compare(other: NodeKey): number; /** * Returns a string representation of the NodeKey. * * @returns String in format "v{version}n{nonce}" */ toString(): string; } //#endregion export { NodeKey }; //# sourceMappingURL=node-key.d.ts.map