export var KeyboardActionExctracterBuilder = /*#__PURE__*/function () {
  function KeyboardActionExctracterBuilder(actionMatchers) {
    if (actionMatchers === void 0) {
      actionMatchers = [];
    }
    this._actionMatchers = actionMatchers;
  }
  var _proto = KeyboardActionExctracterBuilder.prototype;
  _proto.add = function add(type, check) {
    return new KeyboardActionExctracterBuilder(this._actionMatchers.concat({
      type: type,
      check: check
    }));
  };
  _proto.build = function build(defaultAction) {
    var _this = this;
    return function (event) {
      var action = _this._actionMatchers.find(function (x) {
        return x.check(event);
      });
      return action && action.type || defaultAction;
    };
  };
  return KeyboardActionExctracterBuilder;
}();