blob: 76f5990f6e7bd7359afa209dfef492b544399d7f [file] [log] [blame]
import { OptionCodename } from '../../options/optionsPrototype';
import Script, { ConcreteScript } from '../scripts/Script';
export default abstract class Feature {
/**
* Internal codename used for the feature.
*
* It will be used for i18n translations, shown in log messages, etc.
*/
abstract readonly codename: string;
/**
* Options which control the behavior of this feature.
*/
abstract readonly relatedOptions: OptionCodename[];
/**
* Uninitialized scripts which are associated with the feature.
*/
abstract readonly scripts: ConcreteScript[];
private initializedScripts: Script[];
public getScripts() {
if (this.initializedScripts === undefined) {
this.initializedScripts = this.scripts.map((script) => new script());
}
return this.initializedScripts;
}
}