import type { FindCursor, Document, CountOptions, Filter } from "mongodb"; import { HookedEventEmitter, HookedFindCursorInterface, FindCursorHookedEventMap, MaybeStrictFilter, ChainedCallbackEventMapWithCaller } from "./events/index.js"; import { AbstractHookedFindCursor } from "./abstractFindCursorImpl.js"; import { StandardInvokeHookOptions } from "./awaiatableEventEmitter.js"; import { BeforeAfterErrorFindCursorEventDefinitions } from "./events/findCursorEvents.js"; import { ExternalBeforeAfterEvent } from "./events/collectionEvents.js"; import { BeforeAfterCallbackArgsAndReturn, CommonDefinition, ExtractStandardBeforeAfterEventDefinitions, KeysMatching, Merge } from "./events/helpersTypes.js"; import { BeforeAfterErrorSharedEventDefinitions } from "./events/sharedEvents.js"; export interface HookedFindCursorOptions { transform?: (doc: TSchema) => any; ee: HookedEventEmitter>; invocationSymbol: symbol; interceptExecute: boolean; invocationOptions?: StandardInvokeHookOptions>; } export declare class HookedFindCursor extends AbstractHookedFindCursor implements HookedFindCursorInterface { #private; protected __tryCatchEmit: Promise, IE extends "find.cursor.next" | "find.cursor.toArray" | "find.cursor.forEach" | "find.cursor.asyncIterator" | "find.cursor.execute" | "find.cursor.rewind" | "find.cursor.close" | "cursor.execute" | "cursor.next" | "cursor.toArray" | "cursor.forEach" | "cursor.asyncIterator" | "cursor.rewind" | "cursor.close" | "*" | "find.cursor.count", BEA extends HEM[BE]["emitArgs"], AEA extends HEM[AE]["emitArgs"], AIE extends "find.cursor.next" | "find.cursor.toArray" | "find.cursor.forEach" | "find.cursor.asyncIterator" | "find.cursor.execute" | "find.cursor.rewind" | "find.cursor.close" | "cursor.execute" | "cursor.next" | "cursor.toArray" | "cursor.forEach" | "cursor.asyncIterator" | "cursor.rewind" | "cursor.close" | "*" | "find.cursor.count", BEAO extends Omit, AEAO extends BEA extends { argsOrig: any[]; } ? Omit : Omit, CT extends BeforeAfterErrorFindCursorEventDefinitions[IE]["caller"] | undefined>(ee: HookedEventEmitter, fn: T, caller: CT, args: HEM[BE]["emitArgs"]["args"] extends never ? undefined : HEM[BE]["emitArgs"]["args"], beforeAfterEmitArgs: (BEAO & AEAO) | (AEAO & BEAO), chainArgs: HEM[BE]["returnEmitName"] extends never ? false : true, chainResult: HEM[AE]["returnEmitName"] extends never ? false : true, chainArgsKey: "args" | ((keyof BEAO | keyof AEAO) & string) | undefined, invocationOptions: StandardInvokeHookOptions | undefined, internalEvent: IE, ...additionalInternalEvents: import("./tryCatchEmit.js").ExtraBeforeAfterEvent[]) => Promise>>; constructor(filter: MaybeStrictFilter | undefined, findCursor: FindCursor, { transform, ee, invocationSymbol, interceptExecute, invocationOptions }: HookedFindCursorOptions); get ee(): HookedEventEmitter>; project(value: Document): HookedFindCursor; filter(filter: Filter): this; addFilter(filter: Filter): this; close(): any; rewind(): void; next(): Promise; map(transform: (doc: TSchema) => T): HookedFindCursor; toArray(): Promise; count(options?: CountOptions): Promise; forEach(iterator: (doc: TSchema) => boolean | void): Promise; [Symbol.asyncIterator](): AsyncGenerator; clone(): HookedFindCursor; } export declare class ExtendableHookedFindCursor> = {}, ExtraEvents extends ChainedCallbackEventMapWithCaller = BeforeAfterCallbackArgsAndReturn>, AllEvents extends ChainedCallbackEventMapWithCaller = Merge, ExtraEvents>> extends HookedFindCursor { #private; protected _tryCatchEmit Promise, BE extends `before.${IE}` & keyof HEM, AE extends `after.${IE}` & keyof HEM, IE extends keyof BeforeAfterErrorFindCursorEventDefinitions | keyof BeforeAfterErrorSharedEventDefinitions | (KeysMatching & string), OIE extends keyof BeforeAfterErrorFindCursorEventDefinitions | keyof BeforeAfterErrorSharedEventDefinitions | (KeysMatching & string), EA extends HEM[BE]["emitArgs"], OEA extends Omit>(internalEvent: IE, emitArgs: OEA, beforeChainKey: (keyof OEA & HEM[BE]["returnEmitName"]) | undefined, chainResults: HEM[AE]["returnEmitName"] extends never ? false : true, fn: T, invocationOptions: StandardInvokeHookOptions | undefined, ...additionalInternalEvents: OIE[] | { event: OIE; emitArgs: Partial; }[]): Promise>>; }