const IPluginAPI = {
  commands: {}
}

export class Plugin {
  PLUGIN_ID = 'ChangeThemePlugin';

  _commands = IPluginAPI['commands'] || null;

  get commands() {
    return this._commands;
  }

  activate({ context, commands }) {
    this._commands = commands;
    context.subscriptions.push(
      commands.registerCommand(
        'ChangeThemePlugin.changeTheme',
        (value) => {
          commands.executeCommand(
            'alex.setDefaultPreference',
            'general.theme',
            value
          );
        }
      )
    );
  }
}

export default new Plugin();
