export interface UiThemeTokens { primary?: string; primaryHover?: string; primaryActive?: string; primarySubtle?: string; secondary?: string; secondaryHover?: string; danger?: string; dangerSubtle?: string; success?: string; successSubtle?: string; warning?: string; warningSubtle?: string; surface?: string; surfaceMuted?: string; surfaceInset?: string; overlay?: string; border?: string; borderStrong?: string; text?: string; textSecondary?: string; textMuted?: string; textInverse?: string; placeholder?: string; radius?: string; radiusSm?: string; radiusLg?: string; fontFamily?: string; /** Base UI / chart label size, e.g. `"12px"` or `"12"`. */ fontSize?: string; fontSizeSm?: string; fontSizeLg?: string; controlHeight?: string; shadowMd?: string; statusBarBg?: string; statusBarText?: string; statusBarBorder?: string; tooltipBg?: string; spaceXs?: string; spaceSm?: string; spaceMd?: string; spaceLg?: string; spaceXl?: string; bpSm?: string; bpMd?: string; bpLg?: string; } /** Theme input — optional named preset merged before explicit token overrides. */ export interface UiThemeInput extends UiThemeTokens { /** * Theme shortcut. Accepts: * - Built-in pack name: `dark`, `violet`, `rose`, … * - Any CSS color: `#f472b6`, `rgb()`, `hsl()`, `pink` * - Image file path (absolute or relative): `./bg.png`, `/images/hero.jpg`, `assets/wall.webp` * * Image paths set the stage background automatically — no `background` key needed. */ preset?: UiThemePreset | string; } export type UiThemePreset = keyof typeof UI_PRESETS; /** Maps token keys to CSS custom property names on `.lightdraw-html-root`. */ export declare const UI_THEME_VAR_MAP: Record; /** All token keys for completeness checks in tests. */ export declare const UI_THEME_TOKEN_KEYS: (keyof UiThemeTokens)[]; /** Apply theme tokens to a LightDraw HTML root (or any container). Clears unset mapped vars. */ export declare function applyUiTheme(el: HTMLElement, tokens: UiThemeTokens): void; /** Dark surface pack — used by preset `dark` / `darkViolet`, or spread into custom packs. */ export declare const UI_DARK_PACK: UiThemeTokens; /** Light surface pack — used by light presets, or spread into custom packs. */ export declare const UI_LIGHT_PACK: UiThemeTokens; /** @deprecated Use `UI_DARK_PACK`. */ export declare const UI_DARK_MODE_PACK: UiThemeTokens; /** @deprecated Use `UI_LIGHT_PACK`. */ export declare const UI_LIGHT_MODE_PACK: UiThemeTokens; /** * Built-in theme presets — each is a **complete** pack for UI + dashboard + diagram. * Use `dark` / `darkViolet` for dark chrome; other presets are light packs. */ export declare const UI_PRESETS: Record; /** * True when a string looks like an image file / URL / data URI * (not a solid color or named pack). * * Requires an image signal: extension, `url(...)`, `data:image/`, or http(s)/blob/file URL. * Absolute paths without an image extension are not treated as images. */ export declare function isThemeImageValue(value: string): boolean; /** Normalize a theme image value to a CSS `url(...)` fragment. */ export declare function toThemeBackgroundCss(value: string): string; /** Unwrap `url("…")` / path / data URI to a loadable image `src`. */ export declare function unwrapThemeBackgroundSrc(value: string): string | null; /** CSS `background` value for a stage (solid color or cover image). */ export declare function cssStageBackground(value: string): string; /** * Expand a flexible `preset` string into brand tokens (and optional stage background). * Named packs win; then CSS colors; then image URLs. */ export declare function expandPreset(preset: string | undefined): { tokens: UiThemeTokens; background?: string; kind: 'pack' | 'color' | 'image' | 'none'; }; /** * Resolve preset + overrides into a flat token object (no `preset` field). * `preset` may be a built-in pack name, any CSS color, or an image URL. * When `primary` is set without hover/active/subtle, those are derived automatically. */ export declare function resolveUiTheme(input: UiThemeInput): UiThemeTokens; /** Resolve stage background from a theme input (image preset or explicit `background`). */ export declare function resolveThemeBackground(input: UiThemeInput & { background?: string; }): string | undefined;