import { Component, ReactNode, ErrorInfo } from 'react';
import { KeycloakError } from '../errors/keycloak-errors.js';
export interface ErrorBoundaryProps {
/**
* Content to render when no error has occurred
*/
children: ReactNode;
/**
* Optional fallback UI to render instead of the default error display
*/
fallback?: (error: KeycloakError, reset: () => void) => ReactNode;
/**
* Callback function called when an error is caught
*/
onError?: (error: KeycloakError, errorInfo: ErrorInfo) => void;
/**
* Callback function called when the error boundary is reset
*/
onReset?: () => void;
}
export interface ErrorBoundaryState {
error: KeycloakError | null;
}
/**
* React Error Boundary component for catching and displaying Keycloak errors.
*
* @example
* ```tsx
* console.error(error)}>
*
*
* ```
*
* @example With custom fallback
* ```tsx
* (
*
*
Something went wrong
*
{error.userMessage}
*
*
* )}
* >
*
*
* ```
*/
export declare class ErrorBoundary extends Component {
constructor(props: ErrorBoundaryProps);
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
reset: () => void;
render(): string | number | bigint | boolean | Iterable | Promise> | Iterable | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
}
//# sourceMappingURL=error-boundary.d.ts.map