import { ShellApiWithMongoClass } from './decorators'; import type Mongo from './mongo'; import type { Document, ServiceProviderFindCursor, ServiceProviderAggregationCursor, ServiceProviderRunCommandCursor, ServiceProviderBaseCursor, ServiceProvider } from '@mongosh/service-provider-core'; import { asPrintable } from './enums'; import { CursorIterationResult } from './result'; export type CursorConstructionOptions = { method: 'find'; args: Parameters; cursorType: 'Cursor'; } | { method: 'aggregate'; args: Parameters; cursorType: 'AggregationCursor'; } | { method: 'aggregateDb'; args: Parameters; cursorType: 'AggregationCursor'; } | { method: 'runCursorCommand'; args: Parameters; cursorType: 'RunCommandCursor'; }; export type CursorChainOptions = { method: string; args: any[]; }; export type CursorConstructionOptionsWithChains = { options: CursorConstructionOptions; chains?: CursorChainOptions[]; }; export declare abstract class BaseCursor extends ShellApiWithMongoClass { _mongo: Mongo; _cursor: CursorType; readonly _constructionOptions?: CursorConstructionOptions; _chains: CursorChainOptions[]; _transform: ((doc: any) => any) | null; _blockingWarningDisabled: boolean; constructor(mongo: Mongo, cursor: CursorType, constructionOptionsWithChains?: CursorConstructionOptionsWithChains); close(): Promise; forEach(f: (doc: Document) => void | boolean | Promise | Promise): Promise; hasNext(): Promise; tryNext(): Promise; _tryNext(): Promise; _canDelegateIterationToUnderlyingCursor(): boolean; [Symbol.asyncIterator](): AsyncGenerator; isClosed(): boolean; isExhausted(): boolean; itcount(): Promise; pretty(): this; map(f: (doc: Document) => Document): this; next(): Promise; disableBlockWarnings(): this; abstract batchSize(size: number): this; abstract toArray(): Promise; abstract maxTimeMS(value: number): this; abstract objsLeftInBatch(): number; abstract _it(): Promise; } export declare abstract class AbstractFiniteCursor extends BaseCursor { _currentIterationResult: CursorIterationResult | null; constructor(mongo: Mongo, cursor: CursorType, constructionOptionsWithChains?: CursorConstructionOptionsWithChains); [asPrintable](): Promise; _it(): Promise; batchSize(size: number): this; toArray(): Promise; maxTimeMS(value: number): this; objsLeftInBatch(): number; }