/** * talon.ts — Raven's deterministic detector engine. * * A pure, browser-free measurement layer: every rule runs over an HTML/CSS * string and (optionally) pre-measured DOM geometry — no browser is launched * here. Callers that want live-DOM geometry capture it themselves (the same * DevTools-snippet pattern audit_layout already uses) and pass it in via * `elements`; a URL is resolved to `html` upstream via capture.ts before * reaching this module. * * Every finding carries a `source` field citing a `src/data/principles/*.json` * entry id — this is a hard schema requirement (see docs/parity-roadmap.md * Gap 1), not prose. Thresholds are derived from that cited principle's own * content, never from an external rule set. * * Taste integration: each rule declares a `scope` (see taste.ts's * ruleInScope — "global" unless a future rule is surface-restricted) and can * be silenced per-project the same way any taste rule is — via a surface * binding's `overrides` list (severity:"off" for that TAL-### id). A finding * a binding waives is still returned, flagged `waived_by_taste: true`, never * silently dropped. */ import { type OrphanElement } from "./layout-orphans.js"; import { type SurfaceBinding } from "./taste.js"; export type TalonSeverity = "error" | "warning"; export type TalonElement = OrphanElement & { computed?: { padding?: string; margin?: string; gap?: string; fontSize?: string; color?: string; background?: string; }; }; export type TalonFinding = { rule: string; severity: TalonSeverity; message: string; fix: string; source: string; waived_by_taste?: true; }; export type TalonRuleInfo = { id: string; category: "color" | "spacing" | "typography" | "structure" | "motion" | "layout"; severity: TalonSeverity; scope: string; source: string; message_template: string; }; export type TalonScanInput = { html?: string; elements?: TalonElement[]; viewport?: { w: number; h: number; }; }; export type TalonScanOptions = { surface?: string; binding?: SurfaceBinding | null; }; export type TalonScanResult = { findings: TalonFinding[]; passes: string[]; }; export declare function listTalonRules(): TalonRuleInfo[]; export declare function runTalon(input: TalonScanInput, opts?: TalonScanOptions): TalonScanResult;