/** * Theme manager for the terminal UI design system. * * Manages theme registration, activation, and change notifications. * Built-in themes: default (dark) and light. */ import { type ColorDepth, type ColorTheme } from "./color-engine.ts"; import type { ColorTokens } from "./tokens.ts"; import type { MarkdownTypographyStyles, MessageTypographyStyles, SyntaxTypographyStyles, ToolTypographyStyles, TypographyStyles } from "./typography.ts"; export interface ThemeDefinition { readonly name: string; readonly displayName: string; readonly tokens: ColorTokens; } export interface ActiveTheme extends ThemeDefinition { readonly colorTheme: ColorTheme; readonly typography: TypographyStyles; readonly messageTypography: MessageTypographyStyles; readonly markdownTypography: MarkdownTypographyStyles; readonly toolTypography: ToolTypographyStyles; readonly syntaxTypography: SyntaxTypographyStyles; } export declare const builtInThemes: Record; export type ThemeChangeListener = (theme: ActiveTheme) => void; export declare class ThemeManager { private currentTheme; private listeners; private customThemes; constructor(initialThemeName?: string, forcedDepth?: ColorDepth); /** * Get the currently active theme. */ get theme(): ActiveTheme; /** * Get the current theme name. */ get themeName(): string; /** * Get a list of available theme names. */ get availableThemes(): string[]; /** * Switch to a different theme by name. * Returns true if successful, false if theme not found. */ setTheme(name: string, forcedDepth?: ColorDepth): boolean; /** * Register a custom theme. */ registerTheme(definition: ThemeDefinition): void; /** * Unregister a custom theme. */ unregisterTheme(name: string): void; /** * Subscribe to theme changes. * Returns an unsubscribe function. */ onChange(listener: ThemeChangeListener): () => void; /** * Force re-create the current theme (e.g. after terminal capability changes). */ refresh(forcedDepth?: ColorDepth): void; /** * Invalidate all component caches. This should be called after theme changes. * Components should listen to theme changes and call invalidate(). */ invalidate(): void; private buildActiveTheme; private notifyListeners; } /** * Get or create the global theme manager instance. */ export declare function getThemeManager(): ThemeManager; /** * Reset the global theme manager (useful for testing). */ export declare function resetThemeManager(): void; //# sourceMappingURL=manager.d.ts.map