import type { Document } from "mongodb"; export { ProjectionOfTSchema, NestedProjectionOfTSchema, FilterOfTSchema } from "mongo-collection-helpers"; import { CallbackAndOptionsOfEm, ChainedAwaiatableEventEmitter, ChainedCallbackEntry, ChainedCallbackEventMap, ChainedListenerCallback } from "../awaiatableEventEmitter.js"; import { SkipDocument, CommonDefinition } from "./helpersTypes.js"; import { BeforeAfterErrorCollectionEventDefinitions, CollectionBeforeAfterErrorEventDefinitions, CollectionHookedEventMap } from "./collectionEvents.js"; import { BeforeAfterErrorFindOnlyCursorEventDefinitions, FindCursorHookedEventMap } from "./findCursorEvents.js"; import { AggregationCursorHookedEventMap, BeforeAfterErrorAggregationOnlyCursorEventDefinitions } from "./aggregationCursorEvents.js"; import { BeforeAfterErrorGenericCursorEventDefinitions } from "./genericCursorEvents.js"; import { BeforeAfterErrorSharedEventDefinitions } from "./sharedEvents.js"; export { AmendedInsertOneOptions, AmendedBulkWriteOptions, AmendedUpdateOptions, AmendedDeleteOptions, AmendedAggregateOptions, AmendedReplaceOptions, AmendedDistinctOptions, AmendedFindOptions, AmendedCountDocumentsOptions, AmendedCountOptions, AmendedEstimatedDocumentCountOptions, AmendedFindOneAndDeleteOptions, AmendedFindOneAndReplaceOptions, AmendedFindOneAndUpdateOptions, AmendedFindOneOptions, MaybeStrictFilter, ExternalBeforeAfterEvent, } from "./collectionEvents.js"; export { UpdateCallArgs, ReplaceCallArgs, CollectionHookedEventMap } from "./collectionEvents.js"; export { FindCursorHookedEventMap } from "./findCursorEvents.js"; export { AggregationCursorHookedEventMap } from "./aggregationCursorEvents.js"; export { HookedCollectionInterface } from "./hookedCollectionInterface.js"; export { HookedAggregationCursorInterface } from "./hookedAggregationCursorInterface.js"; export { HookedFindCursorInterface } from "./hookedFindCursorInterface.js"; export { CollectionBeforeAfterErrorEventDefinitions }; export { SkipDocument, CommonDefinition }; type _BeforeAfterEventNames = keyof BeforeAfterErrorCollectionEventDefinitions | keyof BeforeAfterErrorFindOnlyCursorEventDefinitions | keyof BeforeAfterErrorAggregationOnlyCursorEventDefinitions | keyof BeforeAfterErrorGenericCursorEventDefinitions | keyof BeforeAfterErrorSharedEventDefinitions; type BeforeAfterEventNames = _BeforeAfterEventNames & limit; export type BeforeAfterEventNamesOfName = `before.${k}` | `after.${k}` | `after.${k}.error` | `after.${k}.success`; type MapWithCaller = { [k in string]: { caller: string | undefined; }; }; export type GenericCallerType = map[k]["caller"]; export type CallerType = CollectionBeforeAfterErrorEventDefinitions[k]["caller"]; type _EventNames = keyof CollectionHookedEventMap | keyof FindCursorHookedEventMap | keyof AggregationCursorHookedEventMap; export type EventNames = _EventNames & limit; export type PartialCallbackMap = { [k in K]?: CallbackAndOptionsOfEm[]; }; export type HookedListenerCallback = ChainedListenerCallback; export type ChainedCallbackEntryWithCaller = ChainedCallbackEntry & { caller: string | undefined; }; export type ChainedCallbackEventMapWithCaller = Record; export declare class HookedEventEmitter extends ChainedAwaiatableEventEmitter { assertCaller(caller: GenericCallerType, eventName: IE): asserts caller is GenericCallerType; } export declare const FindCursorEventsSet: Set<"before.cursor.execute" | "before.cursor.next" | "before.cursor.toArray" | "before.cursor.forEach" | "before.cursor.asyncIterator" | "before.cursor.rewind" | "before.cursor.close" | "before.*" | "after.cursor.execute.success" | "after.cursor.next.success" | "after.cursor.toArray.success" | "after.cursor.forEach.success" | "after.cursor.asyncIterator.success" | "after.cursor.rewind.success" | "after.cursor.close.success" | "after.*.success" | "after.cursor.execute.error" | "after.cursor.next.error" | "after.cursor.toArray.error" | "after.cursor.forEach.error" | "after.cursor.asyncIterator.error" | "after.cursor.rewind.error" | "after.cursor.close.error" | "after.*.error" | "after.cursor.execute" | "after.cursor.next" | "after.cursor.toArray" | "after.cursor.forEach" | "after.cursor.asyncIterator" | "after.cursor.rewind" | "after.cursor.close" | "after.*" | "before.find.cursor.next" | "before.find.cursor.toArray" | "before.find.cursor.forEach" | "before.find.cursor.asyncIterator" | "before.find.cursor.execute" | "before.find.cursor.rewind" | "before.find.cursor.close" | "before.find.cursor.count" | "after.find.cursor.next.success" | "after.find.cursor.toArray.success" | "after.find.cursor.forEach.success" | "after.find.cursor.asyncIterator.success" | "after.find.cursor.execute.success" | "after.find.cursor.rewind.success" | "after.find.cursor.close.success" | "after.find.cursor.count.success" | "after.find.cursor.next.error" | "after.find.cursor.toArray.error" | "after.find.cursor.forEach.error" | "after.find.cursor.asyncIterator.error" | "after.find.cursor.execute.error" | "after.find.cursor.rewind.error" | "after.find.cursor.close.error" | "after.find.cursor.count.error" | "after.find.cursor.next" | "after.find.cursor.toArray" | "after.find.cursor.forEach" | "after.find.cursor.asyncIterator" | "after.find.cursor.execute" | "after.find.cursor.rewind" | "after.find.cursor.close" | "after.find.cursor.count">; export declare const AggregateCursorEventsSet: Set<"before.aggregation.cursor.next" | "before.aggregation.cursor.toArray" | "before.aggregation.cursor.forEach" | "before.aggregation.cursor.asyncIterator" | "before.aggregation.cursor.execute" | "before.aggregation.cursor.rewind" | "before.aggregation.cursor.close" | "before.cursor.execute" | "before.cursor.next" | "before.cursor.toArray" | "before.cursor.forEach" | "before.cursor.asyncIterator" | "before.cursor.rewind" | "before.cursor.close" | "before.*" | "after.aggregation.cursor.next.success" | "after.aggregation.cursor.toArray.success" | "after.aggregation.cursor.forEach.success" | "after.aggregation.cursor.asyncIterator.success" | "after.aggregation.cursor.execute.success" | "after.aggregation.cursor.rewind.success" | "after.aggregation.cursor.close.success" | "after.cursor.execute.success" | "after.cursor.next.success" | "after.cursor.toArray.success" | "after.cursor.forEach.success" | "after.cursor.asyncIterator.success" | "after.cursor.rewind.success" | "after.cursor.close.success" | "after.*.success" | "after.aggregation.cursor.next.error" | "after.aggregation.cursor.toArray.error" | "after.aggregation.cursor.forEach.error" | "after.aggregation.cursor.asyncIterator.error" | "after.aggregation.cursor.execute.error" | "after.aggregation.cursor.rewind.error" | "after.aggregation.cursor.close.error" | "after.cursor.execute.error" | "after.cursor.next.error" | "after.cursor.toArray.error" | "after.cursor.forEach.error" | "after.cursor.asyncIterator.error" | "after.cursor.rewind.error" | "after.cursor.close.error" | "after.*.error" | "after.aggregation.cursor.next" | "after.aggregation.cursor.toArray" | "after.aggregation.cursor.forEach" | "after.aggregation.cursor.asyncIterator" | "after.aggregation.cursor.execute" | "after.aggregation.cursor.rewind" | "after.aggregation.cursor.close" | "after.cursor.execute" | "after.cursor.next" | "after.cursor.toArray" | "after.cursor.forEach" | "after.cursor.asyncIterator" | "after.cursor.rewind" | "after.cursor.close" | "after.*">; export declare const Events: { before: { [k in BeforeAfterEventNames]: `before.${k}`; }; afterSuccess: { [k in BeforeAfterEventNames]: `after.${k}.success`; }; afterError: { [k in BeforeAfterEventNames]: `after.${k}.error`; }; after: { [k in BeforeAfterEventNames]: `after.${k}`; }; }; export declare const InternalEvents: { find: "find"; update: "update"; count: "count"; delete: "delete"; insert: "insert"; aggregate: "aggregate"; "find.cursor.next": "find.cursor.next"; "find.cursor.toArray": "find.cursor.toArray"; "find.cursor.forEach": "find.cursor.forEach"; "find.cursor.asyncIterator": "find.cursor.asyncIterator"; "aggregation.cursor.next": "aggregation.cursor.next"; "aggregation.cursor.toArray": "aggregation.cursor.toArray"; "aggregation.cursor.forEach": "aggregation.cursor.forEach"; "aggregation.cursor.asyncIterator": "aggregation.cursor.asyncIterator"; "aggregation.cursor.execute": "aggregation.cursor.execute"; "find.cursor.execute": "find.cursor.execute"; "aggregation.cursor.rewind": "aggregation.cursor.rewind"; "find.cursor.rewind": "find.cursor.rewind"; "aggregation.cursor.close": "aggregation.cursor.close"; "find.cursor.close": "find.cursor.close"; "cursor.execute": "cursor.execute"; "cursor.next": "cursor.next"; "cursor.toArray": "cursor.toArray"; "cursor.forEach": "cursor.forEach"; "cursor.asyncIterator": "cursor.asyncIterator"; "cursor.rewind": "cursor.rewind"; "cursor.close": "cursor.close"; "*": "*"; findOne: "findOne"; insertOne: "insertOne"; insertMany: "insertMany"; deleteOne: "deleteOne"; deleteMany: "deleteMany"; replaceOne: "replaceOne"; updateOne: "updateOne"; updateMany: "updateMany"; distinct: "distinct"; countDocuments: "countDocuments"; estimatedDocumentCount: "estimatedDocumentCount"; "count*": "count*"; "findOne*": "findOne*"; findOneAndDelete: "findOneAndDelete"; findOneAndUpdate: "findOneAndUpdate"; findOneAndReplace: "findOneAndReplace"; "find.cursor.count": "find.cursor.count"; }; export declare function internalEventToBeforeAfterKey(key: K): { before: `before.${K}`; afterSuccess: `after.${K}.success`; afterError: `after.${K}.error`; after: `after.${K}`; }; export declare function assertCaller(caller: CallerType, internalEvent: IE): asserts caller is CallerType; export declare function getAssertCaller(): (caller: GenericCallerType, internalEvent: IE) => asserts caller is GenericCallerType; export declare function assertArgs[BeforeAfterEventNames]["before"]["emitArgs"] = CollectionBeforeAfterErrorEventDefinitions[BeforeAfterEventNames]["before"]["emitArgs"]>(args: EE extends { args: any; } ? EE["args"] : never, internalEvent: IE): asserts args is CollectionBeforeAfterErrorEventDefinitions[typeof internalEvent]["before"]["emitArgs"] extends { args: any; } ? CollectionBeforeAfterErrorEventDefinitions[typeof internalEvent]["before"]["emitArgs"]["args"] : never;