* @zh 安装插件 * @en Install plugin * * @param plugin - @zh 插件实例 @en Plugin instance * @throws @zh 如果Core实例未创建或插件安装失败 @en If Core instance not created or plugin installation fails * * @example * ```typescript * Core.create({ debug: true }); * * // @zh 安装
(plugin: IPlugin)
| 566 | * ``` |
| 567 | */ |
| 568 | public static async installPlugin(plugin: IPlugin): Promise<void> { |
| 569 | if (!this._instance) { |
| 570 | throw new Error('Core实例未创建,请先调用Core.create()'); |
| 571 | } |
| 572 | |
| 573 | await this._instance._pluginManager.install(plugin); |
| 574 | } |
| 575 | |
| 576 | /** |
| 577 | * @zh 卸载插件 |
no test coverage detected