refactor(cc-dark-theme): migrate to the new DI architecture
Bug: twpowertools:226
Change-Id: I735013393d1d99cadee48399bba53a22fe59e27c
diff --git a/src/services/options/OptionsProvider.ts b/src/services/options/OptionsProvider.ts
new file mode 100644
index 0000000..2e64156
--- /dev/null
+++ b/src/services/options/OptionsProvider.ts
@@ -0,0 +1,31 @@
+import { OptionsConfiguration } from '../../common/options/OptionsConfiguration';
+import {
+ OptionCodename,
+ OptionsValues,
+} from '../../common/options/optionsPrototype';
+
+export interface OptionsProviderPort {
+ /**
+ * Returns the value of option |option|.
+ */
+ getOptionValue<O extends OptionCodename>(
+ option: O,
+ ): Promise<OptionsValues[O]>;
+
+ /**
+ * Returns whether |feature| is enabled.
+ */
+ isEnabled(option: OptionCodename): Promise<boolean>;
+
+ getOptionsValues(): Promise<OptionsValues>;
+
+ /**
+ * Adds a listener for changes in the options configuration.
+ */
+ addListener(listener: OptionsChangeListener): void;
+}
+
+export type OptionsChangeListener = (
+ previousOptionValues: OptionsConfiguration,
+ currentOptionValues: OptionsConfiguration,
+) => void;