import { Component, ReactNode } from "react";
//#region src/react/SchemaErrorBoundary.d.ts
/**
* Props accepted by {@link SchemaErrorBoundary}.
*
* @group Components
*/
interface SchemaErrorBoundaryProps {
/** Called with the caught error. Returns fallback ReactNode to render. */
fallback: (error: Error, reset: () => void) => ReactNode;
children: ReactNode;
}
interface ErrorBoundaryState {
error: Error | undefined;
}
/**
* React error boundary that catches rendering errors from
* `SchemaComponent`, theme adapters, and any descendant.
*
* Provides a `reset` callback that clears the error state, allowing
* the children to re-render (e.g. after fixing a bad schema prop).
* Does not catch errors thrown from event handlers, async work, or
* server-side rendering — those paths must be handled by the host
* application.
*
* @group Components
* @example
* ```tsx
* {error.message}
}>
*
*
* ```
*/
declare class SchemaErrorBoundary extends Component {
state: ErrorBoundaryState;
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
componentDidCatch(error: Error): void;
reset: () => void;
render(): ReactNode;
}
//#endregion
export { SchemaErrorBoundary, SchemaErrorBoundaryProps };