type ConnectionType = "websocket" | "webrtc"; type CallsConfig = { agentId: string; /** Connection type. Defaults to "websocket". Use "websocket" for audio visualization support. */ connectionType?: ConnectionType; /** API URL for session registration. Defaults to "https://api.mychatbot.app". */ apiUrl?: string; }; /** * Per-call overrides forwarded to the underlying ElevenLabs session. * Used to switch the agent's first message language, inject a one-off * system prompt, override the voice, etc. Mirrors the public override * shape of @elevenlabs/client. Each field must also be allow-listed in * the agent's "Security → Allowed overrides" settings on ElevenLabs. */ type CallOverrides = { agent?: { prompt?: { prompt?: string; }; /** Override the greeting verbatim. Usually leave undefined and let * the agent's language_presets translation handle it. */ firstMessage?: string; /** ISO 639 language code, e.g. "en", "ru", "uk". Selects the * matching language_preset (and its first_message_translation) * on the ElevenLabs agent. */ language?: Language; }; tts?: { voiceId?: string; }; conversation?: { textOnly?: boolean; }; }; /** * ISO 639 language codes supported by ElevenLabs Conversational AI. * Re-exported from @elevenlabs/client so consumers don't need that * dependency directly. */ type Language = "en" | "ja" | "zh" | "de" | "hi" | "fr" | "ko" | "pt" | "pt-br" | "it" | "es" | "id" | "nl" | "tr" | "pl" | "sv" | "bg" | "ro" | "ar" | "cs" | "el" | "fi" | "ms" | "da" | "ta" | "uk" | "ru" | "hu" | "hr" | "sk" | "no" | "vi" | "tl"; type StartOptions = { callerId?: string; dynamicVariables?: Record; clientTools?: ClientTools; /** Per-call overrides for the ElevenLabs agent (language, voice, etc.). */ overrides?: CallOverrides; }; type CallStatus = "idle" | "connecting" | "connected" | "disconnecting"; type CallEvent = "connect" | "disconnect" | "error" | "statusChange" | "modeChange" | "message"; type CallEventPayload = { connect: { conversationId: string; }; disconnect: { reason: string; }; error: { /** Human-readable message. Falls back to a generic string when no underlying error is available. */ message: string; /** Original Error.name when the error originated from a thrown Error/DOMException (e.g. "NotAllowedError", "TypeError"). */ name?: string; /** Original thrown value, when available — lets consumers branch on the underlying cause. */ cause?: unknown; }; statusChange: { status: CallStatus; }; modeChange: { mode: "speaking" | "listening"; }; message: { message: string; role: "user" | "agent"; }; }; type CallEventCallback = (payload: CallEventPayload[E]) => void; type ClientToolParameter = { type: "string" | "number" | "boolean"; description: string; required?: boolean; }; type ClientToolDefinition = { description: string; parameters?: Record; expects_response?: boolean; }; type ClientTools = Record Promise | any; }>; declare class MyChatBotCalls { private config; private conversation; private currentStatus; private micMuted; private currentlySpeaking; private listeners; constructor(config: CallsConfig); get status(): CallStatus; get muted(): boolean; get isSpeaking(): boolean; private emit; private setStatus; start(opts?: StartOptions): Promise; stop(): Promise; toggleMute(): void; /** Raw output (agent) audio frequency data for visualization. */ getOutputByteFrequencyData(): Uint8Array | undefined; /** Raw input (user mic) audio frequency data for visualization. */ getInputByteFrequencyData(): Uint8Array | undefined; on(event: E, callback: CallEventCallback): void; off(event: E, callback: CallEventCallback): void; } /** * Returns a persistent caller ID from localStorage. * Generates and stores a new one if none exists. * Falls back to a random ID if localStorage is unavailable. */ declare function defaultCallerId(): string; export { type CallEvent, type CallEventCallback, type CallEventPayload, type CallOverrides, type CallStatus, type CallsConfig, type ClientToolDefinition, type ClientToolParameter, type ClientTools, type ConnectionType, type Language, MyChatBotCalls, type StartOptions, defaultCallerId };