Adrià Vilanova MartÃnez | 6ecaa0d | 2024-10-26 17:04:32 +0200 | [diff] [blame] | 1 | import { OptionsConfiguration } from '../../common/options/OptionsConfiguration'; |
| 2 | import { |
| 3 | OptionCodename, |
| 4 | OptionsValues, |
| 5 | } from '../../common/options/optionsPrototype'; |
| 6 | |
| 7 | export 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 | |
| 28 | export type OptionsChangeListener = ( |
| 29 | previousOptionValues: OptionsConfiguration, |
| 30 | currentOptionValues: OptionsConfiguration, |
| 31 | ) => void; |