diff --git a/src/elderly/types/xmov.d.ts b/src/elderly/types/xmov.d.ts new file mode 100644 index 0000000..42b5467 --- /dev/null +++ b/src/elderly/types/xmov.d.ts @@ -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; + 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 {};