-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
29 lines (29 loc) · 931 Bytes
/
Copy pathtypes.d.ts
File metadata and controls
29 lines (29 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** Minimal Web Speech API surface — not in TypeScript's DOM lib yet. */
interface SpeechRecognitionAlternative { transcript: string }
interface SpeechRecognitionResult {
readonly length: number;
readonly isFinal: boolean;
[index: number]: SpeechRecognitionAlternative;
}
interface SpeechRecognitionResultList {
readonly length: number;
[index: number]: SpeechRecognitionResult;
}
interface SpeechRecognitionEvent extends Event {
readonly resultIndex: number;
readonly results: SpeechRecognitionResultList;
}
declare class SpeechRecognition extends EventTarget {
lang: string;
continuous: boolean;
interimResults: boolean;
start(): void;
stop(): void;
onresult: ((e: SpeechRecognitionEvent) => void) | null;
onerror: ((e: Event) => void) | null;
onend: (() => void) | null;
}
interface Window {
SpeechRecognition?: typeof SpeechRecognition;
webkitSpeechRecognition?: typeof SpeechRecognition;
}