import type { EncodedQuadTerms } from '../PatternTerm'; import type { IBTreeCandidates, RdfStoreIndexBTree } from './RdfStoreIndexBTree'; /** * Iterates over the quads of a {@link RdfStoreIndexBTree} that match a pattern, in index order. * * Components that the pattern binds after an unbound one are matched with a skip-scan: a quad that * does not match makes the scan jump ahead with a binary search rather than read on. * * The index may change while this iterates. The iterator then relocates itself after the last quad * it produced, so it neither repeats nor loses quads that were there all along. */ export declare class RdfStoreIndexBTreeIterator implements IterableIterator> { private readonly index; private readonly ids; private readonly levels; private readonly leading; private readonly candidates; private cursor; private version; private last; private done; /** * @param index The index to iterate over. * @param ids The encoded terms to match, of which only the entries at `levels` are considered. * @param levels The levels that must match, in ascending order. * @param leading The number of levels that are bound to a single term from the first one onwards without a gap. * @param candidates For levels with a quoted triple pattern, the quoted triples it matches. */ constructor(index: RdfStoreIndexBTree, ids: (number | undefined)[], levels: number[], leading: number, candidates?: (IBTreeCandidates | undefined)[]); private resync; /** * Skip forward to the first result whose component at `level` is not before the sought term. * * Only quads that share the components before `level` with the next quad are skipped, and they are * found by binary search, so skipping costs logarithmic time in the number of skipped quads. * @param level The level to skip within. * @param isBefore Whether a key at that level precedes the sought term. */ seek(level: number, isBefore: (key: number) => boolean): void; [Symbol.iterator](): IterableIterator>; next(): IteratorResult>; return(): IteratorResult>; }