/** * The strict write-time HUD theme validator. * * STRICTER than the engine's load-time validator on purpose, and that asymmetry * is the design: at WRITE time a bad per-element leaf is an error the agent can * fix in the same turn, while at LOAD time the engine must keep rendering * already-published themes, so it warns and drops the leaf instead. Everything * this validator accepts, the engine accepts; the reverse is not required. * * This replaced `lightValidateTheme`, which skipped glow keys, every numeric * range, the whole `elements` block, decoration slot suitability and decoration * size/position/repeat — six ways a theme could pass the write tool and then * silently render as the DEFAULT look at engine load, which reads as "theming * is broken" rather than "the value was wrong". Parity with the engine is * enforced by scripts/check-hud-catalog.ts, which runs both validators over a * fixture corpus under tsx and compares verdicts. * * Validation rules mirror game/src/engine/hud/validateTheme.ts; vocabulary * comes from the drift-checked catalog next door. */ import { type CatalogValidationIssue } from './hud-theme-catalog.js'; export interface StrictValidationResult { ok: boolean; errors: CatalogValidationIssue[]; warnings: CatalogValidationIssue[]; } export declare function suggestClosest(value: string, candidates: ReadonlyArray): string | undefined; /** * Whether an issue would make the ENGINE reject the whole theme, or only drop a * leaf while the theme keeps rendering. * * This validator is deliberately stricter than the engine at two spots, and the * difference matters when DESCRIBING a stored theme: per-element * font/colors/shape leaves are warn-and-dropped at engine load (the theme still * renders minus the leaf), and unknown top-level color tokens are ignored * outright. Telling a user "the engine is falling back to the default look" * over one droppable leaf describes a fallback that is not happening — and an * agent acting on that "repairs" a theme the user is actually seeing. */ export declare function isEngineFatalIssue(issue: CatalogValidationIssue): boolean; export declare function validateThemeStrict(theme: unknown): StrictValidationResult;