import { Component, ErrorInfo, ReactNode } from 'react';
type TErrorBoundaryProps = {
    /** Custom fallback UI. When omitted, a default Ant Design Result with status="500" is shown. */
    fallback?: ReactNode;
    /** Optional callback fired when an error is caught. */
    onError?: (error: Error, errorInfo: ErrorInfo) => void;
    /**
     * Array of values that, when changed while the boundary is in an error state,
     * automatically reset the error and re-render children.
     * Inspired by react-error-boundary's resetKeys pattern.
     */
    resetKeys?: unknown[];
    children: ReactNode;
};
type TErrorBoundaryState = {
    hasError: boolean;
    error: Error | null;
    prevResetKeys: unknown[];
};
/**
 * Catches uncaught JS exceptions in child component trees and renders
 * a fallback UI instead of a white screen.
 *
 * Supports automatic recovery via `resetKeys`: when any value in the array
 * changes while the boundary is in an error state, the error is cleared
 * and children are re-rendered.
 *
 * This is a safety net for unexpected crashes — it does NOT handle
 * API errors (those are handled by useAutoPerRequestError / PerRequestError).
 */
export declare class ErrorBoundary extends Component<TErrorBoundaryProps, TErrorBoundaryState> {
    constructor(props: TErrorBoundaryProps);
    static getDerivedStateFromError(error: Error): Partial<TErrorBoundaryState>;
    static getDerivedStateFromProps(props: TErrorBoundaryProps, state: TErrorBoundaryState): Partial<TErrorBoundaryState> | null;
    componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
    render(): ReactNode;
}
export {};
