export interface ValidationIssue { path: string[]; message: string; } export type FormattedValidationError = { path: string; message: string; }; export declare class ValidationIssueCollector { private issues; add(path: string | string[], message: string): void; getIssues(): readonly ValidationIssue[]; hasIssues(): boolean; clear(): void; toValidationError(options?: { entityName?: string; }): ValidationError | undefined; } export declare class ValidationError extends Error { readonly issues: ValidationIssue[]; readonly __isValidationError = true; readonly entityName?: string; constructor(issues: ValidationIssue[], options?: { message?: string; entityName?: string; }); static fromIssues(issues: ValidationIssue[], options?: { message?: string; entityName?: string; }): ValidationError; static merge(existing: ValidationError | undefined, extra: ValidationIssue[], options?: { entityName?: string; }): ValidationError | undefined; private static formatMessage; private static normalizePath; /** * Check if an error is a ValidationError (works across module boundaries) */ static isValidationError(error: unknown): error is ValidationError; /** * Get all error messages as a simple array */ getMessages(): string[]; /** * Get errors for a specific field path */ getErrorsForPath(path: string | string[]): ValidationIssue[]; /** * Check if a specific path has errors */ hasErrorsForPath(path: string | string[]): boolean; /** * Convert to a plain object for serialization */ toJSON(): { name: string; message: string; issues: ValidationIssue[]; entityName?: string; }; /** * Get validation errors formatted for UI/API consumption */ getFormattedErrors(): FormattedValidationError[]; /** * Get a summary of the error for logging */ getSummary(): string; } /** * Helper to create a single validation issue */ export declare function createValidationIssue(path: string | string[], message: string): ValidationIssue; /** * Helper to throw a validation error with a single issue */ export declare function throwValidationError(path: string | string[], message: string): never; //# sourceMappingURL=validation-error.d.ts.map