/** * Centralized error handling for Turbo Themes. * * Provides a consistent error logging strategy with standardized message * formatting, error levels, and optional context for debugging. */ /** Log prefix for all theme-related messages */ export declare const LOG_PREFIX = "[turbo-themes]"; /** Error severity levels */ export declare const ErrorLevel: { readonly WARN: "warn"; readonly ERROR: "error"; }; export type ErrorLevel = (typeof ErrorLevel)[keyof typeof ErrorLevel]; /** Structured theme error with code, message, level, and optional context */ export interface ThemeError { code: string; message: string; level: ErrorLevel; context?: Record; } /** * Factory functions for creating structured theme errors. * Each function returns a ThemeError with appropriate code, message, and level. */ export declare const ThemeErrors: { /** Invalid theme ID provided */ INVALID_THEME_ID: (themeId: string) => ThemeError; /** No themes available in registry */ NO_THEMES_AVAILABLE: () => ThemeError; /** Invalid theme icon path */ INVALID_ICON_PATH: (themeId: string) => ThemeError; /** Theme initialization failed */ INIT_FAILED: (error: unknown) => ThemeError; /** Protocol-relative URL rejected for security */ PROTOCOL_REJECTED: () => ThemeError; /** Insecure HTTP URL rejected */ INSECURE_HTTP_REJECTED: () => ThemeError; /** Cross-origin URL rejected */ CROSS_ORIGIN_REJECTED: (origin: string) => ThemeError; /** Invalid CSS path for theme */ INVALID_CSS_PATH: (themeId: string) => ThemeError; /** CSS failed to load */ CSS_LOAD_FAILED: (themeId: string, error: unknown) => ThemeError; /** Storage unavailable (private browsing or disabled) */ STORAGE_UNAVAILABLE: (operation: string, error: unknown) => ThemeError; }; /** * Log a theme error to the console with consistent formatting. * * @param themeError - The structured error to log */ export declare function logThemeError(themeError: ThemeError): void; /** * Convenience function to log a ThemeError. * * @param error - The ThemeError instance to log */ export declare function logError(error: T): void; //# sourceMappingURL=errors.d.ts.map