import { Component, type ErrorInfo, type ReactNode } from 'react'; /** * Props passed to the fallback component when an error is caught. */ export interface ErrorFallbackProps { /** The error that was thrown. */ error: Error; /** Call this to reset the error boundary and render its children again. */ resetError: () => void; /** * Re-fetch the current route from the server, then reset the boundary. * * `resetError` re-renders against data the client already has, so it can only * recover from a fault in the render itself. When the failure was the data — * a request that errored, a payload that never arrived — the request has to * be repeated, and that is what this does. * * Outside a mounted router there is nothing to re-fetch from, so it falls * back to `resetError`. Resolves once the boundary has been reset. */ retry: () => Promise; } /** * Props for the RuvyxaErrorBoundary component. */ export interface ErrorBoundaryProps { /** The content to render when no error has occurred. */ children: ReactNode; /** Component to render when an error is caught. */ fallback: (props: ErrorFallbackProps) => ReactNode; /** Optional callback invoked when an error is caught. Useful for logging/reporting. */ onError?: (error: Error, info: ErrorInfo) => void; } interface ErrorBoundaryState { error: Error | null; } /** * Production-grade React error boundary for Ruvyxa apps. * * Catches rendering errors in child components and displays a fallback UI * instead of crashing the entire page. Supports error recovery via the * `resetError` callback passed to the fallback component. * * Usage: * ```tsx * ( *
*

Something went wrong: {error.message}

* *
* )} * onError={(error, info) => { * // Send to error reporting service * reportError(error, info.componentStack) * }} * > * *
* ``` */ export declare class RuvyxaErrorBoundary extends Component { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(error: Error): ErrorBoundaryState; componentDidCatch(error: Error, info: ErrorInfo): void; resetError: () => void; retry: () => Promise; render(): ReactNode; } export {}; //# sourceMappingURL=error-boundary.d.ts.map