import Logger from '../../tools/env.logger' ; import InstalledPlugin from './plugin.installed' ; class description export default class ControllerPluginsIncompatiblesStorage { private _logger : Logger = new Logger ( 'ControllerPluginsIncompatiblesStorage' ) ; private _plugins : Map < string , InstalledPlugin > = new Map ( ) ; public destroy ( ) { return new Promise ( ( resolve ) => { this . _plugins . clear ( ) ; resolve ( ) ; } ) ; } public getPluginByName ( name ) { return Array . from ( this . _plugins . values ( ) ) . find ( ( plugin ) => { return plugin . getName ( ) === name ; } ) ; } public get ( ) { return Array . from ( this . _plugins . values ( ) ) . map ( ( plugin ) => { return plugin ; } ) ; } public add ( plugin ) { this . _plugins . set ( plugin . getName ( ) , plugin ) ; } public delete ( name ) { this . _plugins . delete ( name ) ; } }