23 lines
608 B
TypeScript
23 lines
608 B
TypeScript
declare module 'react-speech-recognition' {
|
|
export interface SpeechRecognitionOptions {
|
|
continuous?: boolean
|
|
language?: string
|
|
}
|
|
|
|
export interface UseSpeechRecognitionReturn {
|
|
transcript: string
|
|
listening: boolean
|
|
resetTranscript: () => void
|
|
browserSupportsSpeechRecognition: boolean
|
|
isMicrophoneAvailable: boolean
|
|
}
|
|
|
|
export function useSpeechRecognition(): UseSpeechRecognitionReturn
|
|
|
|
export default class SpeechRecognition {
|
|
static startListening(options?: SpeechRecognitionOptions): void
|
|
static stopListening(): void
|
|
static abortListening(): void
|
|
}
|
|
}
|