sandai-react
Version:
React components and utilities for the Sandai 3D AI Characters.
39 lines • 2.25 kB
TypeScript
import { SandaiClient, VoiceNames, Environments, AuthClientMessage } from "sandai-core/index";
/**
* Props for the `AI3DCharacter` component.
*
* @property {string} url - The base URL for the Sandai AI 3D character chat interface.
* @property {(client: SandaiClient) => void} onLoad - Callback function triggered when the SandaiClient is loaded.
* @property {string} [vrmUrl] - Optional URL for the VRM model to be loaded as the 3D character.
* @property {VoiceNames} [voiceName] - Optional name of the voice to be used by the 3D character.
* @property {boolean} [showControls] - Optional flag to determine if controls should be displayed in the interface.
*/
export type AI3DCharacterProps = {
url: string;
onLoad: (client: SandaiClient) => void;
vrmUrl?: string;
voiceName?: VoiceNames;
environment?: Environments;
showControls?: boolean;
lowPerformanceMode?: boolean;
apiKey?: AuthClientMessage["apiKey"];
userId?: AuthClientMessage["userId"];
};
/**
* A React component that renders a 3D character using Sandai.
*
* This component dynamically constructs the URL based on the provided props and initializes
* a `SandaiClient` instance to interact with the 3D character.
*
* @param {AI3DCharacterProps} props - The properties passed to the component.
* @param {string} props.url - The base URL for the Sandai 3D character iframe.
* @param {(client: SandaiClient) => void} props.onLoad - Callback function triggered when the SandaiClient is loaded.
* @param {string} [props.vrmUrl] - Optional URL for the VRM model to be loaded in the 3D character.
* @param {VoiceNames} [props.voiceName] - Optional name of the voice to be used by the 3D character.
* @param {boolean} [props.showControls] - Optional flag to determine if controls should be displayed in the iframe.
* @param {AuthClientMessage["apiKey"]} [props.apiKey] - API key, available in the sandai dashboard
* @param {AuthClientMessage["userId"]} [props.userId] - userId, available in the sandai dashboard
* @returns {JSX.Element} - Returns an iframe element that displays the 3D character.
*/
export declare const AI3DCharacter: (props: AI3DCharacterProps) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=index.d.ts.map