/** * Theme application — CSS custom properties from theme field, * plus a built-in theme toggle button with two-way sync. */ export interface ThemeConfig { light?: Record; dark?: Record; } export interface ThemeToggleOptions { /** Position of the toggle inside the prefab root. Default: 'top-right'. */ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; /** localStorage key for persistence. Default: 'prefab-theme'. */ storageKey?: string; /** Whether to sync with document.documentElement[data-theme]. Default: true. */ syncDocument?: boolean; } /** * Set a color scheme on an element using both conventions at once: * the `data-theme` attribute (this port) and the `dark`/`light` class * (upstream PrefectHQ/prefab). Keeping both in sync lets a single * compiled-theme stylesheet match regardless of which renderer emitted it. */ export declare function setThemeAttrs(el: HTMLElement, theme: 'light' | 'dark'): void; /** * Apply a legacy `{ light, dark }` theme object to the live DOM. * * Protocol 0.3 ships the theme pre-compiled in the wire `css` array * (see [theme-css.ts] `compileThemeCss`). This helper remains for the * legacy `theme` object input the renderer still accepts for back-compat; * its dark block reuses the same compiler so both paths stay in lockstep. */ export declare function applyTheme(root: HTMLElement, theme?: ThemeConfig): void; /** * Apply keyboard shortcuts. */ export declare function applyKeyBindings(bindings: Record | undefined, dispatch: (actions: unknown) => Promise): (() => void) | undefined; /** * Create a theme toggle button inside a prefab root element. * * - Persists to localStorage * - Syncs two-way with `document.documentElement[data-theme]` via MutationObserver * - Uses sun/moon SVG icons (no external deps) * * @returns A cleanup function that removes the button and observer. */ export declare function createThemeToggle(root: HTMLElement, options?: ThemeToggleOptions): () => void; //# sourceMappingURL=theme.d.ts.map