export type Mode = 'light' | 'dark'; /** What a person prefers: one mode, or whichever the device asks for. */ export type ColorPreference = Mode | 'system'; /** How strongly the code theme colors syntax. */ export type CodeStyle = 'balanced' | 'vivid' | 'muted' | 'mono'; export declare const CODE_STYLES: readonly CodeStyle[]; /** The three choices a surface is generated from. */ export interface Seed { /** The background, as a hex or `oklch()`. Its lightness sets light or dark; its hue tints every neutral. */ base: string; /** The brand color, as a hex or `oklch()`. Filled buttons show it exactly. */ accent: string; /** 0–100, 30 by default. Raises the separation of surfaces and borders and the contrast of text; text never drops below WCAG AA. */ contrast?: number; } /** A theme in one mode: the page's seed, and the sidebar's own base or accent when it has them. */ export interface Scheme { interface: Seed; sidebar?: { base?: string; accent?: string; }; } /** A theme for both modes, as a host stores it and a person copies it. A missing mode is derived from the other. */ export interface Theme { version: 1; light?: Scheme; dark?: Scheme; /** How the code theme colors syntax; balanced by default. */ code?: CodeStyle; } export declare const DEFAULT_CONTRAST = 30; export interface ThemePreset { name: string; label: string; theme: Theme; } export declare const THEME_PRESETS: readonly ThemePreset[]; export declare const DEFAULT_PRESET: ThemePreset; export declare const DEFAULT_THEME: Theme; /** The mode a scheme renders in, read from its base. */ export declare function modeOf(scheme: Scheme): Mode; /** The mode a preference resolves to. */ export declare function resolveMode(preference: ColorPreference, prefersDark: boolean): Mode; /** The scheme a theme has for a mode, derived from its other mode when it has none, * and from the default theme when it has neither. */ export declare function schemeFor(theme: Theme | undefined, mode: Mode): Scheme; /** Why a pasted theme was refused, and where. */ export interface ThemeParseError { code: 'json' | 'version' | 'shape' | 'color' | 'range'; /** The field at fault, such as `light.interface.accent`. */ path: string; } export type ThemeParseResult = { ok: true; theme: Theme; } | { ok: false; error: ThemeParseError; }; /** Reads a theme from JSON text or a parsed value, such as a paste or a stored row. Never throws. */ export declare function parseTheme(input: unknown): ThemeParseResult; /** A theme as small, stable JSON: what a host stores and a person copies. */ export declare function serializeTheme(theme: Theme): string;