Add File
This commit is contained in:
48
src/elderly/types/xmov.d.ts
vendored
Normal file
48
src/elderly/types/xmov.d.ts
vendored
Normal 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 {};
|
||||||
Reference in New Issue
Block a user