/** * DesignAnalyzer — AI-powered visual analysis of Figma screenshots. * * Uses Claude's vision capability to analyze design quality, consistency, * accessibility, and spec compliance from captured screenshots. */ import { z } from "zod"; import type { AnthropicClient } from "../ai/client.js"; import type { DesignSystem } from "../engine/registry.js"; export declare const VisualIssueSchema: z.ZodObject<{ severity: z.ZodEnum<["critical", "major", "minor", "suggestion"]>; category: z.ZodEnum<["spacing", "alignment", "typography", "color", "contrast", "hierarchy", "consistency", "accessibility", "layout", "interaction"]>; description: z.ZodString; location: z.ZodOptional; fix: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; category: "accessibility" | "layout" | "spacing" | "color" | "typography" | "consistency" | "hierarchy" | "interaction" | "alignment" | "contrast"; severity: "critical" | "major" | "minor" | "suggestion"; location?: string | undefined; fix?: string | undefined; }, { description: string; category: "accessibility" | "layout" | "spacing" | "color" | "typography" | "consistency" | "hierarchy" | "interaction" | "alignment" | "contrast"; severity: "critical" | "major" | "minor" | "suggestion"; location?: string | undefined; fix?: string | undefined; }>; export declare const DesignAnalysisSchema: z.ZodObject<{ score: z.ZodNumber; summary: z.ZodString; issues: z.ZodArray; category: z.ZodEnum<["spacing", "alignment", "typography", "color", "contrast", "hierarchy", "consistency", "accessibility", "layout", "interaction"]>; description: z.ZodString; location: z.ZodOptional; fix: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; category: "accessibility" | "layout" | "spacing" | "color" | "typography" | "consistency" | "hierarchy" | "interaction" | "alignment" | "contrast"; severity: "critical" | "major" | "minor" | "suggestion"; location?: string | undefined; fix?: string | undefined; }, { description: string; category: "accessibility" | "layout" | "spacing" | "color" | "typography" | "consistency" | "hierarchy" | "interaction" | "alignment" | "contrast"; severity: "critical" | "major" | "minor" | "suggestion"; location?: string | undefined; fix?: string | undefined; }>, "many">; strengths: z.ZodArray; specCompliance: z.ZodOptional; }, "strip", z.ZodTypeAny, { matches: boolean; deviations: string[]; }, { matches: boolean; deviations: string[]; }>>; }, "strip", z.ZodTypeAny, { issues: { description: string; category: "accessibility" | "layout" | "spacing" | "color" | "typography" | "consistency" | "hierarchy" | "interaction" | "alignment" | "contrast"; severity: "critical" | "major" | "minor" | "suggestion"; location?: string | undefined; fix?: string | undefined; }[]; summary: string; score: number; strengths: string[]; specCompliance?: { matches: boolean; deviations: string[]; } | undefined; }, { issues: { description: string; category: "accessibility" | "layout" | "spacing" | "color" | "typography" | "consistency" | "hierarchy" | "interaction" | "alignment" | "contrast"; severity: "critical" | "major" | "minor" | "suggestion"; location?: string | undefined; fix?: string | undefined; }[]; summary: string; score: number; strengths: string[]; specCompliance?: { matches: boolean; deviations: string[]; } | undefined; }>; export type VisualIssue = z.infer; export type DesignAnalysis = z.infer; export declare class DesignAnalyzer { private ai; constructor(ai: AnthropicClient); /** * General design quality analysis of a screenshot. */ analyzeDesign(imageBase64: string, context?: string): Promise; /** * Check a screenshot against a component/page spec. */ checkSpecCompliance(imageBase64: string, specJson: string, designSystem?: DesignSystem): Promise; /** * WCAG 2.2 accessibility audit of a screenshot. */ auditAccessibility(imageBase64: string): Promise; /** * Compare two screenshots (before/after) and report changes. */ compareScreenshots(beforeBase64: string, afterBase64: string, context?: string): Promise; }