/**
 * Error types for categorizing service worker errors
 */
export declare enum ServiceWorkerErrorType {
    NETWORK = "NETWORK",
    CACHE = "CACHE",
    UPDATE = "UPDATE",
    CONNECTION = "CONNECTION",
    TIMEOUT = "TIMEOUT",
    UNKNOWN = "UNKNOWN"
}
/**
 * Error severity levels
 */
export declare enum ErrorSeverity {
    DEBUG = "debug",
    INFO = "info",
    WARN = "warn",
    ERROR = "error",
    FATAL = "fatal"
}
/**
 * Interface for error context
 */
export interface IErrorContext {
    url?: string;
    method?: string;
    statusCode?: number;
    attempt?: number;
    maxAttempts?: number;
    duration?: number;
    componentName?: string;
    additionalInfo?: Record<string, unknown>;
}
/**
 * Service Worker Error class with type categorization and context
 */
export declare class ServiceWorkerError extends Error {
    readonly type: ServiceWorkerErrorType;
    readonly severity: ErrorSeverity;
    readonly context: IErrorContext;
    readonly timestamp: number;
    readonly originalError?: Error;
    constructor(message: string, type?: ServiceWorkerErrorType, severity?: ErrorSeverity, context?: IErrorContext, originalError?: Error);
    /**
     * Creates a formatted log message
     */
    toLogMessage(): string;
    /**
     * Converts to a plain object for serialization
     */
    toJSON(): Record<string, unknown>;
}
/**
 * Error handler for consistent error handling across service worker components
 */
export declare class ErrorHandler {
    private static instance;
    private errorHistory;
    private readonly maxHistorySize;
    private constructor();
    /**
     * Gets the singleton instance
     */
    static getInstance(): ErrorHandler;
    /**
     * Handles an error with consistent logging and tracking
     */
    handle(error: Error | ServiceWorkerError | string, type?: ServiceWorkerErrorType, severity?: ErrorSeverity, context?: IErrorContext): ServiceWorkerError;
    /**
     * Creates and handles a network error
     */
    handleNetworkError(message: string, url: string, originalError?: Error, context?: Partial<IErrorContext>): ServiceWorkerError;
    /**
     * Creates and handles a cache error
     */
    handleCacheError(message: string, url?: string, originalError?: Error, context?: Partial<IErrorContext>): ServiceWorkerError;
    /**
     * Creates and handles an update error
     */
    handleUpdateError(message: string, originalError?: Error, context?: Partial<IErrorContext>): ServiceWorkerError;
    /**
     * Creates and handles a connection error
     */
    handleConnectionError(message: string, originalError?: Error, context?: Partial<IErrorContext>): ServiceWorkerError;
    /**
     * Creates and handles a timeout error
     */
    handleTimeoutError(message: string, url?: string, duration?: number, context?: Partial<IErrorContext>): ServiceWorkerError;
    /**
     * Gets the error history
     */
    getErrorHistory(): ServiceWorkerError[];
    /**
     * Gets errors by type
     */
    getErrorsByType(type: ServiceWorkerErrorType): ServiceWorkerError[];
    /**
     * Gets errors within a time range
     */
    getRecentErrors(withinMs: number): ServiceWorkerError[];
    /**
     * Clears the error history
     */
    clearHistory(): void;
    /**
     * Gets error statistics
     */
    getStats(): Record<ServiceWorkerErrorType, number>;
    /**
     * Logs an error with the appropriate severity
     */
    private logError;
    /**
     * Tracks an error in the history
     */
    private trackError;
}
export declare const getErrorHandler: () => ErrorHandler;
