import type { ValidateFunction } from 'ajv';
import type { ControllerValidation } from '../../form/controller/controller-validation';
/**
 * Performance optimization configuration
 */
export interface ValidationPerformanceConfig {
    /** Enable validation result caching */
    enableCaching?: boolean;
    /** Cache TTL in milliseconds (default: 5 minutes) */
    cacheTTL?: number;
    /** Maximum cache size (default: 1000 entries) */
    maxCacheSize?: number;
    /** Enable validation batching */
    enableBatching?: boolean;
    /** Batch delay in milliseconds (default: 50ms) */
    batchDelay?: number;
    /** Enable incremental validation */
    enableIncremental?: boolean;
    /** Enable validation prioritization */
    enablePrioritization?: boolean;
    /** Validation timeout in milliseconds */
    validationTimeout?: number;
}
/**
 * Performance metrics
 */
export interface ValidationMetrics {
    /** Total validations performed */
    totalValidations: number;
    /** Cache hits */
    cacheHits: number;
    /** Cache misses */
    cacheMisses: number;
    /** Average validation time (ms) */
    averageValidationTime: number;
    /** Batched validations */
    batchedValidations: number;
    /** Skipped validations (incremental) */
    skippedValidations: number;
}
/**
 * Validation performance optimizer
 */
export declare class ValidationPerformanceOptimizer {
    private config;
    private cache;
    private batchQueue;
    private batchTimeout;
    private metrics;
    private validationTimes;
    constructor(config?: ValidationPerformanceConfig);
    /**
     * Create a hash of a value for caching
     */
    private createValueHash;
    /**
     * Check if cache entry is valid
     */
    private isCacheEntryValid;
    /**
     * Clean expired cache entries
     */
    private cleanCache;
    /**
     * Get cached validation result
     */
    private getCachedResult;
    /**
     * Cache validation result
     */
    private setCachedResult;
    /**
     * Process validation batch
     */
    private processBatch;
    /**
     * Record validation timing
     */
    private recordValidationTime;
    /**
     * Optimized validation with caching, batching, and performance tracking
     */
    validateOptimized(value: unknown, validator: ValidateFunction, cacheKey: string, options?: {
        priority?: number;
        dependencies?: string[];
        skipIncremental?: boolean;
    }): Promise<ControllerValidation>;
    /**
     * Invalidate cache entries that depend on changed fields
     */
    invalidateDependentCache(changedFields: string[]): void;
    /**
     * Check if incremental validation should be skipped
     */
    shouldSkipValidation(newValue: unknown, oldValue: unknown, _fieldPath: string): boolean;
    /**
     * Get performance metrics
     */
    getMetrics(): ValidationMetrics;
    /**
     * Reset performance metrics
     */
    resetMetrics(): void;
    /**
     * Clear all caches
     */
    clearCache(): void;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        size: number;
        hitRate: number;
        averageAge: number;
    };
    /**
     * Dispose of resources
     */
    dispose(): void;
}
