"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.autocompletePlugin = void 0;
var _autocompletePlugin = require("./pm-plugins/autocomplete-plugin");
var autocompletePlugin = exports.autocompletePlugin = function autocompletePlugin(_ref) {
  var options = _ref.config,
    api = _ref.api;
  return {
    name: 'autocomplete',
    getSharedState: function getSharedState(editorState) {
      if (!editorState) {
        return undefined;
      }
      return _autocompletePlugin.autocompletePluginKey.getState(editorState);
    },
    pmPlugins: function pmPlugins() {
      return [{
        name: 'autocomplete',
        plugin: function plugin() {
          return (0, _autocompletePlugin.createAutocompletePlugin)(options, api);
        }
      }];
    }
  };
};