This commit is contained in:
2025-12-13 14:46:15 +08:00
parent cb1658a645
commit a6f5158882

48
src/elderly/types/xmov.d.ts vendored Normal file
View File

@@ -0,0 +1,48 @@
/**
* XmovAvatar SDK TypeScript Type Definitions
*/
export interface XmovConfig {
appId: string;
appSecret: string;
gatewayServer?: string;
}
export interface XmovSDKOptions {
containerId: string;
appId: string;
appSecret: string;
gatewayServer: string;
onWidgetEvent?: (data: any) => void;
onNetworkInfo?: (networkInfo: any) => void;
onMessage?: (message: any) => void;
onStateChange?: (state: string) => void;
onStatusChange?: (status: string) => void;
onStateRenderChange?: (state: string, duration: number) => void;
onVoiceStateChange?: (status: 'start' | 'end') => void;
enableLogger?: boolean;
}
export interface XmovInitOptions {
onDownloadProgress?: (progress: number) => void;
onError?: (error: any) => void;
onClose?: () => void;
}
export interface XmovAvatarSDK {
init(options: XmovInitOptions): Promise<void>;
speak(text: string, isFirst: boolean, isEnd: boolean): void;
think(): void;
interactiveIdle(): void;
offlineMode(): void;
onlineMode(): void;
destroy(): void;
}
declare global {
interface Window {
XmovAvatar: new (options: XmovSDKOptions) => XmovAvatarSDK;
}
}
export {};