/** * localStorage key for persisted theme preference. */ export declare const STORAGE_KEY = "ss-dash-theme"; /** * The two supported theme values. */ export type Theme = 'dark' | 'light'; /** * Read the current theme preference. * * Resolution order: * 1. Explicit value stored in `localStorage` under {@link STORAGE_KEY}. * 2. System preference via `prefers-color-scheme` media query. * 3. Falls back to `'light'` if neither is available (e.g. SSR). */ export declare function getTheme(): Theme; /** * Persist a theme preference to `localStorage` and notify * all in-page listeners via a custom DOM event. * * Other tabs will be notified via the native `storage` event, * which listeners created by {@link onThemeChange} also handle. */ export declare function setTheme(theme: Theme): void; /** * Toggle the current theme and persist the new value. * * @returns The newly active theme. */ export declare function toggleTheme(): Theme; /** * Subscribe to theme changes from: * - Same-tab components (via custom {@link THEME_CHANGE_EVENT} event) * - Other tabs (via native `storage` event) * - System preference changes (via `prefers-color-scheme` media query) * * @param callback - Invoked with the new theme value whenever it changes. * @returns An unsubscribe function that removes all listeners. */ export declare function onThemeChange(callback: (theme: Theme) => void): () => void;