import type { ReactNode } from "react";
import { type FallbackProps } from "react-error-boundary";
/**
 * Available fallback UI variants for the ErrorBoundary component.
 *
 * - `"silent"` - Renders nothing when an error occurs (useful for modals)
 * - `"text"` - Displays a simple centered text message
 * - `"detailed"` - Shows full error details including message and JSON representation
 */
type ErrorFallbackVariant = "silent" | "text" | "detailed";
/**
 * Base props shared by all ErrorBoundary configurations.
 */
type BaseErrorBoundaryProps = {
    /** Content to wrap with error boundary protection */
    children: ReactNode;
    /** Optional callback invoked when an error is caught (in addition to logging) */
    onError?: (error: Error, info: React.ErrorInfo) => void;
    /** When any value in this array changes, the error boundary resets */
    resetKeys?: unknown[];
    /** Logger context path for error logging (e.g., ["Connect", "Editor"]) */
    loggerContext?: string[];
};
/**
 * Props for using a predefined fallback variant.
 */
type VariantErrorBoundaryProps = BaseErrorBoundaryProps & {
    /** The fallback UI variant to display on error */
    variant: ErrorFallbackVariant;
    /** Custom message for the "text" variant (default: "Something went wrong") */
    fallbackMessage?: string;
};
/**
 * Props for using a custom fallback render function.
 */
type CustomFallbackErrorBoundaryProps = BaseErrorBoundaryProps & {
    /** Custom render function for the fallback UI */
    fallbackRender: (props: FallbackProps) => ReactNode;
};
/**
 * Union type for all ErrorBoundary prop configurations.
 * Use either a variant or a custom fallbackRender, but not both.
 */
type ErrorBoundaryProps = VariantErrorBoundaryProps | CustomFallbackErrorBoundaryProps;
/**
 * Simple text-based fallback component.
 * Displays a centered message when an error occurs.
 */
declare function TextFallback({ message, }: {
    message?: string;
}): import("react/jsx-runtime").JSX.Element;
/**
 * Detailed fallback component showing full error information.
 * Displays error message and JSON representation of the error object.
 * Useful for development and debugging purposes.
 */
declare function DetailedFallback({ error }: FallbackProps): import("react/jsx-runtime").JSX.Element;
/**
 * Centered error message fallback component.
 * Displays the error message in a centered, full-size container.
 * Suitable for use as a custom fallbackRender when you need simple error display.
 */
declare function CenteredErrorMessage({ error }: FallbackProps): import("react/jsx-runtime").JSX.Element;
/**
 * Unified error boundary component for catching and handling React errors.
 *
 * Built on top of `react-error-boundary`, this component provides:
 * - Automatic error logging with configurable context
 * - Multiple fallback UI variants (silent, text, detailed)
 * - Support for custom fallback render functions
 * - Reset capability via `resetKeys`
 *
 * @example
 * // Using a predefined variant
 * <ErrorBoundary variant="detailed" loggerContext={["Connect", "Editor"]}>
 *   <EditorComponent />
 * </ErrorBoundary>
 *
 * @example
 * // Using a custom message with the text variant
 * <ErrorBoundary variant="text" fallbackMessage="Failed to load drives">
 *   <DrivesList />
 * </ErrorBoundary>
 *
 * @example
 * // Using a custom fallback render
 * <ErrorBoundary
 *   fallbackRender={CenteredErrorMessage}
 *   onError={(error) => trackError(error)}
 * >
 *   <MyComponent />
 * </ErrorBoundary>
 *
 * @example
 * // Silent mode for modals (renders null on error)
 * <ErrorBoundary variant="silent" loggerContext={["Connect", "Modals"]}>
 *   <ModalContent />
 * </ErrorBoundary>
 */
export declare function ErrorBoundary(props: ErrorBoundaryProps): import("react/jsx-runtime").JSX.Element;
export { CenteredErrorMessage, DetailedFallback, TextFallback };
export type { FallbackProps };
//# sourceMappingURL=error-boundary.d.ts.map