UNPKG

@voice-ai-workforce/react

Version:

React components with 3-tier interface modes for voice-controlled workforce applications

27 lines (26 loc) 1.12 kB
import { VoiceAIConfig, VoiceCommand, VoiceResponse, VoiceAIState, VoiceAIError, VisibilityConfig, CustomLabels, VoiceModeProps } from '../../../types/src/types'; export interface UseVoiceAIOptions extends VoiceModeProps { config: VoiceAIConfig; onCommand?: (command: VoiceCommand) => void; onResponse?: (response: VoiceResponse) => void; onError?: (error: VoiceAIError) => void; autoStart?: boolean; } export interface UseVoiceAIReturn { isListening: boolean; isProcessing: boolean; isAvailable: boolean; currentCommand?: VoiceCommand; lastResponse?: VoiceResponse; error?: string; startListening: () => Promise<void>; stopListening: () => Promise<void>; processText: (text: string) => Promise<VoiceResponse | undefined>; speak: (text: string) => Promise<void>; updateConfig: (newConfig: Partial<VoiceAIConfig>) => void; updateContext: (context: Record<string, any>) => void; getState: () => VoiceAIState; visibility: VisibilityConfig; labels: CustomLabels; } export declare function useVoiceAI(options: UseVoiceAIOptions): UseVoiceAIReturn;