import { DailyCall, DailyDeviceInfos } from "@daily-co/daily-js"; import { Axios } from "axios"; import { AvaturnEventCallback, AvaturnHeadConfig, AvaturnHeadEvent, IAvaturnHead } from "./type"; interface SessionData { id: string; limited_access_token: string; room_url: string; session_config: { uses_stacked_alpha: boolean; }; } interface TTSConfig { engine: "elevenlabs" | "google"; voice_id: string; } export declare class AvaturnHead implements IAvaturnHead { inited: boolean; mediaStream: MediaStream; session_id: string; protected sessionData: SessionData | null; protected uiConfig: { background: { transparent: boolean; }; }; protected config: AvaturnHeadConfig; protected shadow: ShadowRoot | null; protected frameHandle: ReturnType; protected rootElement?: HTMLElement; protected abortController: AbortController; protected timeout: ReturnType | 0; protected keepAlive: boolean; protected fetcher: Axios; protected call: DailyCall; protected handlers: { [K in AvaturnHeadEvent]?: AvaturnEventCallback[]; }; protected lastLocalAudioState: boolean | null; protected lastLocalMicState: string | null; /** * Creates an instance of AvaturnHead using API options. * @constructor * @param options Configuration options. */ constructor(options: AvaturnHeadConfig); /** * Creates an instance of AvaturnHead using a DOM element. * @constructor * @param rootElement A reference to the DOM element. * @param options Configuration options. */ constructor(rootElement: HTMLElement, options: AvaturnHeadConfig); private parseConfig; private dispatch; protected drawUI(): void; protected startIdleTimeout(): void; protected restartIdleTimeout(): void; updateConfig(): void; toggleLocalAudio(value?: boolean): void; setOutputDevice(device: { outputDeviceId?: string; }): Promise; setInputDevices(devices: { audioDeviceId?: string | false | null; videoDeviceId?: string | false | null; }): Promise; requestMediaDevices(): Promise<{ devices: MediaDeviceInfo[]; }>; cancelAllTasks(): Promise; private patchConfig; changeVoice(config: TTSConfig): Promise; protected applyEventHandlers(): void; attachDOMNode(node: HTMLElement): void; init(): Promise; join(opts?: { startAudioOff?: boolean; }): Promise; task(text: string): Promise; on(eventName: T, cb: AvaturnEventCallback): void; off(eventName: T, cb: AvaturnEventCallback): void; dispose(): Promise; } export declare class AvaturnAssistantHead extends AvaturnHead { protected assistantSessionToken: string; protected assistantFetcher: Axios; protected sessionToken: string; constructor(config: AvaturnHeadConfig & { assistantSessionToken: string; }); task(text: string, config?: { waitForSpeechEnd: boolean; }): Promise; dispose(): Promise; } export {};