/** * Deterministic slide QA. * * After a slide is built, run cheap, geometry-and-text checks and return * structured issues the agent can act on in the same turn (ppt-agent's * "quality auto-retry" pattern). Checks cover the common ways generated decks * look broken or lazy: elements overlapping outside the safe margin, text * shrunk below a legibility floor, empty placeholder boxes, contrast that * fails WCAG AA for the palette's role pairs, anchor monotony (same anchor as * the previous slide), and density overload (too many bullets / over-long * bullets). * * Everything here is pure: it inspects a built slide plus the active style and * returns issues; it never mutates state. */ import type { Slide } from '../../types/slides'; import type { FikaStylePreset } from './styles'; import type { CompositionAnchor } from './composition'; /** A single QA finding, with enough context for the agent to fix it. */ export interface QaIssue { /** Machine-readable check id. */ code: 'overlap' | 'contrast' | 'tooSmall' | 'emptyPlaceholder' | 'anchorRepeat' | 'density' | 'contentEmpty'; /** Human-readable explanation. */ message: string; /** Severity — 'error' should block, 'warn' should prompt a fix. */ severity: 'error' | 'warn'; /** Element ids involved (when applicable). */ elementIds?: string[]; } /** * Validate a built slide. `previousAnchor` enables the monotony check; pass * undefined for the first slide. Returns an array of issues (possibly empty). */ export declare function validateSlide(slide: Partial, preset: FikaStylePreset, options?: { anchor?: CompositionAnchor; previousAnchor?: CompositionAnchor; feature?: boolean; /** * When true, the slide was built from a layout whose job is to carry body * content (bullets/columns/rows/cards/steps/stats), so a slide that renders * only a title is a defect. Title/section/closing/quote/imageFull layouts * legitimately render little body text and pass `false`. */ expectsBody?: boolean; /** Layout id, for a more actionable message. */ layoutId?: string; }): QaIssue[];