@lakshmiprasanth/react-voice-to-text
Version:
A modern React package for voice-to-text conversion with real-time speech recognition and file upload support
28 lines • 1.13 kB
TypeScript
import React, { ReactNode } from 'react';
import { VoiceToTextOptions, SpeechRecognitionConfig, SpeechRecognitionResult, BrowserSupport } from '../types';
interface VoiceToTextContextType {
isInitialized: boolean;
isRecording: boolean;
isProcessing: boolean;
results: SpeechRecognitionResult[];
error: string | null;
browserSupport: BrowserSupport | null;
startRecording: (options?: Partial<SpeechRecognitionConfig>) => Promise<void>;
stopRecording: () => Promise<void>;
clearResults: () => void;
clearError: () => void;
updateConfig: (config: Partial<VoiceToTextOptions>) => void;
getConfig: () => VoiceToTextOptions;
}
interface VoiceToTextProviderProps {
children: ReactNode;
options?: VoiceToTextOptions;
onResult?: (result: SpeechRecognitionResult) => void;
onError?: (error: string) => void;
onStart?: () => void;
onStop?: () => void;
}
export declare const VoiceToTextProvider: React.FC<VoiceToTextProviderProps>;
export declare const useVoiceToTextContext: () => VoiceToTextContextType;
export {};
//# sourceMappingURL=VoiceToTextProvider.d.ts.map