import type { ErrorObject } from 'ajv';
import type { ControllerValidation } from '../../form/controller/controller-validation';
/**
 * Aggregated validation error information
 */
export interface AggregatedError {
    /** Field path where the error occurred */
    path: string;
    /** Human-readable field name */
    fieldName: string;
    /** Error message */
    message: string;
    /** Error severity level */
    severity: 'error' | 'warning' | 'info';
    /** Error source/type */
    source: 'schema' | 'conditional' | 'crossField' | 'async' | 'custom';
    /** Additional context */
    context?: Record<string, unknown>;
    /** Original error object */
    originalError?: ErrorObject;
}
/**
 * Error aggregation configuration
 */
export interface ErrorAggregationConfig {
    /** Whether to include warnings in aggregation */
    includeWarnings?: boolean;
    /** Whether to include info messages */
    includeInfo?: boolean;
    /** Maximum number of errors to aggregate per field */
    maxErrorsPerField?: number;
    /** Custom field name resolver */
    fieldNameResolver?: (path: string) => string;
    /** Custom error message formatter */
    messageFormatter?: (error: AggregatedError) => string;
    /** Error priority resolver (higher numbers = higher priority) */
    priorityResolver?: (error: AggregatedError) => number;
}
/**
 * Error aggregation result
 */
export interface ErrorAggregationResult {
    /** All aggregated errors */
    errors: AggregatedError[];
    /** Errors grouped by field path */
    errorsByField: Record<string, AggregatedError[]>;
    /** Error summary statistics */
    summary: {
        totalErrors: number;
        errorCount: number;
        warningCount: number;
        infoCount: number;
        fieldsWithErrors: number;
    };
    /** Whether the form has any validation errors */
    hasErrors: boolean;
    /** Whether the form has any warnings */
    hasWarnings: boolean;
}
/**
 * Aggregate validation errors from multiple sources
 */
export declare function aggregateValidationErrors(sources: {
    ajvErrors?: ErrorObject[];
    controllerValidation?: ControllerValidation;
    asyncErrors?: Record<string, ControllerValidation>;
    customErrors?: AggregatedError[];
}, config?: ErrorAggregationConfig): ErrorAggregationResult;
/**
 * Create a formatted error summary for display
 */
export declare function formatErrorSummary(result: ErrorAggregationResult, config?: ErrorAggregationConfig): string[];
/**
 * Get the first error for each field (useful for inline validation display)
 */
export declare function getFirstErrorPerField(result: ErrorAggregationResult): Record<string, AggregatedError>;
/**
 * Check if a specific field has errors
 */
export declare function fieldHasErrors(result: ErrorAggregationResult, fieldPath: string): boolean;
/**
 * Get errors for a specific field
 */
export declare function getFieldErrors(result: ErrorAggregationResult, fieldPath: string): AggregatedError[];
