export type LayoutQaSeverity = 'critical' | 'error' | 'warning' | 'info'; export type LayoutQaCategory = 'electrical' | 'geometry' | 'readability' | 'grouping' | 'wiring' | 'runtime'; export type LayoutQaEvidenceSource = 'exact_geometry' | 'derived_geometry' | 'runtime_drc' | 'runtime_erc' | 'expected_topology' | 'connectivity_fingerprint' | 'visual_heuristic' | 'runtime_capability'; export type LayoutQaIssueCode = 'TITLE_BLOCK_OVERLAP' | 'PAGE_BOUNDARY_OVERFLOW' | 'COMPONENT_OVERLAP' | 'COMPONENT_TEXT_OVERLAP' | 'TEXT_TEXT_OVERLAP' | 'SECTION_BOX_CONFLICT' | 'DANGLING_PIN' | 'DETACHED_NETPORT' | 'EXPECTED_NET_MISMATCH' | 'DUPLICATE_REFERENCE' | 'DUPLICATE_NET_LABEL' | 'RELATED_COMPONENT_DISTANCE' | 'EXCESSIVE_WIRE_LENGTH' | 'EXCESSIVE_WHITESPACE' | 'LOCAL_CROWDING' | 'CONNECTIVITY_CHANGED_DURING_COSMETIC_EDIT' | 'DOCUMENT_STATE_UNVERIFIED' | 'VISUAL_QA_UNAVAILABLE' | 'DRC_DESIGN_ISSUE' | 'DRC_INTENTIONAL_NC' | 'DRC_SYMBOL_MODEL_LIMITATION' | 'DRC_MISSING_POWER_FLAG' | 'DRC_RUNTIME_LIMITATION' | 'ERC_DESIGN_ISSUE' | 'ERC_INTENTIONAL_NC' | 'ERC_SYMBOL_MODEL_LIMITATION' | 'ERC_MISSING_POWER_FLAG' | 'ERC_RUNTIME_LIMITATION'; export interface LayoutQaBounds { x: number; y: number; width: number; height: number; } export interface LayoutQaPinConnection { pin: string; netName?: string; connected?: boolean; } export interface LayoutQaPrimitive { id: string; primitiveType: 'component' | 'text' | 'label' | 'netport' | 'section' | 'annotation'; ref?: string; netName?: string; blockId?: string; combinedBounds: LayoutQaBounds; bodyBounds?: LayoutQaBounds; referenceBounds?: LayoutQaBounds; valueBounds?: LayoutQaBounds; pinTextBounds?: LayoutQaBounds[]; labelBounds?: LayoutQaBounds[]; annotationBounds?: LayoutQaBounds[]; pinConnections?: LayoutQaPinConnection[]; connected?: boolean; rotation?: number; geometrySource?: 'runtime' | 'derived' | 'approximate' | 'not_available'; } export interface LayoutQaWire { id: string; netName?: string; points?: Array<{ x: number; y: number; }>; length?: number; connectedEndpointCount?: number; } export interface LayoutQaRelationship { sourceId: string; targetId: string; kind: 'decoupling' | 'protection' | 'support' | 'signal-flow' | 'custom'; maxDistance: number; } export interface ExpectedPinMapping { componentRef: string; pin: string; netName: string; } export type RuntimeDiagnosticClassification = 'design_issue' | 'intentional_nc' | 'symbol_model_limitation' | 'missing_power_flag' | 'runtime_limitation'; export interface RuntimeDiagnostic { id?: string; message: string; severity?: LayoutQaSeverity; componentId?: string; netName?: string; classification?: RuntimeDiagnosticClassification; } export interface VisualHeuristicFinding { code: LayoutQaIssueCode; severity: Exclude; message: string; confidence: number; affectedPrimitiveIds?: string[]; region?: LayoutQaBounds; remediation: string; } export interface LayoutQaInput { projectId: string; sheet: { pageBounds: LayoutQaBounds; drawableBounds: LayoutQaBounds; titleBlockKeepout: LayoutQaBounds; hardKeepouts?: Array<{ id: string; bounds: LayoutQaBounds; }>; }; primitives: LayoutQaPrimitive[]; wires?: LayoutQaWire[]; relationships?: LayoutQaRelationship[]; expected?: { componentRefs?: string[]; netNames?: string[]; pinMappings?: ExpectedPinMapping[]; }; runtime?: { bridgeVerified?: boolean; documentVerified?: boolean; drcAvailable?: boolean; ercAvailable?: boolean; drc?: RuntimeDiagnostic[]; erc?: RuntimeDiagnostic[]; }; visual?: { captureAvailable: boolean; deterministicViewport?: boolean; findings?: VisualHeuristicFinding[]; }; connectivity?: { cosmeticOnly: boolean; beforeFingerprint?: string; afterFingerprint?: string; changedPins?: string[]; changedWireEndpoints?: string[]; }; thresholds?: { componentClearance?: number; relatedComponentDistance?: number; excessiveWireLength?: number; minimumUtilization?: number; maximumLocalDensity?: number; }; } export interface LayoutQaIssue { code: LayoutQaIssueCode; severity: LayoutQaSeverity; category: LayoutQaCategory; source: LayoutQaEvidenceSource; message: string; affectedPrimitiveIds: string[]; affectedNets: string[]; affectedPins: string[]; region?: LayoutQaBounds; measured?: number; expected?: number | string; evidence: string; remediation: string; blocksCommit: boolean; confidence: number; } export interface LayoutQaScores { geometry: number; readability: number; grouping: number; spacing: number; wiring: number; electrical: number; runtime: number; overall: number; } export interface LayoutQaResult { projectId: string; status: 'pass' | 'fail' | 'inconclusive'; passed: boolean; commitBlocked: boolean; issues: LayoutQaIssue[]; issueCounts: Record; scores: LayoutQaScores; evidence: { exactGeometry: boolean; runtimeDrc: boolean; runtimeErc: boolean; fullPageCapture: boolean; deterministicCapture: boolean; }; summary: { criticalIssueCodes: LayoutQaIssueCode[]; blockingIssueCodes: LayoutQaIssueCode[]; topIssues: LayoutQaIssue[]; }; } export interface LayoutQaComparison { improved: boolean; beforeScore: number; afterScore: number; newIssues: LayoutQaIssue[]; resolvedIssues: LayoutQaIssue[]; unchangedIssues: LayoutQaIssue[]; } export declare function evaluateSchematicLayoutQa(input: LayoutQaInput): LayoutQaResult; export declare function compareSchematicLayoutQa(before: LayoutQaResult, after: LayoutQaResult): LayoutQaComparison;