import { Vowel } from '../core/VowelClient'; import { VowelAction, ActionHandler, VowelVoiceConfig, VowelClientConfig } from '../types'; /** * Extended interface for the vowel-voice-widget element * These methods will be available on the DOM element */ export interface VowelVoiceWidgetElement extends HTMLElement { /** * Register a custom action programmatically * * @example * const widget = document.querySelector('vowel-voice-widget'); * widget.registerAction('addToCart', { * description: 'Add product to cart', * parameters: { * productId: { type: 'string', description: 'Product ID' } * } * }, async (params) => { * console.log('Adding to cart:', params.productId); * }); */ registerAction(name: string, definition: VowelAction, handler: ActionHandler): void; /** * Get the Vowel client instance * Returns null if not yet initialized * * @example * const widget = document.querySelector('vowel-voice-widget'); * const client = widget.getVowelClient(); * if (client) { * client.startSession(); * } */ getVowelClient(): Vowel | null; /** * Start a voice session programmatically */ startSession(): Promise; /** * Stop the current voice session */ stopSession(): void; /** * Get the current session state */ getState(): any; /** * Set configuration options * * @example * widget.setConfig({ * systemInstructionOverride: 'You are a helpful assistant', * _voiceConfig: { voice: 'Puck' } * }); */ setConfig(config: { instructions?: string; systemInstructionOverride?: string; language?: string; initialGreetingPrompt?: string; turnDetectionPreset?: 'aggressive' | 'balanced' | 'conservative'; /** @deprecated Prefer `_voiceConfig`. */ voiceConfig?: VowelVoiceConfig; _voiceConfig?: VowelVoiceConfig; floatingCursor?: VowelClientConfig['floatingCursor']; _caption?: VowelClientConfig['_caption']; borderGlow?: VowelClientConfig['borderGlow']; }): void; /** * Get instance ID (internal) */ _instanceId?: string; } /** * Enhance a web component element with Vowel API methods */ export declare function enhanceVowelElement(element: HTMLElement, instanceId: string): void; /** * Dispatch lifecycle event */ export declare function dispatchVowelEvent(element: HTMLElement, eventName: 'ready' | 'session-start' | 'session-end' | 'error', detail?: any): void; /** * Wait for Vowel client to be ready * * @example * const widget = document.querySelector('vowel-voice-widget'); * const client = await waitForVowelReady(widget); */ export declare function waitForVowelReady(element: HTMLElement): Promise; /** * Export types for TypeScript users */ export type { VowelAction, ActionHandler } from '../types'; //# sourceMappingURL=VowelWebComponentAPI.d.ts.map