export type ArgsOrig = { /** The original arguments before any hooks mutated them */ argsOrig: O["args"]; }; export type ThisArg = { /** The instance of collection or cursor */ thisArg: O["thisArg"]; }; export type Args = { /** The current arguments as mutated by any hooks ran before this one */ args: O["args"]; }; export type Caller = { /** The name of the call, for `before.insert` events this could be `insertMany` or `insertOne` */ caller: O["caller"]; }; export type InvocationSymbol = { /** A unique identifier per hook pair. The before/after hook for a single request will have the same invocationSymbol */ invocationSymbol: symbol; }; export type ParentInvocationSymbol = { /** The parent invocations invocationSymbol. For internal events it identifies the parent call. e.g., for `before.insert` events it may be the relevant`before.insertMany` call */ parentInvocationSymbol: symbol; }; export type ErrorT = { /** The error caused by the action. Mutually exclusive with result */ error: any; }; export type Result = O extends { result: any; } ? { /**The result of the call */ result: O["result"]; } : O extends { result?: any; } ? { /**The result of the call */ result?: O["result"]; } : {}; export type ResultOrError = (O extends { result?: any; } ? { result?: O["result"]; } : {}) & { error?: any; }; export type ResultOrig = O extends { result: any; } ? { /**The result of the call */ resultOrig: O["result"]; } : {}; export type Abortable = { /** An abort signal to allow interuption of long running operations - particularly useful in the case of *Many operations with individual hooks */ signal: AbortSignal | undefined; };