@trycourier/courier-ui-inbox
Version:
Inbox components for the Courier web UI
52 lines (51 loc) • 1.57 kB
TypeScript
import { CourierComponentThemeMode, SystemThemeMode } from '@trycourier/courier-ui-core';
import { CourierInboxTheme } from './courier-inbox-theme';
export interface CourierInboxThemeSubscription {
manager: CourierInboxThemeManager;
unsubscribe: () => void;
}
export declare class CourierInboxThemeManager {
private readonly THEME_CHANGE_EVENT;
private _theme;
private _lightTheme;
private _darkTheme;
private _target;
private _subscriptions;
private _userMode;
private _systemMode;
private _systemThemeCleanup;
setLightTheme(theme: CourierInboxTheme): void;
setDarkTheme(theme: CourierInboxTheme): void;
constructor(initialTheme: CourierInboxTheme);
/**
* Get the current system theme
*/
get currentSystemTheme(): SystemThemeMode;
/**
* Get the current theme
*/
getTheme(): CourierInboxTheme;
/**
* Update the theme
*/
private updateTheme;
/**
* Set the theme and notify all listeners
*/
private setTheme;
/**
* Set the mode and notify all listeners
*/
setMode(mode: CourierComponentThemeMode): void;
get mode(): CourierComponentThemeMode;
/**
* Subscribe to theme changes
* @param {Function} callback - Function to run when the theme changes
* @returns {CourierInboxThemeSubscription} - Object with remove method to stop listening
*/
subscribe(callback: (theme: CourierInboxTheme) => void): CourierInboxThemeSubscription;
/**
* Clean up event listeners
*/
cleanup(): void;
}