"use strict";

exports.__esModule = true;
exports.createKeyboardShortcutCommandsPool = createKeyboardShortcutCommandsPool;
var _editor = require("./editor");
var _extendCellsSelection = require("./extendCellsSelection");
var _moveCellSelection = require("./moveCellSelection");
var _emptySelectedCells = require("./emptySelectedCells");
var _scrollToFocusedCell = require("./scrollToFocusedCell");
var _selectAll = require("./selectAll");
var _populateSelectedCellsData = require("./populateSelectedCellsData");
const allCommands = [...(0, _editor.getAllCommands)(), ...(0, _extendCellsSelection.getAllCommands)(), ...(0, _moveCellSelection.getAllCommands)(), _emptySelectedCells.command, _scrollToFocusedCell.command, _selectAll.command, _populateSelectedCellsData.command];

/**
 * Prepares and creates an object with all available commands to trigger.
 *
 * @param {Handsontable} hot The Handsontable instance.
 * @returns {object}
 */
function createKeyboardShortcutCommandsPool(hot) {
  const commands = {};
  allCommands.forEach(_ref => {
    let {
      name,
      callback
    } = _ref;
    commands[name] = function () {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return callback(hot, ...args);
    };
  });
  return commands;
}