/** * Theme catalog: built-in presets plus presets authored as files. * * A preset file is data with a fixed shape. It can extend another preset and * override declared tokens; it cannot introduce a token, a selector, or a * declaration, so a shared team preset is exactly as constrained as a built-in * one. Precedence is explicit: built-in < user < project < explicitly named * files, which is what makes a project-level override predictable. */ import { builtinPresetEntries, type PresetEntry } from './presets.js'; export declare const PRESET_NAME_PATTERN: RegExp; export declare const THEME_DIRECTORIES: readonly [".ak-render/themes", ".config/ak-render/themes"]; export interface PresetSource { name: string; origin: PresetEntry['origin']; file?: string; } export interface ThemeCatalog { entries: Record; sources: PresetSource[]; /** Problems found while discovering presets; surfaced, never silently skipped. */ problems: { path: string; message: string; }[]; } /** Built-in-only catalog. */ export declare function builtinThemeCatalog(): ThemeCatalog; /** * Validate a preset document. * * Unknown keys and unknown tokens are errors: a preset that silently ignores a * misspelled token would produce a page with a silently wrong theme. */ export declare function parsePresetDocument(value: unknown, options?: { file?: string; origin?: PresetEntry['origin']; name?: string; }): PresetEntry; /** Load and validate one preset file. Throws a `RenderError` when it is invalid. */ export declare function loadPresetFile(file: string, origin?: PresetEntry['origin']): PresetEntry; /** Directories searched for presets, in increasing precedence. */ export declare function themeSearchDirectories(options?: { cwd?: string; home?: string; }): { user: string[]; project: string[]; }; export interface ThemeCatalogOptions { cwd?: string; home?: string; /** Explicit preset files; highest precedence. */ files?: string[]; /** Set false to use built-ins only. */ discovery?: boolean; } /** * Build a catalog from built-ins, discovered project and user presets, and any * explicitly named files. A malformed file becomes a recorded problem rather * than a crash, so one bad team preset does not make unrelated pages * uncompilable. */ export declare function buildThemeCatalog(options?: ThemeCatalogOptions): ThemeCatalog; /** Preset names in a catalog, sorted. */ export declare function catalogPresetNames(catalog: ThemeCatalog): string[]; export { builtinPresetEntries }; //# sourceMappingURL=theme-catalog.d.ts.map