"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var base_1 = require("./base");
exports.createIndexedBatcher = function (waitTime, cb) {
    return base_1.createBatcher({
        waitTime: waitTime,
        addCall: function (_a) {
            var batchArgs = _a.batchArgs, args = _a.args;
            if (batchArgs === undefined) {
                return [args[0]];
            }
            return tslib_1.__spread(batchArgs, [args[0]]);
        },
        createCallResult: function (batchResult, index) { return batchResult[index]; },
        processBatch: cb,
    });
};
