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 | |
Adrià Vilanova Martínez | 9326a00 | 2025-02-08 23:16:12 +0100 | [diff] [blame] | 20 | getOptionsConfiguration(): Promise<OptionsConfiguration>; |
Adrià Vilanova Martínez | 6ecaa0d | 2024-10-26 17:04:32 +0200 | [diff] [blame] | 21 | getOptionsValues(): Promise<OptionsValues>; |
| 22 | |
| 23 | /** |
| 24 | * Adds a listener for changes in the options configuration. |
| 25 | */ |
| 26 | addListener(listener: OptionsChangeListener): void; |
| 27 | } |
| 28 | |
| 29 | export type OptionsChangeListener = ( |
Adrià Vilanova Martínez | 9326a00 | 2025-02-08 23:16:12 +0100 | [diff] [blame] | 30 | previousConfiguration: OptionsConfiguration, |
| 31 | currentConfiguration: OptionsConfiguration, |
Adrià Vilanova Martínez | 6ecaa0d | 2024-10-26 17:04:32 +0200 | [diff] [blame] | 32 | ) => void; |