import { Component, ErrorInfo, ReactNode } from 'react'; export interface ErrorBoundaryProps { /** Rendered normally; a render/commit error anywhere below is caught. */ children: ReactNode; /** Rendered instead of `children` once a descendant throws. */ fallback: ReactNode; /** Called when an error is caught — use for logging/telemetry. */ onError?: (error: Error, info: ErrorInfo) => void; } interface ErrorBoundaryState { hasError: boolean; } /** * Generic React error boundary: renders `fallback` when a descendant throws * during render or commit, instead of letting the error crash the whole tree. * Consumers own the fallback UI and any logging via `onError`. * * Must be a class component — React exposes error boundaries only through the * `getDerivedStateFromError` / `componentDidCatch` lifecycle, which has no hook * equivalent. */ export declare class ErrorBoundary extends Component { state: ErrorBoundaryState; static getDerivedStateFromError(): ErrorBoundaryState; componentDidCatch(error: Error, info: ErrorInfo): void; render(): ReactNode; } export {};