-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
50 lines (44 loc) · 1.11 KB
/
types.ts
File metadata and controls
50 lines (44 loc) · 1.11 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
export interface SpeechRecognitionEvent extends Event {
results: SpeechRecognitionResultList;
resultIndex: number;
}
export interface SpeechRecognitionResultList {
length: number;
item(index: number): SpeechRecognitionResult;
[index: number]: SpeechRecognitionResult;
}
export interface SpeechRecognitionResult {
isFinal: boolean;
length: number;
item(index: number): SpeechRecognitionAlternative;
[index: number]: SpeechRecognitionAlternative;
}
export interface SpeechRecognitionAlternative {
transcript: string;
confidence: number;
}
export interface SpeechRecognition extends EventTarget {
continuous: boolean;
interimResults: boolean;
lang: string;
start(): void;
stop(): void;
abort(): void;
onresult: ((event: SpeechRecognitionEvent) => void) | null;
onend: ((event: Event) => void) | null;
onerror: ((event: Event) => void) | null;
}
declare global {
interface Window {
SpeechRecognition: {
new (): SpeechRecognition;
};
webkitSpeechRecognition: {
new (): SpeechRecognition;
};
}
}
export enum AppState {
EDITING = 'EDITING',
READING = 'READING',
}