/**
 * Simplified Plugin Error Handler - Week 3 Performance Enhancement
 *
 * Enhanced error handling with performance optimizations:
 * - Error rate limiting and circuit breaker patterns
 * - Error aggregation and batch reporting
 * - Performance metrics for error handling
 * - Memory-efficient error tracking
 */
import type { TachUIPlugin } from '@tachui/core';
interface ErrorMetrics {
    count: number;
    lastOccurrence: number;
    firstOccurrence: number;
    errorTypes: Map<string, number>;
    resolved: boolean;
}
interface CircuitBreakerState {
    isOpen: boolean;
    failureCount: number;
    lastFailureTime: number;
    resetTimeout?: number;
}
export declare class OptimizedPluginErrorHandler {
    private errorMetrics;
    private circuitBreakers;
    private errorQueue;
    private batchTimer?;
    private maxFailuresBeforeCircuitBreak;
    private circuitBreakerResetTime;
    private errorBatchSize;
    private errorBatchTimeout;
    private maxErrorHistory;
    handleInstallError(plugin: TachUIPlugin, error: Error): void;
    handleRuntimeError(pluginName: string, error: Error): void;
    handleUninstallError(pluginName: string, error: Error): void;
    private recordError;
    private recordErrorType;
    private updateCircuitBreaker;
    private isCircuitOpen;
    private resetCircuitBreaker;
    private queueError;
    private flushErrorQueue;
    private emitError;
    getErrorMetrics(errorKey?: string): ErrorMetrics | Map<string, ErrorMetrics>;
    getCircuitBreakerStatus(errorKey?: string): CircuitBreakerState | Map<string, CircuitBreakerState>;
    getPerformanceStats(): {
        totalErrors: number;
        uniqueErrorKeys: number;
        activeCircuitBreakers: number;
        queuedErrors: number;
        errorsByType: {
            [k: string]: number;
        };
        memoryUsage: {
            errorMetrics: number;
            circuitBreakers: number;
            queuedErrors: number;
            estimatedMemoryKB: number;
        };
    };
    markErrorResolved(errorKey: string): void;
    clearErrorHistory(errorKey?: string): void;
}
export declare const globalPluginErrorHandler: OptimizedPluginErrorHandler;
export declare const SimplifiedPluginErrorHandler: typeof OptimizedPluginErrorHandler;
/**
 * Simple error recovery utilities
 */
export declare const ErrorRecoveryUtils: {
    /**
     * Safely execute plugin operation with error handling
     */
    safeExecute<T>(pluginName: string, operation: string, fn: () => Promise<T> | T): Promise<T | undefined>;
    /**
     * Create an error boundary for plugin operations
     */
    createErrorBoundary(pluginName: string): {
        exec<T>(fn: () => Promise<T> | T): Promise<T | undefined>;
    };
};
export {};
//# sourceMappingURL=simplified-error-handler.d.ts.map