"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createRule = void 0;
var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
var createRule = exports.createRule = function createRule(match, handler) {
  var allowsBackwardMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  return {
    match: match,
    handler: handler,
    onHandlerApply: function onHandlerApply(_state, tr) {
      (0, _prosemirrorHistory.closeHistory)(tr);
    },
    allowsBackwardMatch: allowsBackwardMatch
  };
};