//#region src/storage/fast-node.d.ts /** * FastNode represents a lightweight version of Node used for fast storage. * It stores only the essential data: key, value, and the version when it was last updated. * This is used for the fast storage layer optimization in NodeDB. * * Corresponds to Go's fastnode.Node in fastnode/fast_node.go */ /** * FastNode is a lightweight node structure for fast storage. * It contains only the key-value pair and the version when it was last updated. */ declare class FastNode { /** The key for this node */ readonly key: Uint8Array; /** The value stored at this key */ readonly value: Uint8Array; /** The version at which this node was last updated */ readonly versionLastUpdatedAt: bigint; /** * Creates a new FastNode instance. * * @param key - The key for this node * @param value - The value to store * @param version - The version when this node was last updated */ constructor(key: Uint8Array, value: Uint8Array, version: bigint); /** * Calculates the encoded size of this FastNode in bytes. * This is the size that would be written by toBytes(). * * Format: varint(version) + length-prefixed-bytes(value) * Note: Key is stored separately in the database, not in the encoded data. * * @returns The number of bytes needed to encode this FastNode */ encodedSize(): number; /** * Serializes this FastNode to bytes. * * Format: varint(version) + length-prefixed-bytes(value) * Note: Key is stored separately in the database, not in the encoded data. * * @returns Encoded byte array */ toBytes(): Uint8Array; /** * Deserializes a FastNode from bytes. * * Format: varint(version) + length-prefixed-bytes(value) * Note: Key must be provided separately as it's stored separately in the database. * * @param key - The key for this node (stored separately) * @param bytes - The encoded byte array * @returns A new FastNode instance * @throws Error if the bytes are malformed */ static fromBytes(key: Uint8Array, bytes: Uint8Array): FastNode; /** * Returns the key as a hex string for debugging. * * @returns Hex string representation of the key */ keyString(): string; /** * Returns the value as a hex string for debugging. * * @returns Hex string representation of the value */ valueString(): string; } //#endregion export { FastNode }; //# sourceMappingURL=fast-node.d.cts.map