/** * The **Theme Validator** — the security and correctness gate between raw LLM * (or imported) output and the live grid. It guarantees the engine never applies * an invalid or dangerous value: * * 1. **Unknown variables** (not in the {@link ThemeVariableRegistry}) are rejected — * the AI can only touch real Photon tokens, never invented ones. * 2. **Malformed values** are rejected per the variable's {@link ThemeVariableType} * (color / size / opacity / shadow / font / duration / easing / …). * 3. **Injection payloads** are rejected up front — any value containing CSS * control characters or dangerous functions (`; { } url( expression * javascript: @import <`) can never reach `setProperty`. * * It is pure and DOM-free, so it is trivially unit-testable and reused for both * generated and imported themes. * * @packageDocumentation */ import { ThemeVariableType } from '../../types/theme-ai.types'; import type { ThemeValidationResult, ThemeVariableRegistryReader } from '../../types/theme-ai.types'; /** Validates and sanitizes a raw variable map against the registry. */ export declare class ThemeValidator { private readonly registry; constructor(registry: ThemeVariableRegistryReader); /** * Validate a raw `{ cssVar: value }` map. Returns the accepted subset plus a * list of rejected entries with reasons. `valid` is `true` only when nothing * was rejected; the accepted subset is always safe to apply either way. */ validate(rawVariables: unknown): ThemeValidationResult; /** Type-specific value grammar check (assumes the injection guard already passed). */ static isValidForType(type: ThemeVariableType, value: string): boolean; } //# sourceMappingURL=theme-validator.d.ts.map