/** * Theme resolution. * * A preset is resolved through its `extends` chain into a complete light and * dark token set, then emitted as CSS custom properties. This is the only place * a theme becomes CSS, and it can only emit declarations built from validated * token values — which is what makes "themes are typed data, never CSS" a * property of the implementation rather than a promise. * * Nonces and font policy are deliberately absent: a font stack is names only, * and the renderer alone decides whether a named bundled face is inlined. */ import { type Diagnostic, DiagnosticBag } from '../diagnostics.js'; import { type ThemeRecipes } from './recipes.js'; import { type ThemeCatalog } from './theme-catalog.js'; import { type Tokens } from './tokens.js'; export interface ThemeInput { preset?: string; extends?: string; tokens?: Record; dark?: Record; /** Component recipe per surface; overrides the preset chain's choices. */ recipes?: Record; } export interface ResolvedTheme { /** Resolved preset name, which may be a user-defined name. */ name: string; /** Root preset of the resolution chain. */ base: string; version: number; description: string; /** Ordered chain from the root preset to the resolved preset. */ chain: string[]; light: Tokens; dark: Tokens; css: string; motionPolicy: string; density: string; /** * Component recipe for every surface: defaults, then the extends chain from * its root, then the preset itself, then the input's own `recipes`. */ recipes: ThemeRecipes; } /** * Resolve a theme, reporting problems as diagnostics instead of throwing. */ export declare function resolveTheme(input: unknown, bag: DiagnosticBag, catalog?: ThemeCatalog): ResolvedTheme | undefined; export interface LoadThemeOptions { catalog?: ThemeCatalog; } /** * Load and validate a theme preset. * * Accepts a preset name (`'blueprint'`), an object with `preset`, `extends`, * `tokens`, `dark`, and `recipes`, or a spec-shaped theme block. Throws a `RenderError` * carrying every token problem when the input is invalid. */ export declare function loadTheme(input?: unknown, options?: LoadThemeOptions): ResolvedTheme; /** Diagnostics produced while resolving a theme, including completion warnings. */ export declare function themeDiagnostics(input: unknown, catalog: ThemeCatalog): Diagnostic[]; export declare function themePresetNames(catalog?: ThemeCatalog): string[]; //# sourceMappingURL=load-theme.d.ts.map