blob: 5f0cfa04cbf0a223f44f99d39b22dfca233fa936 [file] [log] [blame]
Adrià Vilanova Martínezb523be92024-05-25 19:14:19 +02001import { OptionCodename } from '../../options/optionsPrototype';
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +02002import Script, { ConcreteScript } from '../scripts/Script';
3
Adrià Vilanova Martínez8b591d92024-10-19 15:55:15 +02004/**
5 * @deprecated
6 */
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +02007export default abstract class Feature {
8 /**
9 * Internal codename used for the feature.
10 *
11 * It will be used for i18n translations, shown in log messages, etc.
12 */
13 abstract readonly codename: string;
14
15 /**
16 * Options which control the behavior of this feature.
17 */
Adrià Vilanova Martínez67b0b252024-05-18 00:35:51 +020018 abstract readonly relatedOptions: OptionCodename[];
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +020019
20 /**
21 * Uninitialized scripts which are associated with the feature.
22 */
23 abstract readonly scripts: ConcreteScript[];
24
25 private initializedScripts: Script[];
26
27 public getScripts() {
28 if (this.initializedScripts === undefined) {
29 this.initializedScripts = this.scripts.map((script) => new script());
30 }
31 return this.initializedScripts;
32 }
33}