avatoon
Version:
A React Three Fiber component for realistic avatar lip-syncing and animations.
24 lines (22 loc) • 693 B
TypeScript
import { Component, ReactNode } from 'react';
interface Props {
onError?: (error: Error) => void;
/** Rendered in place of the children after an error (must be R3F-compatible). */
fallback?: ReactNode;
children: ReactNode;
}
interface State {
hasError: boolean;
}
/**
* Catches errors thrown while loading/rendering the avatar (e.g. a bad
* `glbUrl`) so a failed model doesn't crash the host application. The error is
* surfaced via `onError`.
*/
export declare class AvatoonErrorBoundary extends Component<Props, State> {
state: State;
static getDerivedStateFromError(): State;
componentDidCatch(error: Error): void;
render(): ReactNode;
}
export {};