import type { InferIdType } from "mongodb"; export type LimitedCursor = { next(): Promise<{ _id: InferIdType; } | null> | { _id: InferIdType; } | null; }; export type MaybeParalelReturnType = { type: "Break" | "Continue"; result?: any; error?: any; }; /** * This is purely a performance optimisation - used by updateMany/deleteMany when update/delete hooks are present. * If we aren't running in ordered mode - we can run all the operations in parallel * Doing this might overwhelm the memory of the server (given that we may need to fetch a large document for each) * So we support batching. * The expectation is this function doesn't need to care about aggregating write results - it assumes fn will handle that * But it does support aggregating errors (though maybe doesn't need to :shrug:) */ export declare function maybeParallel(fn: (next: { _id: InferIdType; }) => Promise, cursor: LimitedCursor, ordered: boolean, batchSize: number | undefined, signal: AbortSignal | undefined, first?: { _id: InferIdType; }): Promise;