/** * Theme JSON validation, kept out of `theme.ts` on purpose. * * Validating user-authored theme files needs typebox, which costs ~17 MB of module graph to import. * Palette lookup does not, so a presentation that only uses built-in themes should never pay for it. * `main.ts` installs this validator before runtime resource loading; other consumers can opt in with * `setThemeJsonValidator()`. Built-in themes do not need validation. */ import { type Static, Type } from "typebox"; import { type ThemeColorValues } from "./theme-tokens.ts"; export declare const ColorValueSchema: Type.TUnion<[Type.TString, Type.TInteger]>; export type ThemeColorValue = Static; export declare const ThemeJsonSchema: Type.TObject<{ $schema: Type.TOptional; name: Type.TString; appearance: Type.TOptional, Type.TLiteral<"light">]>>; vars: Type.TOptional>>; colors: Type.TUnsafe>; export: Type.TOptional>; cardBg: Type.TOptional>; infoBg: Type.TOptional>; }>>; }>; export type ValidatedThemeJson = Static; /** Validate one theme document, throwing a message that names the offending tokens. */ export declare function validateThemeJson(label: string, json: unknown): ValidatedThemeJson;