2024-03-13 16:25:39 +01:00
|
|
|
import { Observable, Subscription } from "rxjs";
|
2022-06-23 13:36:05 +02:00
|
|
|
|
2023-11-27 21:59:44 +01:00
|
|
|
import { ThemeType } from "@bitwarden/common/platform/enums";
|
2022-06-23 13:36:05 +02:00
|
|
|
|
2024-03-13 16:25:39 +01:00
|
|
|
/**
|
|
|
|
* A service for managing and observing the current application theme.
|
|
|
|
*/
|
|
|
|
// FIXME: Rename to ThemingService
|
2022-06-23 13:36:05 +02:00
|
|
|
export abstract class AbstractThemingService {
|
2024-03-13 16:25:39 +01:00
|
|
|
/**
|
|
|
|
* The effective theme based on the user configured choice and the current system theme if
|
|
|
|
* the configured choice is {@link ThemeType.System}.
|
|
|
|
*/
|
|
|
|
theme$: Observable<ThemeType>;
|
|
|
|
/**
|
|
|
|
* Listens for effective theme changes and applies changes to the provided document.
|
|
|
|
* @param document The document that should have theme classes applied to it.
|
|
|
|
*
|
|
|
|
* @returns A subscription that can be unsubscribed from to cancel the application of theme classes.
|
|
|
|
*/
|
|
|
|
applyThemeChangesTo: (document: Document) => Subscription;
|
2022-06-23 13:36:05 +02:00
|
|
|
}
|