@revrag-ai/embed-react-native
Version:
A powerful React Native library for integrating AI-powered voice agents into mobile applications. Features real-time voice communication, intelligent speech processing, customizable UI components, and comprehensive event handling for building conversation
49 lines • 1.65 kB
TypeScript
/**
* @file EmbedButton.hooks.ts
* @description Custom hooks for the EmbedButton component
*/
import type { ConfigData } from './EmbedButton.helpers';
/**
* Hook to fetch and manage agent configuration data
*/
export declare const useConfigData: () => ConfigData | null;
/**
* Hook to track call duration when connected
*/
export declare const useCallDuration: (connectionState: string) => {
callDuration: number;
resetDuration: () => void;
};
/**
* Hook to handle inactivity behavior (show_popup or auto_trigger)
*/
interface UseInactivityBehaviorParams {
configData: ConfigData | null;
isOpen: boolean;
isLoading: boolean;
hasActiveToken: boolean;
onStartCall: () => Promise<void>;
}
export declare const useInactivityBehavior: ({ configData, isOpen, isLoading, hasActiveToken, onStartCall, }: UseInactivityBehaviorParams) => {
isAutoOpen: boolean;
setIsAutoOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
};
/**
* Hook to manage call lifecycle (start, end, mute)
*/
interface UseCallManagementParams {
initializeVoiceAgent: () => Promise<void>;
endCall: () => Promise<void>;
muteMic: () => void;
unmuteMic: () => void;
isMicMuted: boolean;
resetDuration: () => void;
setIsOpen: (open: boolean) => void;
}
export declare const useCallManagement: ({ initializeVoiceAgent, endCall, muteMic, unmuteMic, isMicMuted, resetDuration, setIsOpen, }: UseCallManagementParams) => {
handleStartCall: () => Promise<void>;
handleEndCall: () => Promise<void>;
handleMicToggle: () => void;
};
export {};
//# sourceMappingURL=EmbedButton.hooks.d.ts.map