1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Add theme enums and platformUtilsService helper (#497)

* Use enum for themes, add getEffectiveTheme

* Update electron and cli to use theme refactor
This commit is contained in:
Thomas Rittson
2021-09-30 06:37:36 +10:00
committed by GitHub
parent 91b73fa777
commit ce71c0c0bd
5 changed files with 35 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
import { DeviceType } from '../enums/deviceType';
import { ThemeType } from '../enums/themeType';
export abstract class PlatformUtilsService {
identityClientId: string;
@@ -28,7 +29,8 @@ export abstract class PlatformUtilsService {
readFromClipboard: (options?: any) => Promise<string>;
supportsBiometric: () => Promise<boolean>;
authenticateBiometric: () => Promise<boolean>;
getDefaultSystemTheme: () => Promise<'light' | 'dark'>;
onDefaultSystemThemeChange: (callback: ((theme: 'light' | 'dark') => unknown)) => unknown;
getDefaultSystemTheme: () => Promise<ThemeType.Light | ThemeType.Dark>;
onDefaultSystemThemeChange: (callback: ((theme: ThemeType.Light | ThemeType.Dark) => unknown)) => unknown;
getEffectiveTheme: () => Promise<ThemeType>;
supportsSecureStorage: () => boolean;
}

View File

@@ -0,0 +1,7 @@
export enum ThemeType {
System = 'system',
Light = 'light',
Dark = 'dark',
Nord = 'nord',
SolarizedDark = 'solarizedDark',
}