@hoosei/voxweave-react
Version:
A customizable and interactive voice UI component for React applications
23 lines (22 loc) • 855 B
TypeScript
import { Component, ErrorInfo, ReactNode } from 'react';
interface WebGLErrorBoundaryProps {
children: ReactNode;
fallback?: ReactNode;
onError?: (error: Error, errorInfo: ErrorInfo) => void;
}
interface WebGLErrorBoundaryState {
hasError: boolean;
error: Error | null;
retryCount: number;
}
/**
* WebGLErrorBoundary is a specialized error boundary for handling WebGL related errors.
* It can detect WebGL context loss and other rendering errors and attempt to recover.
*/
declare class WebGLErrorBoundary extends Component<WebGLErrorBoundaryProps, WebGLErrorBoundaryState> {
constructor(props: WebGLErrorBoundaryProps);
static getDerivedStateFromError(error: Error): WebGLErrorBoundaryState;
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
render(): ReactNode;
}
export default WebGLErrorBoundary;