'use client';

import { default as React } from 'react';
export interface ErrorBoundaryProps {
    /**
     * Child components to wrap
     */
    children: React.ReactNode;
    /**
     * Fallback component to render on error
     */
    fallback?: React.ComponentType<ErrorFallbackProps>;
    /**
     * Error handler callback
     */
    onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
    /**
     * Whether to show error details
     */
    showDetails?: boolean;
    /**
     * Whether to show retry button
     */
    showRetry?: boolean;
    /**
     * Custom retry handler
     */
    onRetry?: () => void;
    /**
     * Error boundary title
     */
    title?: string;
    /**
     * Error boundary subtitle
     */
    subtitle?: string;
    /**
     * Custom className
     */
    className?: string;
    /**
     * Whether to log errors to console
     */
    logErrors?: boolean;
    /**
     * Whether to report errors to external service
     */
    reportErrors?: boolean;
    /**
     * Error reporting endpoint
     */
    errorReportingUrl?: string;
}
export interface ErrorFallbackProps {
    /**
     * The error that occurred
     */
    error: Error;
    /**
     * Error information from React
     */
    errorInfo: React.ErrorInfo;
    /**
     * Function to reset the error boundary
     */
    resetError: () => void;
    /**
     * Whether to show error details
     */
    showDetails?: boolean;
    /**
     * Custom title
     */
    title?: string;
    /**
     * Custom subtitle
     */
    subtitle?: string;
    /**
     * Custom className
     */
    className?: string;
}
interface ErrorBoundaryState {
    hasError: boolean;
    error: Error | null;
    errorInfo: React.ErrorInfo | null;
    errorId: string;
}
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
    private retryTimeoutId;
    constructor(props: ErrorBoundaryProps);
    static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
    componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
    private reportError;
    private resetError;
    render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
}
export declare function useAsyncError(): (error: Error) => void;
export declare function withErrorBoundary<P extends object>(Component: React.ComponentType<P>, errorBoundaryProps?: Partial<ErrorBoundaryProps>): {
    (props: P): import("react/jsx-runtime").JSX.Element;
    displayName: string;
};
export declare function AuthErrorBoundary({ children, ...props }: Omit<ErrorBoundaryProps, "title" | "subtitle">): import("react/jsx-runtime").JSX.Element;
export declare function FormErrorBoundary({ children, ...props }: Omit<ErrorBoundaryProps, "title" | "subtitle">): import("react/jsx-runtime").JSX.Element;
export declare function ApiErrorBoundary({ children, ...props }: Omit<ErrorBoundaryProps, "title" | "subtitle">): import("react/jsx-runtime").JSX.Element;
export default ErrorBoundary;
//# sourceMappingURL=error-boundary.d.ts.map