import DataLoaderNullable from './DataLoaderNullable'; import type { Paths, Projection } from './projectionFromGraphQLInfo'; import type { PartialWithId } from './types'; import type { Collection, Document, EnhancedOmit, Filter, ObjectId, WithId } from 'mongodb'; export type IdWithProjection & { readonly _id: ObjectId; }> = { readonly _id: ObjectId; readonly projection: Projection; }; export type IdWithoutProjection = { readonly _id: ObjectId; readonly projection: null; }; export type Key & { readonly _id: ObjectId; }> = IdWithoutProjection | IdWithProjection; type OptimalProjection & { readonly _id: ObjectId; }> = { readonly projection: Projection | null; readonly $in: Filter['$in']; }; export declare function getOptimalProjection & { readonly _id: ObjectId; }>(keys: readonly Key[]): OptimalProjection; export declare function cacheKeyFn(key: Key): string; export type BatchLoadFnWithoutError = (keys: ReadonlyArray) => Promise>; export type MongoDataLoader>> = DataLoaderNullable, string>; export type LoadMapper, // GraphQL type DBType extends WithId = { readonly _id: ObjectId; }, // Database type DBPath extends Paths = Paths, GQLPath extends Paths = Paths> = Partial>; export declare function createMongoDataloader, // GraphQL type DBTypeInt extends Document = Document, // Database type DBType extends WithId = WithId, // Database type DBPath extends Paths = Paths, GQLPath extends Paths = Paths>(collection: Collection>, dependencies?: Partial>): MongoDataLoader; export default createMongoDataloader;