import { ImmutableTree } from "../immutable-tree.js"; //#region src/iterator/iterator.d.ts /** * TreeIterator iterates over key-value pairs in an ImmutableTree. * * Usage: * ```typescript * const iter = new TreeIterator(tree, start, end, true); * while (iter.valid()) { * console.log(iter.key(), iter.value()); * await iter.next(); * } * iter.close(); * ``` */ declare class TreeIterator { private readonly tree; private readonly start; private readonly end; private readonly ascending; private readonly inclusive; private currentKey; private currentValue; private currentVersion; private isValid; private traversal; /** * Creates a new TreeIterator. * The iterator is positioned before the first element. * Call next() to move to the first element. * * @param tree - The immutable tree to iterate over * @param start - Start key (null for beginning) * @param end - End key (null for no limit) * @param ascending - True for ascending order, false for descending * @param inclusive - True to include end key, false to exclude */ constructor(tree: ImmutableTree, start?: Uint8Array | null, end?: Uint8Array | null, ascending?: boolean, inclusive?: boolean); /** * Checks if the iterator is currently valid. * Returns false when iteration is complete or tree is empty. */ valid(): boolean; /** * Gets the current key. * Only valid when valid() returns true. */ key(): Uint8Array; /** * Gets the current value. * Only valid when valid() returns true. */ value(): Uint8Array; /** * Gets the current node's version. * Only valid when valid() returns true. */ version(): bigint; /** * Advances the iterator to the next key-value pair. * After the last element, valid() will return false. */ next(): Promise; /** * Closes the iterator and releases resources. * The iterator becomes invalid after calling close(). */ close(): void; /** * Gets the iteration domain (start and end keys). */ domain(): [Uint8Array | null, Uint8Array | null]; } //#endregion export { TreeIterator }; //# sourceMappingURL=iterator.d.ts.map