UNPKG

gebeya-dala-error-fixer

Version:

Automatic runtime error detection and fix suggestions for Next.js applications with config-based setup

33 lines (32 loc) 936 B
import { ErrorDetectorConfig } from './config'; export interface ErrorInfo { message: string; stack?: string; componentStack?: string; errorBoundary?: boolean; line?: number; column?: number; filename?: string; timestamp: number; } export interface ErrorSuggestion { title: string; description: string; code?: string; actions: string[]; } export declare class ErrorDetector { private onError; private errorPatterns; private config; private originalConsoleError; private originalConsoleWarn; private isDestroyed; constructor(onError: (error: ErrorInfo, suggestion: ErrorSuggestion) => void, config?: ErrorDetectorConfig); private initializeErrorPatterns; private setupGlobalErrorHandlers; private shouldProcessConsoleError; private findSuggestion; addCustomPattern(pattern: RegExp, suggestion: ErrorSuggestion): void; destroy(): void; }