export type JSFixPattern = 'batch_dom_writes' | 'debounce' | 'move_to_worker' | 'use_raf' | 'use_css_animation'; export type SuggestionConfidence = 'high' | 'medium' | 'low'; export type SuggestionSource = 'js' | 'css' | 'native' | 'unknown'; export type FixTargetType = 'auto-patchable' | 'suggestion-only'; export interface Suggestion { id: string; type: 'css' | 'js' | 'native'; target: string; description: string; patch: string; estimatedSpeedupPct: number; speedupExplanation: string; confidence: SuggestionConfidence; warnings: string[]; affectedFiles: string[]; source?: SuggestionSource; fixTargetType?: FixTargetType; documentationLinks?: string[]; } export interface CSSSuggestion extends Suggestion { type: 'css'; originalRule: string; suggestedRule: string; property: string; memoryImpact: 'none' | 'low' | 'medium' | 'high'; tradeoffs: string[]; } export interface JSSuggestion extends Suggestion { type: 'js'; pattern: JSFixPattern; codeSnippet: string; suggestedCode: string; } export interface NativeSuggestion extends Omit { type: 'native'; patch: ''; platform: 'swift' | 'objc' | 'native'; fixGuidance: string; codeExample?: string; documentationLinks: string[]; relatedFrameworks?: string[]; fixTargetType: 'suggestion-only'; source: 'native'; } export interface SpeedupCalculation { issueTimeMs: number; totalFrameTimeMs: number; efficiencyFactor: number; speedupPct: number; confidence: SuggestionConfidence; }