///
import React, { ErrorInfo } from "react";
export interface ErrorBoundaryProps {
Fallback?: React.ComponentType<{
resetError: () => void;
retry: () => void;
}>;
onError?: (error: Error, errorInfo: ErrorInfo) => void;
onReset?: () => void;
onRetry?: () => Promise;
retryIntervals?: number[] | number;
maxRetry?: number;
children?: React.ReactNode;
}
export interface ErrorBoundaryState {
hasError: boolean;
error?: Error;
}
declare class ErrorBoundary extends React.Component {
retryCount: number;
retryTimeoutId: NodeJS.Timeout | undefined;
constructor(props: ErrorBoundaryProps);
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
componentDidUpdate(_prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState): void;
componentWillUnmount(): void;
getRetryInterval: () => number | undefined;
retry: () => Promise;
resetError: () => void;
render(): string | number | boolean | Iterable | import("react/jsx-runtime").JSX.Element | null | undefined;
}
declare function useErrorBoundary(): {
hasError: boolean;
error: Error | null;
triggerError: (error: Error) => void;
resetError: () => void;
};
declare function withErrorBoundary(WrappedComponent: React.ComponentType, boundaryProps: ErrorBoundaryProps): (componentProps: any) => import("react/jsx-runtime").JSX.Element;
export { ErrorBoundary, useErrorBoundary, withErrorBoundary };