blob: 2e6415651af89e5d8d0b4edcef282504e8e045e2 [file] [log] [blame]
Adrià Vilanova Martínez6ecaa0d2024-10-26 17:04:32 +02001import { OptionsConfiguration } from '../../common/options/OptionsConfiguration';
2import {
3 OptionCodename,
4 OptionsValues,
5} from '../../common/options/optionsPrototype';
6
7export interface OptionsProviderPort {
8 /**
9 * Returns the value of option |option|.
10 */
11 getOptionValue<O extends OptionCodename>(
12 option: O,
13 ): Promise<OptionsValues[O]>;
14
15 /**
16 * Returns whether |feature| is enabled.
17 */
18 isEnabled(option: OptionCodename): Promise<boolean>;
19
20 getOptionsValues(): Promise<OptionsValues>;
21
22 /**
23 * Adds a listener for changes in the options configuration.
24 */
25 addListener(listener: OptionsChangeListener): void;
26}
27
28export type OptionsChangeListener = (
29 previousOptionValues: OptionsConfiguration,
30 currentOptionValues: OptionsConfiguration,
31) => void;