/** * Cursor – lazy, chainable query result that mimics MongoDB's cursor API. */ import type { ProjectionSpec, SortSpec } from '@digitaldefiance/suite-core-lib'; import type { BsonDocument } from '../interfaces/storage/documentTypes'; export declare class Cursor { private readonly _source; private _sort; private _skip; private _limit; private _projection; private _exhausted; constructor(_source: () => Promise); /** Set sort specification (chainable) */ sort(spec: SortSpec): this; /** Set number of documents to skip (chainable) */ skip(n: number): this; /** Set maximum number of documents to return (chainable) */ limit(n: number): this; /** Set field projection (chainable) */ project(spec: ProjectionSpec): this; /** * Execute the query and return all matching documents as an array. */ toArray(): Promise; /** * Count matching documents (applies skip/limit if set). */ count(): Promise; /** * Get the first matching document. */ next(): Promise; /** * Check if there are more results. */ hasNext(): Promise; /** * Iterate over all results with a callback. */ forEach(fn: (doc: T) => void | Promise): Promise; /** * Map results through a transform function. */ map(fn: (doc: T) => U): Promise; /** * Make the cursor thenable so it can be awaited directly. */ then(onfulfilled?: ((value: T[]) => TResult1 | PromiseLike) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null): Promise; } //# sourceMappingURL=cursor.d.ts.map