"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.reconstructCursor = reconstructCursor;
const aggregation_cursor_1 = __importDefault(require("./aggregation-cursor"));
const cursor_1 = __importDefault(require("./cursor"));
const run_command_cursor_1 = __importDefault(require("./run-command-cursor"));
function reconstructCursor(mongo, constructionOptionsWithChains) {
    const { method, args, cursorType } = constructionOptionsWithChains.options;
    const providerCursor = mongo._serviceProvider[method](...args);
    const cursor = new { Cursor: cursor_1.default, AggregationCursor: aggregation_cursor_1.default, RunCommandCursor: run_command_cursor_1.default }[cursorType](mongo, providerCursor, constructionOptionsWithChains);
    return cursor;
}
//# sourceMappingURL=reconstruct-cursor.js.map