Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / closure_compiler / externs / chrome_extensions.js
1 /*
2  * Copyright 2009 The 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 the Chromium extensions API.
19  *
20  * This is the externs file for the Chrome Extensions API.
21  * See http://developer.chrome.com/extensions/
22  *
23  * There are several problematic issues regarding Chrome extension APIs and
24  * this externs files, including:
25  * A. When to add packages to this file
26  * B. Optional parameters
27  * C. Pseudo-types
28  * D. Events
29  * E. Nullability
30  * F. Private APIs
31  * G. Enums
32  *
33  * The best practices for each are described in more detail below.  It
34  * should be noted that, due to historical reasons, and the evolutionary
35  * nature of this file, much this file currently violates the best practices
36  * described below. As changed are made, the changes should adhere to the
37  * best practices.
38  *
39  * A. When to Add Packages to this File?
40  * Packages in chrome.experimental.* should *not* be added to this file. The
41  * experimental APIs change very quickly, so rather than add them here, make a
42  * separate externs file for your project, then move the API here when it moves
43  * out of experimental.
44  *
45  * Some non-experimental APIs are still evolving or are not full documented. It
46  * is still advantageous to include these in this file as doing so avoids a
47  * proliferation of project-private externs files containing duplicated info. In
48  * these cases, use comments to describe the situation.
49  *
50  * B. Optional Parameters
51  * The Chrome extension APIs make extensive use of optional parameters that
52  * are not at the end of the parameter list, "interior optional parameters",
53  * while the JS Compiler's type system requires optional parameters to be
54  * at the end. This creates a bit of tension:
55  *
56  * 1. If a method has N required params, then the parameter declarations
57  *    should have N required params.
58  * 2. If, due to interior optional params, a parameter can be of more than
59  *    one type, its at-param should:
60  *    a. be named to indicate both possibilities, eg, extensionIdOrRequest,
61  *       or getInfoOrCallback.
62  *    b. the type should include both types, in the same order as the parts
63  *       of the name, even when one type subsumes the other, eg, {string|*}
64  *       or {Object|function(string)}.
65  * See chrome.runtime.sendMessage for a complex example as sendMessage
66  * takes three params with the first and third being optional.
67  *
68  * C. Pseudo-types
69  * The Chrome APIs define many types are that actually pseudo-types, that
70  * is, they can't be instantiated by name. The extension APIs also pass
71  * untyped objects (a bag of properties) to callbacks.
72  *
73  * The Chrome extension APIs include at least three different situations:
74  *
75  * 1. an object that must be created by an extension developer and passed
76  *    into a Chrome extension API and for which there is no constructor.
77  * 2. an instance of a type that is created inside the extension libraries
78  *    and passed out to a callback/listener or returned by an extension API
79  *    (the constructor implicity lives within the library).
80  * 3. like #2, but a bag-of-properties object that is passed out to a
81  *    callback/listener or returned by an extension API so there is no
82  *    defined type.
83  *
84  * For #1, use a typedef so object literals and objects created via goog.object
85  * are acceptable, for example, the Permissions type defined at
86  * http://developer.chrome.com/extensions/permissions.html#type-Permissions
87  * should be:
88  *
89  *   / **
90  *     * at-typedef {?{
91  *     *   permissions: (!Array.<string>|undefined),
92  *     *   origins: (!Array.<string>|undefined)
93  *     * }}
94  *     * /
95  *   chrome.permissions.Permissions;
96  *
97  * Using typedefs provides type-safety for the fields that are defined in
98  * the object literal and also defined in the typedef. Note that typedefs define
99  * a minimal interface and will not complain about extraneous (often
100  * misspelled) fields.
101  *
102  * Also, typedefs of record types are non-nullable by default. The "{?{"
103  * creates a nullable record-type typedef so ! has the same meaning in usages
104  * as it does for real types.
105  *
106  * For #2, use a standard constructor, even though no constructor is provided
107  * and extension writers will never instantiate an instance, as using a first
108  * class type provides the strongest type checking. For example, see the Port
109  * type defined at http://developer.chrome.com/apps/runtime.html#type-Port.
110  * Always qualify the type name to reduce top-level pollution in this file:
111  *
112  *   Do:
113  *        chrome.extension.Port = function() {}
114  *   Don't:
115  *        function Port() {}
116  *
117  * Note that, unfortunately, the actual Port class definition in this file
118  * does not follow this recommendation.
119  *
120  * For #3, use {!Object}, that is, a bag of properites. This is a sad reality
121  * given that the Chrome extensions do not document a real type. It is tempting
122  * to define a real-type within this file and treat this situation as identical
123  * to #2, but that means a new type is being defined in this file and developers
124  * do not expect to find required new types in extension files.
125  *
126  * If a real type is declared here, then developers will need to incorporate
127  * that type into the signature of their callback method and there will be
128  * no indication from the docs that they need to do so.
129  *
130  * D. Events
131  * Most packages define a set of events with the standard set of methods:
132  * addListener, removeListener, hasListener and hasListeners.  ChromeEvent
133  * is the appropriate type when an event's listeners do not take any
134  * parameters, however, many events take parameters specific to that event:
135  *
136  * 1. Create a pseudo-type for the event, for example,
137  *    chrome.runtime.PortEvent and define the four methods on it.
138  * 2. Fully describe the listener/callback's signature, for example,
139  *
140  *       * at-param {function(!chrome.runtime.Port): void} callback Callback.
141  *      chrome.runtime.PortEvent.prototype.addListener =
142  *          function(callback) {};
143  *    or
144  *
145  *       * at-param {function(*, !chrome.runtime.MessageSender,
146  *       *     function(*): void): (boolean|undefined)} callback Callback.
147  *      chrome.runtime.MessageSenderEvent.prototype.addListener =
148  *          function(callback) {};
149  *
150  * E. Nullability
151  * We treat the Chrome Extension API pages as "the truth".  Not-null types
152  * should be used in the following situations:
153  *
154  * 1. Parameters and return values that are not explicitly declared to handle
155  *    null.
156  * 2. Static event instances, for example, chrome.runtime.onConnect's type
157  *    should be: !chrome.runtime.PortEvent.
158  * 3. Optional params as there is little value to passing null when the
159  *    parameter can be omitted, of course, if null is explicitly declared
160  *    to be meaningful, then a nullable type should be used.
161  *
162  * F. Private APIs
163  * Private Chrome APIs (such as those that end in "Private") should go at the
164  * bottom of this file.
165  *
166  * G. Enums
167  * The Chrome extension APIs define many enums that define a set of acceptable
168  * strings, however, they do not reify those enum types, therefore, enum
169  * parameters should be defined as {@code string}.
170  *
171  * @externs
172  *
173  */
174
175
176 /**
177  * TODO(tbreisacher): Move all chrome.app.* externs into their own file.
178  * @const
179  */
180 chrome.app = {};
181
182
183 /**
184  * @const
185  * @see http://developer.chrome.com/apps/app.runtime.html
186  */
187 chrome.app.runtime = {};
188
189
190
191 /**
192  * @constructor
193  * @see http://developer.chrome.com/apps/app_runtime.html
194  */
195 chrome.app.runtime.LaunchItem = function() {};
196
197
198 /** @type {!FileEntry} */
199 chrome.app.runtime.LaunchItem.prototype.entry;
200
201
202 /** @type {string} */
203 chrome.app.runtime.LaunchItem.prototype.type;
204
205
206
207 /**
208  * @constructor
209  * @see http://developer.chrome.com/apps/app_runtime.html
210  */
211 chrome.app.runtime.LaunchData = function() {};
212
213
214 /** @type {string|undefined} */
215 chrome.app.runtime.LaunchData.prototype.id;
216
217
218 /** @type {!Array.<!chrome.app.runtime.LaunchItem>|undefined} */
219 chrome.app.runtime.LaunchData.prototype.items;
220
221
222 /** @type {string|undefined} */
223 chrome.app.runtime.LaunchData.prototype.url;
224
225
226 /** @type {string|undefined} */
227 chrome.app.runtime.LaunchData.prototype.referrerUrl;
228
229
230 /** @type {boolean|undefined} */
231 chrome.app.runtime.LaunchData.prototype.isKioskSession;
232
233
234
235 /**
236  * The type of chrome.app.runtime.onLaunched.
237  * @constructor
238  */
239 chrome.app.runtime.LaunchEvent = function() {};
240
241
242 /**
243  * @param {function(!chrome.app.runtime.LaunchData)} callback
244  * @see http://developer.chrome.com/apps/app.runtime.html#event-onLaunched
245  */
246 chrome.app.runtime.LaunchEvent.prototype.addListener = function(callback) {};
247
248
249 /**
250  * @param {function(!chrome.app.runtime.LaunchData)} callback
251  */
252 chrome.app.runtime.LaunchEvent.prototype.removeListener = function(callback) {};
253
254
255 /**
256  * @param {function(!chrome.app.runtime.LaunchData)} callback
257  * @return {boolean}
258  */
259 chrome.app.runtime.LaunchEvent.prototype.hasListener = function(callback) {};
260
261
262 /**
263  * @return {boolean}
264  */
265 chrome.app.runtime.LaunchEvent.prototype.hasListeners = function() {};
266
267
268 /** @type {!chrome.app.runtime.LaunchEvent} */
269 chrome.app.runtime.onLaunched;
270
271
272 /**
273  * @type {!ChromeEvent}
274  * @see http://developer.chrome.com/apps/app.runtime.html#event-onRestarted
275  */
276 chrome.app.runtime.onRestarted;
277
278
279 /**
280  * @const
281  * @see http://developer.chrome.com/apps/app.window.html
282  */
283 chrome.app.window = {};
284
285
286 /**
287  * @see https://developer.chrome.com/apps/app_window#method-getAll
288  * @return {!Array.<!chrome.app.window.AppWindow>}
289  */
290 chrome.app.window.getAll = function() {};
291
292
293 /**
294  * @see https://developer.chrome.com/apps/app_window#method-get
295  * @param {string} id
296  * @return {chrome.app.window.AppWindow}
297  */
298 chrome.app.window.get = function(id) {};
299
300
301
302 /**
303  * @constructor
304  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
305  */
306 chrome.app.window.AppWindow = function() {};
307
308
309 /**
310  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
311  */
312 chrome.app.window.AppWindow.prototype.focus = function() {};
313
314
315 /**
316  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
317  */
318 chrome.app.window.AppWindow.prototype.fullscreen = function() {};
319
320
321 /**
322  * @return {boolean}
323  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
324  */
325 chrome.app.window.AppWindow.prototype.isFullscreen = function() {};
326
327
328 /**
329  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
330  */
331 chrome.app.window.AppWindow.prototype.minimize = function() {};
332
333
334 /**
335  * @return {boolean}
336  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
337  */
338 chrome.app.window.AppWindow.prototype.isMinimized = function() {};
339
340
341 /**
342  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
343  */
344 chrome.app.window.AppWindow.prototype.maximize = function() {};
345
346
347 /**
348  * @return {boolean}
349  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
350  */
351 chrome.app.window.AppWindow.prototype.isMaximized = function() {};
352
353
354 /**
355  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
356  */
357 chrome.app.window.AppWindow.prototype.restore = function() {};
358
359
360 /**
361  * @param {number} left The new left position, in pixels.
362  * @param {number} top The new top position, in pixels.
363  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
364  */
365 chrome.app.window.AppWindow.prototype.moveTo = function(left, top) {};
366
367
368 /**
369  * @param {number} width The new width, in pixels.
370  * @param {number} height The new height, in pixels.
371  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
372  */
373 chrome.app.window.AppWindow.prototype.resizeTo = function(width, height) {};
374
375
376 /**
377  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
378  */
379 chrome.app.window.AppWindow.prototype.drawAttention = function() {};
380
381
382 /**
383  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
384  */
385 chrome.app.window.AppWindow.prototype.clearAttention = function() {};
386
387
388 /**
389  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
390  */
391 chrome.app.window.AppWindow.prototype.close = function() {};
392
393
394 /**
395  * @param {boolean=} opt_focus Should the window be focused? Defaults to true.
396  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
397  */
398 chrome.app.window.AppWindow.prototype.show = function(opt_focus) {};
399
400
401 /**
402  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
403  */
404 chrome.app.window.AppWindow.prototype.hide = function() {};
405
406
407 /**
408  * @return {!chrome.app.window.Bounds} The current window bounds.
409  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
410  */
411 chrome.app.window.AppWindow.prototype.getBounds = function() {};
412
413
414 /**
415  * @param {!chrome.app.window.Bounds} bounds The new window bounds.
416  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
417  */
418 chrome.app.window.AppWindow.prototype.setBounds = function(bounds) {};
419
420
421 /**
422  * @return {boolean}
423  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
424  */
425 chrome.app.window.AppWindow.prototype.isAlwaysOnTop = function() {};
426
427
428 /**
429  * @param {boolean} alwaysOnTop Set whether the window should stay above most
430  *     other windows.
431  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
432  */
433 chrome.app.window.AppWindow.prototype.setAlwaysOnTop = function(alwaysOnTop) {};
434
435
436 /** @type {!ChromeEvent} */
437 chrome.app.window.AppWindow.prototype.onBoundsChanged;
438
439
440 /** @type {!ChromeEvent} */
441 chrome.app.window.AppWindow.prototype.onClosed;
442
443
444 /** @type {!ChromeEvent} */
445 chrome.app.window.AppWindow.prototype.onFullscreened;
446
447
448 /** @type {!ChromeEvent} */
449 chrome.app.window.AppWindow.prototype.onMinimized;
450
451
452 /** @type {!ChromeEvent} */
453 chrome.app.window.AppWindow.prototype.onMaximized;
454
455
456 /** @type {!ChromeEvent} */
457 chrome.app.window.AppWindow.prototype.onRestored;
458
459
460 /** @type {!Window} */
461 chrome.app.window.AppWindow.prototype.contentWindow;
462
463
464 /**
465  * @typedef {{
466  *   left: (number|undefined),
467  *   top: (number|undefined),
468  *   width: (number|undefined),
469  *   height: (number|undefined)
470  * }}
471  * @see http://developer.chrome.com/apps/app.window.html#type-Bounds
472  */
473 chrome.app.window.Bounds;
474
475
476 /**
477  * @typedef {{
478  *   id: (string|undefined),
479  *   minWidth: (number|undefined),
480  *   minHeight: (number|undefined),
481  *   maxWidth: (number|undefined),
482  *   maxHeight: (number|undefined),
483  *   frame: (string|undefined),
484  *   bounds: (!chrome.app.window.Bounds|undefined),
485  *   transparentBackground: (boolean|undefined),
486  *   state: (string|undefined),
487  *   hidden: (boolean|undefined),
488  *   resizable: (boolean|undefined),
489  *   alwaysOnTop: (boolean|undefined),
490  *   focused: (boolean|undefined)
491  * }}
492  * @see http://developer.chrome.com/apps/app.window.html#method-create
493  */
494 chrome.app.window.CreateWindowOptions;
495
496
497 /**
498  * @param {string} url URL to create.
499  * @param {!chrome.app.window.CreateWindowOptions=} opt_options The options for
500  *     the new window.
501  * @param {function(!chrome.app.window.AppWindow)=} opt_createWindowCallback
502  *     Callback to be run.
503  * @see http://developer.chrome.com/apps/app.window.html#method-create
504  */
505 chrome.app.window.create = function(
506     url, opt_options, opt_createWindowCallback) {};
507
508
509 /**
510  * Returns an AppWindow object for the current script context (ie JavaScript
511  * 'window' object).
512  * @return {!chrome.app.window.AppWindow}
513  * @see http://developer.chrome.com/apps/app.window.html#method-current
514  */
515 chrome.app.window.current = function() {};
516
517
518 /**
519  * @type {!ChromeEvent}
520  * @see http://developer.chrome.com/apps/app.window.html#event-onBoundsChanged
521  */
522 chrome.app.window.onBoundsChanged;
523
524
525 /**
526  * @type {!ChromeEvent}
527  * @see http://developer.chrome.com/apps/app.window.html#event-onClosed
528  */
529 chrome.app.window.onClosed;
530
531
532 /**
533  * @type {!ChromeEvent}
534  * @see http://developer.chrome.com/apps/app.window.html#event-onFullscreened
535  */
536 chrome.app.window.onFullscreened;
537
538
539 /**
540  * @type {!ChromeEvent}
541  * @see http://developer.chrome.com/apps/app.window.html#event-onMaximized
542  */
543 chrome.app.window.onMaximized;
544
545
546 /**
547  * @type {!ChromeEvent}
548  * @see http://developer.chrome.com/apps/app.window.html#event-onMinimized
549  */
550 chrome.app.window.onMinimized;
551
552
553 /**
554  * @type {!ChromeEvent}
555  * @see http://developer.chrome.com/apps/app.window.html#event-onRestored
556  */
557 chrome.app.window.onRestored;
558
559
560 /**
561  * @const
562  * @see https://developer.chrome.com/apps/bluetooth
563  */
564 chrome.bluetooth = function() {};
565
566
567
568 /**
569  * @constructor
570  * @see https://developer.chrome.com/apps/bluetooth#type-AdapterState
571  */
572 chrome.bluetooth.AdapterState = function() {};
573
574
575 /** @type {string} */
576 chrome.bluetooth.AdapterState.prototype.address;
577
578
579 /** @type {string} */
580 chrome.bluetooth.AdapterState.prototype.name;
581
582
583 /** @type {boolean} */
584 chrome.bluetooth.AdapterState.prototype.powered;
585
586
587 /** @type {boolean} */
588 chrome.bluetooth.AdapterState.prototype.available;
589
590
591 /** @type {boolean} */
592 chrome.bluetooth.AdapterState.prototype.discovering;
593
594
595
596 /**
597  * @constructor
598  * @see https://developer.chrome.com/apps/bluetooth#type-Device
599  */
600 chrome.bluetooth.Device = function() {};
601
602
603 /** @type {string} */
604 chrome.bluetooth.Device.prototype.address;
605
606
607 /** @type {string|undefined} */
608 chrome.bluetooth.Device.prototype.name;
609
610
611 /** @type {number|undefined} */
612 chrome.bluetooth.Device.prototype.deviceClass;
613
614
615 /** @type {string|undefined} */
616 chrome.bluetooth.Device.prototype.vendorIdSource;
617
618
619 /** @type {string|undefined} */
620 chrome.bluetooth.Device.prototype.vendorId;
621
622
623 /** @type {number|undefined} */
624 chrome.bluetooth.Device.prototype.productId;
625
626
627 /** @type {number|undefined} */
628 chrome.bluetooth.Device.prototype.deviceId;
629
630
631 /** @type {string|undefined} */
632 chrome.bluetooth.Device.prototype.type;
633
634
635 /** @type {boolean|undefined} */
636 chrome.bluetooth.Device.prototype.paired;
637
638
639 /** @type {boolean|undefined} */
640 chrome.bluetooth.Device.prototype.connected;
641
642
643 /** @type {!Array.<string>|undefined} */
644 chrome.bluetooth.Device.prototype.uuids;
645
646
647 /**
648  * @param {function(!chrome.bluetooth.AdapterState)} callback
649  * @see https://developer.chrome.com/apps/bluetooth#method-getAdapterState
650  */
651 chrome.bluetooth.getAdapterState = function(callback) {};
652
653
654 /**
655  * @param {string} deviceAddress
656  * @param {function(!chrome.bluetooth.Device)} callback
657  * @see https://developer.chrome.com/apps/bluetooth#method-getDevice
658  */
659 chrome.bluetooth.getDevice = function(deviceAddress, callback) {};
660
661
662 /**
663  * @param {function(!Array.<!chrome.bluetooth.Device>)} callback
664  * @see https://developer.chrome.com/apps/bluetooth#method-getDevices
665  */
666 chrome.bluetooth.getDevices = function(callback) {};
667
668
669 /**
670  * @param {function()=} opt_callback
671  * @see https://developer.chrome.com/apps/bluetooth#method-startDiscovery
672  */
673 chrome.bluetooth.startDiscovery = function(opt_callback) {};
674
675
676 /**
677  * @param {function()=} opt_callback
678  * @see https://developer.chrome.com/apps/bluetooth#method-stopDiscovery
679  */
680 chrome.bluetooth.stopDiscovery = function(opt_callback) {};
681
682
683
684 /**
685  * Event whose listeners take an AdapaterState parameter.
686  * @constructor
687  */
688 chrome.bluetooth.AdapterStateEvent = function() {};
689
690
691 /** @param {function(!chrome.bluetooth.AdapterState): void} callback */
692 chrome.bluetooth.AdapterStateEvent.prototype.addListener =
693     function(callback) {};
694
695
696 /** @param {function(!chrome.bluetooth.AdapterState): void} callback */
697 chrome.bluetooth.AdapterStateEvent.prototype.removeListener =
698     function(callback) {};
699
700
701 /**
702  * @param {function(!chrome.bluetooth.AdapterState): void} callback
703  * @return {boolean}
704  */
705 chrome.bluetooth.AdapterStateEvent.prototype.hasListener =
706     function(callback) {};
707
708
709 /** @return {boolean} */
710 chrome.bluetooth.AdapterStateEvent.prototype.hasListeners = function() {};
711
712
713 /**
714  * @type {!chrome.bluetooth.AdapterStateEvent}
715  * @see https://developer.chrome.com/apps/bluetooth#event-onAdapterStateChanged
716  */
717 chrome.bluetooth.onAdapterStateChanged;
718
719
720
721 /**
722  * Event whose listeners take an Device parameter.
723  * @constructor
724  */
725 chrome.bluetooth.DeviceEvent = function() {};
726
727
728 /** @param {function(!chrome.bluetooth.Device): void} callback */
729 chrome.bluetooth.DeviceEvent.prototype.addListener = function(callback) {};
730
731
732 /** @param {function(!chrome.bluetooth.Device): void} callback */
733 chrome.bluetooth.DeviceEvent.prototype.removeListener = function(callback) {};
734
735
736 /**
737  * @param {function(!chrome.bluetooth.Device): void} callback
738  * @return {boolean}
739  */
740 chrome.bluetooth.DeviceEvent.prototype.hasListener = function(callback) {};
741
742
743 /** @return {boolean} */
744 chrome.bluetooth.DeviceEvent.prototype.hasListeners = function() {};
745
746
747 /**
748  * @type {!chrome.bluetooth.DeviceEvent}
749  * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceAdded
750  */
751 chrome.bluetooth.onDeviceAdded;
752
753
754 /**
755  * @type {!chrome.bluetooth.DeviceEvent}
756  * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceChanged
757  */
758 chrome.bluetooth.onDeviceChanged;
759
760
761 /**
762  * @type {!chrome.bluetooth.DeviceEvent}
763  * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceRemoved
764  */
765 chrome.bluetooth.onDeviceRemoved;
766
767
768 /**
769  * @const
770  * @see https://developer.chrome.com/apps/bluetoothSocket
771  */
772 chrome.bluetoothSocket = {};
773
774
775 /**
776  * @typedef {{
777  *   persistent: (boolean|undefined),
778  *   name: (string|undefined),
779  *   bufferSize: (number|undefined)
780  * }}
781  * @see https://developer.chrome.com/apps/bluetoothSocket#type-SocketProperties
782  */
783 chrome.bluetoothSocket.SocketProperties;
784
785
786 /**
787  * @typedef {{
788  *   channel: (number|undefined),
789  *   psm: (number|undefined),
790  *   backlog: (number|undefined)
791  * }}
792  * @see https://developer.chrome.com/apps/bluetoothSocket#type-ListenOptions
793  */
794 chrome.bluetoothSocket.ListenOptions;
795
796
797
798 /**
799  * @constructor
800  * @see https://developer.chrome.com/apps/bluetoothSocket#type-SocketInfo
801  */
802 chrome.bluetoothSocket.SocketInfo = function() {};
803
804
805 /** @type {number} */
806 chrome.bluetoothSocket.SocketInfo.prototype.socketId;
807
808
809 /** @type {boolean} */
810 chrome.bluetoothSocket.SocketInfo.prototype.persistent;
811
812
813 /** @type {string|undefined} */
814 chrome.bluetoothSocket.SocketInfo.prototype.name;
815
816
817 /** @type {number|undefined} */
818 chrome.bluetoothSocket.SocketInfo.prototype.bufferSize;
819
820
821 /** @type {boolean} */
822 chrome.bluetoothSocket.SocketInfo.prototype.paused;
823
824
825 /** @type {boolean} */
826 chrome.bluetoothSocket.SocketInfo.prototype.connected;
827
828
829 /** @type {string|undefined} */
830 chrome.bluetoothSocket.SocketInfo.prototype.address;
831
832
833 /** @type {string|undefined} */
834 chrome.bluetoothSocket.SocketInfo.prototype.uuid;
835
836
837 /**
838  * @param {!chrome.bluetoothSocket.SocketProperties|
839  *     function(!{socketId: number})} propertiesOrCallback
840  * @param {function(!{socketId: number})=} opt_callback
841  * @see https://developer.chrome.com/apps/bluetoothSocket#method-create
842  */
843 chrome.bluetoothSocket.create = function(propertiesOrCallback, opt_callback) {};
844
845
846 /**
847  * @param {number} socketId
848  * @param {!chrome.bluetoothSocket.SocketProperties} properties
849  * @param {function()=} opt_callback
850  * @see https://developer.chrome.com/apps/bluetoothSocket#method-update
851  */
852 chrome.bluetoothSocket.update = function(socketId, properties, opt_callback) {};
853
854
855 /**
856  * @param {number} socketId
857  * @param {boolean} paused
858  * @param {function()=} opt_callback
859  * @see https://developer.chrome.com/apps/bluetoothSocket#method-setPaused
860  */
861 chrome.bluetoothSocket.setPaused = function(socketId, paused, opt_callback) {};
862
863
864 /**
865  * @param {number} socketId
866  * @param {string} uuid
867  * @param {!chrome.bluetoothSocket.ListenOptions|function()} optionsOrCallback
868  * @param {function()=} opt_callback
869  * @see https://developer.chrome.com/apps/bluetoothSocket#method-listenUsingRfcomm
870  */
871 chrome.bluetoothSocket.listenUsingRfcomm =
872     function(socketId, uuid, optionsOrCallback, opt_callback) {};
873
874
875 /**
876  * @param {number} socketId
877  * @param {string} uuid
878  * @param {!chrome.bluetoothSocket.ListenOptions|function()} optionsOrCallback
879  * @param {function()=} opt_callback
880  * @see https://developer.chrome.com/apps/bluetoothSocket#method-listenUsingL2cap
881  */
882 chrome.bluetoothSocket.listenUsingL2cap =
883     function(socketId, uuid, optionsOrCallback, opt_callback) {};
884
885
886 /**
887  * @param {number} socketId
888  * @param {string} address
889  * @param {string} uuid
890  * @param {function()} callback
891  * @see https://developer.chrome.com/apps/bluetoothSocket#method-connect
892  */
893 chrome.bluetoothSocket.connect = function(socketId, address, uuid, callback) {};
894
895
896 /**
897  * @param {number} socketId
898  * @param {function()=} opt_callback
899  * @see https://developer.chrome.com/apps/bluetoothSocket#method-disconnect
900  */
901 chrome.bluetoothSocket.disconnect = function(socketId, opt_callback) {};
902
903
904 /**
905  * @param {number} socketId
906  * @param {function()=} opt_callback
907  * @see https://developer.chrome.com/apps/bluetoothSocket#method-close
908  */
909 chrome.bluetoothSocket.close = function(socketId, opt_callback) {};
910
911
912 /**
913  * @param {number} socketId
914  * @param {!ArrayBuffer} data
915  * @param {function(number)=} opt_callback
916  * @see https://developer.chrome.com/apps/bluetoothSocket#method-send
917  */
918 chrome.bluetoothSocket.send = function(socketId, data, opt_callback) {};
919
920
921 /**
922  * @param {number} socketId
923  * @param {function(!chrome.bluetoothSocket.SocketInfo)} callback
924  * @see https://developer.chrome.com/apps/bluetoothSocket#method-getInfo
925  */
926 chrome.bluetoothSocket.getInfo = function(socketId, callback) {};
927
928
929 /**
930  * @param {function(!Array.<!chrome.bluetoothSocket.SocketInfo>)} callback
931  * @see https://developer.chrome.com/apps/bluetoothSocket#method-getSockets
932  */
933 chrome.bluetoothSocket.getSockets = function(callback) {};
934
935
936
937 /**
938  * @constructor
939  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onAccept
940  */
941 chrome.bluetoothSocket.AcceptEventData = function() {};
942
943
944 /** @type {number} */
945 chrome.bluetoothSocket.AcceptEventData.prototype.socketId;
946
947
948 /** @type {number} */
949 chrome.bluetoothSocket.AcceptEventData.prototype.clientSocketId;
950
951
952
953 /**
954  * Event whose listeners take a AcceptEventData parameter.
955  * @constructor
956  */
957 chrome.bluetoothSocket.AcceptEvent = function() {};
958
959
960 /**
961  * @param {function(!chrome.bluetoothSocket.AcceptEventData): void} callback
962  */
963 chrome.bluetoothSocket.AcceptEvent.prototype.addListener =
964     function(callback) {};
965
966
967 /**
968  * @param {function(!chrome.bluetoothSocket.AcceptEventData): void} callback
969  */
970 chrome.bluetoothSocket.AcceptEvent.prototype.removeListener =
971     function(callback) {};
972
973
974 /**
975  * @param {function(!chrome.bluetoothSocket.AcceptEventData): void} callback
976  * @return {boolean}
977  */
978 chrome.bluetoothSocket.AcceptEvent.prototype.hasListener =
979     function(callback) {};
980
981
982 /** @return {boolean} */
983 chrome.bluetoothSocket.AcceptEvent.prototype.hasListeners = function() {};
984
985
986 /** @type {!chrome.bluetoothSocket.AcceptEvent} */
987 chrome.bluetoothSocket.onAccept;
988
989
990
991 /**
992  * @constructor
993  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onAcceptError
994  */
995 chrome.bluetoothSocket.AcceptErrorEventData = function() {};
996
997
998 /** @type {number} */
999 chrome.bluetoothSocket.AcceptErrorEventData.prototype.socketId;
1000
1001
1002 /** @type {string} */
1003 chrome.bluetoothSocket.AcceptErrorEventData.prototype.errorMessage;
1004
1005
1006 /** @type {string} */
1007 chrome.bluetoothSocket.AcceptErrorEventData.prototype.error;
1008
1009
1010
1011 /**
1012  * Event whose listeners take a AcceptErrorEventData parameter.
1013  * @constructor
1014  */
1015 chrome.bluetoothSocket.AcceptErrorEvent = function() {};
1016
1017
1018 /**
1019  * @param {function(
1020  *     !chrome.bluetoothSocket.AcceptErrorEventData): void} callback
1021  */
1022 chrome.bluetoothSocket.AcceptErrorEvent.prototype.addListener =
1023     function(callback) {};
1024
1025
1026 /**
1027  * @param {function(
1028  *     !chrome.bluetoothSocket.AcceptErrorEventData): void} callback
1029  */
1030 chrome.bluetoothSocket.AcceptErrorEvent.prototype.removeListener =
1031     function(callback) {};
1032
1033
1034 /**
1035  * @param {function(
1036  *     !chrome.bluetoothSocket.AcceptErrorEventData): void} callback
1037  * @return {boolean}
1038  */
1039 chrome.bluetoothSocket.AcceptErrorEvent.prototype.hasListener =
1040     function(callback) {};
1041
1042
1043 /** @return {boolean} */
1044 chrome.bluetoothSocket.AcceptErrorEvent.prototype.hasListeners =
1045     function() {};
1046
1047
1048 /** @type {!chrome.bluetoothSocket.AcceptErrorEvent} */
1049 chrome.bluetoothSocket.onAcceptError;
1050
1051
1052
1053 /**
1054  * @constructor
1055  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onReceive
1056  */
1057 chrome.bluetoothSocket.ReceiveEventData = function() {};
1058
1059
1060 /** @type {number} */
1061 chrome.bluetoothSocket.ReceiveEventData.prototype.socketId;
1062
1063
1064 /** @type {!ArrayBuffer} */
1065 chrome.bluetoothSocket.ReceiveEventData.prototype.data;
1066
1067
1068
1069 /**
1070  * Event whose listeners take a ReceiveEventData parameter.
1071  * @constructor
1072  */
1073 chrome.bluetoothSocket.ReceiveEvent = function() {};
1074
1075
1076 /**
1077  * @param {function(!chrome.bluetoothSocket.ReceiveEventData): void} callback
1078  */
1079 chrome.bluetoothSocket.ReceiveEvent.prototype.addListener =
1080     function(callback) {};
1081
1082
1083 /**
1084  * @param {function(!chrome.bluetoothSocket.ReceiveEventData): void} callback
1085  */
1086 chrome.bluetoothSocket.ReceiveEvent.prototype.removeListener =
1087     function(callback) {};
1088
1089
1090 /**
1091  * @param {function(!chrome.bluetoothSocket.ReceiveEventData): void} callback
1092  * @return {boolean}
1093  */
1094 chrome.bluetoothSocket.ReceiveEvent.prototype.hasListener =
1095     function(callback) {};
1096
1097
1098 /** @return {boolean} */
1099 chrome.bluetoothSocket.ReceiveEvent.prototype.hasListeners = function() {};
1100
1101
1102 /** @type {!chrome.bluetoothSocket.ReceiveEvent} */
1103 chrome.bluetoothSocket.onReceive;
1104
1105
1106
1107 /**
1108  * @constructor
1109  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onReceiveError
1110  */
1111 chrome.bluetoothSocket.ReceiveErrorEventData = function() {};
1112
1113
1114 /** @type {number} */
1115 chrome.bluetoothSocket.ReceiveErrorEventData.prototype.socketId;
1116
1117
1118 /** @type {string} */
1119 chrome.bluetoothSocket.ReceiveErrorEventData.prototype.errorMessage;
1120
1121
1122 /** @type {string} */
1123 chrome.bluetoothSocket.ReceiveErrorEventData.prototype.error;
1124
1125
1126
1127 /**
1128  * Event whose listeners take a ReceiveErrorEventData parameter.
1129  * @constructor
1130  */
1131 chrome.bluetoothSocket.ReceiveErrorEvent = function() {};
1132
1133
1134 /**
1135  * @param {function(
1136  *     !chrome.bluetoothSocket.ReceiveErrorEventData): void} callback
1137  */
1138 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.addListener =
1139     function(callback) {};
1140
1141
1142 /**
1143  * @param {function(
1144  *     !chrome.bluetoothSocket.ReceiveErrorEventData): void} callback
1145  */
1146 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.removeListener =
1147     function(callback) {};
1148
1149
1150 /**
1151  * @param {function(
1152  *     !chrome.bluetoothSocket.ReceiveErrorEventData): void} callback
1153  * @return {boolean}
1154  */
1155 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.hasListener =
1156     function(callback) {};
1157
1158
1159 /** @return {boolean} */
1160 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.hasListeners =
1161     function() {};
1162
1163
1164 /** @type {!chrome.bluetoothSocket.ReceiveErrorEvent} */
1165 chrome.bluetoothSocket.onReceiveError;
1166
1167
1168 /**
1169  * @see http://developer.chrome.com/extensions/commands.html
1170  * @const
1171  */
1172 chrome.commands = {};
1173
1174
1175 /**
1176  * @param {function(Array.<string>): void} callback Callback function.
1177  */
1178 chrome.commands.getAll = function(callback) {};
1179
1180
1181 /** @type {!ChromeEvent} */
1182 chrome.commands.onCommand;
1183
1184
1185 /**
1186  * @see https://developer.chrome.com/apps/copresence
1187  * @const
1188  */
1189 chrome.copresence = {};
1190
1191
1192 /**
1193  * @typedef {?{
1194  *   lowPower: (boolean|undefined),
1195  *   onlyBroadcast: (boolean|undefined),
1196  *   onlyScan: (boolean|undefined),
1197  *   audible: (boolean|undefined)
1198  * }}
1199  * @see https://developer.chrome.com/apps/copresence#type-Strategy
1200  */
1201 chrome.copresence.Strategy;
1202
1203
1204 /**
1205  * @typedef {?{
1206  *   type: string,
1207  *   payload: ArrayBuffer
1208  * }}
1209  * @see https://developer.chrome.com/apps/copresence#type-Message
1210  */
1211 chrome.copresence.Message;
1212
1213
1214 /**
1215  * @typedef {?{
1216  *   onlyEarshot: (boolean|undefined)
1217  * }}
1218  * https://developer.chrome.com/apps/copresence#type-AccessPolicy
1219  */
1220 chrome.copresence.AccessPolicy;
1221
1222
1223 /**
1224  * @typedef {?{
1225  *   id: string,
1226  *   message: !chrome.copresence.Message,
1227  *   timeToLiveMillis: (number|undefined),
1228  *   policy: (!chrome.copresence.AccessPolicy|undefined),
1229  *   strategies: (!chrome.copresence.Strategy|undefined)
1230  * }}
1231  * @see https://developer.chrome.com/apps/copresence#type-PublishOperation
1232  */
1233 chrome.copresence.PublishOperation;
1234
1235
1236 /** @typedef {?{type: string}} */
1237 chrome.copresence.SubscriptionFilter;
1238
1239
1240 /**
1241  * @typedef {?{
1242  *   id: string,
1243  *   filter: !chrome.copresence.SubscriptionFilter,
1244  *   timeToLiveMillis: (number|undefined),
1245  *   strategies: (!chrome.copresence.Strategy|undefined)
1246  * }}
1247  * @see https://developer.chrome.com/apps/copresence#type-SubscribeOperation
1248  */
1249 chrome.copresence.SubscribeOperation;
1250
1251
1252 /**
1253  * @typedef {?{
1254  *   unpublishId: string
1255  * }}
1256  * @see https://developer.chrome.com/apps/copresence#type-UnpublishOperation
1257  */
1258 chrome.copresence.UnpublishOperation;
1259
1260
1261 /**
1262  * @typedef {?{
1263  *   unsubscribeId: string
1264  * }}
1265  * @see https://developer.chrome.com/apps/copresence#type-UnsubscribeOperation
1266  */
1267 chrome.copresence.UnsubscribeOperation;
1268
1269
1270 /**
1271  * @typedef {?{
1272  *   publish: (!chrome.copresence.PublishOperation|undefined),
1273  *   subscribe: (!chrome.copresence.SubscribeOperation|undefined),
1274  *   unpublish: (!chrome.copresence.UnpublishOperation|undefined),
1275  *   unsubscribe: (!chrome.copresence.UnsubscribeOperation|undefined)
1276  * }}
1277  * @see https://developer.chrome.com/apps/copresence#type-Operation
1278  */
1279 chrome.copresence.Operation;
1280
1281
1282 /**
1283  * @param {!Array.<!chrome.copresence.Operation>} operations
1284  * @param {function(string): void} callback
1285  * @see https://developer.chrome.com/apps/copresence#method-execute
1286  */
1287 chrome.copresence.execute = function(operations, callback) {};
1288
1289
1290
1291 /**
1292  * Event whose listeners take a subscription id and received messages as a
1293  * parameter.
1294  * @constructor
1295  * @see https://developer.chrome.com/apps/copresence#event-onMessagesReceived
1296  */
1297 chrome.copresence.MessagesReceivedEvent = function() {};
1298
1299
1300 /**
1301  * @param {function(string, !Array.<!chrome.copresence.Message>): void} callback
1302  */
1303 chrome.copresence.MessagesReceivedEvent.prototype.addListener =
1304     function(callback) {};
1305
1306
1307 /**
1308  * @param {function(string, !Array.<!chrome.copresence.Message>): void} callback
1309  */
1310 chrome.copresence.MessagesReceivedEvent.prototype.removeListener =
1311     function(callback) {};
1312
1313
1314 /**
1315  * @param {function(string, !Array.<!chrome.copresence.Message>): void} callback
1316  * @return {boolean}
1317  */
1318 chrome.copresence.MessagesReceivedEvent.prototype.hasListener =
1319     function(callback) {};
1320
1321
1322 /** @return {boolean} */
1323 chrome.copresence.MessagesReceivedEvent.prototype.hasListeners = function() {};
1324
1325
1326 /**
1327  * @type {!chrome.copresence.MessagesReceivedEvent}
1328  * @see https://developer.chrome.com/apps/copresence#event-onMessagesReceived
1329  */
1330 chrome.copresence.onMessagesReceived;
1331
1332
1333 /**
1334  * @type {!ChromeStringEvent}
1335  * @see https://developer.chrome.com/apps/copresence#event-onStatusUpdated
1336  */
1337 chrome.copresence.onStatusUpdated;
1338
1339
1340 /**
1341  * @see https://developer.chrome.com/extensions/extension.html
1342  * @const
1343  */
1344 chrome.extension = {};
1345
1346
1347 /** @type {!Object|undefined} */
1348 chrome.extension.lastError = {};
1349
1350
1351 /**
1352  * @type {string|undefined}
1353  */
1354 chrome.extension.lastError.message;
1355
1356
1357 /** @type {boolean|undefined} */
1358 chrome.extension.inIncognitoContext;
1359
1360
1361 // TODO: change Object to !Object when it's clear nobody is passing in null
1362 // TODO: change Port to !Port since it should never be null
1363 /**
1364  * @param {string|Object.<string>=} opt_extensionIdOrConnectInfo Either the
1365  *     extensionId to connect to, in which case connectInfo params can be
1366  *     passed in the next optional argument, or the connectInfo params.
1367  * @param {Object.<string>=} opt_connectInfo The connectInfo object,
1368  *     if arg1 was the extensionId to connect to.
1369  * @return {Port} New port.
1370  */
1371 chrome.extension.connect = function(
1372     opt_extensionIdOrConnectInfo, opt_connectInfo) {};
1373
1374
1375 /**
1376  * @return {Window} The global JS object for the background page.
1377  */
1378 chrome.extension.getBackgroundPage = function() {};
1379
1380
1381 /**
1382  * @param {string} path A path to a resource within an extension expressed
1383  *     relative to it's install directory.
1384  * @return {string} The fully-qualified URL to the resource.
1385  */
1386 chrome.extension.getURL = function(path) {};
1387
1388
1389 /**
1390  * @param {Object=} opt_fetchProperties An object with optional 'type' and
1391  *     optional 'windowId' keys.
1392  * @return {Array.<Window>} The global JS objects for each content view.
1393  */
1394 chrome.extension.getViews = function(opt_fetchProperties) {};
1395
1396
1397 /**
1398  * @param {function(boolean): void} callback Callback function.
1399  */
1400 chrome.extension.isAllowedFileSchemeAccess = function(callback) {};
1401
1402
1403 /**
1404  * @param {function(boolean): void} callback Callback function.
1405  */
1406 chrome.extension.isAllowedIncognitoAccess = function(callback) {};
1407
1408
1409 /**
1410  * @param {string|*} extensionIdOrRequest Either the extensionId to send the
1411  *     request to, in which case the request is passed as the next arg, or the
1412  *     request.
1413  * @param {*=} opt_request The request value, if arg1 was the extensionId.
1414  * @param {function(*): void=} opt_callback The callback function which
1415  *     takes a JSON response object sent by the handler of the request.
1416  */
1417 chrome.extension.sendMessage = function(
1418     extensionIdOrRequest, opt_request, opt_callback) {};
1419
1420
1421 /**
1422  * @param {number|*=} opt_arg1 Either the extensionId to send the request to,
1423  *     in which case the request is passed as the next arg, or the request.
1424  * @param {*=} opt_request The request value, if arg1 was the extensionId.
1425  * @param {function(*): void=} opt_callback The callback function which
1426  *     takes a JSON response object sent by the handler of the request.
1427  */
1428 chrome.extension.sendRequest = function(opt_arg1, opt_request, opt_callback) {};
1429
1430
1431 /**
1432  * @param {string} data
1433  */
1434 chrome.extension.setUpdateUrlData = function(data) {};
1435
1436
1437 /** @type {!ChromeEvent} */
1438 chrome.extension.onConnect;
1439
1440
1441 /** @type {!ChromeEvent} */
1442 chrome.extension.onConnectExternal;
1443
1444
1445 /** @type {!ChromeEvent} */
1446 chrome.extension.onMessage;
1447
1448
1449 /** @type {!ChromeEvent} */
1450 chrome.extension.onRequest;
1451
1452
1453 /** @type {!ChromeEvent} */
1454 chrome.extension.onRequestExternal;
1455
1456
1457 /**
1458  * @see https://developer.chrome.com/extensions/runtime.html
1459  * @const
1460  */
1461 chrome.runtime = {};
1462
1463
1464 /** @type {!Object|undefined} */
1465 chrome.runtime.lastError = {};
1466
1467
1468 /**
1469  * @type {string|undefined}
1470  */
1471 chrome.runtime.lastError.message;
1472
1473
1474 /** @type {string} */
1475 chrome.runtime.id;
1476
1477
1478 /**
1479  * @param {function(!Window=): void} callback Callback function.
1480  */
1481 chrome.runtime.getBackgroundPage = function(callback) {};
1482
1483
1484
1485 /**
1486  * Manifest information returned from chrome.runtime.getManifest. See
1487  * http://developer.chrome.com/extensions/manifest.html. Note that there are
1488  * several other fields not included here. They should be added to these externs
1489  * as needed.
1490  * @constructor
1491  */
1492 chrome.runtime.Manifest = function() {};
1493
1494
1495 /** @type {string} */
1496 chrome.runtime.Manifest.prototype.name;
1497
1498
1499 /** @type {string} */
1500 chrome.runtime.Manifest.prototype.version;
1501
1502
1503 /** @type {number|undefined} */
1504 chrome.runtime.Manifest.prototype.manifest_version;
1505
1506
1507 /** @type {string|undefined} */
1508 chrome.runtime.Manifest.prototype.description;
1509
1510
1511 /** @type {!chrome.runtime.Manifest.Oauth2|undefined} */
1512 chrome.runtime.Manifest.prototype.oauth2;
1513
1514
1515 /** @type {!Array.<(string|!Object)>} */
1516 chrome.runtime.Manifest.prototype.permissions;
1517
1518
1519
1520 /**
1521  * Oauth2 info in the manifest.
1522  * See http://developer.chrome.com/apps/app_identity.html#update_manifest.
1523  * @constructor
1524  */
1525 chrome.runtime.Manifest.Oauth2 = function() {};
1526
1527
1528 /** @type {string} */
1529 chrome.runtime.Manifest.Oauth2.prototype.client_id;
1530
1531
1532 /**@type {!Array.<string>} */
1533 chrome.runtime.Manifest.Oauth2.prototype.scopes;
1534
1535
1536 /**
1537  * http://developer.chrome.com/extensions/runtime.html#method-getManifest
1538  * @return {!chrome.runtime.Manifest} The full manifest file of the app or
1539  *     extension.
1540  */
1541 chrome.runtime.getManifest = function() {};
1542
1543
1544 /**
1545  * @param {string} path A path to a resource within an extension expressed
1546  *     relative to it's install directory.
1547  * @return {string} The fully-qualified URL to the resource.
1548  */
1549 chrome.runtime.getURL = function(path) {};
1550
1551
1552 /**
1553  * @param {string} url This may be used to clean up server-side data, do
1554  *     analytics, and implement surveys. Maximum 255 characters.
1555  */
1556 chrome.runtime.setUninstallUrl = function(url) {};
1557
1558
1559 /**
1560  * Reloads the app or extension.
1561  */
1562 chrome.runtime.reload = function() {};
1563
1564
1565 /**
1566  * @param {function(string, !Object=): void} callback Called with "throttled",
1567  *     "no_update", or "update_available". If an update is available, the object
1568  *     contains more information about the available update.
1569  */
1570 chrome.runtime.requestUpdateCheck = function(callback) {};
1571
1572
1573 /**
1574  * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's
1575  * no-op.
1576  */
1577 chrome.runtime.restart = function() {};
1578
1579
1580 /**
1581  * @param {string|!Object.<string>=} opt_extensionIdOrConnectInfo Either the
1582  *     extensionId to connect to, in which case connectInfo params can be
1583  *     passed in the next optional argument, or the connectInfo params.
1584  * @param {!Object.<string>=} opt_connectInfo The connectInfo object,
1585  *     if arg1 was the extensionId to connect to.
1586  * @return {!Port} New port.
1587  */
1588 chrome.runtime.connect = function(
1589     opt_extensionIdOrConnectInfo, opt_connectInfo) {};
1590
1591
1592 /**
1593  * @see http://developer.chrome.com/extensions/runtime.html#method-connectNative
1594  * @param {string} application Name of the registered native messaging host to
1595  *     connect to, like 'com.google.your_product'.
1596  * @return {!Port} New port.
1597  */
1598 chrome.runtime.connectNative = function(application) {};
1599
1600
1601 /**
1602  * @param {string|*} extensionIdOrMessage Either the extensionId to send the
1603  *     message to, in which case the message is passed as the next arg, or the
1604  *     message itself.
1605  * @param {(*|Object|function(*): void)=} opt_messageOrOptsOrCallback
1606  *     One of:
1607  *     The message, if arg1 was the extensionId.
1608  *     The options for message sending, if arg1 was the message and this
1609  *     argument is not a function.
1610  *     The callback, if arg1 was the message and this argument is a function.
1611  * @param {(Object|function(*): void)=} opt_optsOrCallback
1612  *     Either the options for message sending, if arg2 was the message,
1613  *     or the callback.
1614  * @param {function(*): void=} opt_callback The callback function which
1615  *     takes a JSON response object sent by the handler of the request.
1616  */
1617 chrome.runtime.sendMessage = function(
1618     extensionIdOrMessage, opt_messageOrOptsOrCallback, opt_optsOrCallback,
1619     opt_callback) {};
1620
1621
1622 /**
1623  * @see http://developer.chrome.com/extensions/runtime.html#method-sendNativeMessage
1624  * @param {string} application Name of the registered native messaging host to
1625  *     connect to, like 'com.google.your_product'.
1626  * @param {Object} message The message that will be passed to the native
1627  *     messaging host.
1628  * @param {function(*)=} opt_callback Called with the response message sent by
1629  *     the native messaging host. If an error occurs while connecting to the
1630  *     native messaging host, the callback will be called with no arguments and
1631  *     chrome.runtime.lastError will be set to the error message.
1632  */
1633 chrome.runtime.sendNativeMessage = function(
1634     application, message, opt_callback) {};
1635
1636
1637 /**
1638  *
1639  * @param {function(!Object)} callback
1640  */
1641 chrome.runtime.getPlatformInfo = function(callback) {};
1642
1643
1644 /**
1645  * @param {function(!DirectoryEntry)} callback
1646  */
1647 chrome.runtime.getPackageDirectoryEntry = function(callback) {};
1648
1649
1650 /** @type {!chrome.runtime.PortEvent} */
1651 chrome.runtime.onConnect;
1652
1653
1654 /** @type {!chrome.runtime.PortEvent} */
1655 chrome.runtime.onConnectExternal;
1656
1657
1658 /** @type {!ChromeObjectEvent} */
1659 chrome.runtime.onInstalled;
1660
1661
1662 /** @type {!chrome.runtime.MessageSenderEvent} */
1663 chrome.runtime.onMessage;
1664
1665
1666 /** @type {!chrome.runtime.MessageSenderEvent} */
1667 chrome.runtime.onMessageExternal;
1668
1669
1670 /** @type {!ChromeEvent} */
1671 chrome.runtime.onStartup;
1672
1673
1674 /** @type {!ChromeEvent} */
1675 chrome.runtime.onSuspend;
1676
1677
1678 /** @type {!ChromeEvent} */
1679 chrome.runtime.onSuspendCanceled;
1680
1681
1682 /** @type {!ChromeObjectEvent} */
1683 chrome.runtime.onUpdateAvailable;
1684
1685
1686 /** @type {!ChromeStringEvent} */
1687 chrome.runtime.onRestartRequired;
1688
1689
1690
1691 /**
1692  * Event whose listeners take a Port parameter.
1693  * @constructor
1694  */
1695 chrome.runtime.PortEvent = function() {};
1696
1697
1698 /**
1699  * @param {function(!Port): void} callback Callback.
1700  */
1701 chrome.runtime.PortEvent.prototype.addListener = function(callback) {};
1702
1703
1704 /**
1705  * @param {function(!Port): void} callback Callback.
1706  */
1707 chrome.runtime.PortEvent.prototype.removeListener = function(callback) {};
1708
1709
1710 /**
1711  * @param {function(!Port): void} callback Callback.
1712  * @return {boolean}
1713  */
1714 chrome.runtime.PortEvent.prototype.hasListener = function(callback) {};
1715
1716
1717 /**
1718  * @return {boolean}
1719  */
1720 chrome.runtime.PortEvent.prototype.hasListeners = function() {};
1721
1722
1723
1724 /**
1725  * Event whose listeners take a MessageSender and additional parameters.
1726  * @see http://developer.chrome.com/dev/apps/runtime.html#event-onMessage
1727  * @constructor
1728  */
1729 chrome.runtime.MessageSenderEvent = function() {};
1730
1731
1732 /**
1733  * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
1734  *     callback Callback.
1735  */
1736 chrome.runtime.MessageSenderEvent.prototype.addListener = function(callback) {};
1737
1738
1739 /**
1740  * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
1741  *     callback Callback.
1742  */
1743 chrome.runtime.MessageSenderEvent.prototype.removeListener = function(callback)
1744     {};
1745
1746
1747 /**
1748  * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
1749  *     callback Callback.
1750  * @return {boolean}
1751  */
1752 chrome.runtime.MessageSenderEvent.prototype.hasListener = function(callback) {};
1753
1754
1755 /**
1756  * @return {boolean}
1757  */
1758 chrome.runtime.MessageSenderEvent.prototype.hasListeners = function() {};
1759
1760
1761 /**
1762  * @const
1763  * @see https://developer.chrome.com/extensions/tabs.html
1764  */
1765 chrome.tabs = {};
1766
1767
1768 /**
1769  * @typedef {?{
1770  *   code: (string|undefined),
1771  *   file: (string|undefined),
1772  *   allFrames: (boolean|undefined),
1773  *   matchAboutBlank: (boolean|undefined),
1774  *   runAt: (string|undefined)
1775  * }}
1776  */
1777 chrome.tabs.InjectDetails;
1778
1779
1780 /**
1781  * @see https://developer.chrome.com/extensions/tabs#method-captureVisibleTab
1782  * @param {number|!chrome.types.ImageDetails|function(string):void}
1783  *     windowIdOrOptionsOrCallback One of:
1784  *     The target window.
1785  *     An object defining details about the format and quality of an image, in
1786  *     which case the window defaults to the current window.
1787  *     A callback function which accepts the data URL string of a JPEG encoding
1788  *     of the visible area of the captured tab.
1789  * @param {(!chrome.types.ImageDetails|function(string):void)=}
1790  *     opt_optionsOrCallback Either an object defining details about the
1791  *     format and quality of an image, or a callback function which accepts the
1792  *     data URL string of a JPEG encoding of the visible area of the captured
1793  *     tab.
1794  * @param {function(string):void=} opt_callback A callback function which
1795  *     accepts the data URL string of a JPEG encoding of the visible area of the
1796  *     captured tab.
1797  */
1798 chrome.tabs.captureVisibleTab = function(windowIdOrOptionsOrCallback,
1799     opt_optionsOrCallback, opt_callback) {};
1800
1801
1802 /**
1803  * @param {number} tabId Tab Id.
1804  * @param {{name: (string|undefined)}=} connectInfo Info Object.
1805  */
1806 chrome.tabs.connect = function(tabId, connectInfo) {};
1807
1808
1809 /**
1810  * @typedef {?{
1811  *   windowId: (number|undefined),
1812  *   index: (number|undefined),
1813  *   url: (string|undefined),
1814  *   active: (boolean|undefined),
1815  *   pinned: (boolean|undefined),
1816  *   openerTabId: (number|undefined)
1817  * }}
1818  */
1819 chrome.tabs.CreateProperties;
1820
1821
1822 /**
1823  * @param {!chrome.tabs.CreateProperties} createProperties Info object.
1824  * @param {function(!Tab): void=} opt_callback The callback function.
1825  */
1826 chrome.tabs.create = function(createProperties, opt_callback) {};
1827
1828
1829 /**
1830  * @see https://developer.chrome.com/extensions/tabs#method-detectLanguage
1831  * @param {number|function(string): void} tabIdOrCallback The tab id, or a
1832  *     callback function that will be invoked with the language of the active
1833  *     tab in the current window.
1834  * @param {function(string): void=} opt_callback An optional callback function
1835  *     that will be invoked with the language of the tab specified as first
1836  *     argument.
1837  */
1838 chrome.tabs.detectLanguage = function(tabIdOrCallback, opt_callback) {};
1839
1840
1841 /**
1842  * @see https://developer.chrome.com/extensions/tabs#method-executeScript
1843  * @param {number|!chrome.tabs.InjectDetails} tabIdOrDetails
1844  *     Either the id of the tab in which to run the script, or an object
1845  *     containing the details of the script to run, in which case the script
1846  *     will be executed in the active tab of the current window.
1847  * @param {(!chrome.tabs.InjectDetails|function(!Array.<*>):void)=}
1848  *     opt_detailsOrCallback Either an object containing the details of the
1849  *     script to run, if the tab id was speficied as first argument, or a
1850  *     callback that will be invoked with the result of the execution of the
1851  *     script in every injected frame.
1852  * @param {function(!Array.<*>):void=} opt_callback A callback that will be
1853  *     invoked with the result of the execution of the script in every
1854  *     injected frame.
1855  */
1856 chrome.tabs.executeScript = function(tabIdOrDetails, opt_detailsOrCallback,
1857     opt_callback) {};
1858
1859
1860 /**
1861  * @param {number} tabId Tab id.
1862  * @param {function(!Tab): void} callback Callback.
1863  */
1864 chrome.tabs.get = function(tabId, callback) {};
1865
1866
1867 /**
1868  * Note (2014-05-21): Because this function is deprecated, the types of it's
1869  * parameters were not upgraded to make the first parameter optional and to mark
1870  * the Array and Tab in the callback as non-null.
1871  *
1872  * @param {number?} windowId Window id.
1873  * @param {function(Array.<Tab>): void} callback Callback.
1874  * @deprecated Please use tabs.query {windowId: windowId}.
1875  */
1876 chrome.tabs.getAllInWindow = function(windowId, callback) {};
1877
1878
1879 /**
1880  * @param {function(!Tab=): void} callback Callback.
1881  */
1882 chrome.tabs.getCurrent = function(callback) {};
1883
1884
1885 /**
1886  * Note (2014-05-21): Because this function is deprecated, the types of it's
1887  * parameters were not upgraded to make the first parameter optional and to mark
1888  * the Array and Tab in the callback as non-null.
1889  *
1890  * @param {number?} windowId Window id.
1891  * @param {function(Tab): void} callback Callback.
1892  * @deprecated Please use tabs.query({active: true}).
1893  */
1894 chrome.tabs.getSelected = function(windowId, callback) {};
1895
1896
1897 /**
1898  * @typedef {?{
1899  *   windowId: (number|undefined),
1900  *   tabs: (number|!Array.<number>)
1901  * }}
1902  */
1903 chrome.tabs.HighlightInfo;
1904
1905
1906 /**
1907  * @param {!chrome.tabs.HighlightInfo} highlightInfo
1908  * @param {function(!Window): void} callback Callback function invoked
1909  *    with each appropriate Window.
1910  */
1911 chrome.tabs.highlight = function(highlightInfo, callback) {};
1912
1913
1914 /**
1915  * @link https://developer.chrome.com/extensions/tabs#method-insertCSS
1916  * @param {number|!chrome.tabs.InjectDetails} tabIdOrDetails
1917  *     Either the id of the tab in which to run the script, or an object
1918  *     containing the details of the CSS to insert, in which case the script
1919  *     will be executed in the active tab of the current window.
1920  * @param {(!chrome.tabs.InjectDetails|function():void)=}
1921  *     opt_detailsOrCallback Either an object containing the details of the
1922  *     CSS to insert, if the tab id was speficied as first argument, or a
1923  *     callback that will be invoked after the CSS has been injected.
1924  * @param {function():void=} opt_callback A callback that will be invoked after
1925  *     the CSS has been injected.
1926  */
1927 chrome.tabs.insertCSS = function(tabIdOrDetails, opt_detailsOrCallback,
1928     opt_callback) {};
1929
1930
1931 /**
1932  * @typedef {?{
1933  *   windowId: (number|undefined),
1934  *   index: number
1935  * }}
1936  */
1937 chrome.tabs.MoveProperties;
1938
1939
1940 /**
1941  * @param {number|!Array.<number>} tabId Tab id or array of tab ids.
1942  * @param {!chrome.tabs.MoveProperties} moveProperties
1943  * @param {function((!Tab|!Array.<!Tab>)): void=} opt_callback Callback.
1944  */
1945 chrome.tabs.move = function(tabId, moveProperties, opt_callback) {};
1946
1947
1948 /**
1949  * @typedef {?{
1950  *   active: (boolean|undefined),
1951  *   pinned: (boolean|undefined),
1952  *   highlighted: (boolean|undefined),
1953  *   currentWindow: (boolean|undefined),
1954  *   lastFocusedWindow: (boolean|undefined),
1955  *   status: (string|undefined),
1956  *   title: (string|undefined),
1957  *   url: (string|undefined),
1958  *   windowId: (number|undefined),
1959  *   windowType: (string|undefined),
1960  *   index: (number|undefined)
1961  * }}
1962  */
1963 chrome.tabs.QueryInfo;
1964
1965
1966 /**
1967  * @param {!chrome.tabs.QueryInfo} queryInfo
1968  * @param {function(!Array.<!Tab>): void} callback Callback.
1969  */
1970 chrome.tabs.query = function(queryInfo, callback) {};
1971
1972
1973 /**
1974  * @see https://developer.chrome.com/extensions/tabs#method-query
1975  * @param {number} tabId The ID of the tab which is to be duplicated.
1976  * @param {(function(!Tab=):void)=} opt_callback A callback to be invoked with
1977  *     details about the duplicated tab.
1978  */
1979 chrome.tabs.duplicate = function(tabId, opt_callback) {};
1980
1981
1982 /**
1983  * @typedef {?{
1984  *   bypassCache: (boolean|undefined)
1985  * }}
1986  */
1987 chrome.tabs.ReloadProperties;
1988
1989
1990 /**
1991  * @see https://developer.chrome.com/extensions/tabs#method-reload
1992  * @param {(number|!chrome.tabs.ReloadProperties|function():void)=}
1993  *     opt_tabIdOrReloadPropertiesOrCallback One of:
1994  *     The ID of the tab to reload; defaults to the selected tab of the current
1995  *     window.
1996  *     An object specifying boolean flags to customize the reload operation.
1997  *     A callback to be invoked when the reload is complete.
1998  * @param {(!chrome.tabs.ReloadProperties|function():void)=}
1999  *     opt_reloadPropertiesOrCallback Either an object specifying boolean flags
2000  *     to customize the reload operation, or a callback to be invoked when the
2001  *     reload is complete, if no object needs to be specified.
2002  * @param {function():void=} opt_callback  A callback to be invoked when the
2003  *     reload is complete.
2004  */
2005 chrome.tabs.reload = function(opt_tabIdOrReloadPropertiesOrCallback,
2006     opt_reloadPropertiesOrCallback, opt_callback) {};
2007
2008
2009 /**
2010  * @param {number|!Array.<number>} tabIds A tab ID or an array of tab IDs.
2011  * @param {function(): void=} opt_callback Callback.
2012  */
2013 chrome.tabs.remove = function(tabIds, opt_callback) {};
2014
2015
2016 /**
2017  * @param {number} tabId Tab id.
2018  * @param {*} request The request value of any type.
2019  * @param {function(*): void=} opt_callback The callback function which
2020  *     takes a JSON response object sent by the handler of the request.
2021  */
2022 chrome.tabs.sendMessage = function(tabId, request, opt_callback) {};
2023
2024
2025 /**
2026  * @param {number} tabId Tab id.
2027  * @param {*} request The request value of any type.
2028  * @param {function(*): void=} opt_callback The callback function which
2029  *     takes a JSON response object sent by the handler of the request.
2030  * @deprecated Please use runtime.sendMessage.
2031  */
2032 chrome.tabs.sendRequest = function(tabId, request, opt_callback) {};
2033
2034
2035 /**
2036  * @typedef {?{
2037  *   url: (string|undefined),
2038  *   active: (boolean|undefined),
2039  *   highlighted: (boolean|undefined),
2040  *   pinned: (boolean|undefined),
2041  *   openerTabId: (number|undefined)
2042  * }}
2043  */
2044 chrome.tabs.UpdateProperties;
2045
2046
2047 /**
2048  * @see https://developer.chrome.com/extensions/tabs#method-update
2049  * @param {number|!chrome.tabs.UpdateProperties} tabIdOrUpdateProperties
2050  *     Either the id of the tab to update, or an object with new property
2051  *     values, in which case the selected tab of the current window will be
2052  *     updated.
2053  * @param {(!chrome.tabs.UpdateProperties|function(Tab):void)=}
2054  *     opt_updatePropertiesOrCallback Either an object with new property values,
2055  *     if the tabId was specified as first parameter, or an optional callback
2056  *     that will be invoked with information about the tab being updated.
2057  * @param {function(!Tab=): void=} opt_callback An optional callback that will
2058  *     be invoked with information about the tab being updated.
2059  */
2060 chrome.tabs.update = function(tabIdOrUpdateProperties,
2061     opt_updatePropertiesOrCallback, opt_callback) {};
2062
2063
2064 /**
2065  * @type {!ChromeEvent}
2066  * @deprecated Please use tabs.onActivated.
2067  */
2068 chrome.tabs.onActiveChanged;
2069
2070
2071 /** @type {!ChromeEvent} */
2072 chrome.tabs.onActivated;
2073
2074
2075 /** @type {!ChromeEvent} */
2076 chrome.tabs.onAttached;
2077
2078
2079 /** @type {!ChromeEvent} */
2080 chrome.tabs.onCreated;
2081
2082
2083 /** @type {!ChromeEvent} */
2084 chrome.tabs.onDetached;
2085
2086
2087 /**
2088  * @type {!ChromeEvent}
2089  * @deprecated Please use tabs.onHighlighted.
2090  */
2091 chrome.tabs.onHighlightChanged;
2092
2093
2094 /**
2095  * @type {!ChromeEvent}
2096  */
2097 chrome.tabs.onHighlighted;
2098
2099
2100 /** @type {!ChromeEvent} */
2101 chrome.tabs.onMoved;
2102
2103
2104 /** @type {!ChromeEvent} */
2105 chrome.tabs.onRemoved;
2106
2107
2108 /** @type {!ChromeEvent} */
2109 chrome.tabs.onUpdated;
2110
2111
2112 /** @type {!ChromeEvent} */
2113 chrome.tabs.onReplaced;
2114
2115 // DEPRECATED:
2116 // TODO(user): Remove once all usage has been confirmed to have ended.
2117
2118
2119 /**
2120  * @type {!ChromeEvent}
2121  * @deprecated Please use tabs.onActivated.
2122  */
2123 chrome.tabs.onSelectionChanged;
2124
2125
2126 /**
2127  * @const
2128  * @see https://developer.chrome.com/extensions/windows.html
2129  */
2130 chrome.windows = {};
2131
2132
2133 /**
2134  * @param {Object=} opt_createData May have many keys to specify parameters.
2135  *     Or the callback.
2136  * @param {function(ChromeWindow): void=} opt_callback Callback.
2137  */
2138 chrome.windows.create = function(opt_createData, opt_callback) {};
2139
2140
2141 /**
2142  * @param {number} id Window id.
2143  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2144  * @param {function(!ChromeWindow): void=} opt_callback Callback when
2145  *     opt_getInfo is an object.
2146  */
2147 chrome.windows.get = function(id, opt_getInfo, opt_callback) {};
2148
2149
2150 /**
2151  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2152  * @param {function(!Array.<!ChromeWindow>): void=} opt_callback Callback.
2153  */
2154 chrome.windows.getAll = function(opt_getInfo, opt_callback) {};
2155
2156
2157 /**
2158  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2159  * @param {function(ChromeWindow): void=} opt_callback Callback.
2160  */
2161 chrome.windows.getCurrent = function(opt_getInfo, opt_callback) { };
2162
2163
2164 /**
2165  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2166  * @param {function(ChromeWindow): void=} opt_callback Callback.
2167  */
2168 chrome.windows.getLastFocused = function(opt_getInfo, opt_callback) { };
2169
2170
2171 /**
2172  * @param {number} tabId Tab Id.
2173  * @param {function(): void=} opt_callback Callback.
2174  */
2175 chrome.windows.remove = function(tabId, opt_callback) {};
2176
2177
2178 /**
2179  * @param {number} tabId Tab Id.
2180  * @param {Object} updateProperties An object which may have many keys for
2181  *     various options.
2182  * @param {function(): void=} opt_callback Callback.
2183  */
2184 chrome.windows.update = function(tabId, updateProperties, opt_callback) {};
2185
2186
2187 /** @type {!ChromeEvent} */
2188 chrome.windows.onCreated;
2189
2190
2191 /** @type {!ChromeEvent} */
2192 chrome.windows.onFocusChanged;
2193
2194
2195 /** @type {!ChromeEvent} */
2196 chrome.windows.onRemoved;
2197
2198
2199 /**
2200  * @see https://developer.chrome.com/extensions/windows.html#property-WINDOW_ID_NONE
2201  * @type {number}
2202  */
2203 chrome.windows.WINDOW_ID_NONE;
2204
2205
2206 /**
2207  * @see https://developer.chrome.com/extensions/windows.html#property-WINDOW_ID_CURRENT
2208  * @type {number}
2209  */
2210 chrome.windows.WINDOW_ID_CURRENT;
2211
2212
2213 /**
2214  * @const
2215  * @see https://developer.chrome.com/extensions/i18n.html
2216  */
2217 chrome.i18n = {};
2218
2219
2220 /**
2221  * @param {function(Array.<string>): void} callback The callback function which
2222  *     accepts an array of the accept languages of the browser, such as
2223  *     'en-US','en','zh-CN'.
2224  */
2225 chrome.i18n.getAcceptLanguages = function(callback) {};
2226
2227
2228 /**
2229  * @param {string} messageName
2230  * @param {(string|Array.<string>)=} opt_args
2231  * @return {string}
2232  */
2233 chrome.i18n.getMessage = function(messageName, opt_args) {};
2234
2235
2236 /**
2237  * @return {string}
2238  */
2239 chrome.i18n.getUILanguage = function() {};
2240
2241
2242 /**
2243  * @const
2244  * @see https://developer.chrome.com/extensions/pageAction.html
2245  */
2246 chrome.pageAction = {};
2247
2248
2249 /**
2250  * @param {number} tabId Tab Id.
2251  */
2252 chrome.pageAction.hide = function(tabId) {};
2253
2254
2255 /**
2256  * @param {Object} details An object which has 'tabId' and either
2257  *     'imageData' or 'path'.
2258  */
2259 chrome.pageAction.setIcon = function(details) {};
2260
2261
2262 /**
2263  * @param {Object} details An object which may have 'popup' or 'tabId' as keys.
2264  */
2265 chrome.pageAction.setPopup = function(details) {};
2266
2267
2268 /**
2269  * @param {Object} details An object which has 'tabId' and 'title'.
2270  */
2271 chrome.pageAction.setTitle = function(details) {};
2272
2273
2274 /**
2275  * @param {number} tabId Tab Id.
2276  */
2277 chrome.pageAction.show = function(tabId) {};
2278
2279
2280 /** @type {!ChromeEvent} */
2281 chrome.pageAction.onClicked;
2282
2283
2284 /**
2285  * @const
2286  */
2287 chrome.browser = {};
2288
2289
2290 /**
2291  * @param {{url: string}} details An object with a single 'url' key.
2292  * @param {function(): void} callback The callback function. If an error occurs
2293  * opening the URL, chrome.runtime.lastError will be set to the error message.
2294  */
2295 chrome.browser.openTab = function(details, callback) {};
2296
2297
2298 /**
2299  * @const
2300  * @see https://developer.chrome.com/extensions/browserAction.html
2301  */
2302 chrome.browserAction = {};
2303
2304
2305 /**
2306  * @param {Object} details An object whose keys are 'color' and
2307  *     optionally 'tabId'.
2308  */
2309 chrome.browserAction.setBadgeBackgroundColor = function(details) {};
2310
2311
2312 /**
2313  * @param {Object} details An object whose keys are 'text' and
2314  *     optionally 'tabId'.
2315  */
2316 chrome.browserAction.setBadgeText = function(details) {};
2317
2318
2319 /**
2320  * @param {Object} details An object which may have 'imageData',
2321  *     'path', or 'tabId' as keys.
2322  */
2323 chrome.browserAction.setIcon = function(details) {};
2324
2325
2326 /**
2327  * @param {Object} details An object which may have 'popup' or 'tabId' as keys.
2328  */
2329 chrome.browserAction.setPopup = function(details) {};
2330
2331
2332 /**
2333  * @param {Object} details An object which has 'title' and optionally
2334  *     'tabId'.
2335  */
2336 chrome.browserAction.setTitle = function(details) {};
2337
2338
2339 /** @type {!ChromeEvent} */
2340 chrome.browserAction.onClicked;
2341
2342
2343 /**
2344  * @param {number} tabId the ID of the tab on which to disable this action.
2345  */
2346 chrome.browserAction.disable = function(tabId) {};
2347
2348
2349 /**
2350  * @param {number} tabId the ID of the tab on which to enable this action.
2351  */
2352 chrome.browserAction.enable = function(tabId) {};
2353
2354
2355 /**
2356  * @const
2357  * @see https://developer.chrome.com/extensions/bookmarks.html
2358  */
2359 chrome.bookmarks = {};
2360
2361
2362 /**
2363  * @typedef {?{
2364  *   parentId: (string|undefined),
2365  *   index: (number|undefined),
2366  *   url: (string|undefined),
2367  *   title: (string|undefined)
2368  * }}
2369  * @see https://developer.chrome.com/extensions/bookmarks#method-create
2370  */
2371 chrome.bookmarks.CreateDetails;
2372
2373
2374 /**
2375  * @typedef {?{
2376  *   query: (string|undefined),
2377  *   url: (string|undefined),
2378  *   title: (string|undefined)
2379  * }}
2380  * @see https://developer.chrome.com/extensions/bookmarks#method-search
2381  */
2382 chrome.bookmarks.SearchDetails;
2383
2384
2385 /**
2386  * @param {(string|Array.<string>)} idOrIdList
2387  * @param {function(Array.<BookmarkTreeNode>): void} callback The
2388  *     callback function which accepts an array of BookmarkTreeNode.
2389  * @return {Array.<BookmarkTreeNode>}
2390  */
2391 chrome.bookmarks.get = function(idOrIdList, callback) {};
2392
2393
2394 /**
2395  * @param {string} id
2396  * @param {function(Array.<BookmarkTreeNode>): void} callback The
2397  *     callback function which accepts an array of BookmarkTreeNode.
2398  * @return {Array.<BookmarkTreeNode>}
2399  */
2400 chrome.bookmarks.getChildren = function(id, callback) {};
2401
2402
2403 /**
2404  * @param {number} numberOfItems The number of items to return.
2405  * @param {function(Array.<BookmarkTreeNode>): void} callback The
2406  *     callback function which accepts an array of BookmarkTreeNode.
2407  * @return {Array.<BookmarkTreeNode>}
2408  */
2409 chrome.bookmarks.getRecent = function(numberOfItems, callback) {};
2410
2411
2412 /**
2413  * @param {function(Array.<BookmarkTreeNode>): void} callback The
2414  *     callback function which accepts an array of BookmarkTreeNode.
2415  * @return {Array.<BookmarkTreeNode>}
2416  */
2417 chrome.bookmarks.getTree = function(callback) {};
2418
2419
2420 /**
2421  * @param {string} id The ID of the root of the subtree to retrieve.
2422  * @param {function(Array.<BookmarkTreeNode>): void} callback The
2423  *     callback function which accepts an array of BookmarkTreeNode.
2424  * @return {Array.<BookmarkTreeNode>}
2425  */
2426 chrome.bookmarks.getSubTree = function(id, callback) {};
2427
2428
2429 /**
2430  * @param {string|!chrome.bookmarks.SearchDetails} query
2431  * @param {function(Array.<BookmarkTreeNode>): void} callback
2432  * @return {Array.<BookmarkTreeNode>}
2433  */
2434 chrome.bookmarks.search = function(query, callback) {};
2435
2436
2437 /**
2438  * @param {chrome.bookmarks.CreateDetails} bookmark
2439  * @param {function(BookmarkTreeNode): void=} opt_callback The
2440  *     callback function which accepts a BookmarkTreeNode object.
2441  */
2442 chrome.bookmarks.create = function(bookmark, opt_callback) {};
2443
2444
2445 /**
2446  * @param {string} id
2447  * @param {Object} destination An object which has optional 'parentId' and
2448  *     optional 'index'.
2449  * @param {function(BookmarkTreeNode): void=} opt_callback
2450  *     The callback function which accepts a BookmarkTreeNode object.
2451  */
2452 chrome.bookmarks.move = function(id, destination, opt_callback) {};
2453
2454
2455 /**
2456  * @param {string} id
2457  * @param {Object} changes An object which may have 'title' as a key.
2458  * @param {function(BookmarkTreeNode): void=} opt_callback The
2459  *     callback function which accepts a BookmarkTreeNode object.
2460  */
2461 chrome.bookmarks.update = function(id, changes, opt_callback) {};
2462
2463
2464 /**
2465  * @param {string} id
2466  * @param {function(): void=} opt_callback
2467  */
2468 chrome.bookmarks.remove = function(id, opt_callback) {};
2469
2470
2471 /**
2472  * @param {string} id
2473  * @param {function(): void=} opt_callback
2474  */
2475 chrome.bookmarks.removeTree = function(id, opt_callback) {};
2476
2477
2478 /**
2479  * @param {function(): void=} opt_callback
2480  */
2481 chrome.bookmarks.import = function(opt_callback) {};
2482
2483
2484 /**
2485  * @param {function(): void=} opt_callback
2486  */
2487 chrome.bookmarks.export = function(opt_callback) {};
2488
2489
2490 /** @type {!ChromeEvent} */
2491 chrome.bookmarks.onChanged;
2492
2493
2494 /** @type {!ChromeEvent} */
2495 chrome.bookmarks.onChildrenReordered;
2496
2497
2498 /** @type {!ChromeEvent} */
2499 chrome.bookmarks.onCreated;
2500
2501
2502 /** @type {!ChromeEvent} */
2503 chrome.bookmarks.onImportBegan;
2504
2505
2506 /** @type {!ChromeEvent} */
2507 chrome.bookmarks.onImportEnded;
2508
2509
2510 /** @type {!ChromeEvent} */
2511 chrome.bookmarks.onMoved;
2512
2513
2514 /** @type {!ChromeEvent} */
2515 chrome.bookmarks.onRemoved;
2516
2517
2518 /**
2519  * @typedef {?{
2520  *   content: string,
2521  *   description: string
2522  * }}
2523  */
2524 var SuggestResult;
2525
2526
2527 /**
2528  * @const
2529  * @see https://developer.chrome.com/extensions/omnibox.html
2530  */
2531 chrome.omnibox = {};
2532
2533
2534
2535 /** @constructor */
2536 chrome.omnibox.InputChangedEvent = function() {};
2537
2538
2539 /**
2540  * @param {function(string, function(!Array.<!SuggestResult>)): void} callback
2541  */
2542 chrome.omnibox.InputChangedEvent.prototype.addListener = function(callback) {};
2543
2544
2545 /**
2546  * @param {function(string, function(!Array.<!SuggestResult>)): void} callback
2547  */
2548 chrome.omnibox.InputChangedEvent.prototype.removeListener =
2549     function(callback) {};
2550
2551
2552 /**
2553  * @param {function(string, function(!Array.<!SuggestResult>)): void} callback
2554  * @return {boolean}
2555  */
2556 chrome.omnibox.InputChangedEvent.prototype.hasListener = function(callback) {};
2557
2558
2559 /** @return {boolean} */
2560 chrome.omnibox.InputChangedEvent.prototype.hasListeners = function() {};
2561
2562
2563
2564 /** @constructor */
2565 chrome.omnibox.InputEnteredEvent = function() {};
2566
2567
2568 /** @param {function(string, string): void} callback */
2569 chrome.omnibox.InputEnteredEvent.prototype.addListener = function(callback) {};
2570
2571
2572 /** @param {function(string, string): void} callback */
2573 chrome.omnibox.InputEnteredEvent.prototype.removeListener =
2574     function(callback) {};
2575
2576
2577 /**
2578  * @param {function(string, string): void} callback
2579  * @return {boolean}
2580  */
2581 chrome.omnibox.InputEnteredEvent.prototype.hasListener = function(callback) {};
2582
2583
2584 /** @return {boolean} */
2585 chrome.omnibox.InputEnteredEvent.prototype.hasListeners = function() {};
2586
2587
2588 /**
2589  * @param {{description: string}} suggestion A partial SuggestResult object.
2590  */
2591 chrome.omnibox.setDefaultSuggestion = function(suggestion) {};
2592
2593
2594 /** @type {!ChromeEvent} */
2595 chrome.omnibox.onInputCancelled;
2596
2597
2598 /** @type {!chrome.omnibox.InputChangedEvent} */
2599 chrome.omnibox.onInputChanged;
2600
2601
2602 /** @type {!chrome.omnibox.InputEnteredEvent} */
2603 chrome.omnibox.onInputEntered;
2604
2605
2606 /** @type {!ChromeEvent} */
2607 chrome.omnibox.onInputStarted;
2608
2609
2610 /**
2611  * @const
2612  * @see https://developer.chrome.com/extensions/dev/contextMenus.html
2613  */
2614 chrome.contextMenus = {};
2615
2616
2617 /**
2618  * @typedef {?{
2619  *   type: (string|undefined),
2620  *   id: (string|undefined),
2621  *   title: (string|undefined),
2622  *   checked: (boolean|undefined),
2623  *   contexts: (!Array.<string>|undefined),
2624  *   onclick: (function(!Object, !Tab)|undefined),
2625  *   parentId: (number|string|undefined),
2626  *   documentUrlPatterns: (!Array.<string>|undefined),
2627  *   targetUrlPatterns: (!Array.<string>|undefined),
2628  *   enabled: (boolean|undefined)
2629  * }}
2630  * @see https://developer.chrome.com/extensions/contextMenus#method-create
2631  */
2632 chrome.contextMenus.CreateProperties;
2633
2634
2635 /**
2636  * @typedef {?{
2637  *   type: (string|undefined),
2638  *   title: (string|undefined),
2639  *   checked: (boolean|undefined),
2640  *   contexts: (!Array.<string>|undefined),
2641  *   onclick: (function(!Object, !Tab)|undefined),
2642  *   parentId: (number|string|undefined),
2643  *   documentUrlPatterns: (!Array.<string>|undefined),
2644  *   targetUrlPatterns: (!Array.<string>|undefined),
2645  *   enabled: (boolean|undefined)
2646  * }}
2647  * @see https://developer.chrome.com/extensions/contextMenus#method-update
2648  */
2649 chrome.contextMenus.UpdateProperties;
2650
2651
2652 /**
2653  * @param {!chrome.contextMenus.CreateProperties} createProperties
2654  * @param {function()=} opt_callback
2655  * @return {(number|string)} The id of the newly created window.
2656  * @see https://developer.chrome.com/extensions/contextMenus#method-create
2657  */
2658 chrome.contextMenus.create = function(createProperties, opt_callback) {};
2659
2660
2661 /**
2662  * @param {(number|string)} id
2663  * @param {!chrome.contextMenus.UpdateProperties} updateProperties
2664  * @param {function()=} opt_callback
2665  * @see https://developer.chrome.com/extensions/contextMenus#method-update
2666  */
2667 chrome.contextMenus.update = function(id, updateProperties, opt_callback) {};
2668
2669
2670 /**
2671  * @param {(number|string)} menuItemId
2672  * @param {function()=} opt_callback
2673  * @see https://developer.chrome.com/extensions/contextMenus#method-remove
2674  */
2675 chrome.contextMenus.remove = function(menuItemId, opt_callback) {};
2676
2677
2678 /**
2679  * @param {function()=} opt_callback
2680  * @see https://developer.chrome.com/extensions/contextMenus#method-removeAll
2681  */
2682 chrome.contextMenus.removeAll = function(opt_callback) {};
2683
2684
2685 /**
2686  * @interface
2687  * @see https://developer.chrome.com/extensions/contextMenus#event-onClicked
2688  */
2689 chrome.contextMenus.ClickedEvent = function() {};
2690
2691
2692 /**
2693  * @param {function(!Object, !Tab=)} callback
2694  */
2695 chrome.contextMenus.ClickedEvent.prototype.addListener = function(callback) {};
2696
2697
2698 /**
2699  * @param {function(!Object, !Tab=)} callback
2700  */
2701 chrome.contextMenus.ClickedEvent.prototype.removeListener =
2702     function(callback) {};
2703
2704
2705 /**
2706  * @param {function(!Object, !Tab=)} callback
2707  * @return {boolean}
2708  */
2709 chrome.contextMenus.ClickedEvent.prototype.hasListener = function(callback) {};
2710
2711
2712 /**
2713  * @return {boolean}
2714  */
2715 chrome.contextMenus.ClickedEvent.prototype.hasListeners = function() {};
2716
2717
2718 /**
2719  * @type {!chrome.contextMenus.ClickedEvent}
2720  * @see https://developer.chrome.com/extensions/contextMenus#event-onClicked
2721  */
2722 chrome.contextMenus.onClicked;
2723
2724
2725 /**
2726  * @const
2727  * @see https://developer.chrome.com/extensions/dev/cookies.html
2728  */
2729 chrome.cookies = {};
2730
2731
2732 /**
2733  * This typedef is used for the parameters to chrome.cookies.get,
2734  * chrome.cookies.remove, and for the parameter to remove's callback. These uses
2735  * all identify a single cookie uniquely without specifying its content, and the
2736  * objects are identical except for the the storeId being optional vs required.
2737  * If greater divergence occurs, then going to two typedefs is recommended.
2738  *
2739  * @typedef {?{
2740  *   url: string,
2741  *   name: string,
2742  *   storeId: (string|undefined)
2743  * }}
2744  */
2745 chrome.cookies.CookieIdentifier;
2746
2747
2748 /**
2749  * @param {!chrome.cookies.CookieIdentifier} details
2750  * @param {function(Cookie=): void} callback
2751  */
2752 chrome.cookies.get = function(details, callback) {};
2753
2754
2755 /**
2756  * @param {Object} details
2757  * @param {function(Array.<Cookie>): void} callback
2758  */
2759 chrome.cookies.getAll = function(details, callback) {};
2760
2761
2762 /**
2763  * @param {function(Array.<CookieStore>): void} callback
2764  */
2765 chrome.cookies.getAllCookieStores = function(callback) {};
2766
2767
2768 /**
2769  * @param {!chrome.cookies.CookieIdentifier} details
2770  * @param {function(chrome.cookies.CookieIdentifier): void=} opt_callback If
2771  *     removal failed for any reason, the parameter will be "null", and
2772  *     "chrome.runtime.lastError" will be set.
2773  */
2774 chrome.cookies.remove = function(details, opt_callback) {};
2775
2776
2777 /**
2778  * @typedef {?{
2779  *   url: string,
2780  *   name: (string|undefined),
2781  *   value: (string|undefined),
2782  *   domain: (string|undefined),
2783  *   path: (string|undefined),
2784  *   secure: (boolean|undefined),
2785  *   httpOnly: (boolean|undefined),
2786  *   expirationDate: (number|undefined),
2787  *   storeId: (string|undefined)
2788  * }}
2789  */
2790 chrome.cookies.CookieSetDetails;
2791
2792
2793 /**
2794  * @param {!chrome.cookies.CookieSetDetails} details
2795  * @param {function(Cookie): void=} opt_callback If setting failed for any
2796  *    reason, the parameter will be "null", and "chrome.runtime.lastError" will
2797  *    be set.
2798  */
2799 chrome.cookies.set = function(details, opt_callback) {};
2800
2801
2802 /**
2803  * @see https://developer.chrome.com/extensions/cookies.html#event-onChanged
2804  * @type {!ChromeEvent}
2805  */
2806 chrome.cookies.onChanged;
2807
2808
2809
2810 /** @constructor */
2811 function CookieChangeInfo() {}
2812
2813
2814 /** @type {boolean} */
2815 CookieChangeInfo.prototype.removed;
2816
2817
2818 /** @type {Cookie} */
2819 CookieChangeInfo.prototype.cookie;
2820
2821
2822 /** @type {string} */
2823 CookieChangeInfo.prototype.cause;
2824
2825
2826 /** @const */
2827 chrome.management = {};
2828
2829
2830 /**
2831  * @typedef {?{
2832  *   showConfirmDialog: (boolean|undefined)
2833  * }}
2834  */
2835 chrome.management.InstallOptions;
2836
2837
2838 /**
2839  * @param {string} id
2840  * @param {function(!ExtensionInfo): void=} opt_callback Optional callback
2841  *     function.
2842  */
2843 chrome.management.get = function(id, opt_callback) {};
2844
2845
2846 /**
2847  * @param {function(!Array.<!ExtensionInfo>): void=} opt_callback Optional
2848  *     callback function.
2849  * @return {!Array.<!ExtensionInfo>}
2850  */
2851 chrome.management.getAll = function(opt_callback) {};
2852
2853
2854 /**
2855  * @param {string} id The id of an already installed extension.
2856  * @param {function(!Array.<string>)=} opt_callback Optional callback function.
2857  */
2858 chrome.management.getPermissionWarningsById = function(id, opt_callback) {};
2859
2860
2861 /**
2862  * @param {string} manifestStr Extension's manifest JSON string.
2863  * @param {function(!Array.<string>)=} opt_callback Optional callback function.
2864  */
2865 chrome.management.getPermissionWarningsByManifest =
2866     function(manifestStr, opt_callback) {};
2867
2868
2869 /**
2870  * @param {string} id The id of an already installed extension.
2871  * @param {function(): void=} opt_callback Optional callback function.
2872  */
2873 chrome.management.launchApp = function(id, opt_callback) {};
2874
2875
2876 /**
2877  * @param {string} id The id of an already installed extension.
2878  * @param {boolean} enabled Whether this item should be enabled.
2879  * @param {function(): void=} opt_callback Optional callback function.
2880  */
2881 chrome.management.setEnabled = function(id, enabled, opt_callback) {};
2882
2883
2884 /**
2885  * @param {string} id The id of an already installed extension.
2886  * @param {(!chrome.management.InstallOptions|function(): void)=}
2887  *     opt_optionsOrCallback An optional uninstall options object or an optional
2888  *     callback function.
2889  * @param {function(): void=} opt_callback Optional callback function.
2890  */
2891 chrome.management.uninstall =
2892     function(id, opt_optionsOrCallback, opt_callback) {};
2893
2894
2895 /**
2896  * @param {(!chrome.management.InstallOptions|function(): void)=}
2897  *     opt_optionsOrCallback An optional uninstall options object or an optional
2898  *     callback function.
2899  * @param {function(): void=} opt_callback An optional callback function.
2900  */
2901 chrome.management.uninstallSelf =
2902     function(opt_optionsOrCallback, opt_callback) {};
2903
2904
2905 /**
2906  * @param {string} id The id of an already installed extension.
2907  * @param {function(): void=} opt_callback Optional callback function.
2908  */
2909 chrome.management.createAppShortcut = function(id, opt_callback) {};
2910
2911
2912 /**
2913  * @param {string} id The id of an already installed extension.
2914  * @param {string} launchType The LaunchType enum value to set. Make sure this
2915  *     value is in ExtensionInfo.availableLaunchTypes because the available
2916  *     launch types vary on different platforms and configurations.
2917  * @param {function(): void=} opt_callback Optional callback function.
2918  */
2919 chrome.management.setLaunchType = function(id, launchType, opt_callback) {};
2920
2921
2922 /**
2923  * @param {string} url The URL of a web page. The scheme of the URL can only be
2924  *     "http" or "https".
2925  * @param {string} title The title of the generated app.
2926  * @param {function(!ExtensionInfo): void=} opt_callback Optional callback
2927  *     function.
2928  */
2929 chrome.management.generateAppForLink = function(url, title, opt_callback) {};
2930
2931
2932 /** @type {!ChromeExtensionInfoEvent} */
2933 chrome.management.onDisabled;
2934
2935
2936 /** @type {!ChromeExtensionInfoEvent} */
2937 chrome.management.onEnabled;
2938
2939
2940 /** @type {!ChromeExtensionInfoEvent} */
2941 chrome.management.onInstalled;
2942
2943
2944 /** @type {!ChromeStringEvent} */
2945 chrome.management.onUninstalled;
2946
2947
2948 /**
2949  * @const
2950  * @see https://developer.chrome.com/extensions/idle.html
2951  */
2952 chrome.idle = {};
2953
2954
2955 /**
2956  * @param {number} thresholdSeconds Threshold in seconds, used to determine
2957  *     when a machine is in the idle state.
2958  * @param {function(string): void} callback Callback to handle the state.
2959  */
2960 chrome.idle.queryState = function(thresholdSeconds, callback) {};
2961
2962
2963 /**
2964  * @param {number} intervalInSeconds Threshold, in seconds, used to determine
2965  *    when the system is in an idle state.
2966  */
2967 chrome.idle.setDetectionInterval = function(intervalInSeconds) {};
2968
2969
2970 /** @type {!ChromeEvent} */
2971 chrome.idle.onStateChanged;
2972
2973
2974 /**
2975  * Chrome Text-to-Speech API.
2976  * @const
2977  * @see https://developer.chrome.com/extensions/tts.html
2978  */
2979 chrome.tts = {};
2980
2981
2982
2983 /**
2984  * An event from the TTS engine to communicate the status of an utterance.
2985  * @constructor
2986  */
2987 function TtsEvent() {}
2988
2989
2990 /** @type {string} */
2991 TtsEvent.prototype.type;
2992
2993
2994 /** @type {number} */
2995 TtsEvent.prototype.charIndex;
2996
2997
2998 /** @type {string} */
2999 TtsEvent.prototype.errorMessage;
3000
3001
3002
3003 /**
3004  * A description of a voice available for speech synthesis.
3005  * @constructor
3006  */
3007 function TtsVoice() {}
3008
3009
3010 /** @type {string} */
3011 TtsVoice.prototype.voiceName;
3012
3013
3014 /** @type {string} */
3015 TtsVoice.prototype.lang;
3016
3017
3018 /** @type {string} */
3019 TtsVoice.prototype.gender;
3020
3021
3022 /** @type {string} */
3023 TtsVoice.prototype.extensionId;
3024
3025
3026 /** @type {Array.<string>} */
3027 TtsVoice.prototype.eventTypes;
3028
3029
3030 /**
3031  * Gets an array of all available voices.
3032  * @param {function(Array.<TtsVoice>)=} opt_callback An optional callback
3033  *     function.
3034  */
3035 chrome.tts.getVoices = function(opt_callback) {};
3036
3037
3038 /**
3039  * Checks if the engine is currently speaking.
3040  * @param {function(boolean)=} opt_callback The callback function.
3041  */
3042 chrome.tts.isSpeaking = function(opt_callback) {};
3043
3044
3045 /**
3046  * Speaks text using a text-to-speech engine.
3047  * @param {string} utterance The text to speak, either plain text or a complete,
3048  *     well-formed SSML document. Speech engines that do not support SSML will
3049  *     strip away the tags and speak the text. The maximum length of the text is
3050  *     32,768 characters.
3051  * @param {Object=} opt_options The speech options.
3052  * @param {function()=} opt_callback Called right away, before speech finishes.
3053  */
3054 chrome.tts.speak = function(utterance, opt_options, opt_callback) {};
3055
3056
3057 /**
3058  * Stops any current speech.
3059  */
3060 chrome.tts.stop = function() {};
3061
3062
3063 /**
3064  * @const
3065  * @see https://developer.chrome.com/extensions/ttsEngine.html
3066  */
3067 chrome.ttsEngine = {};
3068
3069
3070 /** @type {!ChromeEvent} */
3071 chrome.ttsEngine.onSpeak;
3072
3073
3074 /** @type {!ChromeEvent} */
3075 chrome.ttsEngine.onStop;
3076
3077
3078 /**
3079  * @const
3080  * @see https://developer.chrome.com/extensions/contentSettings.html
3081  */
3082 chrome.contentSettings = {};
3083
3084
3085 /** @type {!ContentSetting} */
3086 chrome.contentSettings.cookies;
3087
3088
3089 /** @type {!ContentSetting} */
3090 chrome.contentSettings.images;
3091
3092
3093 /** @type {!ContentSetting} */
3094 chrome.contentSettings.javascript;
3095
3096
3097 /** @type {!ContentSetting} */
3098 chrome.contentSettings.plugins;
3099
3100
3101 /** @type {!ContentSetting} */
3102 chrome.contentSettings.popups;
3103
3104
3105 /** @type {!ContentSetting} */
3106 chrome.contentSettings.notifications;
3107
3108
3109 /**
3110  * @const
3111  * @see https://developer.chrome.com/extensions/fileBrowserHandler
3112  */
3113 chrome.fileBrowserHandler = {};
3114
3115
3116 /**
3117  * @typedef {?{
3118  *   suggestedName: string,
3119  *   allowedFileExtensions: (!Array.<string>|undefined)
3120  * }}
3121  */
3122 chrome.fileBrowserHandler.SelectFileSelectionParams;
3123
3124
3125 /**
3126  * Prompts user to select file path under which file should be saved.
3127  * @see https://developer.chrome.com/extensions/fileBrowserHandler#method-selectFile
3128  * @param {!chrome.fileBrowserHandler.SelectFileSelectionParams} selectionParams
3129  *     Parameters that will be used while selecting the file.
3130  * @param {function(!Object)} callback Function called upon completion.
3131  */
3132 chrome.fileBrowserHandler.selectFile = function(selectionParams, callback) {};
3133
3134
3135 /**
3136  * @interface
3137  * @see https://developer.chrome.com/extensions/fileBrowserHandler#event-onExecute
3138  */
3139 chrome.fileBrowserHandler.ExecuteEvent = function() {};
3140
3141
3142 /**
3143  * @param {function(string, !FileHandlerExecuteEventDetails)} callback
3144  */
3145 chrome.fileBrowserHandler.ExecuteEvent.prototype.addListener = function(
3146     callback) {};
3147
3148
3149 /**
3150  * @param {function(string, !FileHandlerExecuteEventDetails)} callback
3151  */
3152 chrome.fileBrowserHandler.ExecuteEvent.prototype.removeListener = function(
3153     callback) {};
3154
3155
3156 /**
3157  * @param {function(string, !FileHandlerExecuteEventDetails)} callback
3158  * @return {boolean}
3159  */
3160 chrome.fileBrowserHandler.ExecuteEvent.prototype.hasListener = function(
3161     callback) {};
3162
3163
3164 /**
3165  * @return {boolean}
3166  */
3167 chrome.fileBrowserHandler.ExecuteEvent.prototype.hasListeners = function() {};
3168
3169
3170 /**
3171  * Fired when file system action is executed from ChromeOS file browser.
3172  * @see https://developer.chrome.com/extensions/fileBrowserHandler#event-onExecute
3173  * @type {!chrome.fileBrowserHandler.ExecuteEvent}
3174  */
3175 chrome.fileBrowserHandler.onExecute;
3176
3177
3178 /**
3179  * @const
3180  * @see https://developer.chrome.com/extensions/gcm
3181  */
3182 chrome.gcm = {};
3183
3184
3185 /**
3186  * @see https://developer.chrome.com/extensions/gcm#property-MAX_MESSAGE_SIZE
3187  * @type {number}
3188  */
3189 chrome.gcm.MAX_MESSAGE_SIZE;
3190
3191
3192 /**
3193  * Registers the application with GCM. The registration ID will be returned by
3194  * the callback. If register is called again with the same list of senderIds,
3195  * the same registration ID will be returned.
3196  * @see https://developer.chrome.com/extensions/gcm#method-register
3197  * @param {!Array.<string>} senderIds A list of server IDs that are allowed to
3198  *     send messages to the application.
3199  * @param {function(string): void} callback Function called when
3200  *     registration completes with registration ID as argument.
3201  */
3202 chrome.gcm.register = function(senderIds, callback) {};
3203
3204
3205 /**
3206  * Unregisters the application from GCM.
3207  * @see https://developer.chrome.com/extensions/gcm#method-unregister
3208  * @param {function(): void} callback Called when unregistration is done.
3209  */
3210 chrome.gcm.unregister = function(callback) {};
3211
3212
3213 /**
3214  * Sends an upstream message using GCM.
3215  * @see https://developer.chrome.com/extensions/gcm#method-send
3216  * @param {!chrome.gcm.Message} message Message to be sent.
3217  * @param {function(string): void} callback Called with message ID.
3218  */
3219 chrome.gcm.send = function(message, callback) {};
3220
3221
3222 /**
3223  * Outgoing message.
3224  * @typedef {?{
3225  *   destinationId: string,
3226  *   messageId: string,
3227  *   timeToLive: (number|undefined),
3228  *   data: !Object.<string, string>
3229  * }}
3230  */
3231 chrome.gcm.Message;
3232
3233
3234 /**
3235  * An event, fired when a message is received through GCM.
3236  * @see https://developer.chrome.com/extensions/gcm#event-onMessage
3237  * @type {!chrome.gcm.OnMessageEvent}
3238  */
3239 chrome.gcm.onMessage;
3240
3241
3242 /**
3243  * An event, fired when GCM server had to delete messages to the application
3244  * from its queue in order to manage its size.
3245  * @see https://developer.chrome.com/extensions/gcm#event-onMessagesDeleted
3246  * @type {!ChromeEvent}
3247  */
3248 chrome.gcm.onMessagesDeleted;
3249
3250
3251 /**
3252  * An event indicating problems with sending messages.
3253  * @see https://developer.chrome.com/extensions/gcm#event-onSendError
3254  * @type {!chrome.gcm.OnSendErrorEvent}
3255  */
3256 chrome.gcm.onSendError;
3257
3258
3259
3260 /**
3261  * @constructor
3262  */
3263 chrome.gcm.OnMessageEvent = function() {};
3264
3265
3266 /**
3267  * @param {function(!Object): void} callback Callback.
3268  */
3269 chrome.gcm.OnMessageEvent.prototype.addListener = function(callback) {};
3270
3271
3272 /**
3273  * @param {function(!Object): void} callback Callback.
3274  */
3275 chrome.gcm.OnMessageEvent.prototype.removeListener = function(callback) {};
3276
3277
3278 /**
3279  * @param {function(!Object): void} callback Callback.
3280  * @return {boolean}
3281  */
3282 chrome.gcm.OnMessageEvent.prototype.hasListener = function(callback) {};
3283
3284
3285 /**
3286  * @return {boolean}
3287  */
3288 chrome.gcm.OnMessageEvent.prototype.hasListeners = function() {};
3289
3290
3291
3292 /**
3293  * @constructor
3294  */
3295 chrome.gcm.OnSendErrorEvent = function() {};
3296
3297
3298 /**
3299  * @param {function(!Object): void} callback Callback.
3300  */
3301 chrome.gcm.OnSendErrorEvent.prototype.addListener = function(callback) {};
3302
3303
3304 /**
3305  * @param {function(!Object): void} callback Callback.
3306  */
3307 chrome.gcm.OnSendErrorEvent.prototype.removeListener = function(callback) {};
3308
3309
3310 /**
3311  * @param {function(!Object): void} callback Callback.
3312  * @return {boolean}
3313  */
3314 chrome.gcm.OnSendErrorEvent.prototype.hasListener = function(callback) {};
3315
3316
3317 /**
3318  * @return {boolean}
3319  */
3320 chrome.gcm.OnSendErrorEvent.prototype.hasListeners = function() {};
3321
3322
3323 /**
3324  * @const
3325  * @see https://developer.chrome.com/extensions/history.html
3326  */
3327 chrome.history = {};
3328
3329
3330 /**
3331  * @param {Object.<string, string>} details Object with a 'url' key.
3332  */
3333 chrome.history.addUrl = function(details) {};
3334
3335
3336 /**
3337  * @param {function(): void} callback Callback function.
3338  */
3339 chrome.history.deleteAll = function(callback) {};
3340
3341
3342 /**
3343  * @param {Object.<string, string>} range Object with 'startTime'
3344  *     and 'endTime' keys.
3345  * @param {function(): void} callback Callback function.
3346  */
3347 chrome.history.deleteRange = function(range, callback) {};
3348
3349
3350 /**
3351  * @param {Object.<string, string>} details Object with a 'url' key.
3352  */
3353 chrome.history.deleteUrl = function(details) {};
3354
3355
3356 /**
3357  * @param {Object.<string, string>} details Object with a 'url' key.
3358  * @param {function(!Array.<!VisitItem>): void} callback Callback function.
3359  * @return {!Array.<!VisitItem>}
3360  */
3361 chrome.history.getVisits = function(details, callback) {};
3362
3363
3364 /**
3365  * @param {Object.<string, string>} query Object with a 'text' (string)
3366  *     key and optional 'startTime' (number), 'endTime' (number) and
3367  *     'maxResults' keys.
3368  * @param {function(!Array.<!HistoryItem>): void} callback Callback function.
3369  * @return {!Array.<!HistoryItem>}
3370  */
3371 chrome.history.search = function(query, callback) {};
3372
3373
3374 /** @type {!ChromeEvent} */
3375 chrome.history.onVisitRemoved;
3376
3377
3378 /** @type {!ChromeEvent} */
3379 chrome.history.onVisited;
3380
3381
3382 /**
3383  * @const
3384  * @see http://developer.chrome.com/apps/identity.html
3385  * TODO: replace TokenDetails, InvalidTokenDetails and
3386  *     WebAuthFlowDetails with Object.
3387  */
3388 chrome.identity = {};
3389
3390
3391 /**
3392  * @param {(chrome.identity.TokenDetails|function(string=): void)}
3393  *     detailsOrCallback Token options or a callback function if no options are
3394  *     specified.
3395  * @param {function(string=): void=} opt_callback A callback function if options
3396  *     are specified.
3397  */
3398 chrome.identity.getAuthToken = function(detailsOrCallback, opt_callback) {};
3399
3400
3401 /** @typedef {{interactive: (boolean|undefined)}} */
3402 chrome.identity.TokenDetails;
3403
3404
3405 /**
3406  * @param {chrome.identity.InvalidTokenDetails} details
3407  * @param {function(): void} callback
3408  */
3409 chrome.identity.removeCachedAuthToken = function(details, callback) {};
3410
3411
3412 /** @typedef {{token: string}} */
3413 chrome.identity.InvalidTokenDetails;
3414
3415
3416 /**
3417  * @param {chrome.identity.WebAuthFlowDetails} details
3418  * @param {function(string=): void} callback
3419  */
3420 chrome.identity.launchWebAuthFlow = function(details, callback) {};
3421
3422
3423 /** @typedef {{url: string, interactive: (boolean|undefined)}} */
3424 chrome.identity.WebAuthFlowDetails;
3425
3426
3427 /** @param {!function(!Object=):void} callback */
3428 chrome.identity.getProfileUserInfo = function(callback) {};
3429
3430
3431 /** @type {!ChromeEvent} */
3432 chrome.identity.onSignInChanged;
3433
3434
3435 /**
3436  * @const
3437  * @see https://developer.chrome.com/extensions/input.ime.html
3438  */
3439 chrome.input = {};
3440
3441
3442 /** @const */
3443 chrome.input.ime = {};
3444
3445
3446
3447 /**
3448  * The OnKeyEvent event takes an extra argument.
3449  * @constructor
3450  */
3451 function ChromeInputImeOnKeyEventEvent() {}
3452
3453
3454 /**
3455  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
3456  *     callback.
3457  * @param {Array.<string>=} opt_extraInfoSpec Array of extra information.
3458  */
3459 ChromeInputImeOnKeyEventEvent.prototype.addListener =
3460     function(callback, opt_extraInfoSpec) {};
3461
3462
3463 /**
3464  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
3465  *     callback.
3466  */
3467 ChromeInputImeOnKeyEventEvent.prototype.removeListener = function(callback) {};
3468
3469
3470 /**
3471  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
3472  *     callback.
3473  */
3474 ChromeInputImeOnKeyEventEvent.prototype.hasListener = function(callback) {};
3475
3476
3477 /**
3478  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
3479  *     callback.
3480  */
3481 ChromeInputImeOnKeyEventEvent.prototype.hasListeners = function(callback) {};
3482
3483
3484 /**
3485  * @param {!Object.<string,number>} parameters An object with a
3486  *     'contextID' (number) key.
3487  * @param {function(boolean): void} callback Callback function.
3488  */
3489 chrome.input.ime.clearComposition = function(parameters, callback) {};
3490
3491
3492 /**
3493  * @param {!Object.<string,(string|number)>} parameters An object with
3494  *     'contextID' (number) and 'text' (string) keys.
3495  * @param {function(boolean): void=} opt_callback Callback function.
3496  */
3497 chrome.input.ime.commitText = function(parameters, opt_callback) {};
3498
3499
3500 /**
3501  * @param {!Object.<string,(string|number)>} parameters An object with
3502  *     'contextID' (number) and 'text' (string) keys.
3503  * @param {function(boolean): void=} opt_callback Callback function.
3504  */
3505 chrome.input.ime.deleteSurroundingText = function(parameters, opt_callback) {};
3506
3507
3508 /**
3509  * @param {!Object.<string,(number|Object.<string,(string|number|boolean)>)>}
3510  *     parameters An object with 'engineID' (string) and 'properties'
3511  *     (Object) keys.
3512  * @param {function(boolean): void=} opt_callback Callback function.
3513  */
3514 chrome.input.ime.setCandidateWindowProperties =
3515     function(parameters, opt_callback) {};
3516
3517
3518 /**
3519  * @param {!Object.<string,(number|Object.<string,(string|number)>)>}
3520  *     parameters An object with 'contextID' (number) and 'candidates'
3521  *     (array of object) keys.
3522  * @param {function(boolean): void=} opt_callback Callback function.
3523  */
3524 chrome.input.ime.setCandidates = function(parameters, opt_callback) {};
3525
3526
3527 /**
3528  * @param {!Object.<string,(string|number|Object.<string,(string|number)>)>}
3529  *     parameters An object with 'contextID' (number), 'text' (string),
3530  *     'selectionStart (number), 'selectionEnd' (number), 'cursor' (number),
3531  *     and 'segments' (array of object) keys.
3532  * @param {function(boolean): void=} opt_callback Callback function.
3533  */
3534 chrome.input.ime.setComposition = function(parameters, opt_callback) {};
3535
3536
3537 /**
3538  * @param {!Object.<string,number>} parameters An object with
3539  *     'contextID' (number) and 'candidateID' (number) keys.
3540  * @param {function(boolean): void=} opt_callback Callback function.
3541  */
3542 chrome.input.ime.setCursorPosition = function(parameters, opt_callback) {};
3543
3544
3545 /**
3546  * @param {!Object.<string,(string|Array.<Object.<string,(string|boolean)>>)>}
3547  *     parameters An object with 'engineID' (string) and 'items'
3548  *     (array of object) keys.
3549  * @param {function(): void=} opt_callback Callback function.
3550  */
3551 chrome.input.ime.setMenuItems = function(parameters, opt_callback) {};
3552
3553
3554 /**
3555  * @param {!Object.<string,(string|Array.<Object.<string,(string|boolean)>>)>}
3556  *     parameters An object with  'engineID' (string) and 'items'
3557  *     (array of object) keys.
3558  * @param {function(): void=} opt_callback Callback function.
3559  */
3560 chrome.input.ime.updateMenuItems = function(parameters, opt_callback) {};
3561
3562
3563 /**
3564  * @param {string} requestId Request id of the event that was handled. This
3565  *     should come from keyEvent.requestId.
3566  * @param {boolean} response True if the keystroke was handled, false if not.
3567  */
3568 chrome.input.ime.keyEventHandled = function(requestId, response) {};
3569
3570
3571 /** @type {!ChromeEvent} */
3572 chrome.input.ime.onActivate;
3573
3574
3575 /** @type {!ChromeEvent} */
3576 chrome.input.ime.onBlur;
3577
3578
3579 /** @type {!ChromeEvent} */
3580 chrome.input.ime.onCandidateClicked;
3581
3582
3583 /** @type {!ChromeEvent} */
3584 chrome.input.ime.onDeactivated;
3585
3586
3587 /** @type {!ChromeEvent} */
3588 chrome.input.ime.onFocus;
3589
3590
3591 /** @type {!ChromeEvent} */
3592 chrome.input.ime.onInputContextUpdate;
3593
3594
3595 /** @type {!ChromeInputImeOnKeyEventEvent} */
3596 chrome.input.ime.onKeyEvent;
3597
3598
3599 /** @type {!ChromeEvent} */
3600 chrome.input.ime.onMenuItemActivated;
3601
3602
3603 /** @type {!ChromeEvent} */
3604 chrome.input.ime.onReset;
3605
3606
3607 /** @type {!ChromeEvent} */
3608 chrome.input.ime.onSurroundingTextChanged;
3609
3610
3611 /**
3612  * namespace
3613  * @see http://developer.chrome.com/apps/mediaGalleries
3614  * @const
3615  */
3616 chrome.mediaGalleries = {};
3617
3618
3619 /**
3620  * @param {{interactive: (string|undefined)}|function(!Array.<!FileSystem>)}
3621  *     detailsOrCallback A details object for whether the request should be
3622  *     interactive if permissions haven't been granted yet or the callback.
3623  * @param {function(!Array.<!FileSystem>)=} opt_callback A success callback if
3624  *     no details were supplied as arg1.
3625  */
3626 chrome.mediaGalleries.getMediaFileSystems = function(
3627     detailsOrCallback, opt_callback) {};
3628
3629
3630 /**
3631  * @param {function(!Array.<!FileSystem>, string)} callback Callback function.
3632  */
3633 chrome.mediaGalleries.addUserSelectedFolder = function(callback) {};
3634
3635 chrome.mediaGalleries.startMediaScan = function() {};
3636
3637 chrome.mediaGalleries.cancelMediaScan = function() {};
3638
3639
3640 /**
3641  * @param {function(!Array.<!FileSystem>)} callback Callback function.
3642  */
3643 chrome.mediaGalleries.addScanResults = function(callback) {};
3644
3645
3646 /**
3647  * @typedef {{
3648  *   name: string,
3649  *   galleryId: string,
3650  *   deviceId: (string|undefined),
3651  *   isRemovable: boolean,
3652  *   isMediaDevice: boolean,
3653  *   isAvailable: boolean
3654  * }}
3655  */
3656 chrome.mediaGalleries.MediaFileSystemMetadata;
3657
3658
3659 /**
3660  * @param {!FileSystem} mediaFileSystem The file system to get metadata for.
3661  * @return {!chrome.mediaGalleries.MediaFileSystemMetadata}
3662  */
3663 chrome.mediaGalleries.getMediaFileSystemMetadata = function(mediaFileSystem) {};
3664
3665
3666 /**
3667  * @param {function(!Array.<!chrome.mediaGalleries.MediaFileSystemMetadata>)}
3668  *     callback Callback function.
3669  */
3670 chrome.mediaGalleries.getAllMediaFileSystemMetadata = function(callback) {};
3671
3672
3673 /**
3674  * @typedef {{
3675  *   mimeType: string,
3676  *   height: (number|undefined),
3677  *   width: (number|undefined),
3678  *   duration: (number|undefined),
3679  *   rotation: (number|undefined),
3680  *   album: (string|undefined),
3681  *   artist: (string|undefined),
3682  *   comment: (string|undefined),
3683  *   copyright: (string|undefined),
3684  *   disc: (number|undefined),
3685  *   genre: (string|undefined),
3686  *   language: (string|undefined),
3687  *   title: (string|undefined),
3688  *   track: (number|undefined)
3689  * }}
3690  */
3691 chrome.mediaGalleries.MetaData;
3692
3693
3694 /**
3695  * @param {!Blob} mediaFile The media file for which to get metadata.
3696  * @param {{metadataType: (string|undefined)}|
3697  *     function(!chrome.mediaGalleries.MetaData)} optionsOrCallback The options
3698  *     for the metadata to retrieve or the callback to invoke with the metadata.
3699  *     The metadataType should either be 'all' or 'mimeTypeOnly'. Defaults to
3700  *     'all' if the metadataType is omitted.
3701  * @param {function(!chrome.mediaGalleries.MetaData)=} opt_callback If options
3702  *     were passed as arg2, the callback to invoke with the metadata.
3703  */
3704 chrome.mediaGalleries.getMetadata = function(
3705     mediaFile, optionsOrCallback, opt_callback) {};
3706
3707
3708 /**
3709  * @typedef {{
3710  *   type: string,
3711  *   galleryCount: (number|undefined),
3712  *   audioCount: (number|undefined),
3713  *   imageCount: (number|undefined),
3714  *   videoCount: (number|undefined)
3715  * }}
3716  */
3717 chrome.mediaGalleries.OnScanProgressDetails;
3718
3719
3720
3721 /**
3722  * Event whose listeners take a chrome.mediaGalleries.OnScanProgressDetails
3723  * parameter.
3724  * @constructor
3725  */
3726 chrome.mediaGalleries.ScanProgressEvent = function() {};
3727
3728
3729 /** @param {function(!chrome.mediaGalleries.OnScanProgressDetails)} callback */
3730 chrome.mediaGalleries.ScanProgressEvent.prototype.addListener =
3731     function(callback) {};
3732
3733
3734 /** @param {function(!chrome.mediaGalleries.OnScanProgressDetails)} callback */
3735 chrome.mediaGalleries.ScanProgressEvent.prototype.removeListener =
3736     function(callback) {};
3737
3738
3739 /**
3740  * @param {function(!chrome.mediaGalleries.OnScanProgressDetails)} callback
3741  * @return {boolean}
3742  */
3743 chrome.mediaGalleries.ScanProgressEvent.prototype.hasListener =
3744     function(callback) {};
3745
3746
3747 /** @return {boolean} */
3748 chrome.mediaGalleries.ScanProgressEvent.prototype.hasListeners = function() {};
3749
3750
3751 /** @type {!chrome.mediaGalleries.ScanProgressEvent} */
3752 chrome.mediaGalleries.onScanProgress;
3753
3754
3755 /**
3756  * @const
3757  * @see https://developer.chrome.com/extensions/pageCapture.html
3758  */
3759 chrome.pageCapture = {};
3760
3761
3762 /**
3763  * @param {Object.<string, number>} details Object with a 'tabId' (number) key.
3764  * @param {function(Blob=): void} callback Callback function.
3765  */
3766 chrome.pageCapture.saveAsMHTML = function(details, callback) {};
3767
3768
3769 /**
3770  * @const
3771  * @see https://developer.chrome.com/extensions/permissions.html
3772  */
3773 chrome.permissions = {};
3774
3775
3776 /**
3777  * @typedef {{
3778  *   permissions: (Array.<string>|undefined),
3779  *   origins: (Array.<string>|undefined)
3780  * }}
3781  * @see http://developer.chrome.com/extensions/permissions.html#type-Permissions
3782  */
3783 chrome.permissions.Permissions;
3784
3785
3786 /**
3787  * @param {!chrome.permissions.Permissions} permissions
3788  * @param {function(boolean): void} callback Callback function.
3789  */
3790 chrome.permissions.contains = function(permissions, callback) {};
3791
3792
3793 /**
3794  * @param {function(!chrome.permissions.Permissions): void} callback
3795  *     Callback function.
3796  */
3797 chrome.permissions.getAll = function(callback) {};
3798
3799
3800 /**
3801  * @param {!chrome.permissions.Permissions} permissions
3802  * @param {function(boolean): void=} opt_callback Callback function.
3803  */
3804 chrome.permissions.remove = function(permissions, opt_callback) {};
3805
3806
3807 /**
3808  * @param {!chrome.permissions.Permissions} permissions
3809  * @param {function(boolean): void=} opt_callback Callback function.
3810  */
3811 chrome.permissions.request = function(permissions, opt_callback) {};
3812
3813
3814 /** @type {!ChromeEvent} */
3815 chrome.permissions.onAdded;
3816
3817
3818 /** @type {!ChromeEvent} */
3819 chrome.permissions.onRemoved;
3820
3821
3822 /**
3823  * @see http://developer.chrome.com/dev/extensions/power.html
3824  */
3825 chrome.power = {};
3826
3827
3828 /**
3829  * @param {string} level A string describing the degree to which power
3830  *     management should be disabled, should be either "system" or "display".
3831  */
3832 chrome.power.requestKeepAwake = function(level) {};
3833
3834
3835 /**
3836  * Releases a request previously made via requestKeepAwake().
3837  */
3838 chrome.power.releaseKeepAwake = function() {};
3839
3840
3841 /**
3842  * @const
3843  * @see https://developer.chrome.com/extensions/privacy.html
3844  */
3845 chrome.privacy = {};
3846
3847
3848 /** @type {!Object.<string,!ChromeSetting>} */
3849 chrome.privacy.network;
3850
3851
3852 /** @type {!Object.<string,!ChromeSetting>} */
3853 chrome.privacy.services;
3854
3855
3856 /** @type {!Object.<string,!ChromeSetting>} */
3857 chrome.privacy.websites;
3858
3859
3860 /**
3861  * @const
3862  * @see https://developer.chrome.com/extensions/proxy.html
3863  */
3864 chrome.proxy = {};
3865
3866
3867 /** @type {!Object.<string,!ChromeSetting>} */
3868 chrome.proxy.settings;
3869
3870
3871 /** @type {!ChromeEvent} */
3872 chrome.proxy.onProxyError;
3873
3874
3875 /**
3876  * @const
3877  * @see http://developer.chrome.com/apps/socket.html
3878  */
3879 chrome.socket = {};
3880
3881
3882
3883 /**
3884  * @constructor
3885  */
3886 chrome.socket.CreateInfo = function() {};
3887
3888
3889 /** @type {number} */
3890 chrome.socket.CreateInfo.prototype.socketId;
3891
3892
3893
3894 /**
3895  * @constructor
3896  */
3897 chrome.socket.ReadInfo = function() {};
3898
3899
3900 /** @type {number} */
3901 chrome.socket.ReadInfo.prototype.resultCode;
3902
3903
3904 /** @type {!ArrayBuffer} */
3905 chrome.socket.ReadInfo.prototype.data;
3906
3907
3908
3909 /**
3910  * @constructor
3911  */
3912 chrome.socket.WriteInfo = function() {};
3913
3914
3915 /** @type {number} */
3916 chrome.socket.WriteInfo.prototype.bytesWritten;
3917
3918
3919
3920 /**
3921  * @constructor
3922  */
3923 chrome.socket.RecvFromInfo = function() {};
3924
3925
3926 /** @type {number} */
3927 chrome.socket.RecvFromInfo.prototype.resultCode;
3928
3929
3930 /** @type {!ArrayBuffer} */
3931 chrome.socket.RecvFromInfo.prototype.data;
3932
3933
3934 /** @type {string} */
3935 chrome.socket.RecvFromInfo.prototype.address;
3936
3937
3938 /** @type {number} */
3939 chrome.socket.RecvFromInfo.prototype.port;
3940
3941
3942
3943 /**
3944  * @constructor
3945  */
3946 chrome.socket.AcceptInfo = function() {};
3947
3948
3949 /** @type {number} */
3950 chrome.socket.AcceptInfo.prototype.resultCode;
3951
3952
3953 /** @type {(number|undefined)} */
3954 chrome.socket.AcceptInfo.prototype.socketId;
3955
3956
3957
3958 /**
3959  * @constructor
3960  */
3961 chrome.socket.SocketInfo = function() {};
3962
3963
3964 /** @type {string} */
3965 chrome.socket.SocketInfo.prototype.socketType;
3966
3967
3968 /** @type {boolean} */
3969 chrome.socket.SocketInfo.prototype.connected;
3970
3971
3972 /** @type {(string|undefined)} */
3973 chrome.socket.SocketInfo.prototype.peerAddress;
3974
3975
3976 /** @type {(number|undefined)} */
3977 chrome.socket.SocketInfo.prototype.peerPort;
3978
3979
3980 /** @type {(string|undefined)} */
3981 chrome.socket.SocketInfo.prototype.localAddress;
3982
3983
3984 /** @type {(number|undefined)} */
3985 chrome.socket.SocketInfo.prototype.localPort;
3986
3987
3988
3989 /**
3990  * @constructor
3991  */
3992 chrome.socket.NetworkAdapterInfo = function() {};
3993
3994
3995 /** @type {string} */
3996 chrome.socket.NetworkAdapterInfo.prototype.name;
3997
3998
3999 /** @type {string} */
4000 chrome.socket.NetworkAdapterInfo.prototype.address;
4001
4002
4003 /**
4004  * @param {string} type The type of socket to create. Must be 'tcp' or 'udp'.
4005  * @param {(Object|function(!chrome.socket.CreateInfo))} optionsOrCallback The
4006  *     socket options or callback.
4007  * @param {function(!chrome.socket.CreateInfo)=} opt_callback Called when the
4008  *     socket has been created.
4009  */
4010 chrome.socket.create = function(type, optionsOrCallback, opt_callback) {};
4011
4012
4013 /**
4014  * @param {number} socketId The id of the socket to destroy.
4015  */
4016 chrome.socket.destroy = function(socketId) {};
4017
4018
4019 /**
4020  * @param {number} socketId The id of the socket.
4021  * @param {string} hostname The hostname or IP address of the remote machine.
4022  * @param {number} port The port of the remote machine.
4023  * @param {function(number)} callback Called when the connection attempt is
4024  *     complete.
4025  */
4026 chrome.socket.connect = function(socketId, hostname, port, callback) {};
4027
4028
4029 /**
4030  * @param {number} socketId The id of the socket.
4031  * @param {string} address The address of the local machine.
4032  * @param {number} port The port of the local machine.
4033  * @param {function(number)} callback Called when the bind attempt is complete.
4034  */
4035 chrome.socket.bind = function(socketId, address, port, callback) {};
4036
4037
4038 /**
4039  * @param {number} socketId The id of the socket to disconnect.
4040  */
4041 chrome.socket.disconnect = function(socketId) {};
4042
4043
4044 /**
4045  * @param {number} socketId The id of the socket to read from.
4046  * @param {(number|function(!chrome.socket.ReadInfo))} bufferSizeOrCallback The
4047  *     read buffer size or the callback.
4048  * @param {function(!chrome.socket.ReadInfo)=} opt_callback Called with data
4049  *     that was available to be read without blocking.
4050  */
4051 chrome.socket.read = function(socketId, bufferSizeOrCallback, opt_callback) {};
4052
4053
4054 /**
4055  * @param {number} socketId The id of the socket to write to.
4056  * @param {!ArrayBuffer} data The data to write.
4057  * @param {function(!chrome.socket.WriteInfo)} callback Called when the write
4058  *     operation completes without blocking or an error occurs.
4059  */
4060 chrome.socket.write = function(socketId, data, callback) {};
4061
4062
4063 /**
4064  * @param {number} socketId The id of the socket to read from.
4065  * @param {(number|function(!chrome.socket.RecvFromInfo))} bufferSizeOrCallback
4066  *     The read buffer size or the callback.
4067  * @param {function(!chrome.socket.RecvFromInfo)=} opt_callback Called with data
4068  *     that was available to be read without blocking.
4069  */
4070 chrome.socket.recvFrom = function(socketId, bufferSizeOrCallback,
4071     opt_callback) {};
4072
4073
4074 /**
4075  * @param {number} socketId The id of the socket to write to.
4076  * @param {!ArrayBuffer} data The data to write.
4077  * @param {string} address The address of the remote machine.
4078  * @param {number} port The port of the remote machine.
4079  * @param {function(!chrome.socket.WriteInfo)} callback Called when the write
4080  *     operation completes without blocking or an error occurs.
4081  */
4082 chrome.socket.sendTo = function(socketId, data, address, port, callback) {};
4083
4084
4085 /**
4086  * @param {number} socketId The id of the socket to listen on.
4087  * @param {string} address The address of the local machine to listen on. Use
4088  *     '0' to listen on all addresses.
4089  * @param {number} port The port of the local machine.
4090  * @param {(number|function(number))} backlogOrCallback The length of the
4091  *     socket's listen queue or the callback.
4092  * @param {function(number)=} opt_callback Called when the listen operation
4093  *     completes.
4094  */
4095 chrome.socket.listen =
4096     function(socketId, address, port, backlogOrCallback, opt_callback) {};
4097
4098
4099 /**
4100  * @param {number} socketId The id of the socket to accept a connection on.
4101  * @param {function(!chrome.socket.AcceptInfo)} callback Called when a new
4102  *     socket is accepted.
4103  */
4104 chrome.socket.accept = function(socketId, callback) {};
4105
4106
4107 /**
4108  * @param {number} socketId The id of the socket to listen on.
4109  * @param {boolean} enable If true, enable keep-alive functionality.
4110  * @param {(number|function(boolean))} delayOrCallback The delay in seconds
4111  *     between the last packet received and the first keepalive probe (default
4112  *     is 0) or the callback
4113  * @param {function(boolean)=} opt_callback Called when the setKeepAlive attempt
4114  *     is complete.
4115  */
4116 chrome.socket.setKeepAlive = function(socketId, enable, delayOrCallback,
4117     opt_callback) {};
4118
4119
4120 /**
4121  * @param {number} socketId The id of the socket to listen on.
4122  * @param {boolean} noDelay If true, disables Nagle's algorithm.
4123  * @param {function(boolean)} callback Called when the setNoDelay attempt is
4124  *     complete.
4125  */
4126 chrome.socket.setNoDelay = function(socketId, noDelay, callback) {};
4127
4128
4129 /**
4130  * @param {number} socketId The id of the socket.
4131  * @param {function(!chrome.socket.SocketInfo)} callback Called when the state
4132  *     is available.
4133  */
4134 chrome.socket.getInfo = function(socketId, callback) {};
4135
4136
4137 /**
4138  * @param {function(!Array.<!chrome.socket.NetworkAdapterInfo>)} callback Called
4139  *     when local adapter information is available.
4140  */
4141 chrome.socket.getNetworkList = function(callback) {};
4142
4143
4144 /**
4145  * @param {number} socketId The id of the socket.
4146  * @param {string} address The group address to join. Domain names are not
4147  *     supported.
4148  * @param {function(number)} callback Called when the join operation is done.
4149  */
4150 chrome.socket.joinGroup = function(socketId, address, callback) {};
4151
4152
4153 /**
4154  * @param {number} socketId The id of the socket.
4155  * @param {string} address The group address to leave. Domain names are not
4156  *     supported.
4157  * @param {function(number)} callback Called when the leave operation is done.
4158  */
4159 chrome.socket.leaveGroup = function(socketId, address, callback) {};
4160
4161
4162 /**
4163  * @param {number} socketId The id of the socket.
4164  * @param {number} ttl The time-to-live value.
4165  * @param {function(number)} callback Called when the configuration operation is
4166  *     done.
4167  */
4168 chrome.socket.setMulticastTimeToLive = function(socketId, ttl, callback) {};
4169
4170
4171 /**
4172  * @param {number} socketId The id of the socket.
4173  * @param {boolean} enabled True to enable loopback mode.
4174  * @param {function(number)} callback Called when the configuration operation is
4175  *     done.
4176  */
4177 chrome.socket.setMulticastLoopbackMode = function(socketId, enabled,
4178     callback) {};
4179
4180
4181 /**
4182  * @param {number} socketId The id of the socket.
4183  * @param {function(!Array.<string>)} callback Called with an array of string
4184  *     groups.
4185  */
4186 chrome.socket.getJoinedGroups = function(socketId, callback) {};
4187
4188
4189 /**
4190  * @const
4191  * @see https://developer.chrome.com/extensions/storage.html
4192  */
4193 chrome.storage = {};
4194
4195
4196 /** @type {!StorageArea} */
4197 chrome.storage.sync;
4198
4199
4200 /** @type {!StorageArea} */
4201 chrome.storage.local;
4202
4203
4204 /** @type {!StorageChangeEvent} */
4205 chrome.storage.onChanged;
4206
4207
4208 /** @const */
4209 chrome.system = {};
4210
4211
4212 /**
4213  * @const
4214  * @see http://developer.chrome.com/apps/system_display.html
4215  */
4216 chrome.system.display = {};
4217
4218
4219 /** @type {!ChromeEvent} */
4220 chrome.system.display.onDisplayChanged;
4221
4222
4223
4224 /**
4225  * @constructor
4226  */
4227 chrome.system.display.Bounds = function() {};
4228
4229
4230 /** @type {number} */
4231 chrome.system.display.Bounds.prototype.left;
4232
4233
4234 /** @type {number} */
4235 chrome.system.display.Bounds.prototype.top;
4236
4237
4238 /** @type {number} */
4239 chrome.system.display.Bounds.prototype.width;
4240
4241
4242 /** @type {number} */
4243 chrome.system.display.Bounds.prototype.height;
4244
4245
4246 /**
4247  * @typedef {{
4248  *   left: (number|undefined),
4249  *   top: (number|undefined),
4250  *   right: (number|undefined),
4251  *   bottom: (number|undefined)
4252  * }}
4253  */
4254 chrome.system.display.Insets;
4255
4256
4257
4258 /**
4259  * @constructor
4260  */
4261 chrome.system.display.DisplayInfo = function() {};
4262
4263
4264 /** @type {string} */
4265 chrome.system.display.DisplayInfo.prototype.id;
4266
4267
4268 /** @type {string} */
4269 chrome.system.display.DisplayInfo.prototype.name;
4270
4271
4272 /** @type {string} */
4273 chrome.system.display.DisplayInfo.prototype.mirroringSourceId;
4274
4275
4276 /** @type {boolean} */
4277 chrome.system.display.DisplayInfo.prototype.isPrimary;
4278
4279
4280 /** @type {boolean} */
4281 chrome.system.display.DisplayInfo.prototype.isInternal;
4282
4283
4284 /** @type {boolean} */
4285 chrome.system.display.DisplayInfo.prototype.isEnabled;
4286
4287
4288 /** @type {number} */
4289 chrome.system.display.DisplayInfo.prototype.dpiX;
4290
4291
4292 /** @type {number} */
4293 chrome.system.display.DisplayInfo.prototype.dpiY;
4294
4295
4296 /** @type {number} */
4297 chrome.system.display.DisplayInfo.prototype.rotation;
4298
4299
4300 /** @type {!chrome.system.display.Bounds} */
4301 chrome.system.display.DisplayInfo.prototype.bounds;
4302
4303
4304 /** @type {!chrome.system.display.Insets} */
4305 chrome.system.display.DisplayInfo.prototype.overscan;
4306
4307
4308 /** @type {!chrome.system.display.Bounds} */
4309 chrome.system.display.DisplayInfo.prototype.workArea;
4310
4311
4312 /**
4313  * @typedef {{
4314  *   mirroringSourceId: (string|undefined),
4315  *   isPrimary: (boolean|undefined),
4316  *   overscan: (!chrome.system.display.Insets|undefined),
4317  *   rotation: (number|undefined),
4318  *   boundsOriginX: (number|undefined),
4319  *   boundsOriginY: (number|undefined)
4320  * }}
4321  */
4322 chrome.system.display.SettableDisplayInfo;
4323
4324
4325 chrome.types = {};
4326
4327
4328 /**
4329  * @typedef {?{
4330  *   format: (string|undefined),
4331  *   quality: (number|undefined)
4332  * }}
4333  */
4334 chrome.types.ImageDetails;
4335
4336
4337 /**
4338  * @param {function(!Array.<!chrome.system.display.DisplayInfo>)}
4339  *     callback Called with an array of objects representing display info.
4340  */
4341 chrome.system.display.getInfo = function(callback) {};
4342
4343
4344 /**
4345  * @param {string} id The display's unique identifier.
4346  * @param {!chrome.system.display.SettableDisplayInfo} info The information
4347  *     about display properties that should be changed.
4348  * @param {function()=} opt_callback The callback to execute when the display
4349  *     info has been changed.
4350  */
4351 chrome.system.display.setDisplayProperties =
4352     function(id, info, opt_callback) {};
4353
4354
4355 /**
4356  * @const
4357  * @see https://developer.chrome.com/extensions/types.html
4358  */
4359 chrome.chromeSetting = {};
4360
4361
4362 /** @type {!ChromeEvent} */
4363 chrome.chromeSetting.onChange;
4364
4365
4366 /**
4367  * @const
4368  * @see https://developer.chrome.com/extensions/webNavigation.html
4369  */
4370 chrome.webNavigation = {};
4371
4372
4373 /**
4374  * @param {Object} details Object with a 'tabId' (number) key.
4375  * @param {function(!Array.<Object.<string, (boolean|number|string)>>)} callback
4376  *     Callback function.
4377  */
4378 chrome.webNavigation.getAllFrames = function(details, callback) {};
4379
4380
4381 /**
4382  * @param {Object} details Object with 'tabId' (number) and 'frameId' (number)
4383  *     keys.
4384  * @param {function(Object.<string, (boolean|string)>)} callback
4385  *     Callback function.
4386  */
4387 chrome.webNavigation.getFrame = function(details, callback) {};
4388
4389
4390 /** @type {!ChromeEvent} */
4391 chrome.webNavigation.onBeforeNavigate;
4392
4393
4394 /** @type {!ChromeEvent} */
4395 chrome.webNavigation.onCommitted;
4396
4397
4398 /** @type {!ChromeEvent} */
4399 chrome.webNavigation.onDOMContentLoaded;
4400
4401
4402 /** @type {!ChromeEvent} */
4403 chrome.webNavigation.onCompleted;
4404
4405
4406 /** @type {!ChromeEvent} */
4407 chrome.webNavigation.onErrorOccurred;
4408
4409
4410 /** @type {!ChromeEvent} */
4411 chrome.webNavigation.onCreatedNavigationTarget;
4412
4413
4414 /** @type {!ChromeEvent} */
4415 chrome.webNavigation.onReferenceFragmentUpdated;
4416
4417
4418 /** @type {!ChromeEvent} */
4419 chrome.webNavigation.onTabReplaced;
4420
4421
4422 /** @type {!ChromeEvent} */
4423 chrome.webNavigation.onHistoryStateUpdated;
4424
4425
4426
4427 /**
4428  * Most event listeners for WebRequest take extra arguments.
4429  * @see https://developer.chrome.com/extensions/webRequest.html.
4430  * @constructor
4431  */
4432 function WebRequestEvent() {}
4433
4434
4435 /**
4436  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
4437  *     function.
4438  * @param {!RequestFilter} filter A set of filters that restrict
4439  *     the events that will be sent to this listener.
4440  * @param {Array.<string>=} opt_extraInfoSpec Array of extra information
4441  *     that should be passed to the listener function.
4442  */
4443 WebRequestEvent.prototype.addListener =
4444     function(listener, filter, opt_extraInfoSpec) {};
4445
4446
4447 /**
4448  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
4449  *     function.
4450  */
4451 WebRequestEvent.prototype.removeListener = function(listener) {};
4452
4453
4454 /**
4455  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
4456  *     function.
4457  */
4458 WebRequestEvent.prototype.hasListener = function(listener) {};
4459
4460
4461 /**
4462  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
4463  *     function.
4464  */
4465 WebRequestEvent.prototype.hasListeners = function(listener) {};
4466
4467
4468
4469 /**
4470  * The onErrorOccurred event takes one less parameter than the others.
4471  * @see https://developer.chrome.com/extensions/webRequest.html.
4472  * @constructor
4473  */
4474 function WebRequestOnErrorOccurredEvent() {}
4475
4476
4477 /**
4478  * @param {function(!Object): void} listener Listener function.
4479  * @param {!RequestFilter} filter A set of filters that restrict
4480  *     the events that will be sent to this listener.
4481  */
4482 WebRequestOnErrorOccurredEvent.prototype.addListener =
4483     function(listener, filter) {};
4484
4485
4486 /**
4487  * @param {function(!Object): void} listener Listener function.
4488  */
4489 WebRequestOnErrorOccurredEvent.prototype.removeListener = function(listener) {};
4490
4491
4492 /**
4493  * @param {function(!Object): void} listener Listener function.
4494  */
4495 WebRequestOnErrorOccurredEvent.prototype.hasListener = function(listener) {};
4496
4497
4498 /**
4499  * @param {function(!Object): void} listener Listener function.
4500  */
4501 WebRequestOnErrorOccurredEvent.prototype.hasListeners = function(listener) {};
4502
4503
4504 /**
4505  * @const
4506  * @see https://developer.chrome.com/extensions/webRequest.html
4507  */
4508 chrome.webRequest = {};
4509
4510
4511 /**
4512  * @param {function(): void=} opt_callback Callback function.
4513  */
4514 chrome.webRequest.handlerBehaviorChanged = function(opt_callback) {};
4515
4516
4517 /** @type {!WebRequestEvent} */
4518 chrome.webRequest.onAuthRequired;
4519
4520
4521 /** @type {!WebRequestEvent} */
4522 chrome.webRequest.onBeforeRedirect;
4523
4524
4525 /** @type {!WebRequestEvent} */
4526 chrome.webRequest.onBeforeRequest;
4527
4528
4529 /** @type {!WebRequestEvent} */
4530 chrome.webRequest.onBeforeSendHeaders;
4531
4532
4533 /** @type {!WebRequestEvent} */
4534 chrome.webRequest.onCompleted;
4535
4536
4537 /** @type {!WebRequestOnErrorOccurredEvent} */
4538 chrome.webRequest.onErrorOccurred;
4539
4540
4541 /** @type {!WebRequestEvent} */
4542 chrome.webRequest.onHeadersReceived;
4543
4544
4545 /** @type {!WebRequestEvent} */
4546 chrome.webRequest.onResponseStarted;
4547
4548
4549 /** @type {!WebRequestEvent} */
4550 chrome.webRequest.onSendHeaders;
4551
4552
4553 // Classes
4554
4555
4556
4557 /**onKeyEvent
4558  * @see https://developer.chrome.com/extensions/management.html
4559  * @constructor
4560  */
4561 function ExtensionInfo() {}
4562
4563
4564 /** @type {string} */
4565 ExtensionInfo.prototype.id;
4566
4567
4568 /** @type {string} */
4569 ExtensionInfo.prototype.name;
4570
4571
4572 /** @type {string} */
4573 ExtensionInfo.prototype.description;
4574
4575
4576 /** @type {string} */
4577 ExtensionInfo.prototype.version;
4578
4579
4580 /** @type {boolean} */
4581 ExtensionInfo.prototype.mayDisable;
4582
4583
4584 /** @type {boolean} */
4585 ExtensionInfo.prototype.enabled;
4586
4587
4588 /** @type {string|undefined} */
4589 ExtensionInfo.prototype.disabledReason;
4590
4591
4592 /** @type {boolean} */
4593 ExtensionInfo.prototype.isApp;
4594
4595
4596 /** @type {string|undefined} */
4597 ExtensionInfo.prototype.appLaunchUrl;
4598
4599
4600 /** @type {string|undefined} */
4601 ExtensionInfo.prototype.homepageUrl;
4602
4603
4604 /** @type {string|undefined} */
4605 ExtensionInfo.prototype.updateUrl;
4606
4607
4608 /** @type {boolean} */
4609 ExtensionInfo.prototype.offlineEnabled;
4610
4611
4612 /** @type {string} */
4613 ExtensionInfo.prototype.optionsUrl;
4614
4615
4616 /** @type {!Array.<!IconInfo>|undefined} */
4617 ExtensionInfo.prototype.icons;
4618
4619
4620 /** @type {!Array.<string>} */
4621 ExtensionInfo.prototype.permissions;
4622
4623
4624 /** @type {!Array.<string>} */
4625 ExtensionInfo.prototype.hostPermissions;
4626
4627
4628 /** @type {string} */
4629 ExtensionInfo.prototype.installType;
4630
4631
4632 /** @type {string|undefined} */
4633 ExtensionInfo.prototype.launchType;
4634
4635
4636 /** @type {!Array.<string>|undefined} */
4637 ExtensionInfo.prototype.availableLaunchTypes;
4638
4639
4640
4641 /**
4642  * @see https://developer.chrome.com/extensions/management.html
4643  * @constructor
4644  */
4645 function IconInfo() {}
4646
4647
4648 /** @type {number} */
4649 IconInfo.prototype.size;
4650
4651
4652 /** @type {string} */
4653 IconInfo.prototype.url;
4654
4655
4656
4657 /**
4658  * @see https://developer.chrome.com/extensions/tabs
4659  * @constructor
4660  */
4661 function Tab() {}
4662
4663
4664 // TODO: Make this field optional once dependent projects have been updated.
4665 /**
4666  * @type {number}
4667  */
4668 Tab.prototype.id;
4669
4670
4671 /** @type {number} */
4672 Tab.prototype.index;
4673
4674
4675 /** @type {number} */
4676 Tab.prototype.windowId;
4677
4678
4679 // TODO: Make this field optional once dependent projects have been updated.
4680 /**
4681  * @type {number}
4682  */
4683 Tab.prototype.openerTabId;
4684
4685
4686 /** @type {boolean} */
4687 Tab.prototype.highlighted;
4688
4689
4690 /** @type {boolean} */
4691 Tab.prototype.active;
4692
4693
4694 /** @type {boolean} */
4695 Tab.prototype.pinned;
4696
4697
4698 // TODO: Make this field optional once dependent projects have been updated.
4699 /**
4700  * @type {string}
4701  */
4702 Tab.prototype.url;
4703
4704
4705 // TODO: Make this field optional once dependent projects have been updated.
4706 /**
4707  * @type {string}
4708  */
4709 Tab.prototype.title;
4710
4711
4712 // TODO: Make this field optional once dependent projects have been updated.
4713 /**
4714  * @type {string}
4715  */
4716 Tab.prototype.favIconUrl;
4717
4718
4719 // TODO: Make this field optional once dependent projects have been updated.
4720 /**
4721  * @type {string}
4722  */
4723 Tab.prototype.status;
4724
4725
4726 /** @type {boolean} */
4727 Tab.prototype.incognito;
4728
4729
4730 /** @type {number|undefined} */
4731 Tab.prototype.width;
4732
4733
4734 /** @type {number|undefined} */
4735 Tab.prototype.height;
4736
4737
4738 /** @type {number|undefined} */
4739 Tab.prototype.sessionId;
4740
4741
4742
4743 /**
4744  * @see https://developer.chrome.com/extensions/windows.html
4745  * @constructor
4746  */
4747 function ChromeWindow() {}
4748
4749
4750 /** @type {number} */
4751 ChromeWindow.prototype.id;
4752
4753
4754 /** @type {boolean} */
4755 ChromeWindow.prototype.focused;
4756
4757
4758 /** @type {number} */
4759 ChromeWindow.prototype.top;
4760
4761
4762 /** @type {number} */
4763 ChromeWindow.prototype.left;
4764
4765
4766 /** @type {number} */
4767 ChromeWindow.prototype.width;
4768
4769
4770 /** @type {number} */
4771 ChromeWindow.prototype.height;
4772
4773
4774 /** @type {Array.<Tab>} */
4775 ChromeWindow.prototype.tabs;
4776
4777
4778 /** @type {boolean} */
4779 ChromeWindow.prototype.incognito;
4780
4781
4782 /** @type {string} */
4783 ChromeWindow.prototype.type;
4784
4785
4786 /** @type {string} */
4787 ChromeWindow.prototype.state;
4788
4789
4790 /** @type {boolean} */
4791 ChromeWindow.prototype.alwaysOnTop;
4792
4793
4794
4795 /**
4796  * @see https://developer.chrome.com/extensions/events.html
4797  * @constructor
4798  */
4799 function ChromeEvent() {}
4800
4801
4802 /** @param {!Function} callback */
4803 ChromeEvent.prototype.addListener = function(callback) {};
4804
4805
4806 /** @param {!Function} callback */
4807 ChromeEvent.prototype.removeListener = function(callback) {};
4808
4809
4810 /**
4811  * @param {!Function} callback
4812  * @return {boolean}
4813  */
4814 ChromeEvent.prototype.hasListener = function(callback) {};
4815
4816
4817 /** @return {boolean} */
4818 ChromeEvent.prototype.hasListeners = function() {};
4819
4820
4821
4822 /**
4823  * Event whose listeners take a string parameter.
4824  * @constructor
4825  */
4826 function ChromeStringEvent() {}
4827
4828
4829 /** @param {function(string): void} callback */
4830 ChromeStringEvent.prototype.addListener = function(callback) {};
4831
4832
4833 /** @param {function(string): void} callback */
4834 ChromeStringEvent.prototype.removeListener = function(callback) {};
4835
4836
4837 /**
4838  * @param {function(string): void} callback
4839  * @return {boolean}
4840  */
4841 ChromeStringEvent.prototype.hasListener = function(callback) {};
4842
4843
4844 /** @return {boolean} */
4845 ChromeStringEvent.prototype.hasListeners = function() {};
4846
4847
4848
4849 /**
4850  * Event whose listeners take a boolean parameter.
4851  * @constructor
4852  */
4853
4854 function ChromeBooleanEvent() {}
4855
4856
4857 /**
4858  * @param {function(boolean): void} callback
4859  */
4860 ChromeBooleanEvent.prototype.addListener = function(callback) {};
4861
4862
4863 /**
4864  * @param {function(boolean): void} callback
4865  */
4866 ChromeBooleanEvent.prototype.removeListener = function(callback) {};
4867
4868
4869 /**
4870  * @param {function(boolean): void} callback
4871  * @return {boolean}
4872  */
4873 ChromeBooleanEvent.prototype.hasListener = function(callback) {};
4874
4875
4876 /**
4877  * @return {boolean}
4878  */
4879 ChromeBooleanEvent.prototype.hasListeners = function() {};
4880
4881
4882
4883 /**
4884  * Event whose listeners take a number parameter.
4885  * @constructor
4886  */
4887
4888 function ChromeNumberEvent() {}
4889
4890
4891 /**
4892  * @param {function(number): void} callback
4893  */
4894 ChromeNumberEvent.prototype.addListener = function(callback) {};
4895
4896
4897 /**
4898  * @param {function(number): void} callback
4899  */
4900 ChromeNumberEvent.prototype.removeListener = function(callback) {};
4901
4902
4903 /**
4904  * @param {function(number): void} callback
4905  * @return {boolean}
4906  */
4907 ChromeNumberEvent.prototype.hasListener = function(callback) {};
4908
4909
4910 /**
4911  * @return {boolean}
4912  */
4913 ChromeNumberEvent.prototype.hasListeners = function() {};
4914
4915
4916
4917 /**
4918  * Event whose listeners take an Object parameter.
4919  * @constructor
4920  */
4921 function ChromeObjectEvent() {}
4922
4923
4924 /**
4925  * @param {function(!Object): void} callback Callback.
4926  */
4927 ChromeObjectEvent.prototype.addListener = function(callback) {};
4928
4929
4930 /**
4931  * @param {function(!Object): void} callback Callback.
4932  */
4933 ChromeObjectEvent.prototype.removeListener = function(callback) {};
4934
4935
4936 /**
4937  * @param {function(!Object): void} callback Callback.
4938  * @return {boolean}
4939  */
4940 ChromeObjectEvent.prototype.hasListener = function(callback) {};
4941
4942
4943 /**
4944  * @return {boolean}
4945  */
4946 ChromeObjectEvent.prototype.hasListeners = function() {};
4947
4948
4949
4950 /**
4951  * Event whose listeners take an ExtensionInfo parameter.
4952  * @constructor
4953  */
4954 function ChromeExtensionInfoEvent() {}
4955
4956
4957 /** @param {function(!ExtensionInfo): void} callback */
4958 ChromeExtensionInfoEvent.prototype.addListener = function(callback) {};
4959
4960
4961 /** @param {function(!ExtensionInfo): void} callback */
4962 ChromeExtensionInfoEvent.prototype.removeListener = function(callback) {};
4963
4964
4965 /**
4966  * @param {function(!ExtensionInfo): void} callback
4967  * @return {boolean}
4968  */
4969 ChromeExtensionInfoEvent.prototype.hasListener = function(callback) {};
4970
4971
4972 /** @return {boolean} */
4973 ChromeExtensionInfoEvent.prototype.hasListeners = function() {};
4974
4975
4976
4977 /**
4978  * Event whose listeners take a string array parameter.
4979  * @constructor
4980  */
4981 function ChromeStringArrayEvent() {}
4982
4983
4984 /** @param {function(!Array.<string>): void} callback */
4985 ChromeStringArrayEvent.prototype.addListener = function(callback) {};
4986
4987
4988 /** @param {function(!Array.<string>): void} callback */
4989 ChromeStringArrayEvent.prototype.removeListener = function(callback) {};
4990
4991
4992 /**
4993  * @param {function(!Array.<string>): void} callback
4994  * @return {boolean}
4995  */
4996 ChromeStringArrayEvent.prototype.hasListener = function(callback) {};
4997
4998
4999 /** @return {boolean} */
5000 ChromeStringArrayEvent.prototype.hasListeners = function() {};
5001
5002
5003
5004 /**
5005  * Event whose listeners take two strings as parameters.
5006  * @constructor
5007  */
5008 function ChromeStringStringEvent() {}
5009
5010
5011 /** @param {function(string, string): void} callback */
5012 ChromeStringStringEvent.prototype.addListener = function(callback) {};
5013
5014
5015 /** @param {function(string, string): void} callback */
5016 ChromeStringStringEvent.prototype.removeListener = function(callback) {};
5017
5018
5019 /**
5020  * @param {function(string, string): void} callback
5021  * @return {boolean}
5022  */
5023 ChromeStringStringEvent.prototype.hasListener = function(callback) {};
5024
5025
5026 /** @return {boolean} */
5027 ChromeStringStringEvent.prototype.hasListeners = function() {};
5028
5029
5030 /**
5031  * @see http://developer.chrome.com/extensions/pushMessaging.html
5032  * @const
5033  */
5034 chrome.pushMessaging = {};
5035
5036
5037 /**
5038  * @type {!chrome.pushMessaging.PushMessageEvent}
5039  */
5040 chrome.pushMessaging.onMessage;
5041
5042
5043 /**
5044  * @param {boolean|function(!chrome.pushMessaging.ChannelIdResult)}
5045  *     interactiveOrCallback Either a flag(optional), if set to true, user will
5046  *     be asked to log in if they are not already logged in, or, when he flag is
5047  *     not given, the callback.
5048  * @param {function(!chrome.pushMessaging.ChannelIdResult)=} opt_callback
5049  *     Callback.
5050  */
5051 chrome.pushMessaging.getChannelId =
5052     function(interactiveOrCallback, opt_callback) {};
5053
5054
5055
5056 /**
5057  * Event whose listeners take a chrome.pushMessaging.Message parameter.
5058  * @constructor
5059  */
5060 chrome.pushMessaging.PushMessageEvent = function() {};
5061
5062
5063 /**
5064  * @param {function(!chrome.pushMessaging.Message): void} callback
5065  */
5066 chrome.pushMessaging.PushMessageEvent.prototype.addListener =
5067     function(callback) {};
5068
5069
5070 /**
5071  * @param {function(!chrome.pushMessaging.Message): void} callback
5072  */
5073 chrome.pushMessaging.PushMessageEvent.prototype.removeListener =
5074     function(callback) {};
5075
5076
5077 /**
5078  * @param {function(!chrome.pushMessaging.Message): void} callback
5079  * @return {boolean}
5080  */
5081 chrome.pushMessaging.PushMessageEvent.prototype.hasListener =
5082     function(callback) {};
5083
5084
5085 /**
5086  * @return {boolean}
5087  */
5088 chrome.pushMessaging.PushMessageEvent.prototype.hasListeners = function() {};
5089
5090
5091
5092 /**
5093  * @see http://developer.chrome.com/apps/runtime.html#type-Port
5094  * @constructor
5095  */
5096 function Port() {}
5097
5098
5099 /** @type {string} */
5100 Port.prototype.name;
5101
5102
5103 /** @type {!ChromeEvent} */
5104 Port.prototype.onDisconnect;
5105
5106
5107 /** @type {!ChromeEvent} */
5108 Port.prototype.onMessage;
5109
5110
5111 /** @type {MessageSender} */
5112 Port.prototype.sender;
5113
5114
5115 /**
5116  * @param {Object.<string>} obj Message object.
5117  */
5118 Port.prototype.postMessage = function(obj) {};
5119
5120
5121 /**
5122  * Note: as of 2012-04-12, this function is no longer documented on
5123  * the public web pages, but there are still existing usages.
5124  */
5125 Port.prototype.disconnect = function() {};
5126
5127
5128
5129 /**
5130  * @see http://developer.chrome.com/extensions/runtime.html#type-MessageSender
5131  * @constructor
5132  */
5133 function MessageSender() {}
5134
5135
5136 /** @type {!Tab|undefined} */
5137 MessageSender.prototype.tab;
5138
5139
5140 /** @type {string|undefined} */
5141 MessageSender.prototype.id;
5142
5143
5144 /** @type {string|undefined} */
5145 MessageSender.prototype.url;
5146
5147
5148 /** @type {string|undefined} */
5149 MessageSender.prototype.tlsChannelId;
5150
5151
5152
5153 /**
5154  * @see https://developer.chrome.com/extensions/bookmarks.html#type-BookmarkTreeNode
5155  * @constructor
5156  */
5157 function BookmarkTreeNode() {}
5158
5159
5160 /** @type {string} */
5161 BookmarkTreeNode.prototype.id;
5162
5163
5164 /** @type {string|undefined} */
5165 BookmarkTreeNode.prototype.parentId;
5166
5167
5168 /** @type {number|undefined} */
5169 BookmarkTreeNode.prototype.index;
5170
5171
5172 /** @type {string|undefined} */
5173 BookmarkTreeNode.prototype.url;
5174
5175
5176 /** @type {string} */
5177 BookmarkTreeNode.prototype.title;
5178
5179
5180 /** @type {number|undefined} */
5181 BookmarkTreeNode.prototype.dateAdded;
5182
5183
5184 /** @type {number|undefined} */
5185 BookmarkTreeNode.prototype.dateGroupModified;
5186
5187
5188 /** @type {string|undefined} */
5189 BookmarkTreeNode.prototype.unmodifiable;
5190
5191
5192 /** @type {!Array.<!BookmarkTreeNode>|undefined} */
5193 BookmarkTreeNode.prototype.children;
5194
5195
5196
5197 /**
5198  * @see https://developer.chrome.com/extensions/dev/cookies.html#type-Cookie
5199  * @constructor
5200  */
5201 function Cookie() {}
5202
5203
5204 /** @type {string} */
5205 Cookie.prototype.name;
5206
5207
5208 /** @type {string} */
5209 Cookie.prototype.value;
5210
5211
5212 /** @type {string} */
5213 Cookie.prototype.domain;
5214
5215
5216 /** @type {boolean} */
5217 Cookie.prototype.hostOnly;
5218
5219
5220 /** @type {string} */
5221 Cookie.prototype.path;
5222
5223
5224 /** @type {boolean} */
5225 Cookie.prototype.secure;
5226
5227
5228 /** @type {boolean} */
5229 Cookie.prototype.httpOnly;
5230
5231
5232 /** @type {boolean} */
5233 Cookie.prototype.session;
5234
5235
5236 /** @type {number} */
5237 Cookie.prototype.expirationDate;
5238
5239
5240 /** @type {string} */
5241 Cookie.prototype.storeId;
5242
5243
5244
5245 /**
5246  * @see https://developer.chrome.com/extensions/dev/cookies.html#type-CookieStore
5247  * @constructor
5248  */
5249 function CookieStore() {}
5250
5251
5252 /** @type {string} */
5253 CookieStore.prototype.id;
5254
5255
5256 /** @type {Array.<number>} */
5257 CookieStore.prototype.tabIds;
5258
5259
5260
5261 /**
5262  * @see https://developer.chrome.com/extensions/dev/contextMenus.html#type-OnClickData
5263  * @constructor
5264  */
5265 function OnClickData() {}
5266
5267
5268 /** @type {number} */
5269 OnClickData.prototype.menuItemId;
5270
5271
5272 /** @type {number} */
5273 OnClickData.prototype.parentMenuItemId;
5274
5275
5276 /** @type {string} */
5277 OnClickData.prototype.mediaType;
5278
5279
5280 /** @type {string} */
5281 OnClickData.prototype.linkUrl;
5282
5283
5284 /** @type {string} */
5285 OnClickData.prototype.srcUrl;
5286
5287
5288 /** @type {string} */
5289 OnClickData.prototype.pageUrl;
5290
5291
5292 /** @type {string} */
5293 OnClickData.prototype.frameUrl;
5294
5295
5296 /** @type {string} */
5297 OnClickData.prototype.selectionText;
5298
5299
5300 /** @type {string} */
5301 OnClickData.prototype.editable;
5302
5303
5304
5305 /**
5306  * @see https://developer.chrome.com/extensions/debugger.html#type-Debuggee
5307  * @constructor
5308  */
5309 function Debuggee() {}
5310
5311
5312 /** @type {number} */
5313 Debuggee.prototype.tabId;
5314
5315
5316
5317 /**
5318  * @see https://developer.chrome.com/extensions/contentSettings.html#type-ResourceIdentifier
5319  * @constructor
5320  */
5321 function ResourceIdentifier() {}
5322
5323
5324 /** @type {string} */
5325 ResourceIdentifier.prototype.id;
5326
5327
5328 /** @type {string} */
5329 ResourceIdentifier.prototype.description;
5330
5331
5332
5333 /**
5334  * @see https://developer.chrome.com/extensions/contentSettings.html#type-ContentSetting
5335  * @constructor
5336  */
5337 function ContentSetting() {}
5338
5339
5340 /**
5341  * @param {!Object.<string,string>} details Settings details.
5342  * @param {function(): void=} opt_callback Callback function.
5343  */
5344 ContentSetting.prototype.clear = function(details, opt_callback) {};
5345
5346
5347 /**
5348  * @param {!Object.<string,(string|boolean|ResourceIdentifier)>} details
5349  *     Settings details.
5350  * @param {function(): void} callback Callback function.
5351  */
5352 ContentSetting.prototype.get = function(details, callback) {};
5353
5354
5355 /**
5356  * @param {function(): void} callback Callback function.
5357  */
5358 ContentSetting.prototype.getResourceIdentifiers = function(callback) {};
5359
5360
5361 /**
5362  * @param {!Object.<string,(string|ResourceIdentifier)>} details
5363  *     Settings details.
5364  * @param {function(): void=} opt_callback Callback function.
5365  */
5366 ContentSetting.prototype.set = function(details, opt_callback) {};
5367
5368
5369
5370 /**
5371  * @see https://developer.chrome.com/extensions/history.html#type-HistoryItem
5372  * @constructor
5373  */
5374 function HistoryItem() {}
5375
5376
5377 /** @type {string} */
5378 HistoryItem.prototype.id;
5379
5380
5381 /** @type {string} */
5382 HistoryItem.prototype.url;
5383
5384
5385 /** @type {string} */
5386 HistoryItem.prototype.title;
5387
5388
5389 /** @type {number} */
5390 HistoryItem.prototype.lastVisitTime;
5391
5392
5393 /** @type {number} */
5394 HistoryItem.prototype.visitCount;
5395
5396
5397 /** @type {number} */
5398 HistoryItem.prototype.typedCount;
5399
5400
5401
5402 /**
5403  * @see https://developer.chrome.com/extensions/history.html#type-VisitItem
5404  * @constructor
5405  */
5406 function VisitItem() {}
5407
5408
5409 /** @type {string} */
5410 VisitItem.prototype.id;
5411
5412
5413 /** @type {string} */
5414 VisitItem.prototype.visitId;
5415
5416
5417 /** @type {number} */
5418 VisitItem.prototype.visitTime;
5419
5420
5421 /** @type {string} */
5422 VisitItem.prototype.referringVisitId;
5423
5424
5425 /** @type {string} */
5426 VisitItem.prototype.transition;
5427
5428
5429
5430 /**
5431  * @see https://developer.chrome.com/extensions/fileBrowserHandler.html#type-FileHandlerExecuteEventDetails
5432  * @constructor
5433  */
5434 function FileHandlerExecuteEventDetails() {}
5435
5436
5437 /** @type {!Array.<!FileEntry>} */
5438 FileHandlerExecuteEventDetails.prototype.entries;
5439
5440
5441 /** @type {number|undefined} */
5442 FileHandlerExecuteEventDetails.prototype.tab_id;
5443
5444
5445
5446 /**
5447  * @see https://developer.chrome.com/extensions/input.ime.html#type-KeyboardEvent
5448  * @constructor
5449  */
5450 function ChromeKeyboardEvent() {}
5451
5452
5453 /** @type {string} */
5454 ChromeKeyboardEvent.prototype.type;
5455
5456
5457 /** @type {string} */
5458 ChromeKeyboardEvent.prototype.requestId;
5459
5460
5461 /** @type {string|undefined} */
5462 ChromeKeyboardEvent.prototype.extensionId;
5463
5464
5465 /** @type {string} */
5466 ChromeKeyboardEvent.prototype.key;
5467
5468
5469 /** @type {string} */
5470 ChromeKeyboardEvent.prototype.code;
5471
5472
5473 /** @type {number|undefined} */
5474 ChromeKeyboardEvent.prototype.keyCode;
5475
5476
5477 /** @type {boolean|undefined} */
5478 ChromeKeyboardEvent.prototype.altKey;
5479
5480
5481 /** @type {boolean|undefined} */
5482 ChromeKeyboardEvent.prototype.ctrlKey;
5483
5484
5485 /** @type {boolean|undefined} */
5486 ChromeKeyboardEvent.prototype.shiftKey;
5487
5488
5489 /** @type {boolean|undefined} */
5490 ChromeKeyboardEvent.prototype.capsLock;
5491
5492
5493
5494 /**
5495  * @see https://developer.chrome.com/extensions/input.ime.html#type-InputContext
5496  * @constructor
5497  */
5498 function InputContext() {}
5499
5500
5501 /** @type {number} */
5502 InputContext.prototype.contextID;
5503
5504
5505 /** @type {string} */
5506 InputContext.prototype.type;
5507
5508
5509
5510 /**
5511  * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyServer
5512  * @constructor
5513  */
5514 function ProxyServer() {}
5515
5516
5517 /** @type {string} */
5518 ProxyServer.prototype.scheme;
5519
5520
5521 /** @type {string} */
5522 ProxyServer.prototype.host;
5523
5524
5525 /** @type {number} */
5526 ProxyServer.prototype.port;
5527
5528
5529
5530 /**
5531  * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyRules
5532  * @constructor
5533  */
5534 function ProxyRules() {}
5535
5536
5537 /** @type {ProxyServer} */
5538 ProxyRules.prototype.singleProxy;
5539
5540
5541 /** @type {ProxyServer} */
5542 ProxyRules.prototype.proxyForHttp;
5543
5544
5545 /** @type {ProxyServer} */
5546 ProxyRules.prototype.proxyForHttps;
5547
5548
5549 /** @type {ProxyServer} */
5550 ProxyRules.prototype.proxyForFtp;
5551
5552
5553 /** @type {ProxyServer} */
5554 ProxyRules.prototype.fallbackProxy;
5555
5556
5557 /** @type {!Array.<string>} */
5558 ProxyRules.prototype.bypassList;
5559
5560
5561
5562 /**
5563  * @see https://developer.chrome.com/extensions/proxy.html#type-PacScript
5564  * @constructor
5565  */
5566 function PacScript() {}
5567
5568
5569 /** @type {string} */
5570 PacScript.prototype.url;
5571
5572
5573 /** @type {string} */
5574 PacScript.prototype.data;
5575
5576
5577 /** @type {boolean} */
5578 PacScript.prototype.mandatory;
5579
5580
5581
5582 /**
5583  * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyConfig
5584  * @constructor
5585  */
5586 function ProxyConfig() {}
5587
5588
5589 /** @type {ProxyRules} */
5590 ProxyConfig.prototype.rules;
5591
5592
5593 /** @type {PacScript} */
5594 ProxyConfig.prototype.pacScript;
5595
5596
5597 /** @type {string} */
5598 ProxyConfig.prototype.mode;
5599
5600
5601
5602 /**
5603  * The event listener for Storage receives an Object mapping each
5604  * key that changed to its corresponding StorageChange for that item.
5605  *
5606  * @see https://developer.chrome.com/extensions/storage.html
5607  * @constructor
5608  */
5609 function StorageChangeEvent() {}
5610
5611
5612 /**
5613  * @param {function(!Object.<string, !StorageChange>, string)} callback
5614  *    Listener will receive an object that maps each key to its StorageChange,
5615  *    and the namespace ("sync" or "local") of the storage area the changes
5616  *    are for.
5617  */
5618 StorageChangeEvent.prototype.addListener = function(callback) {};
5619
5620
5621 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
5622 StorageChangeEvent.prototype.removeListener = function(callback) {};
5623
5624
5625 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
5626 StorageChangeEvent.prototype.hasListener = function(callback) {};
5627
5628
5629 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
5630 StorageChangeEvent.prototype.hasListeners = function(callback) {};
5631
5632
5633
5634 /**
5635  * @see https://developer.chrome.com/extensions/storage.html#type-StorageChange
5636  * @constructor
5637  */
5638 function StorageChange() {}
5639
5640
5641 /** @type {?} */
5642 StorageChange.prototype.oldValue;
5643
5644
5645 /** @type {?} */
5646 StorageChange.prototype.newValue;
5647
5648
5649
5650 /**
5651  * @see https://developer.chrome.com/extensions/storage.html#type-StorageArea
5652  * @constructor
5653  */
5654 function StorageArea() {}
5655
5656
5657 /**
5658  * Removes all items from storage.
5659  * @param {function(): void=} opt_callback Callback function.
5660  */
5661 StorageArea.prototype.clear = function(opt_callback) {};
5662
5663
5664 /**
5665  * @param {(string|!Array.<string>|!Object|null)=} opt_keys
5666  *    A single key to get, list of keys to get, or a dictionary
5667  *    specifying default values (see description of the
5668  *    object). An empty list or object will return an empty
5669  *    result object. Pass in null to get the entire contents of storage.
5670  * @param {function(Object)=} opt_callback Callback with storage items, or null
5671  *    on failure.
5672  */
5673 StorageArea.prototype.get = function(opt_keys, opt_callback) {};
5674
5675
5676 /**
5677  * @param {(string|!Array.<string>)} keys
5678  *    A single key or a list of keys for items to remove.
5679  * @param {function()=} opt_callback Callback.
5680  */
5681 StorageArea.prototype.remove = function(keys, opt_callback) {};
5682
5683
5684 /**
5685  * @param {!Object.<string>} keys
5686  *    Object specifying items to augment storage
5687  *    with. Values that cannot be serialized (functions, etc) will be ignored.
5688  * @param {function()=} opt_callback Callback.
5689  */
5690 StorageArea.prototype.set = function(keys, opt_callback) { };
5691
5692
5693 /**
5694  * @param {(string|!Array.<string>|null)=} opt_keys
5695  *    A single key or list of keys to get the total usage for. An empty list
5696  *    will return 0. Pass in null to get the total usage of all of storage.
5697  * @param {function(number)=} opt_callback
5698  *    Callback with the amount of space being used by storage.
5699  */
5700 StorageArea.prototype.getBytesInUse = function(opt_keys, opt_callback) { };
5701
5702
5703
5704 /**
5705  * @see https://developer.chrome.com/extensions/types.html#type-ChromeSetting
5706  * @constructor
5707  */
5708 function ChromeSetting() {}
5709
5710
5711 /**
5712  * @param {Object} details Object with a 'scope' (string) key.
5713  * @param {function(): void=} opt_callback Callback function.
5714  */
5715 ChromeSetting.prototype.clear = function(details, opt_callback) {};
5716
5717
5718 /**
5719  * @param {Object} details Object with an 'incognito' (boolean) key.
5720  * @param {function(Object.<string, *>): void} callback Callback function.
5721  */
5722 ChromeSetting.prototype.get = function(details, callback) {};
5723
5724
5725 /**
5726  * @param {Object} details Object with a 'value' (*) key and an optional
5727  *     'scope' (string) key.
5728  * @param {function(): void=} opt_callback Callback function.
5729  */
5730 ChromeSetting.prototype.set = function(details, opt_callback) {};
5731
5732
5733
5734 /**
5735  * @see https://developer.chrome.com/extensions/webRequest.html#type-RequestFilter
5736  * @constructor
5737  */
5738 function RequestFilter() {}
5739
5740
5741 /** @type {!Array.<string>} */
5742 RequestFilter.prototype.urls;
5743
5744
5745 /** @type {!Array.<string>} */
5746 RequestFilter.prototype.types;
5747
5748
5749 /** @type {number} */
5750 RequestFilter.prototype.tabId;
5751
5752
5753 /** @type {number} */
5754 RequestFilter.prototype.windowId;
5755
5756
5757
5758 /**
5759  * @see https://developer.chrome.com/extensions/webRequest.html#type-HttpHeaders
5760  * @constructor
5761  */
5762 function HttpHeader() {}
5763
5764
5765 /** @type {string} */
5766 HttpHeader.prototype.name;
5767
5768
5769 /** @type {string} */
5770 HttpHeader.prototype.value;
5771
5772
5773 /** @type {!Array.<number>} */
5774 HttpHeader.prototype.binaryValue;
5775
5776
5777 /**
5778  * @see https://developer.chrome.com/extensions/webRequest.html#type-HttpHeaders
5779  * @typedef {Array.<!HttpHeader>}
5780  * @private
5781  */
5782 var HttpHeaders_;
5783
5784
5785
5786 /**
5787  * @see https://developer.chrome.com/extensions/webRequest.html#type-BlockingResponse
5788  * @constructor
5789  */
5790 function BlockingResponse() {}
5791
5792
5793 /** @type {boolean} */
5794 BlockingResponse.prototype.cancel;
5795
5796
5797 /** @type {string} */
5798 BlockingResponse.prototype.redirectUrl;
5799
5800
5801 /** @type {!HttpHeaders_} */
5802 BlockingResponse.prototype.requestHeaders;
5803
5804
5805 /** @type {!HttpHeaders_} */
5806 BlockingResponse.prototype.responseHeaders;
5807
5808
5809 /** @type {Object.<string,string>} */
5810 BlockingResponse.prototype.authCredentials;
5811
5812
5813
5814 /**
5815  * @see http://developer.chrome.com/extensions/pushMessaging.html#type-Message
5816  * @constructor
5817  */
5818 chrome.pushMessaging.Message = function() {};
5819
5820
5821 /**
5822  * @type {number}
5823  */
5824 chrome.pushMessaging.Message.prototype.subchannelId;
5825
5826
5827 /**
5828  * @type {string}
5829  */
5830 chrome.pushMessaging.Message.prototype.payload;
5831
5832
5833
5834 /**
5835  * @see http://developer.chrome.com/extensions/pushMessaging.html#type-ChannelIdResult
5836  * @constructor
5837  */
5838 chrome.pushMessaging.ChannelIdResult = function() {};
5839
5840
5841 /**
5842  * @type {string}
5843  */
5844 chrome.pushMessaging.ChannelIdResult.prototype.channelId;
5845
5846
5847 /**
5848  * The {@code chrome.fileSystem} API makes use of the Entry and FileEntry types
5849  * defined in {@code javascript/externs/fileapi.js}.
5850  * @const
5851  * @see http://developer.chrome.com/apps/fileSystem.html
5852  */
5853 chrome.fileSystem = {};
5854
5855
5856 /**
5857  * @param {!Entry} entry The entry to get the display path for. The entry can
5858  *     originally be obtained through
5859  *     {@code chrome.fileSystem.chooseEntry} or
5860  *     {@code chrome.fileSystem.restoreEntry}.
5861  * @param {function(string)} callback A success callback.
5862  * @see http://developer.chrome.com/apps/fileSystem.html#method-getDisplayPath
5863  */
5864 chrome.fileSystem.getDisplayPath = function(entry, callback) {};
5865
5866
5867 /**
5868  * @param {!Entry} entry The entry to get a writable entry for.
5869  * @param {function(!Entry)} callback A success callback.
5870  * @see http://developer.chrome.com/apps/fileSystem.html#method-getWritableEntry
5871  */
5872 chrome.fileSystem.getWritableEntry = function(entry, callback) {};
5873
5874
5875 /**
5876  * @param {!Entry} entry The entry to query writability.
5877  * @param {function(boolean)} callback A success callback.
5878  * @see http://developer.chrome.com/apps/fileSystem.html#method-isWritableEntry
5879  */
5880 chrome.fileSystem.isWritableEntry = function(entry, callback) {};
5881
5882
5883 /**
5884  * @typedef {{
5885  *   description: (string|undefined),
5886  *   mimeTypes: (!Array.<string>|undefined),
5887  *   extensions: (!Array.<string>|undefined)
5888  * }}
5889  * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
5890  */
5891 chrome.fileSystem.AcceptsOption;
5892
5893
5894 /**
5895  * @typedef {{
5896  *   type: (string|undefined),
5897  *   suggestedName: (string|undefined),
5898  *   accepts: (!Array.<!chrome.fileSystem.AcceptsOption>|undefined),
5899  *   acceptsAllTypes: (boolean|undefined),
5900  *   acceptsMultiple: (boolean|undefined)
5901  * }}
5902  * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
5903  */
5904 chrome.fileSystem.ChooseEntryOptions;
5905
5906
5907 /**
5908  * @param {!chrome.fileSystem.ChooseEntryOptions|
5909  *     function(Entry=, !Array.<!FileEntry>=)} optionsOrCallback The
5910  *     options for the file prompt or the callback.
5911  * @param {function(Entry=, !Array.<!FileEntry>=)=} opt_callback A success
5912  *     callback, if arg1 is options.
5913  * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
5914  */
5915 chrome.fileSystem.chooseEntry = function(optionsOrCallback, opt_callback) {};
5916
5917
5918 /**
5919  * @param {string} id The ID of the file entry to restore.
5920  * @param {function(!Entry)} callback A success callback.
5921  * @see http://developer.chrome.com/apps/fileSystem.html#method-restoreEntry
5922  */
5923 chrome.fileSystem.restoreEntry = function(id, callback) {};
5924
5925
5926 /**
5927  * @param {string} id The ID of the file entry to query restorability.
5928  * @param {function(boolean)} callback A success callback.
5929  * @see http://developer.chrome.com/apps/fileSystem.html#method-isRestorable
5930  */
5931 chrome.fileSystem.isRestorable = function(id, callback) {};
5932
5933
5934 /**
5935  * @param {!Entry} entry The entry to regain access to.
5936  * @return {string} The ID that can be passed to restoreEntry to regain access
5937  *     to the given file entry.
5938  * @see http://developer.chrome.com/apps/fileSystem.html#method-retainEntry
5939  */
5940 chrome.fileSystem.retainEntry = function(entry) {};
5941
5942
5943 /**
5944  * @const
5945  * @see https://developer.chrome.com/apps/syncFileSystem
5946  */
5947 chrome.syncFileSystem = {};
5948
5949
5950 /**
5951  * Returns a syncable filesystem backed by Google Drive. The returned
5952  * DOMFileSystem instance can be operated on in the same way as
5953  * the Temporary and Persistant file systems (see
5954  * http://www.w3.org/TR/file-system-api/), except that the filesystem
5955  * object returned for Sync FileSystem does NOT support directory
5956  * operations (yet). You can get a list of file entries by reading
5957  * the root directory (by creating a new DirectoryReader),
5958  * but cannot create a new directory in it.
5959  *
5960  * <p>Calling this multiple times from the same app will return the same
5961  * handle to the same file system.
5962  *
5963  * <p>Note this call can fail. For example, if the user is not signed in
5964  * to Chrome or if there is no network operation. To handle these errors
5965  * it is important chrome.runtime.lastError is checked in the callback.
5966  *
5967  * @param {function(!FileSystem)} callback A callback type for
5968  *     requestFileSystem.
5969  * @see https://developer.chrome.com/apps/syncFileSystem#method-requestFileSystem
5970  */
5971 chrome.syncFileSystem.requestFileSystem = function(callback) {};
5972
5973
5974 /**
5975  * Sets the default conflict resolution policy for the 'syncable' file
5976  * storage for the app. By default it is set to 'last_write_win'.
5977  * When conflict resolution policy is set to 'last_write_win' conflicts
5978  * for existing files are automatically resolved next time the file is updated.
5979  * {@code callback} can be optionally given to know if the request has
5980  * succeeded or not.
5981  *
5982  * @param {string} policy Any of 'last_write_win' or 'manual'
5983  * @param {function()=} opt_callback
5984  *
5985  * @see https://developer.chrome.com/apps/syncFileSystem#method-setConflictResolutionPolicy
5986  */
5987 chrome.syncFileSystem.setConflictResolutionPolicy =
5988     function(policy, opt_callback) {};
5989
5990
5991 /**
5992  * Gets the current conflict resolution policy.
5993  *
5994  * @param {function(string)} callback Accepting any of 'last_write_win'
5995  *     or 'manual'.
5996  * @see https://developer.chrome.com/apps/syncFileSystem#method-getConflictResolutionPolicy
5997  */
5998 chrome.syncFileSystem.getConflictResolutionPolicy = function(callback) {};
5999
6000
6001 /**
6002  * Returns the current usage and quota in bytes for the 'syncable' file
6003  * storage for the app.
6004  *
6005  * @param {!FileSystem} fileSystem
6006  * @param {function(!Object)} callback Taking an object substantially similar
6007  *     to {@code {'usageBytes': number, quotaBytes: number}}.
6008  * @see https://developer.chrome.com/apps/syncFileSystem#method-getUsageAndQuota
6009  */
6010 chrome.syncFileSystem.getUsageAndQuota = function(fileSystem, callback) {};
6011
6012
6013 /**
6014  * Returns the FileStatus for the given fileEntry. The status value can be
6015  * 'synced', 'pending' or 'conflicting'. Note that 'conflicting' state only
6016  * happens when the service's conflict resolution policy is set to 'manual'.
6017  *
6018  * @param {!Entry} fileEntry
6019  * @param {function(string)} callback Called with any of 'synced', 'pending'
6020  *     or 'conflicting'.
6021  *
6022  * @see https://developer.chrome.com/apps/syncFileSystem#method-getFileStatus
6023  */
6024 chrome.syncFileSystem.getFileStatus = function(fileEntry, callback) {};
6025
6026
6027 /**
6028  * Returns each FileStatus for the given fileEntry array. Typically called
6029  * with the result from dirReader.readEntries().
6030  *
6031  * @param {!Array.<!FileEntry>} fileEntries
6032  * @param {function(!Array.<!Object>)} callback Each object will look like:
6033  *     {@code {'fileEntry': Entry, 'status': string, 'error': string?}}.
6034  *
6035  * @see https://developer.chrome.com/apps/syncFileSystem#method-getFileStatuses
6036  */
6037 chrome.syncFileSystem.getFileStatuses = function(fileEntries, callback) {};
6038
6039
6040 /**
6041  * Since Chrome 31.
6042  *
6043  * <p>Returns the current sync backend status.
6044  *
6045  * @param {function(string)} callback Arg is any of 'initializing', 'running',
6046  *     'authentication_required', 'temporary_unavailable', or 'disabled'.
6047  *
6048  * @see https://developer.chrome.com/apps/syncFileSystem#method-getServiceStatus
6049  */
6050 chrome.syncFileSystem.getServiceStatus = function(callback) {};
6051
6052
6053 /**
6054  * Fired when an error or other status change has happened in the sync
6055  * backend (for example, when the sync is temporarily disabled due
6056  * to network or authentication error).
6057  *
6058  * @type {!ChromeObjectEvent}
6059  *
6060  * @see https://developer.chrome.com/apps/syncFileSystem#event-onServiceStatusChanged
6061  */
6062 chrome.syncFileSystem.onServiceStatusChanged;
6063
6064
6065 /**
6066  * Fired when a file has been updated by the background sync service.
6067  *
6068  * @type {!ChromeObjectEvent}
6069  *
6070  * @see https://developer.chrome.com/apps/syncFileSystem#event-onFileStatusChanged
6071  */
6072 chrome.syncFileSystem.onFileStatusChanged;
6073
6074
6075 /**
6076  * @const
6077  * @see http://developer.chrome.com/extensions/alarms.html
6078  */
6079 chrome.alarms = {};
6080
6081
6082 /**
6083  * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event
6084  * is fired. If there is another alarm with the same name (or no name if none is
6085  * specified), it will be cancelled and replaced by this alarm.
6086  * @param {string|!chrome.alarms.AlarmCreateInfo} nameOrAlarmCreateInfo Either
6087  *     the name to identify this alarm or the info used to create the alarm. If
6088  *     no name is passed, the empty string is used to identify the alarm.
6089  * @param {!chrome.alarms.AlarmCreateInfo=} opt_alarmInfo If a name was passed
6090  *     as arg1, the info used to create the alarm.
6091  * @see http://developer.chrome.com/extensions/alarms.html#method-create
6092  */
6093 chrome.alarms.create = function(nameOrAlarmCreateInfo, opt_alarmInfo) {};
6094
6095
6096 /**
6097  * Retrieves details about the specified alarm.
6098  * @param {string|function(!chrome.alarms.Alarm)} nameOrCallback The name
6099  *     of the alarm to get or the callback to invoke with the alarm. If no name
6100  *     is passed, the empty string is used to get the alarm.
6101  * @param {function(!chrome.alarms.Alarm)=} opt_callback If a name was passed
6102  *     as arg1, the callback to invoke with the alarm.
6103  * @see http://developer.chrome.com/extensions/alarms.html#method-get
6104  */
6105 chrome.alarms.get = function(nameOrCallback, opt_callback) {};
6106
6107
6108 /**
6109  * Gets an array of all the alarms.
6110  * @param {function(!Array.<!chrome.alarms.Alarm>)} callback
6111  * @see http://developer.chrome.com/extensions/alarms.html#method-getAll
6112  */
6113 chrome.alarms.getAll = function(callback) {};
6114
6115
6116 /**
6117  * Clears the alarm with the given name.
6118  * @param {string=} opt_name
6119  * @see http://developer.chrome.com/extensions/alarms.html#method-clear
6120  */
6121 chrome.alarms.clear = function(opt_name) {};
6122
6123
6124 /**
6125  * Clears all alarms.
6126  * @see http://developer.chrome.com/extensions/alarms.html#method-clearAll
6127  */
6128 chrome.alarms.clearAll = function() {};
6129
6130
6131 /**
6132  * Fired when an alarm has elapsed. Useful for event pages.
6133  * @type {!chrome.alarms.AlarmEvent}
6134  * @see http://developer.chrome.com/extensions/alarms.html#event-onAlarm
6135  */
6136 chrome.alarms.onAlarm;
6137
6138
6139
6140 /**
6141  * @constructor
6142  */
6143 chrome.alarms.AlarmEvent = function() {};
6144
6145
6146 /**
6147  * @param {function(!chrome.alarms.Alarm): void} callback
6148  */
6149 chrome.alarms.AlarmEvent.prototype.addListener = function(callback) {};
6150
6151
6152 /**
6153  * @param {function(!chrome.alarms.Alarm): void} callback
6154  */
6155 chrome.alarms.AlarmEvent.prototype.removeListener = function(callback) {};
6156
6157
6158 /**
6159  * @param {function(!chrome.alarms.Alarm): void} callback
6160  * @return {boolean}
6161  */
6162 chrome.alarms.AlarmEvent.prototype.hasListener = function(callback) {};
6163
6164
6165 /**
6166  * @return {boolean}
6167  */
6168 chrome.alarms.AlarmEvent.prototype.hasListeners = function() {};
6169
6170
6171
6172 /**
6173  * @interface
6174  * @see http://developer.chrome.com/extensions/alarms.html#type-Alarm
6175  */
6176 chrome.alarms.Alarm = function() {};
6177
6178
6179 /**
6180  * Name of this alarm.
6181  * @type {string}
6182  */
6183 chrome.alarms.Alarm.prototype.name;
6184
6185
6186 /**
6187  * Time at which this alarm was scheduled to fire, in milliseconds past the
6188  * epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been
6189  * delayed an arbitrary amount beyond this.
6190  * @type {number}
6191  */
6192 chrome.alarms.Alarm.prototype.scheduledTime;
6193
6194
6195 /**
6196  * If not null, the alarm is a repeating alarm and will fire again in
6197  * periodInMinutes minutes.
6198  * @type {?number}
6199  */
6200 chrome.alarms.Alarm.prototype.periodInMinutes;
6201
6202
6203 /**
6204  * @typedef {{
6205  *   when: (number|undefined),
6206  *   delayInMinutes: (number|undefined),
6207  *   periodInMinutes: (number|undefined)
6208  * }}
6209  * @see http://developer.chrome.com/extensions/alarms.html#method-create
6210  */
6211 chrome.alarms.AlarmCreateInfo;
6212
6213
6214 /**
6215  * @see https://developer.chrome.com/apps/hid
6216  * @const
6217  */
6218 chrome.hid = {};
6219
6220
6221 /**
6222  * @typedef {?{
6223  *   vendorId: number,
6224  *   productId: number
6225  * }}
6226  * @see https://developer.chrome.com/apps/hid#method-getDevices
6227  */
6228 chrome.hid.HidGetDevicesOptions;
6229
6230
6231 /**
6232  * @typedef {?{
6233  *   usagePage: number,
6234  *   usage: number,
6235  *   reportIds: !Array.<number>
6236  * }}
6237 * @see https://developer.chrome.com/apps/hid#method-getDevices
6238 */
6239 chrome.hid.HidDeviceUsage;
6240
6241
6242 /**
6243  * @typedef {?{
6244  *   deviceId: number,
6245  *   vendorId: number,
6246  *   productId: number,
6247  *   collections: !Array.<!chrome.hid.HidDeviceUsage>,
6248  *   maxInputReportSize: number,
6249  *   maxOutputReportSize: number,
6250  *   maxFeatureReportSize: number
6251  * }}
6252 * @see https://developer.chrome.com/apps/hid#method-getDevices
6253 */
6254 chrome.hid.HidDeviceInfo;
6255
6256
6257 /**
6258  * @typedef {?{
6259  *   connectionId: number
6260  * }}
6261  * @see https://developer.chrome.com/apps/hid#method-connect
6262  */
6263 chrome.hid.HidConnectInfo;
6264
6265
6266 /**
6267  * @see https://developer.chrome.com/apps/hid#method-getDevices
6268  * Enumerates all the connected HID devices specified by the
6269  * vendorId/productId/interfaceId tuple.
6270  * @param {!chrome.hid.HidGetDevicesOptions} options The properties to search
6271  *     for on target devices.
6272  * @param {function(!Array.<!Object>)} callback Invoked with a list of
6273  *     |HidDeviceInfo|s on complete.
6274  */
6275 chrome.hid.getDevices = function(options, callback) {};
6276
6277
6278 /**
6279  * @see https://developer.chrome.com/apps/hid#method-connect
6280  * Opens a connection to a HID device for communication.
6281  * @param {number} deviceId The ID of the device to open.
6282  * @param {function(!Object=)} callback Invoked with an |HidConnectInfo| if the
6283  *     connection succeeds, or undefined if it fails.
6284  */
6285 chrome.hid.connect = function(deviceId, callback) {};
6286
6287
6288 /**
6289  * @see https://developer.chrome.com/apps/hid#method-disconnect
6290  * Disconnects from a device.
6291  * @param {number} connectionId The connection to close.
6292  * @param {function()=} opt_callback The callback to invoke once the connection
6293  *     is closed.
6294  */
6295 chrome.hid.disconnect = function(connectionId, opt_callback) {};
6296
6297
6298 /**
6299  * @see https://developer.chrome.com/apps/hid#method-receive
6300  * Receives an input report from an HID device.
6301  * @param {number} connectionId The connection from which to receive the report.
6302  * @param {function(number, !ArrayBuffer)} callback The callback to invoke with
6303  *     the received report.
6304  */
6305 chrome.hid.receive = function(connectionId, callback) {};
6306
6307
6308 /**
6309  * @see https://developer.chrome.com/apps/hid#method-send
6310  * Sends an output report to an HID device.
6311  * @param {number} connectionId The connection to which to send the report.
6312  * @param {number} reportId The report ID to use, or 0 if none.
6313  * @param {!ArrayBuffer} data The report data.
6314  * @param {function()} callback The callback to invoke once the write is
6315  *     finished.
6316  */
6317 chrome.hid.send = function(connectionId, reportId, data, callback) {};
6318
6319
6320 /**
6321  * @see https://developer.chrome.com/apps/hid#method-receiveFeatureReport
6322  * Receives a feature report from the device.
6323  * @param {number} connectionId The connection from which to read the feature
6324  *     report.
6325  * @param {number} reportId The report ID to use, or 0 if none.
6326  * @param {number} size The size of the feature report to receive.
6327  * @param {function(!ArrayBuffer)} callback The callback to invoke with the
6328  *     received report.
6329  */
6330 chrome.hid.receiveFeatureReport =
6331     function(connectionId, reportId, size, callback) {};
6332
6333
6334 /**
6335  * @see https://developer.chrome.com/apps/hid#method-sendFeatureReport
6336  * Sends a feature report to the device.
6337  * @param {number} connectionId The connection to which to send the feature
6338  *     report.
6339  * @param {number} reportId The report ID to use, or 0 if none.
6340  * @param {!ArrayBuffer} data The report data.
6341  * @param {function()} callback The callback to invoke once the write is
6342  *     finished.
6343  */
6344 chrome.hid.sendFeatureReport =
6345     function(connectionId, reportId, data, callback) {};
6346
6347
6348 /**
6349  * @see http://developer.chrome.com/extensions/notifications.html
6350  * @const
6351  */
6352 chrome.notifications = {};
6353
6354
6355 /**
6356  * @typedef {{
6357  *   title: string,
6358  *   iconUrl: (string|undefined)
6359  * }}
6360  * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
6361  */
6362 chrome.notifications.NotificationButton;
6363
6364
6365 /**
6366  * @typedef {{
6367  *   title: string,
6368  *   message: string
6369  * }}
6370  * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
6371  */
6372 chrome.notifications.NotificationItem;
6373
6374
6375 /**
6376  * @typedef {{
6377  *   type: (string|undefined),
6378  *   iconUrl: (string|undefined),
6379  *   title: (string|undefined),
6380  *   message: (string|undefined),
6381  *   contextMessage: (string|undefined),
6382  *   priority: (number|undefined),
6383  *   eventTime: (number|undefined),
6384  *   buttons: (!Array.<!chrome.notifications.NotificationButton>|undefined),
6385  *   imageUrl: (string|undefined),
6386  *   items: (!Array.<!chrome.notifications.NotificationItem>|undefined),
6387  *   progress: (number|undefined),
6388  *   isClickable: (boolean|undefined)
6389  * }}
6390  * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
6391  */
6392 chrome.notifications.NotificationOptions;
6393
6394
6395 /**
6396  * @typedef {function(boolean): void}
6397  * @see http://developer.chrome.com/extensions/notifications.html#method-update
6398  * @see http://developer.chrome.com/extensions/notifications.html#method-clear
6399  */
6400 chrome.notifications.BooleanCallback;
6401
6402
6403 /**
6404  * @typedef {function(!Object): void}
6405  * @see http://developer.chrome.com/extensions/notifications.html#method-getAll
6406  */
6407 chrome.notifications.ObjectCallback;
6408
6409
6410 /**
6411  * @typedef {function(string, boolean): void}
6412  * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
6413  */
6414 chrome.notifications.ClosedCallback;
6415
6416
6417 /**
6418  * @typedef {function(string, number): void}
6419  * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
6420  */
6421 chrome.notifications.ButtonCallback;
6422
6423
6424 /**
6425  * @param {string} notificationId
6426  * @param {!chrome.notifications.NotificationOptions} options
6427  * @param {function(string): void} callback
6428  * @see http://developer.chrome.com/extensions/notifications.html#method-create
6429  */
6430 chrome.notifications.create = function(notificationId, options, callback) {};
6431
6432
6433 /**
6434  * @param {string} notificationId
6435  * @param {!chrome.notifications.NotificationOptions} options
6436  * @param {!chrome.notifications.BooleanCallback} callback
6437  * @see http://developer.chrome.com/extensions/notifications.html#method-update
6438  */
6439 chrome.notifications.update = function(notificationId, options, callback) {};
6440
6441
6442 /**
6443  * @param {string} notificationId
6444  * @param {!chrome.notifications.BooleanCallback} callback
6445  * @see http://developer.chrome.com/extensions/notifications.html#method-clear
6446  */
6447 chrome.notifications.clear = function(notificationId, callback) {};
6448
6449
6450 /**
6451  * @see http://developer.chrome.com/extensions/notifications.html#method-getAll
6452  * @param {!chrome.notifications.ObjectCallback} callback
6453  */
6454 chrome.notifications.getAll = function(callback) {};
6455
6456
6457 /**
6458  * @see http://developer.chrome.com/extensions/notifications.html#method-getPermissionLevel
6459  * @param {function(string): void} callback takes 'granted' or 'denied'
6460  */
6461 chrome.notifications.getPermissionLevel = function(callback) {};
6462
6463
6464 /**
6465  * @type {!chrome.notifications.ClosedEvent}
6466  * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
6467  */
6468 chrome.notifications.onClosed;
6469
6470
6471 /**
6472  * The user clicked a non-button area of the notification. Callback receives a
6473  * notificationId.
6474  * @type {!ChromeStringEvent}
6475  * @see http://developer.chrome.com/extensions/notifications.html#event-onClicked
6476  */
6477 chrome.notifications.onClicked;
6478
6479
6480 /**
6481  * @type {!chrome.notifications.ButtonClickedEvent}
6482  * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
6483  */
6484 chrome.notifications.onButtonClicked;
6485
6486
6487 /**
6488  * Indicates permission level change. Callback should expect 'granted' or
6489  * 'denied'.
6490  * @type {!ChromeStringEvent}
6491  * @see http://developer.chrome.com/extensions/notifications.html#event-onPermissionLevelChanged
6492  */
6493 chrome.notifications.onPermissionLevelChanged;
6494
6495
6496 /**
6497  * @type {!ChromeEvent}
6498  * @see http://developer.chrome.com/extensions/notifications.html#event-onShowSettings
6499  */
6500 chrome.notifications.onShowSettings;
6501
6502
6503
6504 /**
6505  * @interface
6506  * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
6507  */
6508 chrome.notifications.ClosedEvent = function() {};
6509
6510
6511 /**
6512  * @param {!chrome.notifications.ClosedCallback} callback
6513  */
6514 chrome.notifications.ClosedEvent.prototype.addListener = function(callback) {};
6515
6516
6517 /**
6518  * @param {!chrome.notifications.ClosedCallback} callback
6519  */
6520 chrome.notifications.ClosedEvent.prototype.removeListener =
6521     function(callback) {};
6522
6523
6524 /**
6525  * @param {!chrome.notifications.ClosedCallback} callback
6526  * @return {boolean}
6527  */
6528 chrome.notifications.ClosedEvent.prototype.hasListener = function(callback) {};
6529
6530
6531 /**
6532  * @return {boolean}
6533  */
6534 chrome.notifications.ClosedEvent.prototype.hasListeners = function() {};
6535
6536
6537
6538 /**
6539  * @interface
6540  * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
6541  */
6542 chrome.notifications.ButtonClickedEvent = function() {};
6543
6544
6545 /**
6546  * @param {!chrome.notifications.ButtonCallback} callback
6547  */
6548 chrome.notifications.ButtonClickedEvent.prototype.addListener =
6549     function(callback) {};
6550
6551
6552 /**
6553  * @param {!chrome.notifications.ButtonCallback} callback
6554  */
6555 chrome.notifications.ButtonClickedEvent.prototype.removeListener =
6556     function(callback) {};
6557
6558
6559 /**
6560  * @param {!chrome.notifications.ButtonCallback} callback
6561  * @return {boolean}
6562  */
6563 chrome.notifications.ButtonClickedEvent.prototype.hasListener =
6564     function(callback) {};
6565
6566
6567 /**
6568  * @return {boolean}
6569  */
6570 chrome.notifications.ButtonClickedEvent.prototype.hasListeners = function() {};
6571
6572
6573 /**
6574  * @const
6575  * @see http://developer.chrome.com/apps/system_storage.html
6576  */
6577 chrome.system.storage = {};
6578
6579
6580
6581 /** @constructor */
6582 chrome.system.storage.StorageUnitInfo = function() {};
6583
6584
6585 /** @type {string} */
6586 chrome.system.storage.StorageUnitInfo.id;
6587
6588
6589 /** @type {string} */
6590 chrome.system.storage.StorageUnitInfo.name;
6591
6592
6593 /** @type {string} Any of 'fixed', 'removable', or 'unknown' */
6594 chrome.system.storage.StorageUnitInfo.type;
6595
6596
6597 /** @type {number} */
6598 chrome.system.storage.StorageUnitInfo.capacity;
6599
6600
6601
6602 /**
6603  * Event whose listeners take a StorageUnitInfoEvent parameter.
6604  * @constructor
6605  */
6606 chrome.system.storage.StorageUnitInfoEvent = function() {};
6607
6608
6609 /** @param {function(!chrome.system.storage.StorageUnitInfo): void} callback */
6610 chrome.system.storage.StorageUnitInfoEvent.prototype.addListener =
6611     function(callback) {};
6612
6613
6614 /** @param {function(!chrome.system.storage.StorageUnitInfo): void} callback */
6615 chrome.system.storage.StorageUnitInfoEvent.prototype.removeListener =
6616     function(callback) {};
6617
6618
6619 /**
6620  * @param {function(!chrome.system.storage.StorageUnitInfo): void} callback
6621  * @return {boolean}
6622  */
6623 chrome.system.storage.StorageUnitInfoEvent.prototype.hasListener =
6624     function(callback) {};
6625
6626
6627 /** @return {boolean} */
6628 chrome.system.storage.StorageUnitInfoEvent.prototype.hasListeners =
6629     function() {};
6630
6631
6632 /** @type {chrome.system.storage.StorageUnitInfoEvent} */
6633 chrome.system.storage.onAttached;
6634
6635
6636 /** @type {!ChromeStringEvent} */
6637 chrome.system.storage.onDetached;
6638
6639
6640 /**
6641  * Gets the storage information from the system.
6642  * @param {function(!Array.<!chrome.system.storage.StorageUnitInfo>)} callback
6643  */
6644 chrome.system.storage.getInfo = function(callback) {};
6645
6646
6647 /**
6648  * Ejects a removable storage device.
6649  * @param {string} id The transient device ID from StorageUnitInfo.
6650  * @param {function(string)} callback Callback function where the value
6651  *     is any of: "success", "in_use", "no_such_device", "failure"
6652  */
6653 chrome.system.storage.ejectDevice = function(id, callback) {};
6654
6655
6656 /**
6657  * Gets the available capacity of a specified storage device.
6658  * @param {string} id The transient device ID from StorageUnitInfo.
6659  * @param {function(Object.<string, number>)} callback A callback function that
6660  *     accepts an object with {@code id} and {@code availableCapacity} fields.
6661  */
6662 chrome.system.storage.getAvailableCapacity = function(id, callback) {};
6663
6664
6665 /**
6666  * @see http://developer.chrome.com/apps/usb.html
6667  * @const
6668  */
6669 chrome.usb = {};
6670
6671
6672
6673 /** @constructor */
6674 chrome.usb.Device = function Device() {};
6675
6676
6677 /** @type {number} */
6678 chrome.usb.Device.prototype.device;
6679
6680
6681 /** @type {number} */
6682 chrome.usb.Device.prototype.vendorId;
6683
6684
6685 /** @type {number} */
6686 chrome.usb.Device.prototype.productId;
6687
6688
6689
6690 /** @constructor */
6691 chrome.usb.ConnectionHandle = function ConnectionHandle() {};
6692
6693
6694 /** @type {number} */
6695 chrome.usb.ConnectionHandle.prototype.handle;
6696
6697
6698 /** @type {number} */
6699 chrome.usb.ConnectionHandle.prototype.vendorId;
6700
6701
6702 /** @type {number} */
6703 chrome.usb.ConnectionHandle.prototype.productId;
6704
6705
6706 /**
6707  * @typedef {?{
6708  *   direction: string,
6709  *   endpoint: number,
6710  *   length: (number|undefined),
6711  *   data: (!ArrayBuffer|undefined)
6712  * }}
6713  */
6714 chrome.usb.GenericTransferInfo;
6715
6716
6717 /**
6718  * @typedef {?{
6719  *   direction: string,
6720  *   recipient: string,
6721  *   requestType: string,
6722  *   request: number,
6723  *   value: number,
6724  *   index: number,
6725  *   length: (number|undefined),
6726  *   data: (!ArrayBuffer|undefined)
6727  * }}
6728  */
6729 chrome.usb.ControlTransferInfo;
6730
6731
6732
6733 /** @constructor */
6734 chrome.usb.TransferResultInfo = function() {};
6735
6736
6737 /** @type {number|undefined} */
6738 chrome.usb.TransferResultInfo.prototype.resultCode;
6739
6740
6741 /** @type {!ArrayBuffer|undefined} */
6742 chrome.usb.TransferResultInfo.prototype.data;
6743
6744
6745 /**
6746  * @typedef {?{
6747  *   deviceId: number,
6748  *   productId: number,
6749  *   interfaceId: (number|undefined)
6750  * }}
6751  */
6752 chrome.usb.FindDevicesOptions;
6753
6754
6755 /**
6756  * @see http://developer.chrome.com/apps/usb.html#method-getDevices
6757  * @param {!Object} options The properties to search for on target devices.
6758  * @param {function(!Array.<!chrome.usb.Device>)} callback Invoked with a list
6759  *     of |Device|s on complete.
6760  */
6761 chrome.usb.getDevices = function(options, callback) {};
6762
6763
6764 /**
6765  * @see http://developer.chrome.com/apps/usb.html#method-requestAccess
6766  * @param {!chrome.usb.Device} device The device to request access to.
6767  * @param {number} interfaceId
6768  * @param {function(boolean)} callback
6769  */
6770 chrome.usb.requestAccess = function(device, interfaceId, callback) {};
6771
6772
6773 /**
6774  * @see http://developer.chrome.com/apps/usb.html#method-openDevice
6775  * @param {!chrome.usb.Device} device The device to open.
6776  * @param {function(!chrome.usb.ConnectionHandle=)} callback Invoked with the
6777  *     created ConnectionHandle on complete.
6778  */
6779 chrome.usb.openDevice = function(device, callback) {};
6780
6781
6782 /**
6783  * @see http://developer.chrome.com/apps/usb.html#method-findDevices
6784  * @param {!chrome.usb.FindDevicesOptions} options The properties to search for
6785  *     on target devices.
6786  * @param {function(!Array.<!chrome.usb.ConnectionHandle>)} callback Invoked
6787  *     with the opened ConnectionHandle on complete.
6788  */
6789 chrome.usb.findDevices = function(options, callback) {};
6790
6791
6792 /**
6793  * @see http://developer.chrome.com/apps/usb.html#method-closeDevice
6794  * @param {!chrome.usb.ConnectionHandle} handle The connection handle to close.
6795  * @param {function()=} opt_callback The callback to invoke once the device is
6796  *     closed.
6797  */
6798 chrome.usb.closeDevice = function(handle, opt_callback) {};
6799
6800
6801 /**
6802  * @see http://developer.chrome.com/apps/usb.html#method-listInterfaces
6803  * @param {!chrome.usb.ConnectionHandle} handle The device from which the
6804  *     interfaces should be listed.
6805  * @param {function(!Array.<!Object>)} callback
6806  *     The callback to invoke when the interfaces are enumerated.
6807  */
6808 chrome.usb.listInterfaces = function(handle, callback) {};
6809
6810
6811 /**
6812  * @see http://developer.chrome.com/apps/usb.html#method-claimInterface
6813  * @param {!chrome.usb.ConnectionHandle} handle The device on which the
6814  *     interface is to be claimed.
6815  * @param {number} interfaceNumber
6816  * @param {function()} callback The callback to invoke once the interface is
6817  *     claimed.
6818  */
6819 chrome.usb.claimInterface = function(handle, interfaceNumber, callback) {};
6820
6821
6822 /**
6823  * @see http://developer.chrome.com/apps/usb.html#method-releaseInterface
6824  * @param {!chrome.usb.ConnectionHandle} handle The device on which the
6825  *     interface is to be released.
6826  * @param {number} interfaceNumber
6827  * @param {function()} callback The callback to invoke once the interface is
6828  *     released.
6829  */
6830 chrome.usb.releaseInterface = function(handle, interfaceNumber, callback) {};
6831
6832
6833 /**
6834  * @see http://developer.chrome.com/apps/usb.html#method-setInterfaceAlternateSetting
6835  * @param {!chrome.usb.ConnectionHandle} handle The device on which the
6836  *     interface settings are to be set.
6837  * @param {number} interfaceNumber
6838  * @param {number} alternateSetting The alternate setting to set.
6839  * @param {function()} callback The callback to invoke once the interface
6840  *     setting is set.
6841  */
6842 chrome.usb.setInterfaceAlternateSetting = function(
6843     handle, interfaceNumber, alternateSetting, callback) {};
6844
6845
6846 /**
6847  * @see http://developer.chrome.com/apps/usb.html#method-controlTransfer
6848  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
6849  *     transfer on.
6850  * @param {!chrome.usb.ControlTransferInfo} transferInfo The parameters to the
6851  *     transfer.
6852  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
6853  *     transfer has completed.
6854  */
6855 chrome.usb.controlTransfer = function(handle, transferInfo, callback) {};
6856
6857
6858 /**
6859  * @see http://developer.chrome.com/apps/usb.html#method-bulkTransfer
6860  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make
6861  *     the transfer on.
6862  * @param {!chrome.usb.GenericTransferInfo} transferInfo The parameters to the
6863  *     transfer. See GenericTransferInfo.
6864  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
6865  *     transfer has completed.
6866  */
6867 chrome.usb.bulkTransfer = function(handle, transferInfo, callback) {};
6868
6869
6870 /**
6871  * @see http://developer.chrome.com/apps/usb.html#method-interruptTransfer
6872  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
6873  *     transfer on.
6874  * @param {!chrome.usb.GenericTransferInfo} transferInfo The parameters to the
6875  *     transfer. See GenericTransferInfo.
6876  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
6877  *     transfer has completed.
6878  */
6879 chrome.usb.interruptTransfer = function(handle, transferInfo, callback) {};
6880
6881
6882 /**
6883  * @see http://developer.chrome.com/apps/usb.html#method-isochronousTransfer
6884  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
6885  *     transfer on.
6886  * @param {!Object} transferInfo The parameters to the transfer. See
6887  *     IsochronousTransferInfo.
6888  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
6889  *     transfer has been completed.
6890  */
6891 chrome.usb.isochronousTransfer = function(handle, transferInfo, callback) {};
6892
6893
6894 /**
6895  * @see http://developer.chrome.com/apps/usb.html#method-resetDevice
6896  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to reset.
6897  * @param {function(boolean)} callback Invoked once the device is reset with a
6898  *     boolean indicating whether the reset completed successfully.
6899  */
6900 chrome.usb.resetDevice = function(handle, callback) {};
6901
6902
6903 /**
6904  * @const
6905  * @see https://developer.chrome.com/apps/webstore
6906  */
6907 chrome.webstore = {};
6908
6909
6910 /**
6911  * @param {string|function()|function(string)=}
6912  *     opt_urlOrSuccessCallbackOrFailureCallback Either the URL to install or
6913  *     the succcess callback taking no arg or the failure callback taking an
6914  *     error string arg.
6915  * @param {function()|function(string)=} opt_successCallbackOrFailureCallback
6916  *     Either the succcess callback taking no arg or the failure callback
6917  *     taking an error string arg.
6918  * @param {function(string)=} opt_failureCallback The failure callback.
6919  */
6920 chrome.webstore.install = function(
6921     opt_urlOrSuccessCallbackOrFailureCallback,
6922     opt_successCallbackOrFailureCallback,
6923     opt_failureCallback) {};
6924
6925
6926 /** @type {!ChromeStringEvent} */
6927 chrome.webstore.onInstallStageChanged;
6928
6929
6930 /** @type {!ChromeNumberEvent} */
6931 chrome.webstore.onDownloadProgress;
6932
6933
6934 ////////////////////////////////////////////////////////////////////////////////
6935 /////////////////////////// Chrome Private APIs ////////////////////////////////
6936 ////////////////////////////////////////////////////////////////////////////////
6937
6938
6939 /** @const */
6940 chrome.screenlockPrivate = {};
6941
6942
6943 /**
6944  * @param {string} message Displayed on the unlock screen.
6945  */
6946 chrome.screenlockPrivate.showMessage = function(message) {};
6947
6948
6949 /**
6950  * @param {function(boolean)} callback
6951  */
6952 chrome.screenlockPrivate.getLocked = function(callback) {};
6953
6954
6955 /**
6956  * @param {boolean} locked If true and the screen is unlocked, locks the screen.
6957  *     If false and the screen is locked, unlocks the screen.
6958  */
6959 chrome.screenlockPrivate.setLocked = function(locked) {};
6960
6961
6962 /** @type {!ChromeBooleanEvent} */
6963 chrome.screenlockPrivate.onChanged;
6964
6965
6966 /**
6967  * @const
6968  */
6969 chrome.musicManagerPrivate = {};
6970
6971
6972 /**
6973  * @param {function(string): void} callback
6974  */
6975 chrome.musicManagerPrivate.getDeviceId = function(callback) {};
6976
6977
6978 /**
6979  * @const
6980  */
6981 chrome.mediaGalleriesPrivate = {};
6982
6983
6984 /**
6985  * @typedef {function({deviceId: string, deviceName: string}): void}
6986  */
6987 chrome.mediaGalleriesPrivate.DeviceCallback;
6988
6989
6990 /**
6991  * @typedef {function({galleryId: string}): void}
6992  */
6993 chrome.mediaGalleriesPrivate.GalleryChangeCallback;
6994
6995
6996 /**
6997  * @typedef {function({galleryId: string, success: boolean}): void}
6998  */
6999 chrome.mediaGalleriesPrivate.AddGalleryWatchCallback;
7000
7001
7002 /**
7003  * @param {string} galleryId
7004  * @param {!chrome.mediaGalleriesPrivate.AddGalleryWatchCallback} callback
7005  */
7006 chrome.mediaGalleriesPrivate.addGalleryWatch = function(galleryId, callback) {};
7007
7008
7009 /**
7010  * @type {!chrome.mediaGalleriesPrivate.DeviceEvent}
7011  * @deprecated Use {chrome.system.storage.onAttach}.
7012  */
7013 chrome.mediaGalleriesPrivate.onDeviceAttached;
7014
7015
7016 /**
7017  * @type {!chrome.mediaGalleriesPrivate.DeviceEvent}
7018  * @deprecated Use {chrome.system.storage.onDetach}.
7019  */
7020 chrome.mediaGalleriesPrivate.onDeviceDetached;
7021
7022
7023 /**
7024  * @type {!chrome.mediaGalleriesPrivate.GalleryChangeEvent}
7025  */
7026 chrome.mediaGalleriesPrivate.onGalleryChanged;
7027
7028
7029
7030 /**
7031  * @interface
7032  * @deprecated Use {chrome.system.storage.DeviceEvent}.
7033  */
7034 chrome.mediaGalleriesPrivate.DeviceEvent = function() {};
7035
7036
7037 /**
7038  * @param {!chrome.mediaGalleriesPrivate.DeviceCallback} callback
7039  * @deprecated Use {chrome.system.storage.DeviceEvent.addListener}.
7040  */
7041 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.addListener =
7042     function(callback) {};
7043
7044
7045 /**
7046  * @param {!chrome.mediaGalleriesPrivate.DeviceCallback} callback
7047  * @deprecated Use {chrome.system.storage.DeviceEvent.removeListener}.
7048  */
7049 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.removeListener =
7050     function(callback) {};
7051
7052
7053 /**
7054  * @param {!chrome.mediaGalleriesPrivate.DeviceCallback} callback
7055  * @deprecated Use {chrome.system.storage.DeviceEvent.hasListener}.
7056  */
7057 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.hasListener =
7058     function(callback) {};
7059
7060
7061 /**
7062  * @return {boolean}
7063  * @deprecated Use {chrome.system.storage.DeviceEvent.hasListener}
7064  */
7065 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.hasListeners =
7066     function(callback) {};
7067
7068
7069
7070 /**
7071  * @interface
7072  */
7073 chrome.mediaGalleriesPrivate.GalleryChangeEvent = function() {};
7074
7075
7076 /**
7077  * @param {!chrome.mediaGalleriesPrivate.GalleryChangeCallback} callback
7078  */
7079 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.addListener =
7080     function(callback) {};
7081
7082
7083 /**
7084  * @param {!chrome.mediaGalleriesPrivate.GalleryChangeCallback} callback
7085  */
7086 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.removeListener =
7087     function(callback) {};
7088
7089
7090 /**
7091  * @param {!chrome.mediaGalleriesPrivate.GalleryChangeCallback} callback
7092  */
7093 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.hasListener =
7094     function(callback) {};
7095
7096
7097 /**
7098  * @return {boolean}
7099  */
7100 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.hasListeners =
7101     function() {};
7102
7103
7104 /**
7105  * WARNING(2014/08/04): This API is still under active initial development and
7106  * unstable and has a number of issues:
7107  *
7108  * 1. The types NetworkProperties and ManagedNetworkProperties are not defined
7109  *    in the docs; that is, there is no list of fields and their types.
7110  *    Therefore, these types are treated as bags-of-objects, rather than types.
7111  * 2. According to Steven Bennetts, NetworkProperties *should* be a
7112  *    bag-of-properties as it's a map containing ONC properties and the ONC
7113  *    properties do not follow the JS field naming conventions; specifically,
7114  *    the properties start with an uppercase letter, and at least one property
7115  *    is in all uppercase.
7116  * 3. The deviceSsid and deviceBssid fields of VerticationProperties are listed
7117  *    as being required while their description mentions "Only set if" which
7118  *    sound optional. The dev team was unclear whether they are required or
7119  *    optional.
7120  * 4. Some parameters to some functions are marked as being in the Beta channel
7121  *    only (for example, the networkGuid parameter to getCaptivePortalStatus).
7122  *
7123  * Because of the above issues, this API should not be used as an example for
7124  * other APIs added to this file. Please contact mednik@ for questions on and
7125  * maintenance for this API.
7126  * @const
7127  * @see https://developer.chrome.com/extensions/networkingPrivate
7128  */
7129 chrome.networkingPrivate = {};
7130
7131
7132 /**
7133  * @typedef {?{
7134  *   certificate: string,
7135  *   publicKey: string,
7136  *   nonce: string,
7137  *   signedData: string,
7138  *   deviceSerial: string,
7139  *   deviceSsid: string,
7140  *   deviceBssid: string
7141  * }}
7142  */
7143 chrome.networkingPrivate.VerificationProperties;
7144
7145
7146 /**
7147  * @typedef {?{
7148  *   networkType: string,
7149  *   visible: (boolean|undefined),
7150  *   configured: (boolean|undefined),
7151  *   limit: (number|undefined)
7152  * }}
7153  */
7154 chrome.networkingPrivate.NetworkFilter;
7155
7156
7157 /**
7158  * @param {string} guid
7159  * @param {function(!Object)} callback
7160  */
7161 chrome.networkingPrivate.getProperties = function(guid, callback) {};
7162
7163
7164 /**
7165  * @param {string} guid
7166  * @param {function(!Object)} callback
7167  */
7168 chrome.networkingPrivate.getManagedProperties = function(guid, callback) {};
7169
7170
7171 /**
7172  * @param {string} guid
7173  * @param {function(!Object)} callback
7174  */
7175 chrome.networkingPrivate.getState = function(guid, callback) {};
7176
7177
7178 /**
7179  * @param {string} guid
7180  * @param {!Object} properties
7181  * @param {function()} callback
7182  */
7183 chrome.networkingPrivate.setProperties = function(guid, properties, callback) {
7184 };
7185
7186
7187 /**
7188  * @param {boolean} shared
7189  * @param {!Object} properties
7190  * @param {function(string)} callback Returns guid of the configured
7191  *     configuration.
7192  */
7193 chrome.networkingPrivate.createNetwork =
7194     function(shared, properties, callback) {};
7195
7196
7197 /**
7198  * @param {!chrome.networkingPrivate.NetworkFilter} filter
7199  * @param {function(!Array.<!Object>)=} opt_callback
7200  */
7201 chrome.networkingPrivate.getNetworks = function(filter, opt_callback) {};
7202
7203
7204 /**
7205  * @param {string} type
7206  * @param {function(!Array.<!Object>)=} opt_callback
7207  */
7208 chrome.networkingPrivate.getVisibleNetworks = function(type, opt_callback) {};
7209
7210
7211 /** @param {function(!Array.<string>)=} opt_callback */
7212 chrome.networkingPrivate.getEnabledNetworkTypes = function(opt_callback) {};
7213
7214
7215 /** @param {string} networkType */
7216 chrome.networkingPrivate.enableNetworkType = function(networkType) {};
7217
7218
7219 /** @param {string} networkType */
7220 chrome.networkingPrivate.disableNetworkType = function(networkType) {};
7221
7222
7223 /**
7224  * Requests that the networking subsystem scan for new networks and update the
7225  * list returned by getVisibleNetworks.
7226  */
7227 chrome.networkingPrivate.requestNetworkScan = function() {};
7228
7229
7230 /**
7231  * @param {string} guid
7232  * @param {function()=} opt_callback
7233  */
7234 chrome.networkingPrivate.startConnect = function(guid, opt_callback) {};
7235
7236
7237 /**
7238  * @param {string} guid
7239  * @param {function()=} opt_callback
7240  */
7241 chrome.networkingPrivate.startDisconnect = function(guid, opt_callback) {};
7242
7243
7244 /**
7245  * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo
7246  * @param {function(boolean)} callback
7247  */
7248 chrome.networkingPrivate.verifyDestination =
7249     function(verificationInfo, callback) {};
7250
7251
7252 /**
7253  * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo
7254  * @param {string} guid
7255  * @param {function(string)} callback
7256  */
7257 chrome.networkingPrivate.verifyAndEncryptCredentials =
7258     function(verificationInfo, guid, callback) {};
7259
7260
7261 /**
7262  * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo
7263  * @param {string} data
7264  * @param {function(string)} callback
7265  */
7266 chrome.networkingPrivate.verifyAndEncryptData =
7267     function(verificationInfo, data, callback) {};
7268
7269
7270 /**
7271  * @param {string} ipOrMacAddress
7272  * @param {boolean} enabled
7273  * @param {function(string)} callback
7274  */
7275 chrome.networkingPrivate.setWifiTDLSEnabledState =
7276     function(ipOrMacAddress, enabled, callback) {};
7277
7278
7279 /**
7280  * @param {string} ipOrMacAddress
7281  * @param {function(string)} callback
7282  */
7283 chrome.networkingPrivate.getWifiTDLSStatus =
7284     function(ipOrMacAddress, callback) {};
7285
7286
7287 /**
7288  * @param {string} guid
7289  * @param {function(string)} callback
7290  */
7291 chrome.networkingPrivate.getCaptivePortalStatus = function(guid, callback) {};
7292
7293
7294 /** @type {!ChromeStringArrayEvent} */
7295 chrome.networkingPrivate.onNetworksChanged;
7296
7297
7298 /** @type {!ChromeStringArrayEvent} */
7299 chrome.networkingPrivate.onNetworkListChanged;
7300
7301
7302 /** @type {!ChromeStringStringEvent} */
7303 chrome.networkingPrivate.onPortalDetectionCompleted;
7304
7305
7306 /**
7307  * WARNING(2014/08/14): This API is still under active initial development and
7308  * unstable. The types are not well defined or documented, and this API
7309  * definition here should not be used as an example for other APIs added to this
7310  * file. Please contact mednik@ for questions on and maintenance for this API.
7311  * @const
7312  * @see http://goo.gl/afV8wB
7313  */
7314 chrome.mdns = {};
7315
7316
7317 /**
7318  * Data type sent to the event handler of chrome.mdns.onServiceList.
7319  * TODO: This one event handler data type is being made a typedef
7320  * as an experiment. This allows us to create these objects in tests to pass
7321  * to the handlers which isn't possible by using the object form.
7322  * @typedef {{
7323  *     serviceName: string,
7324  *     serviceHostPort: string,
7325  *     ipAddress: string,
7326  *     serviceData: !Array.<string>}}
7327  */
7328 chrome.mdns.MdnsService;
7329
7330
7331
7332 /**
7333  * Event whose listeners take an array of MdnsService parameter.
7334  * @constructor
7335  */
7336 chrome.mdns.ServiceListEvent = function() {};
7337
7338
7339 /**
7340  * @param {function(!Array.<!chrome.mdns.MdnsService>): void} callback
7341  * @param {!Object=} opt_filter
7342  */
7343 chrome.mdns.ServiceListEvent.prototype.addListener =
7344     function(callback, opt_filter) {};
7345
7346
7347 /** @param {function(!Array.<!chrome.mdns.MdnsService>): void} callback */
7348 chrome.mdns.ServiceListEvent.prototype.removeListener = function(callback) {};
7349
7350
7351 /**
7352  * @param {function(!Array.<!chrome.mdns.MdnsService>): void} callback
7353  * @return {boolean}
7354  */
7355 chrome.mdns.ServiceListEvent.prototype.hasListener = function(callback) {};
7356
7357
7358 /** @return {boolean} */
7359 chrome.mdns.ServiceListEvent.prototype.hasListeners = function() {};
7360
7361
7362 /** @type {!chrome.mdns.ServiceListEvent} */
7363 chrome.mdns.onServiceList;
7364
7365
7366 /**
7367  * @const
7368  * @see http://goo.gl/79p5h5
7369  */
7370 chrome.gcdPrivate = {};
7371
7372
7373 /**
7374  * Represents a GCD device discovered locally or registered to a given user.
7375  * deviceId: Opaque device identifier to be passed to API.
7376  * setupType: How this device was discovered.
7377  * cloudId: Cloud identifier string.
7378  * deviceName: Device human readable name.
7379  * deviceType: Device type (camera, printer, etc).
7380  * deviceDescription: Device human readable description.
7381  * @typedef {?{
7382  *   deviceId: string,
7383  *   setupType: string,
7384  *   cloudId: (string|undefined),
7385  *   deviceType: string,
7386  *   deviceName: string,
7387  *   deviceDescription: string
7388  * }}
7389  */
7390 chrome.gcdPrivate.Device;
7391
7392
7393
7394 /** @constructor */
7395 chrome.gcdPrivate.ConfirmationInfo = function() {};
7396
7397
7398 /** @type {string} */
7399 chrome.gcdPrivate.ConfirmationInfo.prototype.type;
7400
7401
7402 /** @type {string|undefined} */
7403 chrome.gcdPrivate.ConfirmationInfo.prototype.code;
7404
7405
7406 /**
7407  * Returns the list of cloud devices visible locally or available in the
7408  * cloud for user account.
7409  * @param {function(!Array.<!chrome.gcdPrivate.Device>): void} callback
7410  */
7411 chrome.gcdPrivate.getCloudDeviceList = function(callback) {};
7412
7413
7414 /**
7415  * Queries network for local devices. Triggers onDeviceStateChanged and
7416  * onDeviceRemoved events. Call this function *only* after registering for
7417  * onDeviceStateChanged and onDeviceRemoved events, or it will do nothing.
7418  */
7419 chrome.gcdPrivate.queryForNewLocalDevices = function() {};
7420
7421
7422 /**
7423  * Cache the WiFi password in the browser process for use during
7424  * provisioning. This is done to allow the gathering of the wifi password to
7425  * not be done while connected to the device's network. Callback is called
7426  * with true if wifi password was cached and false if it was unavailable.
7427  * @param {string} ssid
7428  * @param {function(boolean): void} callback
7429  */
7430 chrome.gcdPrivate.prefetchWifiPassword = function(ssid, callback) {};
7431
7432
7433 /**
7434  * Establish the session.
7435  * @param {string} ipAddress
7436  * @param {number} port
7437  * @param {function(number, string, !chrome.gcdPrivate.ConfirmationInfo): void}
7438  *     callback Called when the session is established or on error. 1st param,
7439  *     |sessionId|, is the session ID (identifies the session for future calls).
7440  *     2nd param, |status|, is the status (success or type of error). 3rd param,
7441  *     |confirmationInfo|, is the info about how the device handles
7442  *     confirmation.
7443  */
7444 chrome.gcdPrivate.establishSession = function(ipAddress, port, callback) {};
7445
7446
7447 /**
7448  * Confirm that the code is correct. Device will still need to confirm. |code|
7449  * must be present and must match the code from the device, even when the code
7450  * is supplied in the |ConfirmationInfo| object.
7451  * @param {number} sessionId
7452  * @param {string} code
7453  * @param {function(string): void} callback
7454  */
7455 chrome.gcdPrivate.confirmCode = function(sessionId, code, callback) {};
7456
7457
7458 /**
7459  * Send an encrypted message to the device. If the message is a setup message
7460  * with a wifi ssid specified but no password, the password cached from
7461  * prefetchWifiPassword() will be used and the call will fail if it's not
7462  * available. For open networks use an empty string as the password.
7463  * @param {number} sessionId
7464  * @param {string} api The API path.
7465  * @param {!Object} input The input message to be sent over the encrypted
7466  *     channel.
7467  * @param {function(string, ?Object): void} callback
7468  */
7469 chrome.gcdPrivate.sendMessage = function(sessionId, api, input, callback) {};
7470
7471
7472 /**
7473  * Terminate the session with the device.
7474  * @param {number} sessionId
7475  */
7476 chrome.gcdPrivate.terminateSession = function(sessionId) {};
7477
7478
7479 /**
7480  * Returns command definitions.
7481  * @param {string} deviceId The device to get command definitions for.
7482  * @param {function(!Object): void} callback The result callback.
7483  */
7484 chrome.gcdPrivate.getCommandDefinitions = function(deviceId, callback) {};
7485
7486
7487 /**
7488  * Creates and sends a new command.
7489  * @param {string} deviceId The device to send the command to.
7490  * @param {number} expireInMs The number of milliseconds since now before the
7491  *     command expires. An expired command should not be executed by the device.
7492  *     Acceptable values are 10 sec (10000 ms) to 30 days (2592000000 ms),
7493  *     inclusive. All values outside that range will be replaced by 30 days.
7494  * @param {!Object} command Described at
7495  *     https://developers.google.com/cloud-devices/v1/reference/commands.
7496  * @param {function(!Object): void} callback  The result callback.
7497  */
7498 chrome.gcdPrivate.insertCommand = function(
7499     deviceId, expireInMs, command, callback) {};
7500
7501
7502 /**
7503  * Returns a particular command.
7504  * @param {string} commandId Unique command ID.
7505  * @param {function(!Object): void} callback  The result callback.
7506  */
7507 chrome.gcdPrivate.getCommand = function(commandId, callback) {};
7508
7509
7510 /**
7511  * Cancels a command.
7512  * @param {string} commandId Unique command ID.
7513  * @param {function(!Object): void} callback  The result callback.
7514  */
7515 chrome.gcdPrivate.cancelCommand = function(commandId, callback) {};
7516
7517
7518 /**
7519  * Lists all commands in order of creation.
7520  * @param {string} deviceId The device to send the command to.
7521  * @param {string} byUser List all the commands issued by the user. Special
7522  *     value 'me' can be used to list by the current user.
7523  * @param {string} state Command state.
7524  * @param {function(!Array.<!Object>): void} callback  The result callback.
7525  */
7526 chrome.gcdPrivate.getCommandsList = function(
7527     deviceId, byUser, state, callback) {};
7528
7529
7530
7531 /**
7532  * Event whose listeners take a chrome.gcdPrivate.Device.
7533  * @constructor
7534  */
7535 chrome.gcdPrivate.DeviceEvent = function() {};
7536
7537
7538 /** @param {function(!chrome.gcdPrivate.Device): void} callback */
7539 chrome.gcdPrivate.DeviceEvent.prototype.addListener = function(callback) {};
7540
7541
7542 /** @param {function(!chrome.gcdPrivate.Device): void} callback */
7543 chrome.gcdPrivate.DeviceEvent.prototype.removeListener = function(callback) {};
7544
7545
7546 /**
7547  * @param {function(!chrome.gcdPrivate.Device): void} callback
7548  * @return {boolean}
7549  */
7550 chrome.gcdPrivate.DeviceEvent.prototype.hasListener = function(callback) {};
7551
7552
7553 /** @return {boolean} */
7554 chrome.gcdPrivate.DeviceEvent.prototype.hasListeners = function() {};
7555
7556
7557 /**
7558  * Fires when a device's state changes. When a listener is first added, this
7559  * event fires for all known devices on the network. Afterwards, it will fire
7560  * with device status updates.
7561  * @type {!chrome.gcdPrivate.DeviceEvent}
7562  */
7563 chrome.gcdPrivate.onDeviceStateChanged;
7564
7565
7566 /**
7567  * Fires when a given device disappears.
7568  * |deviceId| The device that has disappeared.
7569  * @type {!ChromeStringEvent}
7570  */
7571 chrome.gcdPrivate.onDeviceRemoved;
7572
7573
7574 /**
7575  * @const
7576  * @see http://goo.gl/bKHibo
7577  */
7578 chrome.bluetoothPrivate = {};
7579
7580
7581
7582 /** @constructor */
7583 chrome.bluetoothPrivate.PairingEvent = function() {};
7584
7585
7586 /** @type {string} */
7587 chrome.bluetoothPrivate.PairingEvent.prototype.pairing;
7588
7589
7590 /** @type {!chrome.bluetooth.Device} */
7591 chrome.bluetoothPrivate.PairingEvent.prototype.device;
7592
7593
7594 /** @type {string|undefined} */
7595 chrome.bluetoothPrivate.PairingEvent.prototype.pincode;
7596
7597
7598 /** @type {number|undefined} */
7599 chrome.bluetoothPrivate.PairingEvent.prototype.passkey;
7600
7601
7602 /** @type {number|undefined} */
7603 chrome.bluetoothPrivate.PairingEvent.prototype.enteredKey;
7604
7605
7606 /**
7607  * @typedef {{
7608  *   name: (string|undefined),
7609  *   powered: (boolean|undefined),
7610  *   discoverable: (boolean|undefined)
7611  * }}
7612  */
7613 chrome.bluetoothPrivate.NewAdapterState;
7614
7615
7616 /**
7617  * @typedef {{
7618  *   device: !chrome.bluetooth.Device,
7619  *   response: (string|undefined),
7620  *   pincode: (string|undefined),
7621  *   passkey: (number|undefined),
7622  *   enteredKey: (number|undefined)
7623  * }}
7624  */
7625 chrome.bluetoothPrivate.SetPairingResponseOptions;
7626
7627
7628 /**
7629  * @param {!chrome.bluetoothPrivate.NewAdapterState} adapterState
7630  * @param {function()} callback
7631  */
7632 chrome.bluetoothPrivate.setAdapterState = function(adapterState, callback) {};
7633
7634
7635 /**
7636  * @param {!chrome.bluetoothPrivate.SetPairingResponseOptions} options
7637  * @param {function()} callback
7638  */
7639 chrome.bluetoothPrivate.setPairingResponse = function(options, callback) {};
7640
7641
7642
7643 /**
7644  * Event whose listeners take a PairingEvent parameter.
7645  * @constructor
7646  */
7647 chrome.bluetoothPrivate.PairingEventEvent = function() {};
7648
7649
7650 /** @param {function(!chrome.bluetoothPrivate.PairingEvent): void} callback */
7651 chrome.bluetoothPrivate.PairingEventEvent.prototype.addListener =
7652     function(callback) {};
7653
7654
7655 /** @param {function(!chrome.bluetoothPrivate.PairingEvent): void} callback */
7656 chrome.bluetoothPrivate.PairingEventEvent.prototype.removeListener =
7657     function(callback) {};
7658
7659
7660 /**
7661  * @param {function(!chrome.bluetoothPrivate.PairingEvent): void} callback
7662  * @return {boolean}
7663  */
7664 chrome.bluetoothPrivate.PairingEventEvent.prototype.hasListener =
7665     function(callback) {};
7666
7667
7668 /** @return {boolean} */
7669 chrome.bluetoothPrivate.PairingEventEvent.prototype.hasListeners =
7670     function() {};
7671
7672
7673 /** @type {!chrome.bluetoothPrivate.PairingEventEvent} */
7674 chrome.bluetoothPrivate.onPairing;