import * as React from 'react'; /** Ported from v0.x with the same props surface; reports via the native bridge. */ export type FallbackRender = (errorData: { error: Error; componentStack: string | null; eventId: string | null; resetError(): void; }) => React.ReactElement; export type ErrorBoundaryProps = { children?: React.ReactNode | (() => React.ReactNode); /** Rendered when the boundary catches an error: an element, or a render function receiving the * error, component stack and a reset callback. */ fallback?: React.ReactElement | FallbackRender; /** Called when the error boundary encounters an error */ onError?(error: Error, componentStack: string, eventId: string): void; /** Called on componentDidMount() */ onMount?(): void; /** Called if resetError() is called from the fallback render props function */ onReset?(error: Error | null, componentStack: string | null, eventId: string | null): void; /** Called on componentWillUnmount() */ onUnmount?(error: Error | null, componentStack: string | null, eventId: string | null): void; }; export type ErrorBoundaryState = { componentStack: string | null; error: Error | null; eventId: string | null; }; /** ErrorBoundary component that reports render errors to Noibu. Requires React >= 16. */ export declare class ErrorBoundary extends React.Component { state: ErrorBoundaryState; componentDidMount(): void; componentDidCatch(error: Error & { cause?: Error; }, { componentStack }: React.ErrorInfo): void; componentWillUnmount(): void; resetErrorBoundary: () => void; render(): React.ReactNode; }