import type { Document } from '../bson'; import type { Server } from '../sdam/server'; import type { Topology } from '../sdam/topology'; import type { ClientSession } from '../sessions'; import { Callback } from '../utils'; import { AbstractOperation } from './operation'; /** @internal */ export declare type ResultTypeFromOperation = TOperation extends AbstractOperation ? K : never; /** @internal */ export interface ExecutionResult { /** The server selected for the operation */ server: Server; /** The session used for this operation, may be implicitly created */ session?: ClientSession; /** The raw server response for the operation */ response: Document; } /** * Executes the given operation with provided arguments. * * @remarks * This method reduces large amounts of duplication in the entire codebase by providing * a single point for determining whether callbacks or promises should be used. Additionally * it allows for a single point of entry to provide features such as implicit sessions, which * are required by the Driver Sessions specification in the event that a ClientSession is * not provided * * @param topology - The topology to execute this operation on * @param operation - The operation to execute * @param callback - The command result callback */ /** @public */ export declare function executeOperation, TResult = ResultTypeFromOperation>(topology: Topology, operation: T): Promise; /** @public */ export declare function executeOperation, TResult = ResultTypeFromOperation>(topology: Topology, operation: T, callback: Callback): void; /** @public */ export declare function executeOperation, TResult = ResultTypeFromOperation>(topology: Topology, operation: T, callback?: Callback): Promise | void; //# sourceMappingURL=execute_operation.d.ts.map