var PluginManager = /*#__PURE__*/function () {
  function PluginManager(plugins) {
    this.plugins = void 0;
    this.plugins = plugins;
  }

  /**
   * 注册插件
   * @param pluginConfigCreator 
   * @param options 
   */
  var _proto = PluginManager.prototype;
  _proto.register = function register(pluginConfigCreator, options) {
    return this.plugins.register(pluginConfigCreator, options);
  }

  /**
   * 删除插件
   * @param pluginName 
   */;
  _proto["delete"] = function _delete(pluginName) {
    if (this.has(pluginName)) {
      var thisPlugin = this.get(pluginName);
      this.plugins["delete"](pluginName);
      if (thisPlugin.config.destroy) {
        thisPlugin.config.destroy();
      }
    }
    return Promise.resolve(true);
  }

  /**
   * 是否已经注册了插件
   * @param pluginName 
   */;
  _proto.has = function has(pluginName) {
    return this.getAll().has(pluginName);
  }

  /**
   * 获取插件
   * @param pluginName 
   */;
  _proto.get = function get(pluginName) {
    return this.getAll().get(pluginName);
  }

  /**
   * 获取全部插件
   */;
  _proto.getAll = function getAll() {
    return this.plugins.getPluginMap();
  };
  return PluginManager;
}();
export { PluginManager as default };