UNPKG

@youwen/ai-design-system

Version:

Enterprise AI-driven design system with comprehensive design tokens

174 lines (173 loc) 6.07 kB
/** * 递进式验证架构 - 统一入口 * 企业级AI组件库验证系统 */ export { ValidationPipelineEngine, defaultValidationPipeline, type ValidationResult, type LayerValidationResult, type ValidationPipelineState, type AIFeedback, type AIGenerationContext, type ValidationLayer } from './validation-pipeline'; export { Layer1TokenSchemaValidator, layer1Validator, WidgetComponentSchema, ColorTokenSchema, TypographyTokenSchema, SpacingTokenSchema, SizeTokenSchema } from './layers/layer1-token-schema'; export { Layer2LayoutDesignValidator, layer2Validator, WIDGET_LAYOUT_SYSTEM, DESIGN_CONSTRAINTS } from './layers/layer2-layout-design'; export { Layer3VisualAccessibilityValidator, layer3Validator, ACCESSIBILITY_STANDARDS, VISUAL_TEST_CONFIG } from './layers/layer3-visual-accessibility'; export { Layer4PerformanceIntegrationValidator, layer4Validator, PERFORMANCE_BUDGET, INTEGRATION_CONFIG, E2E_SCENARIOS } from './layers/layer4-performance-integration'; export { AIFeedbackGenerator, ErrorPatternAnalyzer, defaultAIFeedbackGenerator, AI_FEEDBACK_CONFIG } from './ai-feedback-engine'; export { DesignConstraintsValidator, ColorContrastCalculator, designConstraintRules } from './design-constraints-validator'; /** * 企业级验证系统 * 集成4层递进式验证流水线 */ export declare class EnterpriseValidationSystem { private pipeline; private feedbackGenerator; constructor(); private initializeValidationLayers; validateAIComponent(componentId: string, componentConfig: any, aiContext?: any, options?: { maxRetries?: number; sessionId?: string; skipLayers?: number[]; }): Promise<{ success: boolean; validationResult: import("./validation-pipeline").ValidationPipelineState; report: { overview: { status: any; finalScore: any; retryCount: any; totalDuration: number; passedLayers: number; totalLayers: number; }; layerDetails: {}; summary: { totalErrors: number; totalWarnings: number; totalInfos: number; criticalIssues: never[]; improvements: never[]; }; }; sessionId: string; recommendations: { immediate: string[]; shortTerm: string[]; longTerm: string[]; }; }>; private generateValidationReport; private getLayerName; private generateRecommendations; private logValidationResult; getLearningStats(sessionId?: string): { totalErrors: number; fixedErrors: number; fixSuccessRate: number; avgRetriesPerError: number; mostCommonErrors: string[]; }; getPerformanceStats(): Record<string, { avg: number; min: number; max: number; count: number; }>; cleanup(maxAge?: number): void; } export declare const defaultValidationSystem: EnterpriseValidationSystem; export declare const validateComponent: (componentId: string, componentConfig: any, options?: any) => Promise<{ success: boolean; validationResult: import("./validation-pipeline").ValidationPipelineState; report: { overview: { status: any; finalScore: any; retryCount: any; totalDuration: number; passedLayers: number; totalLayers: number; }; layerDetails: {}; summary: { totalErrors: number; totalWarnings: number; totalInfos: number; criticalIssues: never[]; improvements: never[]; }; }; sessionId: string; recommendations: { immediate: string[]; shortTerm: string[]; longTerm: string[]; }; }>; export declare const quickValidate: (componentId: string, componentConfig: any) => Promise<{ success: boolean; validationResult: import("./validation-pipeline").ValidationPipelineState; report: { overview: { status: any; finalScore: any; retryCount: any; totalDuration: number; passedLayers: number; totalLayers: number; }; layerDetails: {}; summary: { totalErrors: number; totalWarnings: number; totalInfos: number; criticalIssues: never[]; improvements: never[]; }; }; sessionId: string; recommendations: { immediate: string[]; shortTerm: string[]; longTerm: string[]; }; }>; export declare const fullValidate: (componentId: string, componentConfig: any, aiContext?: any) => Promise<{ success: boolean; validationResult: import("./validation-pipeline").ValidationPipelineState; report: { overview: { status: any; finalScore: any; retryCount: any; totalDuration: number; passedLayers: number; totalLayers: number; }; layerDetails: {}; summary: { totalErrors: number; totalWarnings: number; totalInfos: number; criticalIssues: never[]; improvements: never[]; }; }; sessionId: string; recommendations: { immediate: string[]; shortTerm: string[]; longTerm: string[]; }; }>; export declare const VALIDATION_CONFIG: { LAYERS: { TOKEN_SCHEMA: number; LAYOUT_DESIGN: number; VISUAL_ACCESSIBILITY: number; PERFORMANCE_INTEGRATION: number; }; DEFAULT_RETRIES: number; DEFAULT_TIMEOUT: number; SCORE_THRESHOLDS: { EXCELLENT: number; GOOD: number; ACCEPTABLE: number; POOR: number; }; }; export type { ValidationResult, LayerValidationResult, ValidationPipelineState, AIFeedback, AIGenerationContext, ValidationLayer } from './validation-pipeline';