Debian Codegraph @

contrib/externs/w3c_speech.js

raw symbols SCIP
1 /*
2 * Copyright 2011 Closure Compiler Authors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /**
18 * @fileoverview Definitions for W3C's Speech Input 2010 draft API and the
19 * 2012 Web Speech draft API (in progress).
20 * 2010 Speech Input API:
21 * http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html
22 * 2012 Web Speech API:
23 * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
24 * This file contains only those functions/properties that are actively
25 * used in the Voice Search experiment. Because the draft is under discussion
26 * and constantly evolving, this file does not attempt to stay in sync with it.
27 *
28 * @externs
29 */
30
31 // W3C Speech Input API implemented in Chrome M12
32 /**
33 * @constructor
34 * @extends {UIEvent}
35 */
36 function SpeechInputEvent() {}
37
38 /** @type {SpeechInputResultList} */
39 SpeechInputEvent.prototype.results;
40
41
42 /**
43 * @constructor
44 */
45 function SpeechInputResultList() {}
46
47 /** @type {number} */
48 SpeechInputResultList.prototype.length;
49
50
51 /**
52 * @constructor
53 */
54 function SpeechInputResult() {}
55
56 /** @type {string} */
57 SpeechInputResult.prototype.utterance;
58
59 /** @type {number} */
60 SpeechInputResult.prototype.confidence;
61
62
63 // HTMLInputElement
64 /** @type {boolean} */
65 HTMLInputElement.prototype.webkitspeech;
66
67 /** @type {?function (Event)} */
68 HTMLInputElement.prototype.onwebkitspeechchange;
69
70
71
72 // W3C Web Speech API implemented in Chrome M23
73 /**
74 * @constructor
75 */
76 function webkitSpeechGrammar() {}
77
78 /** @type {string} */
79 webkitSpeechGrammar.prototype.src;
80
81 /** @type {number} */
82 webkitSpeechGrammar.prototype.weight;
83
84
85 /**
86 * @constructor
87 */
88 function webkitSpeechGrammarList() {}
89
90 /** @type {number} */
91 webkitSpeechGrammarList.prototype.length;
92
93
94 /**
95 * @constructor
96 */
97 function SpeechRecognitionAlternative() {}
98
99 /** @type {string} */
100 SpeechRecognitionAlternative.prototype.transcript;
101
102 /** @type {number} */
103 SpeechRecognitionAlternative.prototype.confidence;
104
105
106 /**
107 * @constructor
108 */
109 function SpeechRecognitionResult() {}
110
111 /** @type {boolean} */
112 SpeechRecognitionResult.prototype.isFinal;
113
114 /** @type {number} */
115 SpeechRecognitionResult.prototype.length;
116
117 /** @type {Document} */
118 SpeechRecognitionResult.prototype.emma;
119
120 /** @type {function(number): SpeechRecognitionAlternative} */
121 SpeechRecognitionResult.prototype.item = function(index) {};
122
123
124 /**
125 * @constructor
126 */
127 function SpeechRecognitionResultList() {}
128
129 /** @type {number} */
130 SpeechRecognitionResultList.prototype.length;
131
132 /** @type {function(number): SpeechRecognitionResult} */
133 SpeechRecognitionResultList.prototype.item = function(index) {};
134
135
136 /**
137 * @constructor
138 * @extends {Event}
139 */
140 function webkitSpeechRecognitionEvent() {}
141
142 /** @type {SpeechRecognitionResult} */
143 webkitSpeechRecognitionEvent.prototype.results;
144
145 /** @type {number} */
146 webkitSpeechRecognitionEvent.prototype.resultIndex;
147
148 /** @type {SpeechRecognitionResultList} */
149 webkitSpeechRecognitionEvent.prototype.resultHistory;
150
151
152 /**
153 * @constructor
154 */
155 function webkitSpeechRecognitionError() {}
156
157 /** @type {number} */
158 webkitSpeechRecognitionError.prototype.code;
159
160 /** @type {number} */
161 webkitSpeechRecognitionError.prototype.OTHER;
162
163 /** @type {number} */
164 webkitSpeechRecognitionError.prototype.NO_SPEECH;
165
166 /** @type {number} */
167 webkitSpeechRecognitionError.prototype.ABORTED;
168
169 /** @type {number} */
170 webkitSpeechRecognitionError.prototype.AUDIO_CAPTURE;
171
172 /** @type {number} */
173 webkitSpeechRecognitionError.prototype.NETWORK;
174
175 /** @type {number} */
176 webkitSpeechRecognitionError.prototype.NOT_ALLOWED;
177
178 /** @type {number} */
179 webkitSpeechRecognitionError.prototype.SERVICE_NOT_ALLOWED;
180
181 /** @type {number} */
182 webkitSpeechRecognitionError.prototype.BAD_GRAMMAR;
183
184 /** @type {number} */
185 webkitSpeechRecognitionError.prototype.LANGUAGE_NOT_SUPPORTED;
186
187 /** @type {string} */
188 webkitSpeechRecognitionError.prototype.message;
189
190 /** @type {string} */
191 webkitSpeechRecognitionError.prototype.error;
192
193 /**
194 * @constructor
195 */
196 function webkitSpeechRecognition() {}
197
198 /** @type {webkitSpeechGrammarList} */
199 webkitSpeechRecognition.prototype.grammars;
200
201 /** @type {string} */
202 webkitSpeechRecognition.prototype.lang;
203
204 /** @type {boolean} */
205 webkitSpeechRecognition.prototype.continuous;
206
207 /** @type {boolean} */
208 webkitSpeechRecognition.prototype.interimResults;
209
210 /** @type {number} */
211 webkitSpeechRecognition.prototype.maxAlternatives;
212
213 /** @type {function(): undefined} */
214 webkitSpeechRecognition.prototype.start;
215
216 /** @type {function(): undefined} */
217 webkitSpeechRecognition.prototype.stop;
218
219 /** @type {function(): undefined} */
220 webkitSpeechRecognition.prototype.abort;
221
222 /** @type {function(Event): (boolean|undefined)} */
223 webkitSpeechRecognition.prototype.onaudiostart;
224
225 /** @type {function(Event): (boolean|undefined)} */
226 webkitSpeechRecognition.prototype.onsoundstart;
227
228 /** @type {function(Event): (boolean|undefined)} */
229 webkitSpeechRecognition.prototype.onspeechstart;
230
231 /** @type {function(Event): (boolean|undefined)} */
232 webkitSpeechRecognition.prototype.onaudioend;
233
234 /** @type {function(Event): (boolean|undefined)} */
235 webkitSpeechRecognition.prototype.onsoundend;
236
237 /** @type {function(Event): (boolean|undefined)} */
238 webkitSpeechRecognition.prototype.onspeechend;
239
240 /** @type {function(Event): (boolean|undefined)} */
241 webkitSpeechRecognition.prototype.onend;
242
243 /** @type {function(Event): (boolean|undefined)} */
244 webkitSpeechRecognition.prototype.onstart;
245
246 /** @type {function(webkitSpeechRecognitionEvent): (boolean|undefined)} */
247 webkitSpeechRecognition.prototype.onnomatch;
248
249 /** @type {function(webkitSpeechRecognitionEvent): (boolean|undefined)} */
250 webkitSpeechRecognition.prototype.onresult;
251
252 /** @type {function(webkitSpeechRecognitionError): (boolean|undefined)} */
253 webkitSpeechRecognition.prototype.onerror;
254