echoes/frontend/service/pluginService.ts

35 lines
1020 B
TypeScript
Raw Normal View History

// File path: /service/pluginService.ts
/**
*
*
*/
import { PluginConfiguration } from "types/pluginRequirement";
export class PluginService {
/** 单例实例 */
private static pluginInstance: PluginService | null = null;
/** 插件组件缓存 */
private pluginComponents: Map<string, Set<{
name: string, // 插件名称
configuration?: PluginConfiguration, // 插件配置
managePath?: string, // 管理路径
}>> = new Map();
/**
*
*/
private constructor() {};
/**
*
* @returns {PluginService}
*/
public static getInstance(): PluginService {
if (!this.pluginInstance) {
this.pluginInstance = new PluginService();
}
return this.pluginInstance;
}
}