import { Component, type ErrorInfo, type ReactNode } from 'react'; interface ErrorBoundaryProps { children: ReactNode; renderFallback: (error: Error) => ReactNode; /** Clears a caught error when it changes, e.g. when a soft-hidden modal reopens */ resetKey?: unknown; /** Optional handler for a boundary that recovers locally from the failure. */ onError?: (error: Error, errorInfo: ErrorInfo) => void; } interface ErrorBoundaryState { error: Error | null; } declare class ErrorBoundary extends Component { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(error: Error): ErrorBoundaryState; componentDidUpdate(prevProps: ErrorBoundaryProps): void; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; render(): ReactNode; } export default ErrorBoundary;