UNPKG

2.14 kBTypeScriptView Raw
1/// <reference types="lodash" />
2import { Emitter, Event } from '../common/event';
3import { Disposable } from '../common/disposable';
4import { Theme, ThemeChangeEvent } from '../common/theme';
5import { Deferred } from '../common/promise-util';
6import { PreferenceSchemaProvider, PreferenceService } from './preferences';
7export declare class ThemeService {
8 static readonly STORAGE_KEY = "theme";
9 protected readonly preferences: PreferenceService;
10 protected readonly schemaProvider: PreferenceSchemaProvider;
11 protected themes: {
12 [id: string]: Theme;
13 };
14 protected activeTheme: Theme;
15 protected readonly themeChange: Emitter<ThemeChangeEvent>;
16 protected readonly deferredInitializer: Deferred<void>;
17 get initialized(): Promise<void>;
18 readonly onDidColorThemeChange: Event<ThemeChangeEvent>;
19 protected init(): void;
20 register(...themes: Theme[]): Disposable;
21 protected validateActiveTheme(): void;
22 protected updateColorThemePreference: import("lodash").DebouncedFunc<() => void>;
23 protected doUpdateColorThemePreference(): void;
24 getThemes(): Theme[];
25 getTheme(themeId: string): Theme;
26 protected tryGetTheme(themeId: string): Theme | undefined;
27 /** Should only be called at startup. */
28 loadUserTheme(): void;
29 /**
30 * @param persist If `true`, the value of the `workbench.colorTheme` preference will be set to the provided ID.
31 */
32 setCurrentTheme(themeId: string, persist?: boolean): void;
33 getCurrentTheme(): Theme;
34 protected getConfiguredTheme(): Theme | undefined;
35 /**
36 * The default theme. If that is not applicable, returns with the fallback theme.
37 */
38 get defaultTheme(): Theme;
39 /**
40 * Resets the state to the user's default, or to the fallback theme. Also discards any persisted state in the local storage.
41 */
42 reset(): void;
43}
44export declare class BuiltinThemeProvider {
45 static readonly darkTheme: Theme;
46 static readonly lightTheme: Theme;
47 static readonly hcTheme: Theme;
48 static readonly hcLightTheme: Theme;
49 static readonly themes: Theme[];
50}
51//# sourceMappingURL=theming.d.ts.map
\No newline at end of file