import { FactoryComponent } from 'mithril'; export type Theme = 'light' | 'dark' | 'auto'; export interface ThemeSwitcherI18n { /** Label for the theme switcher */ theme?: string; /** Light theme label */ light?: string; /** Dark theme label */ dark?: string; /** Auto theme label */ auto?: string; /** Light theme title/tooltip */ lightTitle?: string; /** Dark theme title/tooltip */ darkTitle?: string; /** Auto theme title/tooltip */ autoTitle?: string; /** Toggle button title when switching to dark */ switchToDark?: string; /** Toggle button title when switching to light */ switchToLight?: string; } export interface ThemeSwitcherAttrs { /** Current theme selection */ theme?: Theme; /** Callback when theme changes */ onThemeChange?: (theme: Theme) => void; /** Show labels on the toggle buttons */ showLabels?: boolean; /** Custom class for the container */ className?: string; /** Internationalization */ i18n?: ThemeSwitcherI18n; } /** * Theme switching utilities and component */ export declare class ThemeManager { private static currentTheme; private static useLocalStorage; /** * Configure whether ThemeManager should use localStorage for persistence. * When disabled, you can manage theme state externally and pass it via component attrs. * @param enabled - Whether to use localStorage (default: true) */ static setUseLocalStorage(enabled: boolean): void; /** * Check if localStorage persistence is enabled */ static isUsingLocalStorage(): boolean; /** * Set the theme for the entire application * @param theme - The theme to set * @param persist - Override localStorage behavior for this call (optional) */ static setTheme(theme: Theme, persist?: boolean): void; /** * Get the current theme */ static getTheme(): Theme; /** * Get the effective theme (resolves 'auto' to actual theme) */ static getEffectiveTheme(): 'light' | 'dark'; /** * Initialize theme from localStorage or system preference. * If localStorage is disabled, initializes to the provided default or 'auto'. * @param defaultTheme - Default theme to use when localStorage is disabled or empty */ static initialize(defaultTheme?: Theme): void; /** * Toggle between light and dark themes */ static toggle(): void; /** * Clear the stored theme from localStorage */ static clearStoredTheme(): void; } /** * Theme Switcher Component * Provides UI controls for changing themes */ export declare const ThemeSwitcher: FactoryComponent; /** * Simple theme toggle button (just switches between light/dark) */ export declare const ThemeToggle: FactoryComponent<{ className?: string; i18n?: ThemeSwitcherI18n; }>;