import type { CountOptions } from "mongodb"; import { CursorParams, CursorParamsWithArgs, CursorParamsWithArgsAndResult, CursorParamsWithCaller, CursorParamsWithResult } from "./cursorHelperTypes.js"; import { HookedFindCursorInterface } from "./hookedFindCursorInterface.js"; import { BeforeAfterCallbackArgsAndReturn, ExtractEventDefinitions } from "./helpersTypes.js"; import { BeforeAfterErrorGenericCursorEventDefinitions } from "./genericCursorEvents.js"; import { BeforeAfterErrorSharedEventDefinitions } from "./sharedEvents.js"; export type BeforeAfterErrorFindOnlyCursorEventDefinitions = { "find.cursor.execute": CursorParamsWithCaller, { caller: "find.cursor.toArray" | "find.cursor.next" | "find.cursor.forEach" | "find.cursor.asyncIterator" | "find.cursor.count"; }>; "find.cursor.next": CursorParamsWithResult, { result: TSchema | null; }>; "find.cursor.toArray": CursorParamsWithResult, { result: TSchema[]; }>; "find.cursor.count": CursorParamsWithArgsAndResult, { result: number; args: [CountOptions | undefined]; }>; "find.cursor.forEach": CursorParamsWithArgs, { args: [iterator: (doc: TSchema) => boolean | void]; }>; "find.cursor.asyncIterator": CursorParams, {}>; "find.cursor.rewind": CursorParams, { isPromise: false; }>; "find.cursor.close": CursorParams, {}>; }; export type BeforeAfterErrorFindCursorEventDefinitions = BeforeAfterErrorFindOnlyCursorEventDefinitions & BeforeAfterErrorGenericCursorEventDefinitions & BeforeAfterErrorSharedEventDefinitions; type FindCursorBeforeEventDefinitions = ExtractEventDefinitions, "before", "before">; type FindCursorAfterSuccessEventDefinitions = ExtractEventDefinitions, "after", "success", "success">; type FindCursorAfterErrorEventDefinitions = ExtractEventDefinitions, "after", "error", "error">; type FindCursorAfterEventDefinitions = ExtractEventDefinitions, "after", "after">; export type BeforeAfterErrorFindCursorFlatEventDefinitions = FindCursorBeforeEventDefinitions & FindCursorAfterSuccessEventDefinitions & FindCursorAfterErrorEventDefinitions & FindCursorAfterEventDefinitions; type FindCursorCallbackArgsAndReturn = BeforeAfterCallbackArgsAndReturn>; export type FindCursorHookedEventMap = FindCursorCallbackArgsAndReturn; export {};