import * as React from "react"; interface FallbackProps { error: Error; resetErrorBoundary: (...args: Array) => void; } interface ErrorBoundaryPropsWithComponent { onResetKeysChange?: (prevResetKeys: Array | undefined, resetKeys: Array | undefined) => void; onReset?: (...args: Array) => void; onError?: (error: Error, info: { componentStack: string; }) => void; resetKeys?: Array; fallback?: never; FallbackComponent: React.ComponentType; fallbackRender?: never; } declare function FallbackRender(props: FallbackProps): React.ReactElement | null; interface ErrorBoundaryPropsWithRender { onResetKeysChange?: (prevResetKeys: Array | undefined, resetKeys: Array | undefined) => void; onReset?: (...args: Array) => void; onError?: (error: Error, info: { componentStack: string; }) => void; resetKeys?: Array; fallback?: never; FallbackComponent?: never; fallbackRender: typeof FallbackRender; } interface ErrorBoundaryPropsWithFallback { onResetKeysChange?: (prevResetKeys: Array | undefined, resetKeys: Array | undefined) => void; onReset?: (...args: Array) => void; onError?: (error: Error, info: { componentStack: string; }) => void; resetKeys?: Array; fallback: React.ReactElement | null; FallbackComponent?: never; fallbackRender?: never; } declare type ErrorBoundaryProps = ErrorBoundaryPropsWithFallback | ErrorBoundaryPropsWithComponent | ErrorBoundaryPropsWithRender; declare type ErrorBoundaryState = { error: Error | null; }; declare class ErrorBoundary extends React.Component>, ErrorBoundaryState> { static contextType: React.Context; static getDerivedStateFromError(error: Error): { error: Error; }; state: ErrorBoundaryState; updatedWithError: boolean; resetErrorBoundary: (...args: Array) => void; reset(): void; componentDidCatch(error: Error, info: React.ErrorInfo): Promise; componentDidMount(): void; handleRouteChange: () => void; componentWillUnmount(): void; componentDidUpdate(prevProps: ErrorBoundaryProps): void; render(): React.ReactNode; } declare function withErrorBoundary

(Component: React.ComponentType

, errorBoundaryProps: ErrorBoundaryProps): React.ComponentType

; declare function useErrorHandler(givenError?: unknown): (error: unknown) => void; export { ErrorBoundary, withErrorBoundary, useErrorHandler }; export type { FallbackProps, ErrorBoundaryPropsWithComponent, ErrorBoundaryPropsWithRender, ErrorBoundaryPropsWithFallback, ErrorBoundaryProps, };