/** * GenericElementValidator - Default validator implementation for most element types * * Provides standard validation logic that works for any element type. * Uses the existing ValidationService and TriggerValidationService for * consistent security-first validation patterns. * * Element types that need specialized validation (like personas) can * extend this class or implement ElementValidator directly. */ import { ElementType } from '../../portfolio/types.js'; import { ValidationService } from './ValidationService.js'; import { TriggerValidationService } from './TriggerValidationService.js'; import { MetadataService } from '../MetadataService.js'; import { ElementValidator, ValidationResult, ValidationReport, ElementValidationOptions, MetadataValidationOptions } from './ElementValidator.js'; /** * Default validator implementation for most element types */ export declare class GenericElementValidator implements ElementValidator { protected validationService: ValidationService; protected triggerValidationService: TriggerValidationService; protected metadataService: MetadataService; readonly elementType: ElementType; constructor(elementType: ElementType, validationService: ValidationService, triggerValidationService: TriggerValidationService, metadataService: MetadataService); /** * Validate data for element creation * * ARCHITECTURE: Input Normalization at Boundary * Step 1: Normalize ALL string fields (Unicode, confusables, direction overrides) * Step 2: Validate the normalized data (field rules, lengths, patterns) * * This ensures we can't forget to normalize a field - it happens once at entry. */ validateCreate(data: unknown, options?: ElementValidationOptions): Promise; /** * Validate changes to an existing element * * ARCHITECTURE: Input Normalization at Boundary * Step 1: Normalize ALL string fields in changes object * Step 2: Validate the normalized changes */ validateEdit(element: unknown, changes: unknown, options?: ElementValidationOptions): Promise; /** * Validate element metadata */ validateMetadata(metadata: unknown, options?: MetadataValidationOptions): Promise; /** * Generate a comprehensive validation report */ generateReport(element: unknown): Promise; /** * Validate element name */ protected validateName(name: unknown): ValidationResult; /** * Validate element description */ protected validateDescription(description: unknown): ValidationResult; private sanitizeDescriptionInput; /** * Validate element content */ protected validateContent(content: unknown, maxLength?: number): Promise; /** * Validate triggers array */ protected validateTriggers(triggers: unknown, elementName: string): ValidationResult; /** * Calculate a quality score for the element (0-100) */ protected calculateQualityScore(metadata: Record, content: string): number; /** * Get human-readable label for this element type */ protected getElementLabel(): string; } //# sourceMappingURL=GenericElementValidator.d.ts.map