blob: 2391f45c3c5d6a92c6fb8f3c0e10c7642dceb893 [file] [log] [blame]
export enum KillSwitchType {
Option = 'option',
Experiment = 'experiment',
Ignore = 'ignore',
Deprecated = 'deprecated',
InternalKillSwitch = 'internalKillSwitch',
}
export enum OptionContext {
Options = 'options',
Experiments = 'experiments',
Internal = 'internal',
Deprecated = 'deprecated',
}
export interface OptionConfig<T> {
codename: string;
context: OptionContext;
defaultValue: T;
killSwitchType: KillSwitchType;
optionalPermissions?: string[];
}
export class Option<T> implements OptionConfig<T> {
public codename: string;
public context: OptionContext;
public defaultValue: T;
public killSwitchType: KillSwitchType;
public optionalPermissions: string[];
constructor(config: OptionConfig<T>) {
this.codename = config.codename;
this.context = config.context;
this.defaultValue = config.defaultValue;
this.killSwitchType = config.killSwitchType;
this.optionalPermissions = config.optionalPermissions ?? [];
}
}