import { IEnvironment } from '../types/environment'; import { PluginConfiguration } from '../types/plugin-config'; import { IPluginManifest } from './plugin'; export class PluginConfigurator { private configs: Map = new Map(); constructor(private env: IEnvironment) {} public async loadConfig(mf: IPluginManifest): Promise { if (!this.configs.has(mf.name)) { const conf = new PluginConfiguration(this.env, mf.name); this.configs.set(mf.name, conf); return conf; } return this.configs.get(mf.name) as PluginConfiguration; } }