@voice-ai-workforce/react
Version:
React components with 3-tier interface modes for voice-controlled workforce applications
49 lines (48 loc) • 1.75 kB
TypeScript
import { VoiceCommand, VoiceResponse, AIProvider } from '../../../types/src/types';
import { VoiceAIHistoryFilters } from '../types/theme';
export interface VoiceCommandHistoryEntry extends VoiceCommand {
id: string;
response?: VoiceResponse;
duration?: number;
success: boolean;
error?: string;
sessionId?: string;
}
export interface VoiceHistoryStats {
totalCommands: number;
successfulCommands: number;
failedCommands: number;
averageConfidence: number;
commandsByProvider: Record<AIProvider, number>;
commandsByIntent: Record<string, number>;
mostUsedCommands: Array<{
intent: string;
count: number;
}>;
averageResponseTime: number;
}
interface UseVoiceHistoryOptions {
maxHistoryItems?: number;
persistHistory?: boolean;
storageKey?: string;
enableStats?: boolean;
}
interface UseVoiceHistoryReturn {
history: VoiceCommandHistoryEntry[];
filteredHistory: VoiceCommandHistoryEntry[];
stats: VoiceHistoryStats;
addCommand: (command: VoiceCommand, response?: VoiceResponse, duration?: number) => void;
clearHistory: () => void;
removeCommand: (id: string) => void;
exportHistory: (format?: 'json' | 'csv') => string;
filters: VoiceAIHistoryFilters;
setFilters: (filters: Partial<VoiceAIHistoryFilters>) => void;
clearFilters: () => void;
searchQuery: string;
setSearchQuery: (query: string) => void;
replayCommand: (id: string) => VoiceCommand | null;
getRecentCommands: (count?: number) => VoiceCommandHistoryEntry[];
getFavoriteCommands: (count?: number) => VoiceCommandHistoryEntry[];
}
export declare const useVoiceHistory: (options?: UseVoiceHistoryOptions) => UseVoiceHistoryReturn;
export {};