Apply internal chrome_extensions.js review feedback.
[chromium-blink-merge.git] / third_party / closure_compiler / externs / chrome_extensions.js
blob7722210d300b5cbed37dfc7e834a9e9147c99655
1 //    SSSSSSSSSSSSSSS TTTTTTTTTTTTTTTTTTTTTTT     OOOOOOOOO     PPPPPPPPPPPPPPPPP
2 //  SS:::::::::::::::ST:::::::::::::::::::::T   OO:::::::::OO   P::::::::::::::::P
3 // S:::::SSSSSS::::::ST:::::::::::::::::::::T OO:::::::::::::OO P::::::PPPPPP:::::P
4 // S:::::S     SSSSSSST:::::TT:::::::TT:::::TO:::::::OOO:::::::OPP:::::P     P:::::P
5 // S:::::S            TTTTTT  T:::::T  TTTTTTO::::::O   O::::::O  P::::P     P:::::P
6 // S:::::S                    T:::::T        O:::::O     O:::::O  P::::P     P:::::P
7 //  S::::SSSS                                                     P::::PPPPPP:::::P
8 //   SS::::::SSSSS       This file is generated. To update it,    P:::::::::::::PP
9 //     SSS::::::::SS          run bump_compiler_version.          P::::PPPPPPPPP
10 //        SSSSSS::::S                                             P::::P
11 //             S:::::S        T:::::T        O:::::O     O:::::O  P::::P
12 //             S:::::S        T:::::T        O::::::O   O::::::O  P::::P
13 // SSSSSSS     S:::::S      TT:::::::TT      O:::::::OOO:::::::OPP::::::PP
14 // S::::::SSSSSS:::::S      T:::::::::T       OO:::::::::::::OO P::::::::P
15 // S:::::::::::::::SS       T:::::::::T         OO:::::::::OO   P::::::::P
16 //  SSSSSSSSSSSSSSS         TTTTTTTTTTT           OOOOOOOOO     PPPPPPPPPP
18  * Copyright 2009 The Closure Compiler Authors
19  *
20  * Licensed under the Apache License, Version 2.0 (the "License");
21  * you may not use this file except in compliance with the License.
22  * You may obtain a copy of the License at
23  *
24  *     http://www.apache.org/licenses/LICENSE-2.0
25  *
26  * Unless required by applicable law or agreed to in writing, software
27  * distributed under the License is distributed on an "AS IS" BASIS,
28  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  * See the License for the specific language governing permissions and
30  * limitations under the License.
31  */
33 /**
34  * @fileoverview Definitions for the Chromium extensions API.
35  *
36  * This is the externs file for the Chrome Extensions API.
37  * See http://developer.chrome.com/extensions/
38  *
39  * There are several problematic issues regarding Chrome extension APIs and
40  * this externs files, including:
41  * A. When to add packages to this file
42  * B. Optional parameters
43  * C. Pseudo-types
44  * D. Events
45  * E. Nullability
46  * F. Private APIs
47  * G. Enums
48  *
49  * The best practices for each are described in more detail below.  It
50  * should be noted that, due to historical reasons, and the evolutionary
51  * nature of this file, much this file currently violates the best practices
52  * described below. As changed are made, the changes should adhere to the
53  * best practices.
54  *
55  * A. When to Add Packages to this File?
56  * Packages in chrome.experimental.* should *not* be added to this file. The
57  * experimental APIs change very quickly, so rather than add them here, make a
58  * separate externs file for your project, then move the API here when it moves
59  * out of experimental.
60  *
61  * Some non-experimental APIs are still evolving or are not full documented. It
62  * is still advantageous to include these in this file as doing so avoids a
63  * proliferation of project-private externs files containing duplicated info. In
64  * these cases, use comments to describe the situation.
65  *
66  * B. Optional Parameters
67  * The Chrome extension APIs make extensive use of optional parameters that
68  * are not at the end of the parameter list, "interior optional parameters",
69  * while the JS Compiler's type system requires optional parameters to be
70  * at the end. This creates a bit of tension:
71  *
72  * 1. If a method has N required params, then the parameter declarations
73  *    should have N required params.
74  * 2. If, due to interior optional params, a parameter can be of more than
75  *    one type, its at-param should:
76  *    a. be named to indicate both possibilities, eg, extensionIdOrRequest,
77  *       or getInfoOrCallback.
78  *    b. the type should include both types, in the same order as the parts
79  *       of the name, even when one type subsumes the other, eg, {string|*}
80  *       or {Object|function(string)}.
81  * See chrome.runtime.sendMessage for a complex example as sendMessage
82  * takes three params with the first and third being optional.
83  *
84  * C. Pseudo-types
85  * The Chrome APIs define many types are that actually pseudo-types, that
86  * is, they can't be instantiated by name. The extension APIs also pass
87  * untyped objects (a bag of properties) to callbacks.
88  *
89  * The Chrome extension APIs include at least three different situations:
90  *
91  * 1. an object that must be created by an extension developer and passed
92  *    into a Chrome extension API and for which there is no constructor.
93  * 2. an instance of a type that is created inside the extension libraries
94  *    and passed out to a callback/listener or returned by an extension API
95  *    (the constructor implicity lives within the library).
96  * 3. like #2, but a bag-of-properties object that is passed out to a
97  *    callback/listener or returned by an extension API so there is no
98  *    defined type.
99  *
100  * For #1, use a typedef so object literals and objects created via goog.object
101  * are acceptable, for example, the Permissions type defined at
102  * http://developer.chrome.com/extensions/permissions.html#type-Permissions
103  * should be:
105  *   / **
106  *     * at-typedef {?{
107  *     *   permissions: (!Array.<string>|undefined),
108  *     *   origins: (!Array.<string>|undefined)
109  *     * }}
110  *     * /
111  *   chrome.permissions.Permissions;
113  * Using typedefs provides type-safety for the fields that are defined in
114  * the object literal and also defined in the typedef. Note that typedefs define
115  * a minimal interface and will not complain about extraneous (often
116  * misspelled) fields.
118  * Also, typedefs of record types are non-nullable by default. The "{?{"
119  * creates a nullable record-type typedef so ! has the same meaning in usages
120  * as it does for real types.
122  * For #2, use a standard constructor, even though no constructor is provided
123  * and extension writers will never instantiate an instance, as using a first
124  * class type provides the strongest type checking. For example, see the Port
125  * type defined at http://developer.chrome.com/apps/runtime.html#type-Port.
126  * Always qualify the type name to reduce top-level pollution in this file:
128  *   Do:
129  *        chrome.extension.Port = function() {}
130  *   Don't:
131  *        function Port() {}
133  * Note that, unfortunately, the actual Port class definition in this file
134  * does not follow this recommendation.
136  * For #3, use {!Object}, that is, a bag of properites. This is a sad reality
137  * given that the Chrome extensions do not document a real type. It is tempting
138  * to define a real-type within this file and treat this situation as identical
139  * to #2, but that means a new type is being defined in this file and developers
140  * do not expect to find required new types in extension files.
142  * If a real type is declared here, then developers will need to incorporate
143  * that type into the signature of their callback method and there will be
144  * no indication from the docs that they need to do so.
146  * D. Events
147  * Most packages define a set of events with the standard set of methods:
148  * addListener, removeListener, hasListener and hasListeners.  ChromeEvent
149  * is the appropriate type when an event's listeners do not take any
150  * parameters, however, many events take parameters specific to that event:
152  * 1. Create a pseudo-type for the event, for example,
153  *    chrome.runtime.PortEvent and define the four methods on it.
154  * 2. Fully describe the listener/callback's signature, for example,
156  *       * at-param {function(!chrome.runtime.Port): void} callback Callback.
157  *      chrome.runtime.PortEvent.prototype.addListener =
158  *          function(callback) {};
159  *    or
161  *       * at-param {function(*, !chrome.runtime.MessageSender,
162  *       *     function(*): void): (boolean|undefined)} callback Callback.
163  *      chrome.runtime.MessageSenderEvent.prototype.addListener =
164  *          function(callback) {};
166  * E. Nullability
167  * We treat the Chrome Extension API pages as "the truth".  Not-null types
168  * should be used in the following situations:
170  * 1. Parameters and return values that are not explicitly declared to handle
171  *    null.
172  * 2. Static event instances, for example, chrome.runtime.onConnect's type
173  *    should be: !chrome.runtime.PortEvent.
174  * 3. Optional params as there is little value to passing null when the
175  *    parameter can be omitted, of course, if null is explicitly declared
176  *    to be meaningful, then a nullable type should be used.
178  * F. Private APIs
179  * Private Chrome APIs (such as those that end in "Private") should go at the
180  * bottom of this file.
182  * G. Enums
183  * The Chrome extension APIs define many enums that define a set of acceptable
184  * strings, however, they do not reify those enum types, therefore, enum
185  * parameters should be defined as {@code string}.
187  * @externs
189  */
193  * Ensure projects don't execute this file.
194  * The throw is to catch executions of this file, however, without the guard,
195  * the compiler's flow analysis stops at the throw, even for an externs file.
196  * Therefore, the Math.random() guard fools the compiler during externs
197  * processing.
198  */
199 if (Math.random() < 1) {  // always true but the compiler doesn't know that
200   throw 'Externs file "chrome_extensions.js" should not be executed';
205  * @see https://developer.chrome.com/extensions/accessibilityFeatures
206  * @const
207  */
208 chrome.accessibilityFeatures = {};
211 /** @type {!ChromeSetting} */
212 chrome.accessibilityFeatures.spokenFeedback;
215 /** @type {!ChromeSetting} */
216 chrome.accessibilityFeatures.largeCursor;
219 /** @type {!ChromeSetting} */
220 chrome.accessibilityFeatures.stickyKeys;
223 /** @type {!ChromeSetting} */
224 chrome.accessibilityFeatures.highContrast;
227 /** @type {!ChromeSetting} */
228 chrome.accessibilityFeatures.screenMagnifier;
231 /** @type {!ChromeSetting} */
232 chrome.accessibilityFeatures.autoclick;
235 /** @type {!ChromeSetting} */
236 chrome.accessibilityFeatures.virtualKeyboard;
239 /** @type {!ChromeSetting} */
240 chrome.accessibilityFeatures.animationPolicy;
244  * TODO(tbreisacher): Move all chrome.app.* externs into their own file.
245  * @const
246  */
247 chrome.app = {};
251  * @const
252  * @see http://developer.chrome.com/apps/app.runtime.html
253  */
254 chrome.app.runtime = {};
259  * @constructor
260  * @see http://developer.chrome.com/apps/app_runtime.html
261  */
262 chrome.app.runtime.LaunchItem = function() {};
265 /** @type {!FileEntry} */
266 chrome.app.runtime.LaunchItem.prototype.entry;
269 /** @type {string} */
270 chrome.app.runtime.LaunchItem.prototype.type;
275  * @constructor
276  * @see http://developer.chrome.com/apps/app_runtime.html
277  */
278 chrome.app.runtime.LaunchData = function() {};
281 /** @type {string|undefined} */
282 chrome.app.runtime.LaunchData.prototype.id;
285 /** @type {!Array.<!chrome.app.runtime.LaunchItem>|undefined} */
286 chrome.app.runtime.LaunchData.prototype.items;
289 /** @type {string|undefined} */
290 chrome.app.runtime.LaunchData.prototype.url;
293 /** @type {string|undefined} */
294 chrome.app.runtime.LaunchData.prototype.referrerUrl;
297 /** @type {boolean|undefined} */
298 chrome.app.runtime.LaunchData.prototype.isKioskSession;
303  * The type of chrome.app.runtime.onLaunched.
304  * @constructor
305  */
306 chrome.app.runtime.LaunchEvent = function() {};
310  * @param {function(!chrome.app.runtime.LaunchData)} callback
311  * @see http://developer.chrome.com/apps/app.runtime.html#event-onLaunched
312  */
313 chrome.app.runtime.LaunchEvent.prototype.addListener = function(callback) {};
317  * @param {function(!chrome.app.runtime.LaunchData)} callback
318  */
319 chrome.app.runtime.LaunchEvent.prototype.removeListener = function(callback) {};
323  * @param {function(!chrome.app.runtime.LaunchData)} callback
324  * @return {boolean}
325  */
326 chrome.app.runtime.LaunchEvent.prototype.hasListener = function(callback) {};
330  * @return {boolean}
331  */
332 chrome.app.runtime.LaunchEvent.prototype.hasListeners = function() {};
335 /** @type {!chrome.app.runtime.LaunchEvent} */
336 chrome.app.runtime.onLaunched;
340  * @type {!ChromeEvent}
341  * @see http://developer.chrome.com/apps/app.runtime.html#event-onRestarted
342  */
343 chrome.app.runtime.onRestarted;
347  * @const
348  * @see http://developer.chrome.com/apps/app.window.html
349  */
350 chrome.app.window = {};
354  * @see https://developer.chrome.com/apps/app_window#method-getAll
355  * @return {!Array.<!chrome.app.window.AppWindow>}
356  */
357 chrome.app.window.getAll = function() {};
361  * @see https://developer.chrome.com/apps/app_window#method-get
362  * @param {string} id
363  * @return {chrome.app.window.AppWindow}
364  */
365 chrome.app.window.get = function(id) {};
370  * @constructor
371  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
372  */
373 chrome.app.window.AppWindow = function() {};
377  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
378  */
379 chrome.app.window.AppWindow.prototype.focus = function() {};
383  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
384  */
385 chrome.app.window.AppWindow.prototype.fullscreen = function() {};
389  * @return {boolean}
390  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
391  */
392 chrome.app.window.AppWindow.prototype.isFullscreen = function() {};
396  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
397  */
398 chrome.app.window.AppWindow.prototype.minimize = function() {};
402  * @return {boolean}
403  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
404  */
405 chrome.app.window.AppWindow.prototype.isMinimized = function() {};
409  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
410  */
411 chrome.app.window.AppWindow.prototype.maximize = function() {};
415  * @return {boolean}
416  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
417  */
418 chrome.app.window.AppWindow.prototype.isMaximized = function() {};
422  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
423  */
424 chrome.app.window.AppWindow.prototype.restore = function() {};
428  * @param {number} left The new left position, in pixels.
429  * @param {number} top The new top position, in pixels.
430  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
431  */
432 chrome.app.window.AppWindow.prototype.moveTo = function(left, top) {};
436  * @param {number} width The new width, in pixels.
437  * @param {number} height The new height, in pixels.
438  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
439  */
440 chrome.app.window.AppWindow.prototype.resizeTo = function(width, height) {};
444  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
445  */
446 chrome.app.window.AppWindow.prototype.drawAttention = function() {};
450  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
451  */
452 chrome.app.window.AppWindow.prototype.clearAttention = function() {};
456  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
457  */
458 chrome.app.window.AppWindow.prototype.close = function() {};
462  * @param {boolean=} opt_focus Should the window be focused? Defaults to true.
463  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
464  */
465 chrome.app.window.AppWindow.prototype.show = function(opt_focus) {};
469  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
470  */
471 chrome.app.window.AppWindow.prototype.hide = function() {};
475  * @return {!chrome.app.window.Bounds} The current window bounds.
476  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
477  */
478 chrome.app.window.AppWindow.prototype.getBounds = function() {};
482  * @param {!chrome.app.window.Bounds} bounds The new window bounds.
483  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
484  */
485 chrome.app.window.AppWindow.prototype.setBounds = function(bounds) {};
489  * @return {boolean}
490  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
491  */
492 chrome.app.window.AppWindow.prototype.isAlwaysOnTop = function() {};
496  * @param {boolean} alwaysOnTop Set whether the window should stay above most
497  *     other windows.
498  * @see http://developer.chrome.com/apps/app.window.html#type-AppWindow
499  */
500 chrome.app.window.AppWindow.prototype.setAlwaysOnTop = function(alwaysOnTop) {};
503 /** @type {!ChromeEvent} */
504 chrome.app.window.AppWindow.prototype.onBoundsChanged;
507 /** @type {!ChromeEvent} */
508 chrome.app.window.AppWindow.prototype.onClosed;
511 /** @type {!ChromeEvent} */
512 chrome.app.window.AppWindow.prototype.onFullscreened;
515 /** @type {!ChromeEvent} */
516 chrome.app.window.AppWindow.prototype.onMinimized;
519 /** @type {!ChromeEvent} */
520 chrome.app.window.AppWindow.prototype.onMaximized;
523 /** @type {!ChromeEvent} */
524 chrome.app.window.AppWindow.prototype.onRestored;
527 /** @type {!Window} */
528 chrome.app.window.AppWindow.prototype.contentWindow;
532  * @typedef {{
533  *   left: (number|undefined),
534  *   top: (number|undefined),
535  *   width: (number|undefined),
536  *   height: (number|undefined)
537  * }}
538  * @see http://developer.chrome.com/apps/app.window.html#type-Bounds
539  */
540 chrome.app.window.Bounds;
544  * @typedef {{
545  *   id: (string|undefined),
546  *   minWidth: (number|undefined),
547  *   minHeight: (number|undefined),
548  *   maxWidth: (number|undefined),
549  *   maxHeight: (number|undefined),
550  *   frame: (string|undefined),
551  *   bounds: (!chrome.app.window.Bounds|undefined),
552  *   transparentBackground: (boolean|undefined),
553  *   state: (string|undefined),
554  *   hidden: (boolean|undefined),
555  *   resizable: (boolean|undefined),
556  *   alwaysOnTop: (boolean|undefined),
557  *   focused: (boolean|undefined)
558  * }}
559  * @see http://developer.chrome.com/apps/app.window.html#method-create
560  */
561 chrome.app.window.CreateWindowOptions;
565  * @param {string} url URL to create.
566  * @param {!chrome.app.window.CreateWindowOptions=} opt_options The options for
567  *     the new window.
568  * @param {function(!chrome.app.window.AppWindow)=} opt_createWindowCallback
569  *     Callback to be run.
570  * @see http://developer.chrome.com/apps/app.window.html#method-create
571  */
572 chrome.app.window.create = function(
573     url, opt_options, opt_createWindowCallback) {};
577  * Returns an AppWindow object for the current script context (ie JavaScript
578  * 'window' object).
579  * @return {!chrome.app.window.AppWindow}
580  * @see http://developer.chrome.com/apps/app.window.html#method-current
581  */
582 chrome.app.window.current = function() {};
586  * @type {!ChromeEvent}
587  * @see http://developer.chrome.com/apps/app.window.html#event-onBoundsChanged
588  */
589 chrome.app.window.onBoundsChanged;
593  * @type {!ChromeEvent}
594  * @see http://developer.chrome.com/apps/app.window.html#event-onClosed
595  */
596 chrome.app.window.onClosed;
600  * @type {!ChromeEvent}
601  * @see http://developer.chrome.com/apps/app.window.html#event-onFullscreened
602  */
603 chrome.app.window.onFullscreened;
607  * @type {!ChromeEvent}
608  * @see http://developer.chrome.com/apps/app.window.html#event-onMaximized
609  */
610 chrome.app.window.onMaximized;
614  * @type {!ChromeEvent}
615  * @see http://developer.chrome.com/apps/app.window.html#event-onMinimized
616  */
617 chrome.app.window.onMinimized;
621  * @type {!ChromeEvent}
622  * @see http://developer.chrome.com/apps/app.window.html#event-onRestored
623  */
624 chrome.app.window.onRestored;
628  * Private API.
630  * @const
631  * @see https://code.google.com/p/chromium/codesearch#chromium/src/chrome/common/extensions/api/audio_modem.idl
632  * @see go/chrome-modem
633  */
634 chrome.audioModem = {};
638  * @typedef {?{
639  *   tokenLength: number,
640  *   crc: (boolean|undefined),
641  *   parity: (boolean|undefined)
642  * }}
643  */
644 chrome.audioModem.TokenEncoding;
648  * @typedef {?{
649  *   timeoutMillis: number,
650  *   band: string,
651  *   encoding: !chrome.audioModem.TokenEncoding
652  * }}
653  */
654 chrome.audioModem.RequestParams;
657 /** @constructor */
658 chrome.audioModem.ReceivedToken = function() {};
661 /** @type {!ArrayBuffer} */
662 chrome.audioModem.ReceivedToken.prototype.token;
665 /** @type {string} */
666 chrome.audioModem.ReceivedToken.prototype.band;
670  * @param {!chrome.audioModem.RequestParams} params
671  * @param {!ArrayBuffer} token
672  * @param {function(string)} callback
673  */
674 chrome.audioModem.transmit = function(params, token, callback) {};
678  * @param {string} band
679  * @param {function(string)} callback
680  */
681 chrome.audioModem.stopTransmit = function(band, callback) {};
685  * @param {!chrome.audioModem.RequestParams} params
686  * @param {function(string)} callback
687  */
688 chrome.audioModem.receive = function(params, callback) {};
692  * @param {string} band
693  * @param {function(string)} callback
694  */
695 chrome.audioModem.stopReceive = function(band, callback) {};
698 /** @constructor */
699 chrome.audioModem.ReceivedEvent = function() {};
703  * @param {function(!Array<!chrome.audioModem.ReceivedToken>)} callback
704  */
705 chrome.audioModem.ReceivedEvent.prototype.addListener = function(callback) {};
709  * @param {function(!Array<!chrome.audioModem.ReceivedToken>)} callback
710  */
711 chrome.audioModem.ReceivedEvent.prototype.removeListener =
712     function(callback) {};
716  * @param {function(!Array<!chrome.audioModem.ReceivedToken>)} callback
717  * @return {boolean}
718  */
719 chrome.audioModem.ReceivedEvent.prototype.hasListener = function(callback) {};
723  * @return {boolean}
724  */
725 chrome.audioModem.ReceivedEvent.prototype.hasListeners = function() {};
728 /** @type {!chrome.audioModem.ReceivedEvent} */
729 chrome.audioModem.onReceived;
732 /** @type {!ChromeStringEvent} */
733 chrome.audioModem.onTransmitFail;
737  * @const
738  * @see https://developer.chrome.com/apps/bluetooth
739  */
740 chrome.bluetooth = function() {};
745  * @constructor
746  * @see https://developer.chrome.com/apps/bluetooth#type-AdapterState
747  */
748 chrome.bluetooth.AdapterState = function() {};
751 /** @type {string} */
752 chrome.bluetooth.AdapterState.prototype.address;
755 /** @type {string} */
756 chrome.bluetooth.AdapterState.prototype.name;
759 /** @type {boolean} */
760 chrome.bluetooth.AdapterState.prototype.powered;
763 /** @type {boolean} */
764 chrome.bluetooth.AdapterState.prototype.available;
767 /** @type {boolean} */
768 chrome.bluetooth.AdapterState.prototype.discovering;
773  * @constructor
774  * @see https://developer.chrome.com/apps/bluetooth#type-Device
775  */
776 chrome.bluetooth.Device = function() {};
779 /** @type {string} */
780 chrome.bluetooth.Device.prototype.address;
783 /** @type {string|undefined} */
784 chrome.bluetooth.Device.prototype.name;
787 /** @type {number|undefined} */
788 chrome.bluetooth.Device.prototype.deviceClass;
791 /** @type {string|undefined} */
792 chrome.bluetooth.Device.prototype.vendorIdSource;
795 /** @type {string|undefined} */
796 chrome.bluetooth.Device.prototype.vendorId;
799 /** @type {number|undefined} */
800 chrome.bluetooth.Device.prototype.productId;
803 /** @type {number|undefined} */
804 chrome.bluetooth.Device.prototype.deviceId;
807 /** @type {string|undefined} */
808 chrome.bluetooth.Device.prototype.type;
811 /** @type {boolean|undefined} */
812 chrome.bluetooth.Device.prototype.paired;
815 /** @type {boolean|undefined} */
816 chrome.bluetooth.Device.prototype.connected;
819 /** @type {!Array.<string>|undefined} */
820 chrome.bluetooth.Device.prototype.uuids;
824  * @param {function(!chrome.bluetooth.AdapterState)} callback
825  * @see https://developer.chrome.com/apps/bluetooth#method-getAdapterState
826  */
827 chrome.bluetooth.getAdapterState = function(callback) {};
831  * @param {string} deviceAddress
832  * @param {function(!chrome.bluetooth.Device)} callback
833  * @see https://developer.chrome.com/apps/bluetooth#method-getDevice
834  */
835 chrome.bluetooth.getDevice = function(deviceAddress, callback) {};
839  * @param {function(!Array.<!chrome.bluetooth.Device>)} callback
840  * @see https://developer.chrome.com/apps/bluetooth#method-getDevices
841  */
842 chrome.bluetooth.getDevices = function(callback) {};
846  * @param {function()=} opt_callback
847  * @see https://developer.chrome.com/apps/bluetooth#method-startDiscovery
848  */
849 chrome.bluetooth.startDiscovery = function(opt_callback) {};
853  * @param {function()=} opt_callback
854  * @see https://developer.chrome.com/apps/bluetooth#method-stopDiscovery
855  */
856 chrome.bluetooth.stopDiscovery = function(opt_callback) {};
861  * Event whose listeners take an AdapaterState parameter.
862  * @constructor
863  */
864 chrome.bluetooth.AdapterStateEvent = function() {};
867 /** @param {function(!chrome.bluetooth.AdapterState): void} callback */
868 chrome.bluetooth.AdapterStateEvent.prototype.addListener =
869     function(callback) {};
872 /** @param {function(!chrome.bluetooth.AdapterState): void} callback */
873 chrome.bluetooth.AdapterStateEvent.prototype.removeListener =
874     function(callback) {};
878  * @param {function(!chrome.bluetooth.AdapterState): void} callback
879  * @return {boolean}
880  */
881 chrome.bluetooth.AdapterStateEvent.prototype.hasListener =
882     function(callback) {};
885 /** @return {boolean} */
886 chrome.bluetooth.AdapterStateEvent.prototype.hasListeners = function() {};
890  * @type {!chrome.bluetooth.AdapterStateEvent}
891  * @see https://developer.chrome.com/apps/bluetooth#event-onAdapterStateChanged
892  */
893 chrome.bluetooth.onAdapterStateChanged;
898  * Event whose listeners take an Device parameter.
899  * @constructor
900  */
901 chrome.bluetooth.DeviceEvent = function() {};
904 /** @param {function(!chrome.bluetooth.Device): void} callback */
905 chrome.bluetooth.DeviceEvent.prototype.addListener = function(callback) {};
908 /** @param {function(!chrome.bluetooth.Device): void} callback */
909 chrome.bluetooth.DeviceEvent.prototype.removeListener = function(callback) {};
913  * @param {function(!chrome.bluetooth.Device): void} callback
914  * @return {boolean}
915  */
916 chrome.bluetooth.DeviceEvent.prototype.hasListener = function(callback) {};
919 /** @return {boolean} */
920 chrome.bluetooth.DeviceEvent.prototype.hasListeners = function() {};
924  * @type {!chrome.bluetooth.DeviceEvent}
925  * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceAdded
926  */
927 chrome.bluetooth.onDeviceAdded;
931  * @type {!chrome.bluetooth.DeviceEvent}
932  * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceChanged
933  */
934 chrome.bluetooth.onDeviceChanged;
938  * @type {!chrome.bluetooth.DeviceEvent}
939  * @see https://developer.chrome.com/apps/bluetooth#event-onDeviceRemoved
940  */
941 chrome.bluetooth.onDeviceRemoved;
945  * @const
946  * @see https://developer.chrome.com/apps/bluetoothSocket
947  */
948 chrome.bluetoothSocket = {};
952  * @typedef {{
953  *   persistent: (boolean|undefined),
954  *   name: (string|undefined),
955  *   bufferSize: (number|undefined)
956  * }}
957  * @see https://developer.chrome.com/apps/bluetoothSocket#type-SocketProperties
958  */
959 chrome.bluetoothSocket.SocketProperties;
963  * @typedef {{
964  *   channel: (number|undefined),
965  *   psm: (number|undefined),
966  *   backlog: (number|undefined)
967  * }}
968  * @see https://developer.chrome.com/apps/bluetoothSocket#type-ListenOptions
969  */
970 chrome.bluetoothSocket.ListenOptions;
975  * @constructor
976  * @see https://developer.chrome.com/apps/bluetoothSocket#type-SocketInfo
977  */
978 chrome.bluetoothSocket.SocketInfo = function() {};
981 /** @type {number} */
982 chrome.bluetoothSocket.SocketInfo.prototype.socketId;
985 /** @type {boolean} */
986 chrome.bluetoothSocket.SocketInfo.prototype.persistent;
989 /** @type {string|undefined} */
990 chrome.bluetoothSocket.SocketInfo.prototype.name;
993 /** @type {number|undefined} */
994 chrome.bluetoothSocket.SocketInfo.prototype.bufferSize;
997 /** @type {boolean} */
998 chrome.bluetoothSocket.SocketInfo.prototype.paused;
1001 /** @type {boolean} */
1002 chrome.bluetoothSocket.SocketInfo.prototype.connected;
1005 /** @type {string|undefined} */
1006 chrome.bluetoothSocket.SocketInfo.prototype.address;
1009 /** @type {string|undefined} */
1010 chrome.bluetoothSocket.SocketInfo.prototype.uuid;
1014  * @param {!chrome.bluetoothSocket.SocketProperties|
1015  *     function(!{socketId: number})} propertiesOrCallback
1016  * @param {function(!{socketId: number})=} opt_callback
1017  * @see https://developer.chrome.com/apps/bluetoothSocket#method-create
1018  */
1019 chrome.bluetoothSocket.create = function(propertiesOrCallback, opt_callback) {};
1023  * @param {number} socketId
1024  * @param {!chrome.bluetoothSocket.SocketProperties} properties
1025  * @param {function()=} opt_callback
1026  * @see https://developer.chrome.com/apps/bluetoothSocket#method-update
1027  */
1028 chrome.bluetoothSocket.update = function(socketId, properties, opt_callback) {};
1032  * @param {number} socketId
1033  * @param {boolean} paused
1034  * @param {function()=} opt_callback
1035  * @see https://developer.chrome.com/apps/bluetoothSocket#method-setPaused
1036  */
1037 chrome.bluetoothSocket.setPaused = function(socketId, paused, opt_callback) {};
1041  * @param {number} socketId
1042  * @param {string} uuid
1043  * @param {!chrome.bluetoothSocket.ListenOptions|function()} optionsOrCallback
1044  * @param {function()=} opt_callback
1045  * @see https://developer.chrome.com/apps/bluetoothSocket#method-listenUsingRfcomm
1046  */
1047 chrome.bluetoothSocket.listenUsingRfcomm =
1048     function(socketId, uuid, optionsOrCallback, opt_callback) {};
1052  * @param {number} socketId
1053  * @param {string} uuid
1054  * @param {!chrome.bluetoothSocket.ListenOptions|function()} optionsOrCallback
1055  * @param {function()=} opt_callback
1056  * @see https://developer.chrome.com/apps/bluetoothSocket#method-listenUsingL2cap
1057  */
1058 chrome.bluetoothSocket.listenUsingL2cap =
1059     function(socketId, uuid, optionsOrCallback, opt_callback) {};
1063  * @param {number} socketId
1064  * @param {string} address
1065  * @param {string} uuid
1066  * @param {function()} callback
1067  * @see https://developer.chrome.com/apps/bluetoothSocket#method-connect
1068  */
1069 chrome.bluetoothSocket.connect = function(socketId, address, uuid, callback) {};
1073  * @param {number} socketId
1074  * @param {function()=} opt_callback
1075  * @see https://developer.chrome.com/apps/bluetoothSocket#method-disconnect
1076  */
1077 chrome.bluetoothSocket.disconnect = function(socketId, opt_callback) {};
1081  * @param {number} socketId
1082  * @param {function()=} opt_callback
1083  * @see https://developer.chrome.com/apps/bluetoothSocket#method-close
1084  */
1085 chrome.bluetoothSocket.close = function(socketId, opt_callback) {};
1089  * @param {number} socketId
1090  * @param {!ArrayBuffer} data
1091  * @param {function(number)=} opt_callback
1092  * @see https://developer.chrome.com/apps/bluetoothSocket#method-send
1093  */
1094 chrome.bluetoothSocket.send = function(socketId, data, opt_callback) {};
1098  * @param {number} socketId
1099  * @param {function(!chrome.bluetoothSocket.SocketInfo)} callback
1100  * @see https://developer.chrome.com/apps/bluetoothSocket#method-getInfo
1101  */
1102 chrome.bluetoothSocket.getInfo = function(socketId, callback) {};
1106  * @param {function(!Array.<!chrome.bluetoothSocket.SocketInfo>)} callback
1107  * @see https://developer.chrome.com/apps/bluetoothSocket#method-getSockets
1108  */
1109 chrome.bluetoothSocket.getSockets = function(callback) {};
1114  * @constructor
1115  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onAccept
1116  */
1117 chrome.bluetoothSocket.AcceptEventData = function() {};
1120 /** @type {number} */
1121 chrome.bluetoothSocket.AcceptEventData.prototype.socketId;
1124 /** @type {number} */
1125 chrome.bluetoothSocket.AcceptEventData.prototype.clientSocketId;
1130  * Event whose listeners take a AcceptEventData parameter.
1131  * @constructor
1132  */
1133 chrome.bluetoothSocket.AcceptEvent = function() {};
1137  * @param {function(!chrome.bluetoothSocket.AcceptEventData): void} callback
1138  */
1139 chrome.bluetoothSocket.AcceptEvent.prototype.addListener =
1140     function(callback) {};
1144  * @param {function(!chrome.bluetoothSocket.AcceptEventData): void} callback
1145  */
1146 chrome.bluetoothSocket.AcceptEvent.prototype.removeListener =
1147     function(callback) {};
1151  * @param {function(!chrome.bluetoothSocket.AcceptEventData): void} callback
1152  * @return {boolean}
1153  */
1154 chrome.bluetoothSocket.AcceptEvent.prototype.hasListener =
1155     function(callback) {};
1158 /** @return {boolean} */
1159 chrome.bluetoothSocket.AcceptEvent.prototype.hasListeners = function() {};
1162 /** @type {!chrome.bluetoothSocket.AcceptEvent} */
1163 chrome.bluetoothSocket.onAccept;
1168  * @constructor
1169  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onAcceptError
1170  */
1171 chrome.bluetoothSocket.AcceptErrorEventData = function() {};
1174 /** @type {number} */
1175 chrome.bluetoothSocket.AcceptErrorEventData.prototype.socketId;
1178 /** @type {string} */
1179 chrome.bluetoothSocket.AcceptErrorEventData.prototype.errorMessage;
1182 /** @type {string} */
1183 chrome.bluetoothSocket.AcceptErrorEventData.prototype.error;
1188  * Event whose listeners take a AcceptErrorEventData parameter.
1189  * @constructor
1190  */
1191 chrome.bluetoothSocket.AcceptErrorEvent = function() {};
1195  * @param {function(
1196  *     !chrome.bluetoothSocket.AcceptErrorEventData): void} callback
1197  */
1198 chrome.bluetoothSocket.AcceptErrorEvent.prototype.addListener =
1199     function(callback) {};
1203  * @param {function(
1204  *     !chrome.bluetoothSocket.AcceptErrorEventData): void} callback
1205  */
1206 chrome.bluetoothSocket.AcceptErrorEvent.prototype.removeListener =
1207     function(callback) {};
1211  * @param {function(
1212  *     !chrome.bluetoothSocket.AcceptErrorEventData): void} callback
1213  * @return {boolean}
1214  */
1215 chrome.bluetoothSocket.AcceptErrorEvent.prototype.hasListener =
1216     function(callback) {};
1219 /** @return {boolean} */
1220 chrome.bluetoothSocket.AcceptErrorEvent.prototype.hasListeners =
1221     function() {};
1224 /** @type {!chrome.bluetoothSocket.AcceptErrorEvent} */
1225 chrome.bluetoothSocket.onAcceptError;
1230  * @constructor
1231  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onReceive
1232  */
1233 chrome.bluetoothSocket.ReceiveEventData = function() {};
1236 /** @type {number} */
1237 chrome.bluetoothSocket.ReceiveEventData.prototype.socketId;
1240 /** @type {!ArrayBuffer} */
1241 chrome.bluetoothSocket.ReceiveEventData.prototype.data;
1246  * Event whose listeners take a ReceiveEventData parameter.
1247  * @constructor
1248  */
1249 chrome.bluetoothSocket.ReceiveEvent = function() {};
1253  * @param {function(!chrome.bluetoothSocket.ReceiveEventData): void} callback
1254  */
1255 chrome.bluetoothSocket.ReceiveEvent.prototype.addListener =
1256     function(callback) {};
1260  * @param {function(!chrome.bluetoothSocket.ReceiveEventData): void} callback
1261  */
1262 chrome.bluetoothSocket.ReceiveEvent.prototype.removeListener =
1263     function(callback) {};
1267  * @param {function(!chrome.bluetoothSocket.ReceiveEventData): void} callback
1268  * @return {boolean}
1269  */
1270 chrome.bluetoothSocket.ReceiveEvent.prototype.hasListener =
1271     function(callback) {};
1274 /** @return {boolean} */
1275 chrome.bluetoothSocket.ReceiveEvent.prototype.hasListeners = function() {};
1278 /** @type {!chrome.bluetoothSocket.ReceiveEvent} */
1279 chrome.bluetoothSocket.onReceive;
1284  * @constructor
1285  * @see https://developer.chrome.com/apps/bluetoothSocket#event-onReceiveError
1286  */
1287 chrome.bluetoothSocket.ReceiveErrorEventData = function() {};
1290 /** @type {number} */
1291 chrome.bluetoothSocket.ReceiveErrorEventData.prototype.socketId;
1294 /** @type {string} */
1295 chrome.bluetoothSocket.ReceiveErrorEventData.prototype.errorMessage;
1298 /** @type {string} */
1299 chrome.bluetoothSocket.ReceiveErrorEventData.prototype.error;
1304  * Event whose listeners take a ReceiveErrorEventData parameter.
1305  * @constructor
1306  */
1307 chrome.bluetoothSocket.ReceiveErrorEvent = function() {};
1311  * @param {function(
1312  *     !chrome.bluetoothSocket.ReceiveErrorEventData): void} callback
1313  */
1314 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.addListener =
1315     function(callback) {};
1319  * @param {function(
1320  *     !chrome.bluetoothSocket.ReceiveErrorEventData): void} callback
1321  */
1322 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.removeListener =
1323     function(callback) {};
1327  * @param {function(
1328  *     !chrome.bluetoothSocket.ReceiveErrorEventData): void} callback
1329  * @return {boolean}
1330  */
1331 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.hasListener =
1332     function(callback) {};
1335 /** @return {boolean} */
1336 chrome.bluetoothSocket.ReceiveErrorEvent.prototype.hasListeners =
1337     function() {};
1340 /** @type {!chrome.bluetoothSocket.ReceiveErrorEvent} */
1341 chrome.bluetoothSocket.onReceiveError;
1345  * @see https://developer.chrome.com/apps/bluetoothLowEnergy
1346  * @const
1347  */
1348 chrome.bluetoothLowEnergy = {};
1352  * @constructor
1353  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#type-Service
1354  */
1355 chrome.bluetoothLowEnergy.Service = function() {};
1358 /** @type {string} */
1359 chrome.bluetoothLowEnergy.Service.prototype.uuid;
1362 /** @type {boolean} */
1363 chrome.bluetoothLowEnergy.Service.prototype.isPrimary;
1366 /** @type {string|undefined} */
1367 chrome.bluetoothLowEnergy.Service.prototype.instanceId;
1370 /** @type {string|undefined} */
1371 chrome.bluetoothLowEnergy.Service.prototype.deviceAddress;
1375  * @constructor
1376  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#type-Characteristic
1377  */
1378 chrome.bluetoothLowEnergy.Characteristic = function() {};
1381 /** @type {string} */
1382 chrome.bluetoothLowEnergy.Characteristic.prototype.uuid;
1385 /** @type {!chrome.bluetoothLowEnergy.Service} */
1386 chrome.bluetoothLowEnergy.Characteristic.prototype.service;
1389 /** @type {!Array.<string>} */
1390 chrome.bluetoothLowEnergy.Characteristic.prototype.properties;
1393 /** @type {string|undefined} */
1394 chrome.bluetoothLowEnergy.Characteristic.prototype.instanceId;
1397 /** @type {!ArrayBuffer|undefined} */
1398 chrome.bluetoothLowEnergy.Characteristic.prototype.value;
1402  * @constructor
1403  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#type-Descriptor
1404  */
1405 chrome.bluetoothLowEnergy.Descriptor = function() {};
1407 /** @type {string} */
1408 chrome.bluetoothLowEnergy.Descriptor.prototype.uuid;
1411 /** @type {!chrome.bluetoothLowEnergy.Characteristic} */
1412 chrome.bluetoothLowEnergy.Descriptor.prototype.characteristic;
1415 /** @type {string|undefined} */
1416 chrome.bluetoothLowEnergy.Descriptor.prototype.instanceId;
1419 /** @type {!ArrayBuffer|undefined} */
1420 chrome.bluetoothLowEnergy.Descriptor.prototype.value;
1424  * @typedef {?{
1425  *   persistent: boolean
1426  * }}
1427  */
1428 chrome.bluetoothLowEnergy.ConnectionProperties;
1432  * @param {string} deviceAddress
1433  * @param {!chrome.bluetoothLowEnergy.ConnectionProperties|function()}
1434  *     propertiesOrCallback
1435  * @param {function()=} opt_callback
1436  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-connect
1437  */
1438 chrome.bluetoothLowEnergy.connect =
1439   function(deviceAddress, propertiesOrCallback, opt_callback) {};
1442  * @param {string} deviceAddress
1443  * @param {function()=} opt_callback
1444  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-disconnect
1445  */
1446 chrome.bluetoothLowEnergy.disconnect = function(deviceAddress, opt_callback) {};
1450  * @param {string} serviceId
1451  * @param {function(!chrome.bluetoothLowEnergy.Service)} callback
1452  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getService
1453  */
1454 chrome.bluetoothLowEnergy.getService = function(serviceId, callback) {};
1458  * @param {string} deviceAddress
1459  * @param {function(!Array.<!chrome.bluetoothLowEnergy.Service>)} callback
1460  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getServices
1461  */
1462 chrome.bluetoothLowEnergy.getServices = function(deviceAddress, callback) {};
1466  * @param {string} characteristicId
1467  * @param {function(!chrome.bluetoothLowEnergy.Characteristic)} callback
1468  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getCharacteristic
1469  */
1470 chrome.bluetoothLowEnergy.getCharacteristic =
1471     function(characteristicId, callback) {};
1475  * @param {string} serviceId
1476  * @param {function(!Array.<!chrome.bluetoothLowEnergy.Characteristic>)}
1477  * callback
1478  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getCharacteristics
1479  */
1480 chrome.bluetoothLowEnergy.getCharacteristics =
1481     function(serviceId, callback) {};
1485  * @param {string} serviceId
1486  * @param {function(!Array.<!chrome.bluetoothLowEnergy.Service>)} callback
1487  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getIncludedServices
1488  */
1489 chrome.bluetoothLowEnergy.getIncludedServices =
1490   function(serviceId, callback) {};
1494  * @param {string} descriptorId
1495  * @param {function(!chrome.bluetoothLowEnergy.Descriptor)} callback
1496  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getDescriptor
1497  */
1498 chrome.bluetoothLowEnergy.getDescriptor = function(descriptorId, callback) {};
1502  * @param {string} characteristicId
1503  * @param {function(!Array.<!chrome.bluetoothLowEnergy.Descriptor>)} callback
1504  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-getDescriptors
1505  */
1506 chrome.bluetoothLowEnergy.getDescriptors =
1507   function(characteristicId, callback) {};
1511  * @param {string} characteristicId
1512  * @param {function(!chrome.bluetoothLowEnergy.Characteristic)} callback
1513  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-readCharacteristicValue
1514  */
1515 chrome.bluetoothLowEnergy.readCharacteristicValue =
1516   function(characteristicId, callback) {};
1520  * @param {string} characteristicId
1521  * @param {!ArrayBuffer} value
1522  * @param {function()} callback
1523  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-writeCharacteristicValue
1524  */
1525 chrome.bluetoothLowEnergy.writeCharacteristicValue =
1526   function(characteristicId, value, callback) {};
1530  * @typedef {?{
1531  *   persistent: boolean
1532  * }}
1533  */
1534 chrome.bluetoothLowEnergy.NotificationSessionProperties;
1537   * @param {string} characteristicId
1538   * @param {!chrome.bluetoothLowEnergy.NotificationSessionProperties|function()}
1539   *     propertiesOrCallback
1540   * @param {function()=} opt_callback
1541   * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-startCharacteristicNotifications
1542   */
1543 chrome.bluetoothLowEnergy.startCharacteristicNotifications =
1544   function(characteristicId, propertiesOrCallback, opt_callback) {};
1548   * @param {string} characteristicId
1549   * @param {function()=} opt_callback
1550   * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-stopCharacteristicNotifications
1551   */
1552 chrome.bluetoothLowEnergy.stopCharacteristicNotifications =
1553   function(characteristicId, opt_callback) {};
1557  * @param {string} descriptorId
1558  * @param {function(!chrome.bluetoothLowEnergy.Descriptor)} callback
1559  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-readDescriptorValue
1560  */
1561 chrome.bluetoothLowEnergy.readDescriptorValue =
1562   function(descriptorId, callback) {};
1566  * @param {string} descriptorId
1567  * @param {!ArrayBuffer} value
1568  * @param {function()} callback
1569  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#method-writeDescriptorValue
1570  */
1571 chrome.bluetoothLowEnergy.writeDescriptorValue =
1572   function(descriptorId, value, callback) {};
1576  * Event whose listeners take a Service parameter.
1577  * @constructor
1578  */
1579 chrome.bluetoothLowEnergy.ServiceEvent = function() {};
1582 /** @param {function(!chrome.bluetoothLowEnergy.Service): void} callback */
1583 chrome.bluetoothLowEnergy.ServiceEvent.prototype.addListener =
1584     function(callback) {};
1587 /** @param {function(!chrome.bluetoothLowEnergy.Service): void} callback */
1588 chrome.bluetoothLowEnergy.ServiceEvent.prototype.removeListener =
1589     function(callback) {};
1592  * @param {function(!chrome.bluetoothLowEnergy.Service): void} callback
1593  * @return {boolean}
1594  */
1595 chrome.bluetoothLowEnergy.ServiceEvent.prototype.hasListener =
1596     function(callback) {};
1599 /** @return {boolean} */
1600 chrome.bluetoothLowEnergy.ServiceEvent.prototype.hasListeners =
1601     function() {};
1604   * @type {!chrome.bluetoothLowEnergy.ServiceEvent}
1605   * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onServiceAdded
1606   */
1607 chrome.bluetoothLowEnergy.onServiceAdded;
1611  * @type {!chrome.bluetoothLowEnergy.ServiceEvent}
1612  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onServiceChanged
1613  */
1614 chrome.bluetoothLowEnergy.onServiceChanged;
1618   * @type {!chrome.bluetoothLowEnergy.ServiceEvent}
1619   * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onServiceRemoved
1620   */
1621 chrome.bluetoothLowEnergy.onServiceRemoved;
1625  * Event whose listeners take a Characteristic parameter.
1626  * @constructor
1627  */
1628 chrome.bluetoothLowEnergy.CharacteristicEvent = function() {};
1632  * @param {function(!chrome.bluetoothLowEnergy.Characteristic): void}
1633  *     callback
1634  */
1635 chrome.bluetoothLowEnergy.CharacteristicEvent.prototype.addListener =
1636     function(callback) {};
1640  * @param {function(!chrome.bluetoothLowEnergy.Characteristic): void}
1641  *     callback
1642  */
1643 chrome.bluetoothLowEnergy.CharacteristicEvent.prototype.removeListener =
1644     function(callback) {};
1648  * @param {function(!chrome.bluetoothLowEnergy.Characteristic): void}
1649  *     callback
1650  * @return {boolean}
1651  */
1652 chrome.bluetoothLowEnergy.CharacteristicEvent.prototype.hasListener =
1653     function(callback) {};
1656 /** @return {boolean} */
1657 chrome.bluetoothLowEnergy.CharacteristicEvent.prototype.hasListeners =
1658     function() {};
1662  * @type {!chrome.bluetoothLowEnergy.CharacteristicEvent}
1663  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onCharacteristicValueChanged
1664  */
1665 chrome.bluetoothLowEnergy.onCharacteristicValueChanged;
1669  * Event whose listeners take a Characteristic parameter.
1670  * @constructor
1671  */
1672 chrome.bluetoothLowEnergy.DescriptorEvent = function() {};
1676  * @param {function(!chrome.bluetoothLowEnergy.Descriptor): void}
1677  *     callback
1678  */
1679 chrome.bluetoothLowEnergy.DescriptorEvent.prototype.addListener =
1680     function(callback) {};
1684  * @param {function(!chrome.bluetoothLowEnergy.Descriptor): void}
1685  *     callback
1686  */
1687 chrome.bluetoothLowEnergy.DescriptorEvent.prototype.removeListener =
1688     function(callback) {};
1692  * @param {function(!chrome.bluetoothLowEnergy.Descriptor): void} callback
1693  * @return {boolean}
1694  */
1695 chrome.bluetoothLowEnergy.DescriptorEvent.prototype.hasListener =
1696     function(callback) {};
1699 /** @return {boolean} */
1700 chrome.bluetoothLowEnergy.DescriptorEvent.prototype.hasListeners =
1701     function() {};
1705  * @type {!chrome.bluetoothLowEnergy.DescriptorEvent}
1706  * @see https://developer.chrome.com/apps/bluetoothLowEnergy#event-onDescriptorValueChanged
1707  */
1708 chrome.bluetoothLowEnergy.onDescriptorValueChanged;
1712  * @see http://developer.chrome.com/extensions/commands.html
1713  * @const
1714  */
1715 chrome.commands = {};
1719  * @param {function(Array.<string>): void} callback Callback function.
1720  */
1721 chrome.commands.getAll = function(callback) {};
1724 /** @type {!ChromeEvent} */
1725 chrome.commands.onCommand;
1729  * @see https://developer.chrome.com/apps/copresence
1730  * @const
1731  */
1732 chrome.copresence = {};
1736  * @typedef {?{
1737  *   lowPower: (boolean|undefined),
1738  *   onlyBroadcast: (boolean|undefined),
1739  *   onlyScan: (boolean|undefined),
1740  *   audible: (boolean|undefined)
1741  * }}
1742  * @see https://developer.chrome.com/apps/copresence#type-Strategy
1743  */
1744 chrome.copresence.Strategy;
1748  * @typedef {?{
1749  *   type: string,
1750  *   payload: ArrayBuffer
1751  * }}
1752  * @see https://developer.chrome.com/apps/copresence#type-Message
1753  */
1754 chrome.copresence.Message;
1758  * @typedef {?{
1759  *   onlyEarshot: (boolean|undefined)
1760  * }}
1761  * https://developer.chrome.com/apps/copresence#type-AccessPolicy
1762  */
1763 chrome.copresence.AccessPolicy;
1767  * @typedef {?{
1768  *   id: string,
1769  *   message: !chrome.copresence.Message,
1770  *   timeToLiveMillis: (number|undefined),
1771  *   policy: (!chrome.copresence.AccessPolicy|undefined),
1772  *   strategies: (!chrome.copresence.Strategy|undefined)
1773  * }}
1774  * @see https://developer.chrome.com/apps/copresence#type-PublishOperation
1775  */
1776 chrome.copresence.PublishOperation;
1779 /** @typedef {?{type: string}} */
1780 chrome.copresence.SubscriptionFilter;
1784  * @typedef {?{
1785  *   id: string,
1786  *   filter: !chrome.copresence.SubscriptionFilter,
1787  *   timeToLiveMillis: (number|undefined),
1788  *   strategies: (!chrome.copresence.Strategy|undefined)
1789  * }}
1790  * @see https://developer.chrome.com/apps/copresence#type-SubscribeOperation
1791  */
1792 chrome.copresence.SubscribeOperation;
1796  * @typedef {?{
1797  *   unpublishId: string
1798  * }}
1799  * @see https://developer.chrome.com/apps/copresence#type-UnpublishOperation
1800  */
1801 chrome.copresence.UnpublishOperation;
1805  * @typedef {?{
1806  *   unsubscribeId: string
1807  * }}
1808  * @see https://developer.chrome.com/apps/copresence#type-UnsubscribeOperation
1809  */
1810 chrome.copresence.UnsubscribeOperation;
1814  * @typedef {?{
1815  *   publish: (!chrome.copresence.PublishOperation|undefined),
1816  *   subscribe: (!chrome.copresence.SubscribeOperation|undefined),
1817  *   unpublish: (!chrome.copresence.UnpublishOperation|undefined),
1818  *   unsubscribe: (!chrome.copresence.UnsubscribeOperation|undefined)
1819  * }}
1820  * @see https://developer.chrome.com/apps/copresence#type-Operation
1821  */
1822 chrome.copresence.Operation;
1826  * @param {!Array.<!chrome.copresence.Operation>} operations
1827  * @param {function(string): void} callback
1828  * @see https://developer.chrome.com/apps/copresence#method-execute
1829  */
1830 chrome.copresence.execute = function(operations, callback) {};
1835  * Event whose listeners take a subscription id and received messages as a
1836  * parameter.
1837  * @constructor
1838  * @see https://developer.chrome.com/apps/copresence#event-onMessagesReceived
1839  */
1840 chrome.copresence.MessagesReceivedEvent = function() {};
1844  * @param {function(string, !Array.<!chrome.copresence.Message>): void} callback
1845  */
1846 chrome.copresence.MessagesReceivedEvent.prototype.addListener =
1847     function(callback) {};
1851  * @param {function(string, !Array.<!chrome.copresence.Message>): void} callback
1852  */
1853 chrome.copresence.MessagesReceivedEvent.prototype.removeListener =
1854     function(callback) {};
1858  * @param {function(string, !Array.<!chrome.copresence.Message>): void} callback
1859  * @return {boolean}
1860  */
1861 chrome.copresence.MessagesReceivedEvent.prototype.hasListener =
1862     function(callback) {};
1865 /** @return {boolean} */
1866 chrome.copresence.MessagesReceivedEvent.prototype.hasListeners = function() {};
1870  * @type {!chrome.copresence.MessagesReceivedEvent}
1871  * @see https://developer.chrome.com/apps/copresence#event-onMessagesReceived
1872  */
1873 chrome.copresence.onMessagesReceived;
1877  * @type {!ChromeStringEvent}
1878  * @see https://developer.chrome.com/apps/copresence#event-onStatusUpdated
1879  */
1880 chrome.copresence.onStatusUpdated;
1884  * @see https://developer.chrome.com/extensions/enterprise_platformKeys
1885  * @const
1886  */
1887 chrome.enterprise = {};
1891  * @constructor
1892  * platformKeys allows for generating hardware-backed keys and the installation
1893  * of certificates for these keys.
1894  * @see https://developer.chrome.com/extensions/enterprise_platformKeys.
1895  */
1896 chrome.enterprise.platformKeys = function() {};
1900  * @constructor
1901  * @see https://developer.chrome.com/extensions/enterprise_platformKeys#type-Token
1902  */
1903 chrome.enterprise.Token = function() {};
1907  * @type {string} Unique id for the Token, either "user" or "system."
1908  */
1909 chrome.enterprise.Token.prototype.id;
1913  * @type {!webCrypto.SubtleCrypto} Implements the WebCrypto's
1914  *     SubtleCrypto interface. The cryptographic operations, including key
1915  *     generation, are hardware-backed.
1916  */
1917 chrome.enterprise.Token.prototype.subtleCrypto;
1921  * @param {function(!Array.<!chrome.enterprise.Token>): void} callback Called
1922  * with an array of Tokens.
1923  */
1924 chrome.enterprise.platformKeys.getTokens = function(callback) {};
1928  * @param {string} tokenId Id of cetificate token either "user" or "system".
1929  * @param {(function(!Array.<!ArrayBuffer>): void)} callback Array of DER
1930  *     encoded x.509 certificates.
1931  */
1932 chrome.enterprise.platformKeys.getCertificates = function(tokenId, callback) {};
1936  * @param {string} tokenId The id of a Token returned by getTokens.
1937  * @param {!ArrayBuffer} certificate The DER encoding of a X.509 certificate.
1938  * @param {function(): void=} opt_callback Called back when this operation is
1939  *     finished.
1940  */
1941 chrome.enterprise.platformKeys.importCertificate =
1942     function(tokenId, certificate, opt_callback) {};
1946  * @param {string} tokenId The id of a Token returned by getTokens.
1947  * @param {!ArrayBuffer} certificate The DER encoding of a X.509 certificate.
1948  * @param {(function(): void)=} opt_callback Called back when this operation is
1949  *     finished.
1950  */
1951 chrome.enterprise.platformKeys.removeCertificate =
1952     function(tokenId, certificate, opt_callback) {};
1956  * @see https://developer.chrome.com/extensions/extension.html
1957  * @const
1958  */
1959 chrome.extension = {};
1962 /** @type {!Object|undefined} */
1963 chrome.extension.lastError = {};
1967  * @type {string|undefined}
1968  */
1969 chrome.extension.lastError.message;
1972 /** @type {boolean|undefined} */
1973 chrome.extension.inIncognitoContext;
1976 // TODO: change Object to !Object when it's clear nobody is passing in null
1977 // TODO: change Port to !Port since it should never be null
1979  * @param {string|Object.<string>=} opt_extensionIdOrConnectInfo Either the
1980  *     extensionId to connect to, in which case connectInfo params can be
1981  *     passed in the next optional argument, or the connectInfo params.
1982  * @param {Object.<string>=} opt_connectInfo The connectInfo object,
1983  *     if arg1 was the extensionId to connect to.
1984  * @return {Port} New port.
1985  */
1986 chrome.extension.connect = function(
1987     opt_extensionIdOrConnectInfo, opt_connectInfo) {};
1991  * @return {Window} The global JS object for the background page.
1992  */
1993 chrome.extension.getBackgroundPage = function() {};
1997  * @param {string} path A path to a resource within an extension expressed
1998  *     relative to it's install directory.
1999  * @return {string} The fully-qualified URL to the resource.
2000  */
2001 chrome.extension.getURL = function(path) {};
2005  * @param {Object=} opt_fetchProperties An object with optional 'type' and
2006  *     optional 'windowId' keys.
2007  * @return {Array.<Window>} The global JS objects for each content view.
2008  */
2009 chrome.extension.getViews = function(opt_fetchProperties) {};
2013  * @param {function(boolean): void} callback Callback function.
2014  */
2015 chrome.extension.isAllowedFileSchemeAccess = function(callback) {};
2019  * @param {function(boolean): void} callback Callback function.
2020  */
2021 chrome.extension.isAllowedIncognitoAccess = function(callback) {};
2025  * @param {string|*} extensionIdOrRequest Either the extensionId to send the
2026  *     request to, in which case the request is passed as the next arg, or the
2027  *     request.
2028  * @param {*=} opt_request The request value, if arg1 was the extensionId.
2029  * @param {function(*): void=} opt_callback The callback function which
2030  *     takes a JSON response object sent by the handler of the request.
2031  */
2032 chrome.extension.sendMessage = function(
2033     extensionIdOrRequest, opt_request, opt_callback) {};
2037  * @param {number|*=} opt_arg1 Either the extensionId to send the request to,
2038  *     in which case the request is passed as the next arg, or the request.
2039  * @param {*=} opt_request The request value, if arg1 was the extensionId.
2040  * @param {function(*): void=} opt_callback The callback function which
2041  *     takes a JSON response object sent by the handler of the request.
2042  */
2043 chrome.extension.sendRequest = function(opt_arg1, opt_request, opt_callback) {};
2047  * @param {string} data
2048  */
2049 chrome.extension.setUpdateUrlData = function(data) {};
2052 /** @type {!ChromeEvent} */
2053 chrome.extension.onConnect;
2056 /** @type {!ChromeEvent} */
2057 chrome.extension.onConnectExternal;
2060 /** @type {!ChromeEvent} */
2061 chrome.extension.onMessage;
2064 /** @type {!ChromeEvent} */
2065 chrome.extension.onRequest;
2068 /** @type {!ChromeEvent} */
2069 chrome.extension.onRequestExternal;
2073  * @see https://developer.chrome.com/extensions/runtime.html
2074  * @const
2075  */
2076 chrome.runtime = {};
2079 /** @type {!Object|undefined} */
2080 chrome.runtime.lastError = {};
2084  * @type {string|undefined}
2085  */
2086 chrome.runtime.lastError.message;
2089 /** @type {string} */
2090 chrome.runtime.id;
2094  * @param {function(!Window=): void} callback Callback function.
2095  */
2096 chrome.runtime.getBackgroundPage = function(callback) {};
2100  * @param {function(): void=} opt_callback Callback function.
2101  */
2102 chrome.runtime.openOptionsPage = function(opt_callback) {};
2106  * Manifest information returned from chrome.runtime.getManifest. See
2107  * http://developer.chrome.com/extensions/manifest.html. Note that there are
2108  * several other fields not included here. They should be added to these externs
2109  * as needed.
2110  * @constructor
2111  */
2112 chrome.runtime.Manifest = function() {};
2115 /** @type {string} */
2116 chrome.runtime.Manifest.prototype.name;
2119 /** @type {string} */
2120 chrome.runtime.Manifest.prototype.version;
2123 /** @type {number|undefined} */
2124 chrome.runtime.Manifest.prototype.manifest_version;
2127 /** @type {string|undefined} */
2128 chrome.runtime.Manifest.prototype.description;
2131 /** @type {!chrome.runtime.Manifest.Oauth2|undefined} */
2132 chrome.runtime.Manifest.prototype.oauth2;
2135 /** @type {!Array.<(string|!Object)>} */
2136 chrome.runtime.Manifest.prototype.permissions;
2141  * Oauth2 info in the manifest.
2142  * See http://developer.chrome.com/apps/app_identity.html#update_manifest.
2143  * @constructor
2144  */
2145 chrome.runtime.Manifest.Oauth2 = function() {};
2148 /** @type {string} */
2149 chrome.runtime.Manifest.Oauth2.prototype.client_id;
2152 /**@type {!Array.<string>} */
2153 chrome.runtime.Manifest.Oauth2.prototype.scopes;
2157  * http://developer.chrome.com/extensions/runtime.html#method-getManifest
2158  * @return {!chrome.runtime.Manifest} The full manifest file of the app or
2159  *     extension.
2160  */
2161 chrome.runtime.getManifest = function() {};
2165  * @param {string} path A path to a resource within an extension expressed
2166  *     relative to it's install directory.
2167  * @return {string} The fully-qualified URL to the resource.
2168  */
2169 chrome.runtime.getURL = function(path) {};
2173  * @param {string} url This may be used to clean up server-side data, do
2174  *     analytics, and implement surveys. Maximum 255 characters.
2175  */
2176 chrome.runtime.setUninstallUrl = function(url) {};
2180  * Reloads the app or extension.
2181  */
2182 chrome.runtime.reload = function() {};
2186  * @param {function(string, !Object=): void} callback Called with "throttled",
2187  *     "no_update", or "update_available". If an update is available, the object
2188  *     contains more information about the available update.
2189  */
2190 chrome.runtime.requestUpdateCheck = function(callback) {};
2194  * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's
2195  * no-op.
2196  */
2197 chrome.runtime.restart = function() {};
2201  * @param {string|!Object.<string>=} opt_extensionIdOrConnectInfo Either the
2202  *     extensionId to connect to, in which case connectInfo params can be
2203  *     passed in the next optional argument, or the connectInfo params.
2204  * @param {!Object.<string>=} opt_connectInfo The connectInfo object,
2205  *     if arg1 was the extensionId to connect to.
2206  * @return {!Port} New port.
2207  */
2208 chrome.runtime.connect = function(
2209     opt_extensionIdOrConnectInfo, opt_connectInfo) {};
2213  * @see http://developer.chrome.com/extensions/runtime.html#method-connectNative
2214  * @param {string} application Name of the registered native messaging host to
2215  *     connect to, like 'com.google.your_product'.
2216  * @return {!Port} New port.
2217  */
2218 chrome.runtime.connectNative = function(application) {};
2222  * @param {string|*} extensionIdOrMessage Either the extensionId to send the
2223  *     message to, in which case the message is passed as the next arg, or the
2224  *     message itself.
2225  * @param {(*|Object|function(*): void)=} opt_messageOrOptsOrCallback
2226  *     One of:
2227  *     The message, if arg1 was the extensionId.
2228  *     The options for message sending, if arg1 was the message and this
2229  *     argument is not a function.
2230  *     The callback, if arg1 was the message and this argument is a function.
2231  * @param {(Object|function(*): void)=} opt_optsOrCallback
2232  *     Either the options for message sending, if arg2 was the message,
2233  *     or the callback.
2234  * @param {function(*): void=} opt_callback The callback function which
2235  *     takes a JSON response object sent by the handler of the request.
2236  */
2237 chrome.runtime.sendMessage = function(
2238     extensionIdOrMessage, opt_messageOrOptsOrCallback, opt_optsOrCallback,
2239     opt_callback) {};
2243  * @see http://developer.chrome.com/extensions/runtime.html#method-sendNativeMessage
2244  * @param {string} application Name of the registered native messaging host to
2245  *     connect to, like 'com.google.your_product'.
2246  * @param {Object} message The message that will be passed to the native
2247  *     messaging host.
2248  * @param {function(*)=} opt_callback Called with the response message sent by
2249  *     the native messaging host. If an error occurs while connecting to the
2250  *     native messaging host, the callback will be called with no arguments and
2251  *     chrome.runtime.lastError will be set to the error message.
2252  */
2253 chrome.runtime.sendNativeMessage = function(
2254     application, message, opt_callback) {};
2259  * @param {function(!Object)} callback
2260  */
2261 chrome.runtime.getPlatformInfo = function(callback) {};
2265  * @param {function(!DirectoryEntry)} callback
2266  */
2267 chrome.runtime.getPackageDirectoryEntry = function(callback) {};
2270 /** @type {!chrome.runtime.PortEvent} */
2271 chrome.runtime.onConnect;
2274 /** @type {!chrome.runtime.PortEvent} */
2275 chrome.runtime.onConnectExternal;
2278 /** @type {!ChromeObjectEvent} */
2279 chrome.runtime.onInstalled;
2282 /** @type {!chrome.runtime.MessageSenderEvent} */
2283 chrome.runtime.onMessage;
2286 /** @type {!chrome.runtime.MessageSenderEvent} */
2287 chrome.runtime.onMessageExternal;
2290 /** @type {!ChromeEvent} */
2291 chrome.runtime.onStartup;
2294 /** @type {!ChromeEvent} */
2295 chrome.runtime.onSuspend;
2298 /** @type {!ChromeEvent} */
2299 chrome.runtime.onSuspendCanceled;
2302 /** @type {!ChromeObjectEvent} */
2303 chrome.runtime.onUpdateAvailable;
2306 /** @type {!ChromeStringEvent} */
2307 chrome.runtime.onRestartRequired;
2312  * Event whose listeners take a Port parameter.
2313  * @constructor
2314  */
2315 chrome.runtime.PortEvent = function() {};
2319  * @param {function(!Port): void} callback Callback.
2320  */
2321 chrome.runtime.PortEvent.prototype.addListener = function(callback) {};
2325  * @param {function(!Port): void} callback Callback.
2326  */
2327 chrome.runtime.PortEvent.prototype.removeListener = function(callback) {};
2331  * @param {function(!Port): void} callback Callback.
2332  * @return {boolean}
2333  */
2334 chrome.runtime.PortEvent.prototype.hasListener = function(callback) {};
2338  * @return {boolean}
2339  */
2340 chrome.runtime.PortEvent.prototype.hasListeners = function() {};
2345  * Event whose listeners take a MessageSender and additional parameters.
2346  * @see http://developer.chrome.com/dev/apps/runtime.html#event-onMessage
2347  * @constructor
2348  */
2349 chrome.runtime.MessageSenderEvent = function() {};
2353  * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
2354  *     callback Callback.
2355  */
2356 chrome.runtime.MessageSenderEvent.prototype.addListener = function(callback) {};
2360  * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
2361  *     callback Callback.
2362  */
2363 chrome.runtime.MessageSenderEvent.prototype.removeListener = function(callback)
2364     {};
2368  * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
2369  *     callback Callback.
2370  * @return {boolean}
2371  */
2372 chrome.runtime.MessageSenderEvent.prototype.hasListener = function(callback) {};
2376  * @return {boolean}
2377  */
2378 chrome.runtime.MessageSenderEvent.prototype.hasListeners = function() {};
2382  * @const
2383  * @see https://developer.chrome.com/extensions/tabs.html
2384  */
2385 chrome.tabs = {};
2389  * @typedef {?{
2390  *   code: (string|undefined),
2391  *   file: (string|undefined),
2392  *   allFrames: (boolean|undefined),
2393  *   matchAboutBlank: (boolean|undefined),
2394  *   runAt: (string|undefined)
2395  * }}
2396  */
2397 chrome.tabs.InjectDetails;
2401  * @see https://developer.chrome.com/extensions/tabs#method-captureVisibleTab
2402  * @param {number|!chrome.types.ImageDetails|function(string):void}
2403  *     windowIdOrOptionsOrCallback One of:
2404  *     The target window.
2405  *     An object defining details about the format and quality of an image, in
2406  *     which case the window defaults to the current window.
2407  *     A callback function which accepts the data URL string of a JPEG encoding
2408  *     of the visible area of the captured tab.
2409  * @param {(!chrome.types.ImageDetails|function(string):void)=}
2410  *     opt_optionsOrCallback Either an object defining details about the
2411  *     format and quality of an image, or a callback function which accepts the
2412  *     data URL string of a JPEG encoding of the visible area of the captured
2413  *     tab.
2414  * @param {function(string):void=} opt_callback A callback function which
2415  *     accepts the data URL string of a JPEG encoding of the visible area of the
2416  *     captured tab.
2417  */
2418 chrome.tabs.captureVisibleTab = function(windowIdOrOptionsOrCallback,
2419     opt_optionsOrCallback, opt_callback) {};
2423  * @param {number} tabId Tab Id.
2424  * @param {{name: (string|undefined)}=} connectInfo Info Object.
2425  */
2426 chrome.tabs.connect = function(tabId, connectInfo) {};
2430  * @typedef {?{
2431  *   windowId: (number|undefined),
2432  *   index: (number|undefined),
2433  *   url: (string|undefined),
2434  *   active: (boolean|undefined),
2435  *   pinned: (boolean|undefined),
2436  *   openerTabId: (number|undefined)
2437  * }}
2438  */
2439 chrome.tabs.CreateProperties;
2443  * @param {!chrome.tabs.CreateProperties} createProperties Info object.
2444  * @param {function(!Tab): void=} opt_callback The callback function.
2445  */
2446 chrome.tabs.create = function(createProperties, opt_callback) {};
2450  * @see https://developer.chrome.com/extensions/tabs#method-detectLanguage
2451  * @param {number|function(string): void} tabIdOrCallback The tab id, or a
2452  *     callback function that will be invoked with the language of the active
2453  *     tab in the current window.
2454  * @param {function(string): void=} opt_callback An optional callback function
2455  *     that will be invoked with the language of the tab specified as first
2456  *     argument.
2457  */
2458 chrome.tabs.detectLanguage = function(tabIdOrCallback, opt_callback) {};
2462  * @see https://developer.chrome.com/extensions/tabs#method-executeScript
2463  * @param {number|!chrome.tabs.InjectDetails} tabIdOrDetails
2464  *     Either the id of the tab in which to run the script, or an object
2465  *     containing the details of the script to run, in which case the script
2466  *     will be executed in the active tab of the current window.
2467  * @param {(!chrome.tabs.InjectDetails|function(!Array.<*>):void)=}
2468  *     opt_detailsOrCallback Either an object containing the details of the
2469  *     script to run, if the tab id was speficied as first argument, or a
2470  *     callback that will be invoked with the result of the execution of the
2471  *     script in every injected frame.
2472  * @param {function(!Array.<*>):void=} opt_callback A callback that will be
2473  *     invoked with the result of the execution of the script in every
2474  *     injected frame.
2475  */
2476 chrome.tabs.executeScript = function(tabIdOrDetails, opt_detailsOrCallback,
2477     opt_callback) {};
2481  * @param {number} tabId Tab id.
2482  * @param {function(!Tab): void} callback Callback.
2483  */
2484 chrome.tabs.get = function(tabId, callback) {};
2488  * Note (2014-05-21): Because this function is deprecated, the types of it's
2489  * parameters were not upgraded to make the first parameter optional and to mark
2490  * the Array and Tab in the callback as non-null.
2492  * @param {number?} windowId Window id.
2493  * @param {function(Array.<Tab>): void} callback Callback.
2494  * @deprecated Please use tabs.query {windowId: windowId}.
2495  */
2496 chrome.tabs.getAllInWindow = function(windowId, callback) {};
2500  * @param {function(!Tab=): void} callback Callback.
2501  */
2502 chrome.tabs.getCurrent = function(callback) {};
2506  * Note (2014-05-21): Because this function is deprecated, the types of it's
2507  * parameters were not upgraded to make the first parameter optional and to mark
2508  * the Array and Tab in the callback as non-null.
2510  * @param {number?} windowId Window id.
2511  * @param {function(Tab): void} callback Callback.
2512  * @deprecated Please use tabs.query({active: true}).
2513  */
2514 chrome.tabs.getSelected = function(windowId, callback) {};
2518  * @typedef {?{
2519  *   windowId: (number|undefined),
2520  *   tabs: (number|!Array.<number>)
2521  * }}
2522  */
2523 chrome.tabs.HighlightInfo;
2527  * @param {!chrome.tabs.HighlightInfo} highlightInfo
2528  * @param {function(!Window): void} callback Callback function invoked
2529  *    with each appropriate Window.
2530  */
2531 chrome.tabs.highlight = function(highlightInfo, callback) {};
2535  * @link https://developer.chrome.com/extensions/tabs#method-insertCSS
2536  * @param {number|!chrome.tabs.InjectDetails} tabIdOrDetails
2537  *     Either the id of the tab in which to run the script, or an object
2538  *     containing the details of the CSS to insert, in which case the script
2539  *     will be executed in the active tab of the current window.
2540  * @param {(!chrome.tabs.InjectDetails|function():void)=}
2541  *     opt_detailsOrCallback Either an object containing the details of the
2542  *     CSS to insert, if the tab id was speficied as first argument, or a
2543  *     callback that will be invoked after the CSS has been injected.
2544  * @param {function():void=} opt_callback A callback that will be invoked after
2545  *     the CSS has been injected.
2546  */
2547 chrome.tabs.insertCSS = function(tabIdOrDetails, opt_detailsOrCallback,
2548     opt_callback) {};
2552  * @typedef {?{
2553  *   windowId: (number|undefined),
2554  *   index: number
2555  * }}
2556  */
2557 chrome.tabs.MoveProperties;
2561  * @param {number|!Array.<number>} tabId Tab id or array of tab ids.
2562  * @param {!chrome.tabs.MoveProperties} moveProperties
2563  * @param {function((!Tab|!Array.<!Tab>)): void=} opt_callback Callback.
2564  */
2565 chrome.tabs.move = function(tabId, moveProperties, opt_callback) {};
2569  * @typedef {?{
2570  *   active: (boolean|undefined),
2571  *   pinned: (boolean|undefined),
2572  *   highlighted: (boolean|undefined),
2573  *   currentWindow: (boolean|undefined),
2574  *   lastFocusedWindow: (boolean|undefined),
2575  *   status: (string|undefined),
2576  *   title: (string|undefined),
2577  *   url: (string|undefined),
2578  *   windowId: (number|undefined),
2579  *   windowType: (string|undefined),
2580  *   index: (number|undefined)
2581  * }}
2582  */
2583 chrome.tabs.QueryInfo;
2587  * @param {!chrome.tabs.QueryInfo} queryInfo
2588  * @param {function(!Array.<!Tab>): void} callback Callback.
2589  */
2590 chrome.tabs.query = function(queryInfo, callback) {};
2594  * @see https://developer.chrome.com/extensions/tabs#method-query
2595  * @param {number} tabId The ID of the tab which is to be duplicated.
2596  * @param {(function(!Tab=):void)=} opt_callback A callback to be invoked with
2597  *     details about the duplicated tab.
2598  */
2599 chrome.tabs.duplicate = function(tabId, opt_callback) {};
2603  * @typedef {?{
2604  *   bypassCache: (boolean|undefined)
2605  * }}
2606  */
2607 chrome.tabs.ReloadProperties;
2611  * @see https://developer.chrome.com/extensions/tabs#method-reload
2612  * @param {(number|!chrome.tabs.ReloadProperties|function():void)=}
2613  *     opt_tabIdOrReloadPropertiesOrCallback One of:
2614  *     The ID of the tab to reload; defaults to the selected tab of the current
2615  *     window.
2616  *     An object specifying boolean flags to customize the reload operation.
2617  *     A callback to be invoked when the reload is complete.
2618  * @param {(!chrome.tabs.ReloadProperties|function():void)=}
2619  *     opt_reloadPropertiesOrCallback Either an object specifying boolean flags
2620  *     to customize the reload operation, or a callback to be invoked when the
2621  *     reload is complete, if no object needs to be specified.
2622  * @param {function():void=} opt_callback  A callback to be invoked when the
2623  *     reload is complete.
2624  */
2625 chrome.tabs.reload = function(opt_tabIdOrReloadPropertiesOrCallback,
2626     opt_reloadPropertiesOrCallback, opt_callback) {};
2630  * @param {number|!Array.<number>} tabIds A tab ID or an array of tab IDs.
2631  * @param {function(): void=} opt_callback Callback.
2632  */
2633 chrome.tabs.remove = function(tabIds, opt_callback) {};
2637  * @param {number} tabId Tab id.
2638  * @param {*} request The request value of any type.
2639  * @param {function(*): void=} opt_callback The callback function which
2640  *     takes a JSON response object sent by the handler of the request.
2641  */
2642 chrome.tabs.sendMessage = function(tabId, request, opt_callback) {};
2646  * @param {number} tabId Tab id.
2647  * @param {*} request The request value of any type.
2648  * @param {function(*): void=} opt_callback The callback function which
2649  *     takes a JSON response object sent by the handler of the request.
2650  * @deprecated Please use runtime.sendMessage.
2651  */
2652 chrome.tabs.sendRequest = function(tabId, request, opt_callback) {};
2656  * @typedef {?{
2657  *   url: (string|undefined),
2658  *   active: (boolean|undefined),
2659  *   highlighted: (boolean|undefined),
2660  *   pinned: (boolean|undefined),
2661  *   openerTabId: (number|undefined)
2662  * }}
2663  */
2664 chrome.tabs.UpdateProperties;
2668  * @see https://developer.chrome.com/extensions/tabs#method-update
2669  * @param {number|!chrome.tabs.UpdateProperties} tabIdOrUpdateProperties
2670  *     Either the id of the tab to update, or an object with new property
2671  *     values, in which case the selected tab of the current window will be
2672  *     updated.
2673  * @param {(!chrome.tabs.UpdateProperties|function(Tab):void)=}
2674  *     opt_updatePropertiesOrCallback Either an object with new property values,
2675  *     if the tabId was specified as first parameter, or an optional callback
2676  *     that will be invoked with information about the tab being updated.
2677  * @param {function(!Tab=): void=} opt_callback An optional callback that will
2678  *     be invoked with information about the tab being updated.
2679  */
2680 chrome.tabs.update = function(tabIdOrUpdateProperties,
2681     opt_updatePropertiesOrCallback, opt_callback) {};
2685  * @type {!ChromeEvent}
2686  * @deprecated Please use tabs.onActivated.
2687  */
2688 chrome.tabs.onActiveChanged;
2691 /** @type {!ChromeEvent} */
2692 chrome.tabs.onActivated;
2695 /** @type {!ChromeEvent} */
2696 chrome.tabs.onAttached;
2699 /** @type {!ChromeEvent} */
2700 chrome.tabs.onCreated;
2703 /** @type {!ChromeEvent} */
2704 chrome.tabs.onDetached;
2708  * @type {!ChromeEvent}
2709  * @deprecated Please use tabs.onHighlighted.
2710  */
2711 chrome.tabs.onHighlightChanged;
2715  * @type {!ChromeEvent}
2716  */
2717 chrome.tabs.onHighlighted;
2720 /** @type {!ChromeEvent} */
2721 chrome.tabs.onMoved;
2724 /** @type {!ChromeEvent} */
2725 chrome.tabs.onRemoved;
2728 /** @type {!ChromeEvent} */
2729 chrome.tabs.onUpdated;
2732 /** @type {!ChromeEvent} */
2733 chrome.tabs.onReplaced;
2735 // DEPRECATED:
2736 // TODO(user): Remove once all usage has been confirmed to have ended.
2740  * @type {!ChromeEvent}
2741  * @deprecated Please use tabs.onActivated.
2742  */
2743 chrome.tabs.onSelectionChanged;
2747  * @see https://developer.chrome.com/extensions/topSites
2748  * @const
2749  */
2750 chrome.topSites = {};
2755  * @constructor
2756  * @see https://developer.chrome.com/extensions/topSites#type-MostVisitedURL
2757  */
2758 chrome.topSites.MostVisitedURL = function() {};
2761 /** @type {string} */
2762 chrome.topSites.MostVisitedURL.prototype.url;
2765 /** @type {string} */
2766 chrome.topSites.MostVisitedURL.prototype.title;
2770  * Gets a list of top sites.
2771  * @param {function(!Array<!chrome.topSites.MostVisitedURL>)} callback Invoked
2772  *     with a list of most visited URLs.
2773  * @see https://developer.chrome.com/extensions/topSites#method-get
2774  */
2775 chrome.topSites.get = function(callback) {};
2779  * @const
2780  * @see https://developer.chrome.com/extensions/windows.html
2781  */
2782 chrome.windows = {};
2786  * @param {Object=} opt_createData May have many keys to specify parameters.
2787  *     Or the callback.
2788  * @param {function(ChromeWindow): void=} opt_callback Callback.
2789  */
2790 chrome.windows.create = function(opt_createData, opt_callback) {};
2794  * @param {number} id Window id.
2795  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2796  * @param {function(!ChromeWindow): void=} opt_callback Callback when
2797  *     opt_getInfo is an object.
2798  */
2799 chrome.windows.get = function(id, opt_getInfo, opt_callback) {};
2803  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2804  * @param {function(!Array.<!ChromeWindow>): void=} opt_callback Callback.
2805  */
2806 chrome.windows.getAll = function(opt_getInfo, opt_callback) {};
2810  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2811  * @param {function(ChromeWindow): void=} opt_callback Callback.
2812  */
2813 chrome.windows.getCurrent = function(opt_getInfo, opt_callback) { };
2817  * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
2818  * @param {function(ChromeWindow): void=} opt_callback Callback.
2819  */
2820 chrome.windows.getLastFocused = function(opt_getInfo, opt_callback) { };
2824  * @param {number} tabId Tab Id.
2825  * @param {function(): void=} opt_callback Callback.
2826  */
2827 chrome.windows.remove = function(tabId, opt_callback) {};
2831  * @param {number} tabId Tab Id.
2832  * @param {Object} updateProperties An object which may have many keys for
2833  *     various options.
2834  * @param {function(): void=} opt_callback Callback.
2835  */
2836 chrome.windows.update = function(tabId, updateProperties, opt_callback) {};
2839 /** @type {!ChromeEvent} */
2840 chrome.windows.onCreated;
2843 /** @type {!ChromeEvent} */
2844 chrome.windows.onFocusChanged;
2847 /** @type {!ChromeEvent} */
2848 chrome.windows.onRemoved;
2852  * @see https://developer.chrome.com/extensions/windows.html#property-WINDOW_ID_NONE
2853  * @type {number}
2854  */
2855 chrome.windows.WINDOW_ID_NONE;
2859  * @see https://developer.chrome.com/extensions/windows.html#property-WINDOW_ID_CURRENT
2860  * @type {number}
2861  */
2862 chrome.windows.WINDOW_ID_CURRENT;
2866  * @const
2867  * @see https://developer.chrome.com/extensions/i18n.html
2868  */
2869 chrome.i18n = {};
2873  * @param {function(Array.<string>): void} callback The callback function which
2874  *     accepts an array of the accept languages of the browser, such as
2875  *     'en-US','en','zh-CN'.
2876  */
2877 chrome.i18n.getAcceptLanguages = function(callback) {};
2881  * @param {string} messageName
2882  * @param {(string|Array.<string>)=} opt_args
2883  * @return {string}
2884  */
2885 chrome.i18n.getMessage = function(messageName, opt_args) {};
2889  * @return {string}
2890  */
2891 chrome.i18n.getUILanguage = function() {};
2895  * @const
2896  * @see https://developer.chrome.com/extensions/pageAction.html
2897  */
2898 chrome.pageAction = {};
2902  * @param {number} tabId Tab Id.
2903  */
2904 chrome.pageAction.hide = function(tabId) {};
2908  * @param {Object} details An object which has 'tabId' and either
2909  *     'imageData' or 'path'.
2910  */
2911 chrome.pageAction.setIcon = function(details) {};
2915  * @param {Object} details An object which may have 'popup' or 'tabId' as keys.
2916  */
2917 chrome.pageAction.setPopup = function(details) {};
2921  * @param {Object} details An object which has 'tabId' and 'title'.
2922  */
2923 chrome.pageAction.setTitle = function(details) {};
2927  * @param {number} tabId Tab Id.
2928  */
2929 chrome.pageAction.show = function(tabId) {};
2932 /** @type {!ChromeEvent} */
2933 chrome.pageAction.onClicked;
2937  * @const
2938  */
2939 chrome.browser = {};
2943  * @param {{url: string}} details An object with a single 'url' key.
2944  * @param {function(): void} callback The callback function. If an error occurs
2945  * opening the URL, chrome.runtime.lastError will be set to the error message.
2946  */
2947 chrome.browser.openTab = function(details, callback) {};
2951  * @const
2952  * @see https://developer.chrome.com/extensions/browserAction.html
2953  */
2954 chrome.browserAction = {};
2958  * @typedef {?{
2959  *   tabId: (number|undefined)
2960  * }}
2961  */
2962 chrome.browserAction.Tab;
2966  * @typedef {Array<number>}
2967  * @see https://developer.chrome.com/extensions/browserAction#type-ColorArray
2968  */
2969 chrome.browserAction.ColorArray;
2973  * @typedef {{
2974  *   imageData: (!ImageData|!Object.<number, !ImageData>|undefined),
2975  *   path: (string|!Object.<number, string>|undefined),
2976  *   tabId: (number|undefined)
2977  * }}
2978  */
2979 chrome.browserAction.SetIconImageData;
2983  * @param {{
2984  *   title: string,
2985  *   tabId: (number|undefined)
2986  * }} details
2987  * @see https://developer.chrome.com/extensions/browserAction#method-setTitle
2988  */
2989 chrome.browserAction.setTitle = function(details) {};
2993  * @param {!chrome.browserAction.Tab} details
2994  * @param {function(string): void} callback
2995  * @see https://developer.chrome.com/extensions/browserAction#method-getTitle
2996  */
2997 chrome.browserAction.getTitle = function(details, callback) {};
3001  * @param {!chrome.browserAction.SetIconImageData} details
3002  * @param {function(): void=} opt_callback
3003  * @see https://developer.chrome.com/extensions/browserAction#method-setIcon
3004  */
3005 chrome.browserAction.setIcon = function(details, opt_callback) {};
3009  * @param {{
3010  *   tabId: (number|undefined),
3011  *   popup: string
3012  * }} details
3013  * @see https://developer.chrome.com/extensions/browserAction#method-setPopup
3014  */
3015 chrome.browserAction.setPopup = function(details) {};
3019  * @param {!chrome.browserAction.Tab} details
3020  * @param {function(string): void} callback
3021  * @see https://developer.chrome.com/extensions/browserAction#method-getPopup
3022  */
3023 chrome.browserAction.getPopup = function(details, callback) {};
3027  * @param {{
3028  *   text: string,
3029  *   tabId: (number|undefined)
3030  * }} details
3031  * @see https://developer.chrome.com/extensions/browserAction#method-setBadgeText
3032  */
3033 chrome.browserAction.setBadgeText = function(details) {};
3037  * @param {!chrome.browserAction.Tab} details
3038  * @param {function(string): void} callback
3039  * @see https://developer.chrome.com/extensions/browserAction#method-getBadgeText
3040  */
3041 chrome.browserAction.getBadgeText = function(details, callback) {};
3045  * @param {{
3046  *   color: (string|chrome.browserAction.ColorArray),
3047  *   tabId: (number|undefined)
3048  * }} details
3049  * @see https://developer.chrome.com/extensions/browserAction#method-setBadgeBackgroundColor
3050  */
3051 chrome.browserAction.setBadgeBackgroundColor = function(details) {};
3055  * @param {!chrome.browserAction.Tab} details
3056  * @param {function(chrome.browserAction.ColorArray): void} callback
3057  * @see https://developer.chrome.com/extensions/browserAction#method-getBadgeBackgroundColor
3058  */
3059 chrome.browserAction.getBadgeBackgroundColor = function(details, callback) {};
3063  * @param {number=} opt_tabId
3064  * @see https://developer.chrome.com/extensions/browserAction#method-enable
3065  */
3066 chrome.browserAction.enable = function(opt_tabId) {};
3070  * @param {number=} opt_tabId
3071  * @see https://developer.chrome.com/extensions/browserAction#method-disable
3072  */
3073 chrome.browserAction.disable = function(opt_tabId) {};
3077  * @constructor
3078  */
3079 chrome.browserAction.BrowserActionTabEvent = function() {};
3083  * @param {function(!Tab): void} callback
3084  */
3085 chrome.browserAction.BrowserActionTabEvent.prototype.addListener =
3086     function(callback) {};
3090  * @param {function(!Tab): void} callback
3091  */
3092 chrome.browserAction.BrowserActionTabEvent.prototype.removeListener =
3093     function(callback) {};
3097  * @param {function(!Tab): void} callback
3098  * @return {boolean}
3099  */
3100 chrome.browserAction.BrowserActionTabEvent.prototype.hasListener =
3101     function(callback) {};
3104 /** @return {boolean} */
3105 chrome.browserAction.BrowserActionTabEvent.prototype.hasListeners =
3106     function() {};
3110  * @type {!chrome.browserAction.BrowserActionTabEvent}
3111  * @see https://developer.chrome.com/extensions/browserAction#event-onClicked
3112  */
3113 chrome.browserAction.onClicked;
3117  * @const
3118  * @see https://developer.chrome.com/extensions/bookmarks.html
3119  */
3120 chrome.bookmarks = {};
3124  * @typedef {?{
3125  *   parentId: (string|undefined),
3126  *   index: (number|undefined),
3127  *   url: (string|undefined),
3128  *   title: (string|undefined)
3129  * }}
3130  * @see https://developer.chrome.com/extensions/bookmarks#method-create
3131  */
3132 chrome.bookmarks.CreateDetails;
3136  * @typedef {?{
3137  *   query: (string|undefined),
3138  *   url: (string|undefined),
3139  *   title: (string|undefined)
3140  * }}
3141  * @see https://developer.chrome.com/extensions/bookmarks#method-search
3142  */
3143 chrome.bookmarks.SearchDetails;
3147  * @param {(string|Array.<string>)} idOrIdList
3148  * @param {function(Array.<BookmarkTreeNode>): void} callback The
3149  *     callback function which accepts an array of BookmarkTreeNode.
3150  * @return {Array.<BookmarkTreeNode>}
3151  */
3152 chrome.bookmarks.get = function(idOrIdList, callback) {};
3156  * @param {string} id
3157  * @param {function(Array.<BookmarkTreeNode>): void} callback The
3158  *     callback function which accepts an array of BookmarkTreeNode.
3159  * @return {Array.<BookmarkTreeNode>}
3160  */
3161 chrome.bookmarks.getChildren = function(id, callback) {};
3165  * @param {number} numberOfItems The number of items to return.
3166  * @param {function(Array.<BookmarkTreeNode>): void} callback The
3167  *     callback function which accepts an array of BookmarkTreeNode.
3168  * @return {Array.<BookmarkTreeNode>}
3169  */
3170 chrome.bookmarks.getRecent = function(numberOfItems, callback) {};
3174  * @param {function(Array.<BookmarkTreeNode>): void} callback The
3175  *     callback function which accepts an array of BookmarkTreeNode.
3176  * @return {Array.<BookmarkTreeNode>}
3177  */
3178 chrome.bookmarks.getTree = function(callback) {};
3182  * @param {string} id The ID of the root of the subtree to retrieve.
3183  * @param {function(Array.<BookmarkTreeNode>): void} callback The
3184  *     callback function which accepts an array of BookmarkTreeNode.
3185  * @return {Array.<BookmarkTreeNode>}
3186  */
3187 chrome.bookmarks.getSubTree = function(id, callback) {};
3191  * @param {string|!chrome.bookmarks.SearchDetails} query
3192  * @param {function(Array.<BookmarkTreeNode>): void} callback
3193  * @return {Array.<BookmarkTreeNode>}
3194  */
3195 chrome.bookmarks.search = function(query, callback) {};
3199  * @param {chrome.bookmarks.CreateDetails} bookmark
3200  * @param {function(BookmarkTreeNode): void=} opt_callback The
3201  *     callback function which accepts a BookmarkTreeNode object.
3202  */
3203 chrome.bookmarks.create = function(bookmark, opt_callback) {};
3207  * @param {string} id
3208  * @param {Object} destination An object which has optional 'parentId' and
3209  *     optional 'index'.
3210  * @param {function(BookmarkTreeNode): void=} opt_callback
3211  *     The callback function which accepts a BookmarkTreeNode object.
3212  */
3213 chrome.bookmarks.move = function(id, destination, opt_callback) {};
3217  * @param {string} id
3218  * @param {Object} changes An object which may have 'title' as a key.
3219  * @param {function(BookmarkTreeNode): void=} opt_callback The
3220  *     callback function which accepts a BookmarkTreeNode object.
3221  */
3222 chrome.bookmarks.update = function(id, changes, opt_callback) {};
3226  * @param {string} id
3227  * @param {function(): void=} opt_callback
3228  */
3229 chrome.bookmarks.remove = function(id, opt_callback) {};
3233  * @param {string} id
3234  * @param {function(): void=} opt_callback
3235  */
3236 chrome.bookmarks.removeTree = function(id, opt_callback) {};
3240  * @param {function(): void=} opt_callback
3241  */
3242 chrome.bookmarks.import = function(opt_callback) {};
3246  * @param {function(): void=} opt_callback
3247  */
3248 chrome.bookmarks.export = function(opt_callback) {};
3251 /** @type {!ChromeEvent} */
3252 chrome.bookmarks.onChanged;
3255 /** @type {!ChromeEvent} */
3256 chrome.bookmarks.onChildrenReordered;
3259 /** @type {!ChromeEvent} */
3260 chrome.bookmarks.onCreated;
3263 /** @type {!ChromeEvent} */
3264 chrome.bookmarks.onImportBegan;
3267 /** @type {!ChromeEvent} */
3268 chrome.bookmarks.onImportEnded;
3271 /** @type {!ChromeEvent} */
3272 chrome.bookmarks.onMoved;
3275 /** @type {!ChromeEvent} */
3276 chrome.bookmarks.onRemoved;
3280  * @typedef {?{
3281  *   content: string,
3282  *   description: string
3283  * }}
3284  */
3285 var SuggestResult;
3289  * @const
3290  * @see https://developer.chrome.com/extensions/omnibox.html
3291  */
3292 chrome.omnibox = {};
3296 /** @constructor */
3297 chrome.omnibox.InputChangedEvent = function() {};
3301  * @param {function(string, function(!Array.<!SuggestResult>)): void} callback
3302  */
3303 chrome.omnibox.InputChangedEvent.prototype.addListener = function(callback) {};
3307  * @param {function(string, function(!Array.<!SuggestResult>)): void} callback
3308  */
3309 chrome.omnibox.InputChangedEvent.prototype.removeListener =
3310     function(callback) {};
3314  * @param {function(string, function(!Array.<!SuggestResult>)): void} callback
3315  * @return {boolean}
3316  */
3317 chrome.omnibox.InputChangedEvent.prototype.hasListener = function(callback) {};
3320 /** @return {boolean} */
3321 chrome.omnibox.InputChangedEvent.prototype.hasListeners = function() {};
3325 /** @constructor */
3326 chrome.omnibox.InputEnteredEvent = function() {};
3329 /** @param {function(string, string): void} callback */
3330 chrome.omnibox.InputEnteredEvent.prototype.addListener = function(callback) {};
3333 /** @param {function(string, string): void} callback */
3334 chrome.omnibox.InputEnteredEvent.prototype.removeListener =
3335     function(callback) {};
3339  * @param {function(string, string): void} callback
3340  * @return {boolean}
3341  */
3342 chrome.omnibox.InputEnteredEvent.prototype.hasListener = function(callback) {};
3345 /** @return {boolean} */
3346 chrome.omnibox.InputEnteredEvent.prototype.hasListeners = function() {};
3350  * @param {{description: string}} suggestion A partial SuggestResult object.
3351  */
3352 chrome.omnibox.setDefaultSuggestion = function(suggestion) {};
3355 /** @type {!ChromeEvent} */
3356 chrome.omnibox.onInputCancelled;
3359 /** @type {!chrome.omnibox.InputChangedEvent} */
3360 chrome.omnibox.onInputChanged;
3363 /** @type {!chrome.omnibox.InputEnteredEvent} */
3364 chrome.omnibox.onInputEntered;
3367 /** @type {!ChromeEvent} */
3368 chrome.omnibox.onInputStarted;
3372  * @const
3373  * @see https://developer.chrome.com/extensions/dev/contextMenus.html
3374  */
3375 chrome.contextMenus = {};
3379  * @typedef {?{
3380  *   type: (string|undefined),
3381  *   id: (string|undefined),
3382  *   title: (string|undefined),
3383  *   checked: (boolean|undefined),
3384  *   contexts: (!Array.<string>|undefined),
3385  *   onclick: (function(!Object, !Tab)|undefined),
3386  *   parentId: (number|string|undefined),
3387  *   documentUrlPatterns: (!Array.<string>|undefined),
3388  *   targetUrlPatterns: (!Array.<string>|undefined),
3389  *   enabled: (boolean|undefined)
3390  * }}
3391  * @see https://developer.chrome.com/extensions/contextMenus#method-create
3392  */
3393 chrome.contextMenus.CreateProperties;
3397  * @typedef {?{
3398  *   type: (string|undefined),
3399  *   title: (string|undefined),
3400  *   checked: (boolean|undefined),
3401  *   contexts: (!Array.<string>|undefined),
3402  *   onclick: (function(!Object, !Tab)|undefined),
3403  *   parentId: (number|string|undefined),
3404  *   documentUrlPatterns: (!Array.<string>|undefined),
3405  *   targetUrlPatterns: (!Array.<string>|undefined),
3406  *   enabled: (boolean|undefined)
3407  * }}
3408  * @see https://developer.chrome.com/extensions/contextMenus#method-update
3409  */
3410 chrome.contextMenus.UpdateProperties;
3414  * @param {!chrome.contextMenus.CreateProperties} createProperties
3415  * @param {function()=} opt_callback
3416  * @return {(number|string)} The id of the newly created window.
3417  * @see https://developer.chrome.com/extensions/contextMenus#method-create
3418  */
3419 chrome.contextMenus.create = function(createProperties, opt_callback) {};
3423  * @param {(number|string)} id
3424  * @param {!chrome.contextMenus.UpdateProperties} updateProperties
3425  * @param {function()=} opt_callback
3426  * @see https://developer.chrome.com/extensions/contextMenus#method-update
3427  */
3428 chrome.contextMenus.update = function(id, updateProperties, opt_callback) {};
3432  * @param {(number|string)} menuItemId
3433  * @param {function()=} opt_callback
3434  * @see https://developer.chrome.com/extensions/contextMenus#method-remove
3435  */
3436 chrome.contextMenus.remove = function(menuItemId, opt_callback) {};
3440  * @param {function()=} opt_callback
3441  * @see https://developer.chrome.com/extensions/contextMenus#method-removeAll
3442  */
3443 chrome.contextMenus.removeAll = function(opt_callback) {};
3447  * @interface
3448  * @see https://developer.chrome.com/extensions/contextMenus#event-onClicked
3449  */
3450 chrome.contextMenus.ClickedEvent = function() {};
3454  * @param {function(!Object, !Tab=)} callback
3455  */
3456 chrome.contextMenus.ClickedEvent.prototype.addListener = function(callback) {};
3460  * @param {function(!Object, !Tab=)} callback
3461  */
3462 chrome.contextMenus.ClickedEvent.prototype.removeListener =
3463     function(callback) {};
3467  * @param {function(!Object, !Tab=)} callback
3468  * @return {boolean}
3469  */
3470 chrome.contextMenus.ClickedEvent.prototype.hasListener = function(callback) {};
3474  * @return {boolean}
3475  */
3476 chrome.contextMenus.ClickedEvent.prototype.hasListeners = function() {};
3480  * @type {!chrome.contextMenus.ClickedEvent}
3481  * @see https://developer.chrome.com/extensions/contextMenus#event-onClicked
3482  */
3483 chrome.contextMenus.onClicked;
3487  * @const
3488  * @see https://developer.chrome.com/extensions/dev/cookies.html
3489  */
3490 chrome.cookies = {};
3494  * This typedef is used for the parameters to chrome.cookies.get,
3495  * chrome.cookies.remove, and for the parameter to remove's callback. These uses
3496  * all identify a single cookie uniquely without specifying its content, and the
3497  * objects are identical except for the the storeId being optional vs required.
3498  * If greater divergence occurs, then going to two typedefs is recommended.
3500  * @typedef {?{
3501  *   url: string,
3502  *   name: string,
3503  *   storeId: (string|undefined)
3504  * }}
3505  */
3506 chrome.cookies.CookieIdentifier;
3510  * @param {!chrome.cookies.CookieIdentifier} details
3511  * @param {function(Cookie=): void} callback
3512  */
3513 chrome.cookies.get = function(details, callback) {};
3517  * @param {Object} details
3518  * @param {function(Array.<Cookie>): void} callback
3519  */
3520 chrome.cookies.getAll = function(details, callback) {};
3524  * @param {function(Array.<CookieStore>): void} callback
3525  */
3526 chrome.cookies.getAllCookieStores = function(callback) {};
3530  * @param {!chrome.cookies.CookieIdentifier} details
3531  * @param {function(chrome.cookies.CookieIdentifier): void=} opt_callback If
3532  *     removal failed for any reason, the parameter will be "null", and
3533  *     "chrome.runtime.lastError" will be set.
3534  */
3535 chrome.cookies.remove = function(details, opt_callback) {};
3539  * @typedef {?{
3540  *   url: string,
3541  *   name: (string|undefined),
3542  *   value: (string|undefined),
3543  *   domain: (string|undefined),
3544  *   path: (string|undefined),
3545  *   secure: (boolean|undefined),
3546  *   httpOnly: (boolean|undefined),
3547  *   expirationDate: (number|undefined),
3548  *   storeId: (string|undefined)
3549  * }}
3550  */
3551 chrome.cookies.CookieSetDetails;
3555  * @param {!chrome.cookies.CookieSetDetails} details
3556  * @param {function(Cookie): void=} opt_callback If setting failed for any
3557  *    reason, the parameter will be "null", and "chrome.runtime.lastError" will
3558  *    be set.
3559  */
3560 chrome.cookies.set = function(details, opt_callback) {};
3564  * @see https://developer.chrome.com/extensions/cookies.html#event-onChanged
3565  * @type {!ChromeEvent}
3566  */
3567 chrome.cookies.onChanged;
3571 /** @constructor */
3572 function CookieChangeInfo() {}
3575 /** @type {boolean} */
3576 CookieChangeInfo.prototype.removed;
3579 /** @type {Cookie} */
3580 CookieChangeInfo.prototype.cookie;
3583 /** @type {string} */
3584 CookieChangeInfo.prototype.cause;
3587 /** @const */
3588 chrome.management = {};
3592  * @typedef {?{
3593  *   showConfirmDialog: (boolean|undefined)
3594  * }}
3595  */
3596 chrome.management.InstallOptions;
3600  * @param {string} id
3601  * @param {function(!ExtensionInfo): void=} opt_callback Optional callback
3602  *     function.
3603  */
3604 chrome.management.get = function(id, opt_callback) {};
3608  * @param {function(!Array.<!ExtensionInfo>): void=} opt_callback Optional
3609  *     callback function.
3610  * @return {!Array.<!ExtensionInfo>}
3611  */
3612 chrome.management.getAll = function(opt_callback) {};
3616  * @param {string} id The id of an already installed extension.
3617  * @param {function(!Array.<string>)=} opt_callback Optional callback function.
3618  */
3619 chrome.management.getPermissionWarningsById = function(id, opt_callback) {};
3623  * @param {string} manifestStr Extension's manifest JSON string.
3624  * @param {function(!Array.<string>)=} opt_callback Optional callback function.
3625  */
3626 chrome.management.getPermissionWarningsByManifest =
3627     function(manifestStr, opt_callback) {};
3631  * @param {string} id The id of an already installed extension.
3632  * @param {function(): void=} opt_callback Optional callback function.
3633  */
3634 chrome.management.launchApp = function(id, opt_callback) {};
3638  * @param {string} id The id of an already installed extension.
3639  * @param {boolean} enabled Whether this item should be enabled.
3640  * @param {function(): void=} opt_callback Optional callback function.
3641  */
3642 chrome.management.setEnabled = function(id, enabled, opt_callback) {};
3646  * @param {string} id The id of an already installed extension.
3647  * @param {(!chrome.management.InstallOptions|function(): void)=}
3648  *     opt_optionsOrCallback An optional uninstall options object or an optional
3649  *     callback function.
3650  * @param {function(): void=} opt_callback Optional callback function.
3651  */
3652 chrome.management.uninstall =
3653     function(id, opt_optionsOrCallback, opt_callback) {};
3657  * @param {(!chrome.management.InstallOptions|function(): void)=}
3658  *     opt_optionsOrCallback An optional uninstall options object or an optional
3659  *     callback function.
3660  * @param {function(): void=} opt_callback An optional callback function.
3661  */
3662 chrome.management.uninstallSelf =
3663     function(opt_optionsOrCallback, opt_callback) {};
3667  * @param {string} id The id of an already installed extension.
3668  * @param {function(): void=} opt_callback Optional callback function.
3669  */
3670 chrome.management.createAppShortcut = function(id, opt_callback) {};
3674  * @param {string} id The id of an already installed extension.
3675  * @param {string} launchType The LaunchType enum value to set. Make sure this
3676  *     value is in ExtensionInfo.availableLaunchTypes because the available
3677  *     launch types vary on different platforms and configurations.
3678  * @param {function(): void=} opt_callback Optional callback function.
3679  */
3680 chrome.management.setLaunchType = function(id, launchType, opt_callback) {};
3684  * @param {string} url The URL of a web page. The scheme of the URL can only be
3685  *     "http" or "https".
3686  * @param {string} title The title of the generated app.
3687  * @param {function(!ExtensionInfo): void=} opt_callback Optional callback
3688  *     function.
3689  */
3690 chrome.management.generateAppForLink = function(url, title, opt_callback) {};
3693 /** @type {!ChromeExtensionInfoEvent} */
3694 chrome.management.onDisabled;
3697 /** @type {!ChromeExtensionInfoEvent} */
3698 chrome.management.onEnabled;
3701 /** @type {!ChromeExtensionInfoEvent} */
3702 chrome.management.onInstalled;
3705 /** @type {!ChromeStringEvent} */
3706 chrome.management.onUninstalled;
3710  * @const
3711  * @see https://developer.chrome.com/extensions/idle.html
3712  */
3713 chrome.idle = {};
3717  * @param {number} thresholdSeconds Threshold in seconds, used to determine
3718  *     when a machine is in the idle state.
3719  * @param {function(string): void} callback Callback to handle the state.
3720  */
3721 chrome.idle.queryState = function(thresholdSeconds, callback) {};
3725  * @param {number} intervalInSeconds Threshold, in seconds, used to determine
3726  *    when the system is in an idle state.
3727  */
3728 chrome.idle.setDetectionInterval = function(intervalInSeconds) {};
3731 /** @type {!ChromeEvent} */
3732 chrome.idle.onStateChanged;
3736  * Chrome Text-to-Speech API.
3737  * @const
3738  * @see https://developer.chrome.com/extensions/tts.html
3739  */
3740 chrome.tts = {};
3745  * An event from the TTS engine to communicate the status of an utterance.
3746  * @constructor
3747  */
3748 function TtsEvent() {}
3751 /** @type {string} */
3752 TtsEvent.prototype.type;
3755 /** @type {number} */
3756 TtsEvent.prototype.charIndex;
3759 /** @type {string} */
3760 TtsEvent.prototype.errorMessage;
3765  * A description of a voice available for speech synthesis.
3766  * @constructor
3767  */
3768 function TtsVoice() {}
3771 /** @type {string} */
3772 TtsVoice.prototype.voiceName;
3775 /** @type {string} */
3776 TtsVoice.prototype.lang;
3779 /** @type {string} */
3780 TtsVoice.prototype.gender;
3783 /** @type {string} */
3784 TtsVoice.prototype.extensionId;
3787 /** @type {Array.<string>} */
3788 TtsVoice.prototype.eventTypes;
3792  * Gets an array of all available voices.
3793  * @param {function(Array.<TtsVoice>)=} opt_callback An optional callback
3794  *     function.
3795  */
3796 chrome.tts.getVoices = function(opt_callback) {};
3800  * Checks if the engine is currently speaking.
3801  * @param {function(boolean)=} opt_callback The callback function.
3802  */
3803 chrome.tts.isSpeaking = function(opt_callback) {};
3807  * Speaks text using a text-to-speech engine.
3808  * @param {string} utterance The text to speak, either plain text or a complete,
3809  *     well-formed SSML document. Speech engines that do not support SSML will
3810  *     strip away the tags and speak the text. The maximum length of the text is
3811  *     32,768 characters.
3812  * @param {Object=} opt_options The speech options.
3813  * @param {function()=} opt_callback Called right away, before speech finishes.
3814  */
3815 chrome.tts.speak = function(utterance, opt_options, opt_callback) {};
3819  * Stops any current speech.
3820  */
3821 chrome.tts.stop = function() {};
3825  * @const
3826  * @see https://developer.chrome.com/extensions/ttsEngine.html
3827  */
3828 chrome.ttsEngine = {};
3831 /** @type {!ChromeEvent} */
3832 chrome.ttsEngine.onSpeak;
3835 /** @type {!ChromeEvent} */
3836 chrome.ttsEngine.onStop;
3840  * @const
3841  * @see https://developer.chrome.com/extensions/contentSettings.html
3842  */
3843 chrome.contentSettings = {};
3846 /** @type {!ContentSetting} */
3847 chrome.contentSettings.cookies;
3850 /** @type {!ContentSetting} */
3851 chrome.contentSettings.images;
3854 /** @type {!ContentSetting} */
3855 chrome.contentSettings.javascript;
3858 /** @type {!ContentSetting} */
3859 chrome.contentSettings.plugins;
3862 /** @type {!ContentSetting} */
3863 chrome.contentSettings.popups;
3866 /** @type {!ContentSetting} */
3867 chrome.contentSettings.notifications;
3871  * @const
3872  * @see https://developer.chrome.com/extensions/fileBrowserHandler
3873  */
3874 chrome.fileBrowserHandler = {};
3878  * @typedef {?{
3879  *   suggestedName: string,
3880  *   allowedFileExtensions: (!Array.<string>|undefined)
3881  * }}
3882  */
3883 chrome.fileBrowserHandler.SelectFileSelectionParams;
3887  * Prompts user to select file path under which file should be saved.
3888  * @see https://developer.chrome.com/extensions/fileBrowserHandler#method-selectFile
3889  * @param {!chrome.fileBrowserHandler.SelectFileSelectionParams} selectionParams
3890  *     Parameters that will be used while selecting the file.
3891  * @param {function(!Object)} callback Function called upon completion.
3892  */
3893 chrome.fileBrowserHandler.selectFile = function(selectionParams, callback) {};
3897  * @interface
3898  * @see https://developer.chrome.com/extensions/fileBrowserHandler#event-onExecute
3899  */
3900 chrome.fileBrowserHandler.ExecuteEvent = function() {};
3904  * @param {function(string, !FileHandlerExecuteEventDetails)} callback
3905  */
3906 chrome.fileBrowserHandler.ExecuteEvent.prototype.addListener = function(
3907     callback) {};
3911  * @param {function(string, !FileHandlerExecuteEventDetails)} callback
3912  */
3913 chrome.fileBrowserHandler.ExecuteEvent.prototype.removeListener = function(
3914     callback) {};
3918  * @param {function(string, !FileHandlerExecuteEventDetails)} callback
3919  * @return {boolean}
3920  */
3921 chrome.fileBrowserHandler.ExecuteEvent.prototype.hasListener = function(
3922     callback) {};
3926  * @return {boolean}
3927  */
3928 chrome.fileBrowserHandler.ExecuteEvent.prototype.hasListeners = function() {};
3932  * Fired when file system action is executed from ChromeOS file browser.
3933  * @see https://developer.chrome.com/extensions/fileBrowserHandler#event-onExecute
3934  * @type {!chrome.fileBrowserHandler.ExecuteEvent}
3935  */
3936 chrome.fileBrowserHandler.onExecute;
3940  * @const
3941  * @see https://developer.chrome.com/extensions/gcm
3942  */
3943 chrome.gcm = {};
3947  * @see https://developer.chrome.com/extensions/gcm#property-MAX_MESSAGE_SIZE
3948  * @type {number}
3949  */
3950 chrome.gcm.MAX_MESSAGE_SIZE;
3954  * Registers the application with GCM. The registration ID will be returned by
3955  * the callback. If register is called again with the same list of senderIds,
3956  * the same registration ID will be returned.
3957  * @see https://developer.chrome.com/extensions/gcm#method-register
3958  * @param {!Array.<string>} senderIds A list of server IDs that are allowed to
3959  *     send messages to the application.
3960  * @param {function(string): void} callback Function called when
3961  *     registration completes with registration ID as argument.
3962  */
3963 chrome.gcm.register = function(senderIds, callback) {};
3967  * Unregisters the application from GCM.
3968  * @see https://developer.chrome.com/extensions/gcm#method-unregister
3969  * @param {function(): void} callback Called when unregistration is done.
3970  */
3971 chrome.gcm.unregister = function(callback) {};
3975  * Sends an upstream message using GCM.
3976  * @see https://developer.chrome.com/extensions/gcm#method-send
3977  * @param {!chrome.gcm.Message} message Message to be sent.
3978  * @param {function(string): void} callback Called with message ID.
3979  */
3980 chrome.gcm.send = function(message, callback) {};
3984  * Outgoing message.
3985  * @typedef {?{
3986  *   destinationId: string,
3987  *   messageId: string,
3988  *   timeToLive: (number|undefined),
3989  *   data: !Object.<string, string>
3990  * }}
3991  */
3992 chrome.gcm.Message;
3996  * An event, fired when a message is received through GCM.
3997  * @see https://developer.chrome.com/extensions/gcm#event-onMessage
3998  * @type {!chrome.gcm.OnMessageEvent}
3999  */
4000 chrome.gcm.onMessage;
4004  * An event, fired when GCM server had to delete messages to the application
4005  * from its queue in order to manage its size.
4006  * @see https://developer.chrome.com/extensions/gcm#event-onMessagesDeleted
4007  * @type {!ChromeEvent}
4008  */
4009 chrome.gcm.onMessagesDeleted;
4013  * An event indicating problems with sending messages.
4014  * @see https://developer.chrome.com/extensions/gcm#event-onSendError
4015  * @type {!chrome.gcm.OnSendErrorEvent}
4016  */
4017 chrome.gcm.onSendError;
4022  * @constructor
4023  */
4024 chrome.gcm.OnMessageEvent = function() {};
4028  * @param {function(!Object): void} callback Callback.
4029  */
4030 chrome.gcm.OnMessageEvent.prototype.addListener = function(callback) {};
4034  * @param {function(!Object): void} callback Callback.
4035  */
4036 chrome.gcm.OnMessageEvent.prototype.removeListener = function(callback) {};
4040  * @param {function(!Object): void} callback Callback.
4041  * @return {boolean}
4042  */
4043 chrome.gcm.OnMessageEvent.prototype.hasListener = function(callback) {};
4047  * @return {boolean}
4048  */
4049 chrome.gcm.OnMessageEvent.prototype.hasListeners = function() {};
4054  * @constructor
4055  */
4056 chrome.gcm.OnSendErrorEvent = function() {};
4060  * @param {function(!Object): void} callback Callback.
4061  */
4062 chrome.gcm.OnSendErrorEvent.prototype.addListener = function(callback) {};
4066  * @param {function(!Object): void} callback Callback.
4067  */
4068 chrome.gcm.OnSendErrorEvent.prototype.removeListener = function(callback) {};
4072  * @param {function(!Object): void} callback Callback.
4073  * @return {boolean}
4074  */
4075 chrome.gcm.OnSendErrorEvent.prototype.hasListener = function(callback) {};
4079  * @return {boolean}
4080  */
4081 chrome.gcm.OnSendErrorEvent.prototype.hasListeners = function() {};
4085  * @const
4086  * @see https://developer.chrome.com/extensions/history.html
4087  */
4088 chrome.history = {};
4092  * @param {Object.<string, string>} details Object with a 'url' key.
4093  */
4094 chrome.history.addUrl = function(details) {};
4098  * @param {function(): void} callback Callback function.
4099  */
4100 chrome.history.deleteAll = function(callback) {};
4104  * @param {Object.<string, string>} range Object with 'startTime'
4105  *     and 'endTime' keys.
4106  * @param {function(): void} callback Callback function.
4107  */
4108 chrome.history.deleteRange = function(range, callback) {};
4112  * @param {Object.<string, string>} details Object with a 'url' key.
4113  */
4114 chrome.history.deleteUrl = function(details) {};
4118  * @param {Object.<string, string>} details Object with a 'url' key.
4119  * @param {function(!Array.<!VisitItem>): void} callback Callback function.
4120  * @return {!Array.<!VisitItem>}
4121  */
4122 chrome.history.getVisits = function(details, callback) {};
4126  * @param {Object.<string, string>} query Object with a 'text' (string)
4127  *     key and optional 'startTime' (number), 'endTime' (number) and
4128  *     'maxResults' keys.
4129  * @param {function(!Array.<!HistoryItem>): void} callback Callback function.
4130  * @return {!Array.<!HistoryItem>}
4131  */
4132 chrome.history.search = function(query, callback) {};
4135 /** @type {!ChromeEvent} */
4136 chrome.history.onVisitRemoved;
4139 /** @type {!ChromeEvent} */
4140 chrome.history.onVisited;
4144  * @const
4145  * @see http://developer.chrome.com/apps/identity.html
4146  */
4147 chrome.identity = {};
4151  * @param {(chrome.identity.TokenDetails|function(string=): void)}
4152  *     detailsOrCallback Token options or a callback function if no options are
4153  *     specified.
4154  * @param {function(string=): void=} opt_callback A callback function if options
4155  *     are specified.
4156  */
4157 chrome.identity.getAuthToken = function(detailsOrCallback, opt_callback) {};
4160 /** @typedef {{interactive: (boolean|undefined)}} */
4161 chrome.identity.TokenDetails;
4165  * @param {chrome.identity.InvalidTokenDetails} details
4166  * @param {function(): void} callback
4167  */
4168 chrome.identity.removeCachedAuthToken = function(details, callback) {};
4171 /** @typedef {{token: string}} */
4172 chrome.identity.InvalidTokenDetails;
4176  * @param {chrome.identity.WebAuthFlowDetails} details
4177  * @param {function(string=): void} callback
4178  */
4179 chrome.identity.launchWebAuthFlow = function(details, callback) {};
4182 /** @typedef {{url: string, interactive: (boolean|undefined)}} */
4183 chrome.identity.WebAuthFlowDetails;
4186 /** @param {function(!Object):void} callback */
4187 chrome.identity.getProfileUserInfo = function(callback) {};
4190 /** @type {!ChromeEvent} */
4191 chrome.identity.onSignInChanged;
4195  * @const
4196  * @see https://developer.chrome.com/extensions/input.ime.html
4197  */
4198 chrome.input = {};
4201 /** @const */
4202 chrome.input.ime = {};
4207  * The OnKeyEvent event takes an extra argument.
4208  * @constructor
4209  */
4210 function ChromeInputImeOnKeyEventEvent() {}
4214  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
4215  *     callback.
4216  * @param {Array.<string>=} opt_extraInfoSpec Array of extra information.
4217  */
4218 ChromeInputImeOnKeyEventEvent.prototype.addListener =
4219     function(callback, opt_extraInfoSpec) {};
4223  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
4224  *     callback.
4225  */
4226 ChromeInputImeOnKeyEventEvent.prototype.removeListener = function(callback) {};
4230  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
4231  *     callback.
4232  */
4233 ChromeInputImeOnKeyEventEvent.prototype.hasListener = function(callback) {};
4237  * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
4238  *     callback.
4239  */
4240 ChromeInputImeOnKeyEventEvent.prototype.hasListeners = function(callback) {};
4244  * @param {!Object.<string,number>} parameters An object with a
4245  *     'contextID' (number) key.
4246  * @param {function(boolean): void} callback Callback function.
4247  */
4248 chrome.input.ime.clearComposition = function(parameters, callback) {};
4252  * @param {!Object.<string,(string|number)>} parameters An object with
4253  *     'contextID' (number) and 'text' (string) keys.
4254  * @param {function(boolean): void=} opt_callback Callback function.
4255  */
4256 chrome.input.ime.commitText = function(parameters, opt_callback) {};
4260  * @param {!Object.<string,(string|number)>} parameters An object with
4261  *     'contextID' (number) and 'text' (string) keys.
4262  * @param {function(boolean): void=} opt_callback Callback function.
4263  */
4264 chrome.input.ime.deleteSurroundingText = function(parameters, opt_callback) {};
4268  * @param {!Object.<string,(number|Object.<string,(string|number|boolean)>)>}
4269  *     parameters An object with 'engineID' (string) and 'properties'
4270  *     (Object) keys.
4271  * @param {function(boolean): void=} opt_callback Callback function.
4272  */
4273 chrome.input.ime.setCandidateWindowProperties =
4274     function(parameters, opt_callback) {};
4278  * @param {!Object.<string,(number|Object.<string,(string|number)>)>}
4279  *     parameters An object with 'contextID' (number) and 'candidates'
4280  *     (array of object) keys.
4281  * @param {function(boolean): void=} opt_callback Callback function.
4282  */
4283 chrome.input.ime.setCandidates = function(parameters, opt_callback) {};
4287  * @param {!Object.<string,(string|number|Object.<string,(string|number)>)>}
4288  *     parameters An object with 'contextID' (number), 'text' (string),
4289  *     'selectionStart (number), 'selectionEnd' (number), 'cursor' (number),
4290  *     and 'segments' (array of object) keys.
4291  * @param {function(boolean): void=} opt_callback Callback function.
4292  */
4293 chrome.input.ime.setComposition = function(parameters, opt_callback) {};
4297  * @param {!Object.<string,number>} parameters An object with
4298  *     'contextID' (number) and 'candidateID' (number) keys.
4299  * @param {function(boolean): void=} opt_callback Callback function.
4300  */
4301 chrome.input.ime.setCursorPosition = function(parameters, opt_callback) {};
4305  * @param {!Object.<string,(string|Array.<Object.<string,(string|boolean)>>)>}
4306  *     parameters An object with 'engineID' (string) and 'items'
4307  *     (array of object) keys.
4308  * @param {function(): void=} opt_callback Callback function.
4309  */
4310 chrome.input.ime.setMenuItems = function(parameters, opt_callback) {};
4314  * @param {!Object.<string,(string|Array.<Object.<string,(string|boolean)>>)>}
4315  *     parameters An object with  'engineID' (string) and 'items'
4316  *     (array of object) keys.
4317  * @param {function(): void=} opt_callback Callback function.
4318  */
4319 chrome.input.ime.updateMenuItems = function(parameters, opt_callback) {};
4323  * @param {string} requestId Request id of the event that was handled. This
4324  *     should come from keyEvent.requestId.
4325  * @param {boolean} response True if the keystroke was handled, false if not.
4326  */
4327 chrome.input.ime.keyEventHandled = function(requestId, response) {};
4330 /** @type {!ChromeEvent} */
4331 chrome.input.ime.onActivate;
4334 /** @type {!ChromeEvent} */
4335 chrome.input.ime.onBlur;
4338 /** @type {!ChromeEvent} */
4339 chrome.input.ime.onCandidateClicked;
4342 /** @type {!ChromeEvent} */
4343 chrome.input.ime.onDeactivated;
4346 /** @type {!ChromeEvent} */
4347 chrome.input.ime.onFocus;
4350 /** @type {!ChromeEvent} */
4351 chrome.input.ime.onInputContextUpdate;
4354 /** @type {!ChromeInputImeOnKeyEventEvent} */
4355 chrome.input.ime.onKeyEvent;
4358 /** @type {!ChromeEvent} */
4359 chrome.input.ime.onMenuItemActivated;
4362 /** @type {!ChromeEvent} */
4363 chrome.input.ime.onReset;
4366 /** @type {!ChromeEvent} */
4367 chrome.input.ime.onSurroundingTextChanged;
4371  * namespace
4372  * @see http://developer.chrome.com/apps/mediaGalleries
4373  * @const
4374  */
4375 chrome.mediaGalleries = {};
4379  * @param {{interactive: (string|undefined)}|function(!Array.<!FileSystem>)}
4380  *     detailsOrCallback A details object for whether the request should be
4381  *     interactive if permissions haven't been granted yet or the callback.
4382  * @param {function(!Array.<!FileSystem>)=} opt_callback A success callback if
4383  *     no details were supplied as arg1.
4384  */
4385 chrome.mediaGalleries.getMediaFileSystems = function(
4386     detailsOrCallback, opt_callback) {};
4390  * @param {function(!Array.<!FileSystem>, string)} callback Callback function.
4391  */
4392 chrome.mediaGalleries.addUserSelectedFolder = function(callback) {};
4396  * @param {string} galleryId ID of the media gallery.
4397  * @param {function()=} opt_callback Optional callback function.
4398  */
4399 chrome.mediaGalleries.dropPermissionForMediaFileSystem =
4400     function(galleryId, opt_callback) {};
4403 chrome.mediaGalleries.startMediaScan = function() {};
4406 chrome.mediaGalleries.cancelMediaScan = function() {};
4410  * @param {function(!Array.<!FileSystem>)} callback Callback function.
4411  */
4412 chrome.mediaGalleries.addScanResults = function(callback) {};
4416  * @typedef {{
4417  *   name: string,
4418  *   galleryId: string,
4419  *   deviceId: (string|undefined),
4420  *   isRemovable: boolean,
4421  *   isMediaDevice: boolean,
4422  *   isAvailable: boolean
4423  * }}
4424  */
4425 chrome.mediaGalleries.MediaFileSystemMetadata;
4429  * @param {!FileSystem} mediaFileSystem The file system to get metadata for.
4430  * @return {!chrome.mediaGalleries.MediaFileSystemMetadata}
4431  */
4432 chrome.mediaGalleries.getMediaFileSystemMetadata = function(mediaFileSystem) {};
4436  * @param {function(!Array.<!chrome.mediaGalleries.MediaFileSystemMetadata>)}
4437  *     callback Callback function.
4438  */
4439 chrome.mediaGalleries.getAllMediaFileSystemMetadata = function(callback) {};
4443  * @typedef {{
4444  *   mimeType: string,
4445  *   height: (number|undefined),
4446  *   width: (number|undefined),
4447  *   xResolution: (number|undefined),
4448  *   yResolution: (number|undefined),
4449  *   duration: (number|undefined),
4450  *   rotation: (number|undefined),
4451  *   cameraMake: (string|undefined),
4452  *   cameraModel: (string|undefined),
4453  *   exposureTimeSeconds: (number|undefined),
4454  *   flashFired: (boolean|undefined),
4455  *   fNumber: (number|undefined),
4456  *   focalLengthMm: (number|undefined),
4457  *   isoEquivalent: (number|undefined),
4458  *   album: (string|undefined),
4459  *   artist: (string|undefined),
4460  *   comment: (string|undefined),
4461  *   copyright: (string|undefined),
4462  *   disc: (number|undefined),
4463  *   genre: (string|undefined),
4464  *   language: (string|undefined),
4465  *   title: (string|undefined),
4466  *   track: (number|undefined),
4467  *   rawTags: !Array.<!chrome.mediaGalleries.metadata.RawTag>,
4468  *   attachedImages: !Array.<!Blob>
4469  * }}
4470  */
4471 chrome.mediaGalleries.MetaData;
4474 /** @const */
4475 chrome.mediaGalleries.metadata = {};
4478 /** @constructor */
4479 chrome.mediaGalleries.metadata.RawTag = function() {};
4482 /** @type {string} */
4483 chrome.mediaGalleries.metadata.RawTag.prototype.type;
4486 /** @type {!Object.<string, string>} */
4487 chrome.mediaGalleries.metadata.RawTag.prototype.tags;
4491  * @param {!Blob} mediaFile The media file for which to get metadata.
4492  * @param {{metadataType: (string|undefined)}|
4493  *     function(!chrome.mediaGalleries.MetaData)} optionsOrCallback The options
4494  *     for the metadata to retrieve or the callback to invoke with the metadata.
4495  *     The metadataType should either be 'all' or 'mimeTypeOnly'. Defaults to
4496  *     'all' if the metadataType is omitted.
4497  * @param {function(!chrome.mediaGalleries.MetaData)=} opt_callback If options
4498  *     were passed as arg2, the callback to invoke with the metadata.
4499  */
4500 chrome.mediaGalleries.getMetadata = function(
4501     mediaFile, optionsOrCallback, opt_callback) {};
4505  * @typedef {function({galleryId: string, success: boolean}): void}
4506  */
4507 chrome.mediaGalleries.AddGalleryWatchCallback;
4511  * @param {string} galleryId The media gallery's ID.
4512  * @param {!chrome.mediaGalleries.AddGalleryWatchCallback} callback Fired with
4513  *     success or failure result.
4514  */
4515 chrome.mediaGalleries.addGalleryWatch = function(galleryId, callback) {};
4519  * @param {string} galleryId The media gallery's ID.
4520  */
4521 chrome.mediaGalleries.removeGalleryWatch = function(galleryId) {};
4525  * @param {function(!Array.<string>): void} callback Callback function notifies
4526  *     which galleries are being watched.
4527  */
4528 chrome.mediaGalleries.getAllGalleryWatch = function(callback) {};
4531 chrome.mediaGalleries.removeAllGalleryWatch = function() {};
4536  * @constructor
4537  */
4538 chrome.mediaGalleries.GalleryChangeEvent = function() {};
4542  * @typedef {function({type: string, galleryId: string}): void}
4543  */
4544 chrome.mediaGalleries.GalleryChangeCallback;
4548  * @param {!chrome.mediaGalleries.GalleryChangeCallback} callback
4549  */
4550 chrome.mediaGalleries.GalleryChangeEvent.prototype.addListener =
4551     function(callback) {};
4555  * @param {!chrome.mediaGalleries.GalleryChangeCallback} callback
4556  */
4557 chrome.mediaGalleries.GalleryChangeEvent.prototype.removeListener =
4558     function(callback) {};
4562  * @param {!chrome.mediaGalleries.GalleryChangeCallback} callback
4563  */
4564 chrome.mediaGalleries.GalleryChangeEvent.prototype.hasListener =
4565     function(callback) {};
4569  * @return {boolean}
4570  */
4571 chrome.mediaGalleries.GalleryChangeEvent.prototype.hasListeners = function() {};
4575  * @type {!chrome.mediaGalleries.GalleryChangeEvent}
4576  */
4577 chrome.mediaGalleries.onGalleryChanged;
4581  * @typedef {{
4582  *   type: string,
4583  *   galleryCount: (number|undefined),
4584  *   audioCount: (number|undefined),
4585  *   imageCount: (number|undefined),
4586  *   videoCount: (number|undefined)
4587  * }}
4588  */
4589 chrome.mediaGalleries.OnScanProgressDetails;
4594  * Event whose listeners take a chrome.mediaGalleries.OnScanProgressDetails
4595  * parameter.
4596  * @constructor
4597  */
4598 chrome.mediaGalleries.ScanProgressEvent = function() {};
4601 /** @param {function(!chrome.mediaGalleries.OnScanProgressDetails)} callback */
4602 chrome.mediaGalleries.ScanProgressEvent.prototype.addListener =
4603     function(callback) {};
4606 /** @param {function(!chrome.mediaGalleries.OnScanProgressDetails)} callback */
4607 chrome.mediaGalleries.ScanProgressEvent.prototype.removeListener =
4608     function(callback) {};
4612  * @param {function(!chrome.mediaGalleries.OnScanProgressDetails)} callback
4613  * @return {boolean}
4614  */
4615 chrome.mediaGalleries.ScanProgressEvent.prototype.hasListener =
4616     function(callback) {};
4619 /** @return {boolean} */
4620 chrome.mediaGalleries.ScanProgressEvent.prototype.hasListeners = function() {};
4623 /** @type {!chrome.mediaGalleries.ScanProgressEvent} */
4624 chrome.mediaGalleries.onScanProgress;
4628  * @const
4629  * @see https://developer.chrome.com/extensions/pageCapture.html
4630  */
4631 chrome.pageCapture = {};
4635  * @param {Object.<string, number>} details Object with a 'tabId' (number) key.
4636  * @param {function(Blob=): void} callback Callback function.
4637  */
4638 chrome.pageCapture.saveAsMHTML = function(details, callback) {};
4642  * @const
4643  * @see https://developer.chrome.com/extensions/permissions.html
4644  */
4645 chrome.permissions = {};
4649  * @typedef {{
4650  *   permissions: (Array.<string>|undefined),
4651  *   origins: (Array.<string>|undefined)
4652  * }}
4653  * @see http://developer.chrome.com/extensions/permissions.html#type-Permissions
4654  */
4655 chrome.permissions.Permissions;
4659  * @param {!chrome.permissions.Permissions} permissions
4660  * @param {function(boolean): void} callback Callback function.
4661  */
4662 chrome.permissions.contains = function(permissions, callback) {};
4666  * @param {function(!chrome.permissions.Permissions): void} callback
4667  *     Callback function.
4668  */
4669 chrome.permissions.getAll = function(callback) {};
4673  * @param {!chrome.permissions.Permissions} permissions
4674  * @param {function(boolean): void=} opt_callback Callback function.
4675  */
4676 chrome.permissions.remove = function(permissions, opt_callback) {};
4680  * @param {!chrome.permissions.Permissions} permissions
4681  * @param {function(boolean): void=} opt_callback Callback function.
4682  */
4683 chrome.permissions.request = function(permissions, opt_callback) {};
4686 /** @type {!ChromeEvent} */
4687 chrome.permissions.onAdded;
4690 /** @type {!ChromeEvent} */
4691 chrome.permissions.onRemoved;
4695  * @see http://developer.chrome.com/dev/extensions/power.html
4696  */
4697 chrome.power = {};
4701  * @param {string} level A string describing the degree to which power
4702  *     management should be disabled, should be either "system" or "display".
4703  */
4704 chrome.power.requestKeepAwake = function(level) {};
4708  * Releases a request previously made via requestKeepAwake().
4709  */
4710 chrome.power.releaseKeepAwake = function() {};
4714  * @const
4715  * @see https://developer.chrome.com/extensions/privacy.html
4716  */
4717 chrome.privacy = {};
4720 /** @type {!Object.<string,!ChromeSetting>} */
4721 chrome.privacy.network;
4724 /** @type {!Object.<string,!ChromeSetting>} */
4725 chrome.privacy.services;
4728 /** @type {!Object.<string,!ChromeSetting>} */
4729 chrome.privacy.websites;
4733  * @const
4734  * @see https://developer.chrome.com/extensions/proxy.html
4735  */
4736 chrome.proxy = {};
4739 /** @type {!Object.<string,!ChromeSetting>} */
4740 chrome.proxy.settings;
4743 /** @type {!ChromeEvent} */
4744 chrome.proxy.onProxyError;
4748  * @const
4749  * @see http://developer.chrome.com/apps/socket.html
4750  */
4751 chrome.socket = {};
4756  * @constructor
4757  */
4758 chrome.socket.CreateInfo = function() {};
4761 /** @type {number} */
4762 chrome.socket.CreateInfo.prototype.socketId;
4767  * @constructor
4768  */
4769 chrome.socket.ReadInfo = function() {};
4772 /** @type {number} */
4773 chrome.socket.ReadInfo.prototype.resultCode;
4776 /** @type {!ArrayBuffer} */
4777 chrome.socket.ReadInfo.prototype.data;
4782  * @constructor
4783  */
4784 chrome.socket.WriteInfo = function() {};
4787 /** @type {number} */
4788 chrome.socket.WriteInfo.prototype.bytesWritten;
4793  * @constructor
4794  */
4795 chrome.socket.RecvFromInfo = function() {};
4798 /** @type {number} */
4799 chrome.socket.RecvFromInfo.prototype.resultCode;
4802 /** @type {!ArrayBuffer} */
4803 chrome.socket.RecvFromInfo.prototype.data;
4806 /** @type {string} */
4807 chrome.socket.RecvFromInfo.prototype.address;
4810 /** @type {number} */
4811 chrome.socket.RecvFromInfo.prototype.port;
4816  * @constructor
4817  */
4818 chrome.socket.AcceptInfo = function() {};
4821 /** @type {number} */
4822 chrome.socket.AcceptInfo.prototype.resultCode;
4825 /** @type {(number|undefined)} */
4826 chrome.socket.AcceptInfo.prototype.socketId;
4831  * @constructor
4832  */
4833 chrome.socket.SocketInfo = function() {};
4836 /** @type {string} */
4837 chrome.socket.SocketInfo.prototype.socketType;
4840 /** @type {boolean} */
4841 chrome.socket.SocketInfo.prototype.connected;
4844 /** @type {(string|undefined)} */
4845 chrome.socket.SocketInfo.prototype.peerAddress;
4848 /** @type {(number|undefined)} */
4849 chrome.socket.SocketInfo.prototype.peerPort;
4852 /** @type {(string|undefined)} */
4853 chrome.socket.SocketInfo.prototype.localAddress;
4856 /** @type {(number|undefined)} */
4857 chrome.socket.SocketInfo.prototype.localPort;
4862  * @constructor
4863  */
4864 chrome.socket.NetworkAdapterInfo = function() {};
4867 /** @type {string} */
4868 chrome.socket.NetworkAdapterInfo.prototype.name;
4871 /** @type {string} */
4872 chrome.socket.NetworkAdapterInfo.prototype.address;
4876  * @param {string} type The type of socket to create. Must be 'tcp' or 'udp'.
4877  * @param {(Object|function(!chrome.socket.CreateInfo))} optionsOrCallback The
4878  *     socket options or callback.
4879  * @param {function(!chrome.socket.CreateInfo)=} opt_callback Called when the
4880  *     socket has been created.
4881  */
4882 chrome.socket.create = function(type, optionsOrCallback, opt_callback) {};
4886  * @param {number} socketId The id of the socket to destroy.
4887  */
4888 chrome.socket.destroy = function(socketId) {};
4892  * @param {number} socketId The id of the socket.
4893  * @param {string} hostname The hostname or IP address of the remote machine.
4894  * @param {number} port The port of the remote machine.
4895  * @param {function(number)} callback Called when the connection attempt is
4896  *     complete.
4897  */
4898 chrome.socket.connect = function(socketId, hostname, port, callback) {};
4902  * @param {number} socketId The id of the socket.
4903  * @param {string} address The address of the local machine.
4904  * @param {number} port The port of the local machine.
4905  * @param {function(number)} callback Called when the bind attempt is complete.
4906  */
4907 chrome.socket.bind = function(socketId, address, port, callback) {};
4911  * @param {number} socketId The id of the socket to disconnect.
4912  */
4913 chrome.socket.disconnect = function(socketId) {};
4917  * @param {number} socketId The id of the socket to read from.
4918  * @param {(number|function(!chrome.socket.ReadInfo))} bufferSizeOrCallback The
4919  *     read buffer size or the callback.
4920  * @param {function(!chrome.socket.ReadInfo)=} opt_callback Called with data
4921  *     that was available to be read without blocking.
4922  */
4923 chrome.socket.read = function(socketId, bufferSizeOrCallback, opt_callback) {};
4927  * @param {number} socketId The id of the socket to write to.
4928  * @param {!ArrayBuffer} data The data to write.
4929  * @param {function(!chrome.socket.WriteInfo)} callback Called when the write
4930  *     operation completes without blocking or an error occurs.
4931  */
4932 chrome.socket.write = function(socketId, data, callback) {};
4936  * @param {number} socketId The id of the socket to read from.
4937  * @param {(number|function(!chrome.socket.RecvFromInfo))} bufferSizeOrCallback
4938  *     The read buffer size or the callback.
4939  * @param {function(!chrome.socket.RecvFromInfo)=} opt_callback Called with data
4940  *     that was available to be read without blocking.
4941  */
4942 chrome.socket.recvFrom = function(socketId, bufferSizeOrCallback,
4943     opt_callback) {};
4947  * @param {number} socketId The id of the socket to write to.
4948  * @param {!ArrayBuffer} data The data to write.
4949  * @param {string} address The address of the remote machine.
4950  * @param {number} port The port of the remote machine.
4951  * @param {function(!chrome.socket.WriteInfo)} callback Called when the write
4952  *     operation completes without blocking or an error occurs.
4953  */
4954 chrome.socket.sendTo = function(socketId, data, address, port, callback) {};
4958  * @param {number} socketId The id of the socket to listen on.
4959  * @param {string} address The address of the local machine to listen on. Use
4960  *     '0' to listen on all addresses.
4961  * @param {number} port The port of the local machine.
4962  * @param {(number|function(number))} backlogOrCallback The length of the
4963  *     socket's listen queue or the callback.
4964  * @param {function(number)=} opt_callback Called when the listen operation
4965  *     completes.
4966  */
4967 chrome.socket.listen =
4968     function(socketId, address, port, backlogOrCallback, opt_callback) {};
4972  * @param {number} socketId The id of the socket to accept a connection on.
4973  * @param {function(!chrome.socket.AcceptInfo)} callback Called when a new
4974  *     socket is accepted.
4975  */
4976 chrome.socket.accept = function(socketId, callback) {};
4980  * @param {number} socketId The id of the socket to listen on.
4981  * @param {boolean} enable If true, enable keep-alive functionality.
4982  * @param {(number|function(boolean))} delayOrCallback The delay in seconds
4983  *     between the last packet received and the first keepalive probe (default
4984  *     is 0) or the callback
4985  * @param {function(boolean)=} opt_callback Called when the setKeepAlive attempt
4986  *     is complete.
4987  */
4988 chrome.socket.setKeepAlive = function(socketId, enable, delayOrCallback,
4989     opt_callback) {};
4993  * @param {number} socketId The id of the socket to listen on.
4994  * @param {boolean} noDelay If true, disables Nagle's algorithm.
4995  * @param {function(boolean)} callback Called when the setNoDelay attempt is
4996  *     complete.
4997  */
4998 chrome.socket.setNoDelay = function(socketId, noDelay, callback) {};
5002  * @param {number} socketId The id of the socket.
5003  * @param {function(!chrome.socket.SocketInfo)} callback Called when the state
5004  *     is available.
5005  */
5006 chrome.socket.getInfo = function(socketId, callback) {};
5010  * @param {function(!Array.<!chrome.socket.NetworkAdapterInfo>)} callback Called
5011  *     when local adapter information is available.
5012  */
5013 chrome.socket.getNetworkList = function(callback) {};
5017  * @param {number} socketId The id of the socket.
5018  * @param {string} address The group address to join. Domain names are not
5019  *     supported.
5020  * @param {function(number)} callback Called when the join operation is done.
5021  */
5022 chrome.socket.joinGroup = function(socketId, address, callback) {};
5026  * @param {number} socketId The id of the socket.
5027  * @param {string} address The group address to leave. Domain names are not
5028  *     supported.
5029  * @param {function(number)} callback Called when the leave operation is done.
5030  */
5031 chrome.socket.leaveGroup = function(socketId, address, callback) {};
5035  * @param {number} socketId The id of the socket.
5036  * @param {number} ttl The time-to-live value.
5037  * @param {function(number)} callback Called when the configuration operation is
5038  *     done.
5039  */
5040 chrome.socket.setMulticastTimeToLive = function(socketId, ttl, callback) {};
5044  * @param {number} socketId The id of the socket.
5045  * @param {boolean} enabled True to enable loopback mode.
5046  * @param {function(number)} callback Called when the configuration operation is
5047  *     done.
5048  */
5049 chrome.socket.setMulticastLoopbackMode = function(socketId, enabled,
5050     callback) {};
5054  * @param {number} socketId The id of the socket.
5055  * @param {function(!Array.<string>)} callback Called with an array of string
5056  *     groups.
5057  */
5058 chrome.socket.getJoinedGroups = function(socketId, callback) {};
5062   * @const
5063   */
5064 chrome.sockets = {};
5068   * @const
5069   * @see https://developer.chrome.com/apps/sockets_tcp
5070   */
5071 chrome.sockets.tcp = {};
5076  * @constructor
5077  * @see https://developer.chrome.com/apps/sockets_tcp#type-SocketInfo
5078  */
5079 chrome.sockets.tcp.SocketInfo = function() {};
5082 /** @type {number} */
5083 chrome.sockets.tcp.SocketInfo.prototype.socketId;
5086 /** @type {boolean} */
5087 chrome.sockets.tcp.SocketInfo.prototype.persistent;
5090 /** @type {string|undefined} */
5091 chrome.sockets.tcp.SocketInfo.prototype.name;
5094 /** @type {number|undefined} */
5095 chrome.sockets.tcp.SocketInfo.prototype.bufferSize;
5098 /** @type {boolean} */
5099 chrome.sockets.tcp.SocketInfo.prototype.paused;
5102 /** @type {boolean} */
5103 chrome.sockets.tcp.SocketInfo.prototype.connected;
5106 /** @type {string|undefined} */
5107 chrome.sockets.tcp.SocketInfo.prototype.localAddress;
5110 /** @type {number|undefined} */
5111 chrome.sockets.tcp.SocketInfo.prototype.localPort;
5114 /** @type {string|undefined} */
5115 chrome.sockets.tcp.SocketInfo.prototype.peerAddress;
5118 /** @type {number|undefined} */
5119 chrome.sockets.tcp.SocketInfo.prototype.peerPort;
5123  * @typedef {?{
5124  *   persistent: (boolean|undefined),
5125  *   name: (string|undefined),
5126  *   bufferSize: (number|undefined)
5127  * }}
5128  * @see https://developer.chrome.com/apps/sockets_tcp#type-SocketProperties
5129  */
5130 chrome.sockets.tcp.SocketProperties;
5134  * @typedef {?{
5135  *   min: (string|undefined),
5136  *   max: (string|undefined)
5137  * }}
5138  * @see https://developer.chrome.com/apps/sockets_tcp#method-secure
5139  */
5140 chrome.sockets.tcp.SecurePropertiesTlsVersion;
5144  * @typedef {?{
5145  *   tlsVersion: (chrome.sockets.tcp.SecurePropertiesTlsVersion|undefined)
5146  * }}
5147  * @see https://developer.chrome.com/apps/sockets_tcp#method-secure
5148  */
5149 chrome.sockets.tcp.SecureProperties;
5153  * @param {!chrome.sockets.tcp.SocketProperties|
5154  *     function(!Object)} propertiesOrCallback
5155  * @param {function(!Object)=} opt_callback
5156  * @see https://developer.chrome.com/apps/sockets_tcp#method-create
5157  */
5158 chrome.sockets.tcp.create = function(propertiesOrCallback, opt_callback) {};
5162  * @param {number} socketId
5163  * @param {!chrome.sockets.tcp.SocketProperties} properties
5164  * @param {function()=} opt_callback
5165  * @see https://developer.chrome.com/apps/sockets_tcp#method-update
5166  */
5167 chrome.sockets.tcp.update = function(socketId, properties, opt_callback) {};
5171  * @param {number} socketId
5172  * @param {boolean} paused
5173  * @param {function()=} opt_callback
5174  * @see https://developer.chrome.com/apps/sockets_tcp#method-setPaused
5175  */
5176 chrome.sockets.tcp.setPaused = function(socketId, paused, opt_callback) {};
5180  * @param {number} socketId
5181  * @param {boolean} enable
5182  * @param {(number|function(number))} delayOrCallback
5183  * @param {function(number)=} opt_callback
5184  * @see https://developer.chrome.com/apps/sockets_tcp#method-setKeepAlive
5185  */
5186 chrome.sockets.tcp.setKeepAlive = function(socketId, enable, delayOrCallback,
5187     opt_callback) {};
5191  * @param {number} socketId
5192  * @param {boolean} noDelay
5193  * @param {function(number)} callback
5194  * @see https://developer.chrome.com/apps/sockets_tcp#method-setNoDelay
5195  */
5196 chrome.sockets.tcp.setNoDelay = function(socketId, noDelay, callback) {};
5200  * @param {number} socketId
5201  * @param {string} peerAddress
5202  * @param {number} peerPort
5203  * @param {function(number)} callback
5204  * @see https://developer.chrome.com/apps/sockets_tcp#method-connect
5205  */
5206 chrome.sockets.tcp.connect = function(socketId, peerAddress, peerPort,
5207     callback) {};
5211  * @param {number} socketId The id of the socket to disconnect.
5212  * @param {function()=} opt_callback
5213  * @see https://developer.chrome.com/apps/sockets_tcp#method-disconnect
5214  */
5215 chrome.sockets.tcp.disconnect = function(socketId, opt_callback) {};
5219  * @param {number} socketId
5220  * @param {!chrome.sockets.tcp.SecureProperties|function(number)}
5221  *     optionsOrCallback
5222  * @param {function(number)=} opt_callback
5223  * @see https://developer.chrome.com/apps/sockets_tcp#method-secure
5224  */
5225 chrome.sockets.tcp.secure = function(socketId, optionsOrCallback,
5226     opt_callback) {};
5230  * @param {number} socketId
5231  * @param {!ArrayBuffer} data
5232  * @param {function(!Object)} callback
5233  * @see https://developer.chrome.com/apps/sockets_tcp#method-send
5234  */
5235 chrome.sockets.tcp.send = function(socketId, data, callback) {};
5239  * @param {number} socketId
5240  * @param {function()=} opt_callback
5241  * @see https://developer.chrome.com/apps/sockets_tcp#method-close
5242  */
5243 chrome.sockets.tcp.close = function(socketId, opt_callback) {};
5247  * @param {number} socketId
5248  * @param {function(!chrome.sockets.tcp.SocketInfo)} callback
5249  * @see https://developer.chrome.com/apps/sockets_tcp#method-getInfo
5250  */
5251 chrome.sockets.tcp.getInfo = function(socketId, callback) {};
5255  * @param {function(!Array.<!chrome.sockets.tcp.SocketInfo>)} callback
5256  * @see https://developer.chrome.com/apps/sockets_tcp#method-getSockets
5257  */
5258 chrome.sockets.tcp.getSockets = function(callback) {};
5263  * @constructor
5264  * @see https://developer.chrome.com/apps/sockets_tcp#event-onReceive
5265  */
5266 chrome.sockets.tcp.ReceiveEventData = function() {};
5269 /** @type {number} */
5270 chrome.sockets.tcp.ReceiveEventData.prototype.socketId;
5273 /** @type {!ArrayBuffer} */
5274 chrome.sockets.tcp.ReceiveEventData.prototype.data;
5279  * Event whose listeners take a ReceiveEventData parameter.
5280  * @constructor
5281  */
5282 chrome.sockets.tcp.ReceiveEvent = function() {};
5286  * @param {function(!chrome.sockets.tcp.ReceiveEventData): void} callback
5287  */
5288 chrome.sockets.tcp.ReceiveEvent.prototype.addListener =
5289     function(callback) {};
5293  * @param {function(!chrome.sockets.tcp.ReceiveEventData): void} callback
5294  */
5295 chrome.sockets.tcp.ReceiveEvent.prototype.removeListener =
5296     function(callback) {};
5300  * @param {function(!chrome.sockets.tcp.ReceiveEventData): void} callback
5301  * @return {boolean}
5302  */
5303 chrome.sockets.tcp.ReceiveEvent.prototype.hasListener =
5304     function(callback) {};
5307 /** @return {boolean} */
5308 chrome.sockets.tcp.ReceiveEvent.prototype.hasListeners = function() {};
5311 /** @type {!chrome.sockets.tcp.ReceiveEvent} */
5312 chrome.sockets.tcp.onReceive;
5317  * @constructor
5318  * @see https://developer.chrome.com/apps/sockets_tcp#event-onReceiveError
5319  */
5320 chrome.sockets.tcp.ReceiveErrorEventData = function() {};
5323 /** @type {number} */
5324 chrome.sockets.tcp.ReceiveErrorEventData.prototype.socketId;
5327 /** @type {number} */
5328 chrome.sockets.tcp.ReceiveErrorEventData.prototype.resultCode;
5333  * Event whose listeners take a ReceiveErrorEventData parameter.
5334  * @constructor
5335  */
5336 chrome.sockets.tcp.ReceiveErrorEvent = function() {};
5340  * @param {function(
5341  *     !chrome.sockets.tcp.ReceiveErrorEventData): void} callback
5342  */
5343 chrome.sockets.tcp.ReceiveErrorEvent.prototype.addListener =
5344     function(callback) {};
5348  * @param {function(
5349  *     !chrome.sockets.tcp.ReceiveErrorEventData): void} callback
5350  */
5351 chrome.sockets.tcp.ReceiveErrorEvent.prototype.removeListener =
5352     function(callback) {};
5356  * @param {function(
5357  *     !chrome.sockets.tcp.ReceiveErrorEventData): void} callback
5358  * @return {boolean}
5359  */
5360 chrome.sockets.tcp.ReceiveErrorEvent.prototype.hasListener =
5361     function(callback) {};
5364 /** @return {boolean} */
5365 chrome.sockets.tcp.ReceiveErrorEvent.prototype.hasListeners =
5366     function() {};
5369 /** @type {!chrome.sockets.tcp.ReceiveErrorEvent} */
5370 chrome.sockets.tcp.onReceiveError;
5374  * @const
5375  * @see https://developer.chrome.com/extensions/storage.html
5376  */
5377 chrome.storage = {};
5380 /** @type {!StorageArea} */
5381 chrome.storage.sync;
5384 /** @type {!StorageArea} */
5385 chrome.storage.local;
5388 /** @type {!StorageChangeEvent} */
5389 chrome.storage.onChanged;
5392 /** @const */
5393 chrome.system = {};
5397  * @const
5398  * @see https://developer.chrome.com/extensions/system_cpu.html
5399  */
5400 chrome.system.cpu = {};
5404  * @param {function(!Object)} callback
5405  */
5406 chrome.system.cpu.getInfo = function(callback) {};
5410  * @const
5411  * @see http://developer.chrome.com/apps/system_display.html
5412  */
5413 chrome.system.display = {};
5416 /** @type {!ChromeEvent} */
5417 chrome.system.display.onDisplayChanged;
5422  * @constructor
5423  */
5424 chrome.system.display.Bounds = function() {};
5427 /** @type {number} */
5428 chrome.system.display.Bounds.prototype.left;
5431 /** @type {number} */
5432 chrome.system.display.Bounds.prototype.top;
5435 /** @type {number} */
5436 chrome.system.display.Bounds.prototype.width;
5439 /** @type {number} */
5440 chrome.system.display.Bounds.prototype.height;
5444  * @typedef {{
5445  *   left: (number|undefined),
5446  *   top: (number|undefined),
5447  *   right: (number|undefined),
5448  *   bottom: (number|undefined)
5449  * }}
5450  */
5451 chrome.system.display.Insets;
5456  * @constructor
5457  */
5458 chrome.system.display.DisplayInfo = function() {};
5461 /** @type {string} */
5462 chrome.system.display.DisplayInfo.prototype.id;
5465 /** @type {string} */
5466 chrome.system.display.DisplayInfo.prototype.name;
5469 /** @type {string} */
5470 chrome.system.display.DisplayInfo.prototype.mirroringSourceId;
5473 /** @type {boolean} */
5474 chrome.system.display.DisplayInfo.prototype.isPrimary;
5477 /** @type {boolean} */
5478 chrome.system.display.DisplayInfo.prototype.isInternal;
5481 /** @type {boolean} */
5482 chrome.system.display.DisplayInfo.prototype.isEnabled;
5485 /** @type {number} */
5486 chrome.system.display.DisplayInfo.prototype.dpiX;
5489 /** @type {number} */
5490 chrome.system.display.DisplayInfo.prototype.dpiY;
5493 /** @type {number} */
5494 chrome.system.display.DisplayInfo.prototype.rotation;
5497 /** @type {!chrome.system.display.Bounds} */
5498 chrome.system.display.DisplayInfo.prototype.bounds;
5501 /** @type {!chrome.system.display.Insets} */
5502 chrome.system.display.DisplayInfo.prototype.overscan;
5505 /** @type {!chrome.system.display.Bounds} */
5506 chrome.system.display.DisplayInfo.prototype.workArea;
5510  * @typedef {{
5511  *   mirroringSourceId: (string|undefined),
5512  *   isPrimary: (boolean|undefined),
5513  *   overscan: (!chrome.system.display.Insets|undefined),
5514  *   rotation: (number|undefined),
5515  *   boundsOriginX: (number|undefined),
5516  *   boundsOriginY: (number|undefined)
5517  * }}
5518  */
5519 chrome.system.display.SettableDisplayInfo;
5522 chrome.types = {};
5526  * @typedef {?{
5527  *   format: (string|undefined),
5528  *   quality: (number|undefined)
5529  * }}
5530  */
5531 chrome.types.ImageDetails;
5535  * @param {function(!Array.<!chrome.system.display.DisplayInfo>)}
5536  *     callback Called with an array of objects representing display info.
5537  */
5538 chrome.system.display.getInfo = function(callback) {};
5542  * @param {string} id The display's unique identifier.
5543  * @param {!chrome.system.display.SettableDisplayInfo} info The information
5544  *     about display properties that should be changed.
5545  * @param {function()=} opt_callback The callback to execute when the display
5546  *     info has been changed.
5547  */
5548 chrome.system.display.setDisplayProperties =
5549     function(id, info, opt_callback) {};
5553  * @const
5554  * @see https://developer.chrome.com/extensions/types.html
5555  */
5556 chrome.chromeSetting = {};
5559 /** @type {!ChromeEvent} */
5560 chrome.chromeSetting.onChange;
5564  * @const
5565  * @see https://developer.chrome.com/extensions/webNavigation.html
5566  */
5567 chrome.webNavigation = {};
5571  * @param {Object} details Object with a 'tabId' (number) key.
5572  * @param {function(!Array.<Object.<string, (boolean|number|string)>>)} callback
5573  *     Callback function.
5574  */
5575 chrome.webNavigation.getAllFrames = function(details, callback) {};
5579  * @param {Object} details Object with 'tabId' (number) and 'frameId' (number)
5580  *     keys.
5581  * @param {function(Object.<string, (boolean|string)>)} callback
5582  *     Callback function.
5583  */
5584 chrome.webNavigation.getFrame = function(details, callback) {};
5587 /** @type {!ChromeEvent} */
5588 chrome.webNavigation.onBeforeNavigate;
5591 /** @type {!ChromeEvent} */
5592 chrome.webNavigation.onCommitted;
5595 /** @type {!ChromeEvent} */
5596 chrome.webNavigation.onDOMContentLoaded;
5599 /** @type {!ChromeEvent} */
5600 chrome.webNavigation.onCompleted;
5603 /** @type {!ChromeEvent} */
5604 chrome.webNavigation.onErrorOccurred;
5607 /** @type {!ChromeEvent} */
5608 chrome.webNavigation.onCreatedNavigationTarget;
5611 /** @type {!ChromeEvent} */
5612 chrome.webNavigation.onReferenceFragmentUpdated;
5615 /** @type {!ChromeEvent} */
5616 chrome.webNavigation.onTabReplaced;
5619 /** @type {!ChromeEvent} */
5620 chrome.webNavigation.onHistoryStateUpdated;
5625  * Most event listeners for WebRequest take extra arguments.
5626  * @see https://developer.chrome.com/extensions/webRequest.html.
5627  * @constructor
5628  */
5629 function WebRequestEvent() {}
5633  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
5634  *     function.
5635  * @param {!RequestFilter} filter A set of filters that restrict
5636  *     the events that will be sent to this listener.
5637  * @param {Array.<string>=} opt_extraInfoSpec Array of extra information
5638  *     that should be passed to the listener function.
5639  */
5640 WebRequestEvent.prototype.addListener =
5641     function(listener, filter, opt_extraInfoSpec) {};
5645  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
5646  *     function.
5647  */
5648 WebRequestEvent.prototype.removeListener = function(listener) {};
5652  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
5653  *     function.
5654  */
5655 WebRequestEvent.prototype.hasListener = function(listener) {};
5659  * @param {function(!Object): (void|!BlockingResponse)} listener Listener
5660  *     function.
5661  */
5662 WebRequestEvent.prototype.hasListeners = function(listener) {};
5667  * The onErrorOccurred event takes one less parameter than the others.
5668  * @see https://developer.chrome.com/extensions/webRequest.html.
5669  * @constructor
5670  */
5671 function WebRequestOnErrorOccurredEvent() {}
5675  * @param {function(!Object): void} listener Listener function.
5676  * @param {!RequestFilter} filter A set of filters that restrict
5677  *     the events that will be sent to this listener.
5678  */
5679 WebRequestOnErrorOccurredEvent.prototype.addListener =
5680     function(listener, filter) {};
5684  * @param {function(!Object): void} listener Listener function.
5685  */
5686 WebRequestOnErrorOccurredEvent.prototype.removeListener = function(listener) {};
5690  * @param {function(!Object): void} listener Listener function.
5691  */
5692 WebRequestOnErrorOccurredEvent.prototype.hasListener = function(listener) {};
5696  * @param {function(!Object): void} listener Listener function.
5697  */
5698 WebRequestOnErrorOccurredEvent.prototype.hasListeners = function(listener) {};
5702  * @const
5703  * @see https://developer.chrome.com/extensions/webRequest.html
5704  */
5705 chrome.webRequest = {};
5709  * @param {function(): void=} opt_callback Callback function.
5710  */
5711 chrome.webRequest.handlerBehaviorChanged = function(opt_callback) {};
5714 /** @type {!WebRequestEvent} */
5715 chrome.webRequest.onAuthRequired;
5718 /** @type {!WebRequestEvent} */
5719 chrome.webRequest.onBeforeRedirect;
5722 /** @type {!WebRequestEvent} */
5723 chrome.webRequest.onBeforeRequest;
5726 /** @type {!WebRequestEvent} */
5727 chrome.webRequest.onBeforeSendHeaders;
5730 /** @type {!WebRequestEvent} */
5731 chrome.webRequest.onCompleted;
5734 /** @type {!WebRequestOnErrorOccurredEvent} */
5735 chrome.webRequest.onErrorOccurred;
5738 /** @type {!WebRequestEvent} */
5739 chrome.webRequest.onHeadersReceived;
5742 /** @type {!WebRequestEvent} */
5743 chrome.webRequest.onResponseStarted;
5746 /** @type {!WebRequestEvent} */
5747 chrome.webRequest.onSendHeaders;
5750 // Classes
5754 /**onKeyEvent
5755  * @see https://developer.chrome.com/extensions/management.html
5756  * @constructor
5757  */
5758 function ExtensionInfo() {}
5761 /** @type {string} */
5762 ExtensionInfo.prototype.id;
5765 /** @type {string} */
5766 ExtensionInfo.prototype.name;
5769 /** @type {string} */
5770 ExtensionInfo.prototype.shortName;
5773 /** @type {string} */
5774 ExtensionInfo.prototype.description;
5777 /** @type {string} */
5778 ExtensionInfo.prototype.version;
5781 /** @type {boolean} */
5782 ExtensionInfo.prototype.mayDisable;
5785 /** @type {boolean} */
5786 ExtensionInfo.prototype.enabled;
5789 /** @type {string|undefined} */
5790 ExtensionInfo.prototype.disabledReason;
5793 /** @type {boolean} */
5794 ExtensionInfo.prototype.isApp;
5797 /** @type {string} */
5798 ExtensionInfo.prototype.type;
5801 /** @type {string|undefined} */
5802 ExtensionInfo.prototype.appLaunchUrl;
5805 /** @type {string|undefined} */
5806 ExtensionInfo.prototype.homepageUrl;
5809 /** @type {string|undefined} */
5810 ExtensionInfo.prototype.updateUrl;
5813 /** @type {boolean} */
5814 ExtensionInfo.prototype.offlineEnabled;
5817 /** @type {string} */
5818 ExtensionInfo.prototype.optionsUrl;
5821 /** @type {!Array.<!IconInfo>|undefined} */
5822 ExtensionInfo.prototype.icons;
5825 /** @type {!Array.<string>} */
5826 ExtensionInfo.prototype.permissions;
5829 /** @type {!Array.<string>} */
5830 ExtensionInfo.prototype.hostPermissions;
5833 /** @type {string} */
5834 ExtensionInfo.prototype.installType;
5837 /** @type {string|undefined} */
5838 ExtensionInfo.prototype.launchType;
5841 /** @type {!Array.<string>|undefined} */
5842 ExtensionInfo.prototype.availableLaunchTypes;
5847  * @see https://developer.chrome.com/extensions/management.html
5848  * @constructor
5849  */
5850 function IconInfo() {}
5853 /** @type {number} */
5854 IconInfo.prototype.size;
5857 /** @type {string} */
5858 IconInfo.prototype.url;
5863  * @see https://developer.chrome.com/extensions/tabs
5864  * @constructor
5865  */
5866 function Tab() {}
5869 // TODO: Make this field optional once dependent projects have been updated.
5871  * @type {number}
5872  */
5873 Tab.prototype.id;
5876 /** @type {number} */
5877 Tab.prototype.index;
5880 /** @type {number} */
5881 Tab.prototype.windowId;
5884 // TODO: Make this field optional once dependent projects have been updated.
5886  * @type {number}
5887  */
5888 Tab.prototype.openerTabId;
5891 /** @type {boolean} */
5892 Tab.prototype.highlighted;
5895 /** @type {boolean} */
5896 Tab.prototype.active;
5899 /** @type {boolean} */
5900 Tab.prototype.pinned;
5903 // TODO: Make this field optional once dependent projects have been updated.
5905  * @type {string}
5906  */
5907 Tab.prototype.url;
5910 // TODO: Make this field optional once dependent projects have been updated.
5912  * @type {string}
5913  */
5914 Tab.prototype.title;
5917 // TODO: Make this field optional once dependent projects have been updated.
5919  * @type {string}
5920  */
5921 Tab.prototype.favIconUrl;
5924 // TODO: Make this field optional once dependent projects have been updated.
5926  * @type {string}
5927  */
5928 Tab.prototype.status;
5931 /** @type {boolean} */
5932 Tab.prototype.incognito;
5935 /** @type {number|undefined} */
5936 Tab.prototype.width;
5939 /** @type {number|undefined} */
5940 Tab.prototype.height;
5943 /** @type {number|undefined} */
5944 Tab.prototype.sessionId;
5949  * @see https://developer.chrome.com/extensions/windows.html
5950  * @constructor
5951  */
5952 function ChromeWindow() {}
5955 /** @type {number} */
5956 ChromeWindow.prototype.id;
5959 /** @type {boolean} */
5960 ChromeWindow.prototype.focused;
5963 /** @type {number} */
5964 ChromeWindow.prototype.top;
5967 /** @type {number} */
5968 ChromeWindow.prototype.left;
5971 /** @type {number} */
5972 ChromeWindow.prototype.width;
5975 /** @type {number} */
5976 ChromeWindow.prototype.height;
5979 /** @type {Array.<Tab>} */
5980 ChromeWindow.prototype.tabs;
5983 /** @type {boolean} */
5984 ChromeWindow.prototype.incognito;
5987 /** @type {string} */
5988 ChromeWindow.prototype.type;
5991 /** @type {string} */
5992 ChromeWindow.prototype.state;
5995 /** @type {boolean} */
5996 ChromeWindow.prototype.alwaysOnTop;
6001  * @see https://developer.chrome.com/extensions/events.html
6002  * @constructor
6003  */
6004 function ChromeEvent() {}
6007 /** @param {!Function} callback */
6008 ChromeEvent.prototype.addListener = function(callback) {};
6011 /** @param {!Function} callback */
6012 ChromeEvent.prototype.removeListener = function(callback) {};
6016  * @param {!Function} callback
6017  * @return {boolean}
6018  */
6019 ChromeEvent.prototype.hasListener = function(callback) {};
6022 /** @return {boolean} */
6023 ChromeEvent.prototype.hasListeners = function() {};
6028  * Event whose listeners take a string parameter.
6029  * @constructor
6030  */
6031 function ChromeStringEvent() {}
6034 /** @param {function(string): void} callback */
6035 ChromeStringEvent.prototype.addListener = function(callback) {};
6038 /** @param {function(string): void} callback */
6039 ChromeStringEvent.prototype.removeListener = function(callback) {};
6043  * @param {function(string): void} callback
6044  * @return {boolean}
6045  */
6046 ChromeStringEvent.prototype.hasListener = function(callback) {};
6049 /** @return {boolean} */
6050 ChromeStringEvent.prototype.hasListeners = function() {};
6055  * Event whose listeners take a boolean parameter.
6056  * @constructor
6057  */
6059 function ChromeBooleanEvent() {}
6063  * @param {function(boolean): void} callback
6064  */
6065 ChromeBooleanEvent.prototype.addListener = function(callback) {};
6069  * @param {function(boolean): void} callback
6070  */
6071 ChromeBooleanEvent.prototype.removeListener = function(callback) {};
6075  * @param {function(boolean): void} callback
6076  * @return {boolean}
6077  */
6078 ChromeBooleanEvent.prototype.hasListener = function(callback) {};
6082  * @return {boolean}
6083  */
6084 ChromeBooleanEvent.prototype.hasListeners = function() {};
6089  * Event whose listeners take a number parameter.
6090  * @constructor
6091  */
6093 function ChromeNumberEvent() {}
6097  * @param {function(number): void} callback
6098  */
6099 ChromeNumberEvent.prototype.addListener = function(callback) {};
6103  * @param {function(number): void} callback
6104  */
6105 ChromeNumberEvent.prototype.removeListener = function(callback) {};
6109  * @param {function(number): void} callback
6110  * @return {boolean}
6111  */
6112 ChromeNumberEvent.prototype.hasListener = function(callback) {};
6116  * @return {boolean}
6117  */
6118 ChromeNumberEvent.prototype.hasListeners = function() {};
6123  * Event whose listeners take an Object parameter.
6124  * @constructor
6125  */
6126 function ChromeObjectEvent() {}
6130  * @param {function(!Object): void} callback Callback.
6131  */
6132 ChromeObjectEvent.prototype.addListener = function(callback) {};
6136  * @param {function(!Object): void} callback Callback.
6137  */
6138 ChromeObjectEvent.prototype.removeListener = function(callback) {};
6142  * @param {function(!Object): void} callback Callback.
6143  * @return {boolean}
6144  */
6145 ChromeObjectEvent.prototype.hasListener = function(callback) {};
6149  * @return {boolean}
6150  */
6151 ChromeObjectEvent.prototype.hasListeners = function() {};
6156  * Event whose listeners take an ExtensionInfo parameter.
6157  * @constructor
6158  */
6159 function ChromeExtensionInfoEvent() {}
6162 /** @param {function(!ExtensionInfo): void} callback */
6163 ChromeExtensionInfoEvent.prototype.addListener = function(callback) {};
6166 /** @param {function(!ExtensionInfo): void} callback */
6167 ChromeExtensionInfoEvent.prototype.removeListener = function(callback) {};
6171  * @param {function(!ExtensionInfo): void} callback
6172  * @return {boolean}
6173  */
6174 ChromeExtensionInfoEvent.prototype.hasListener = function(callback) {};
6177 /** @return {boolean} */
6178 ChromeExtensionInfoEvent.prototype.hasListeners = function() {};
6183  * Event whose listeners take a string array parameter.
6184  * @constructor
6185  */
6186 function ChromeStringArrayEvent() {}
6189 /** @param {function(!Array.<string>): void} callback */
6190 ChromeStringArrayEvent.prototype.addListener = function(callback) {};
6193 /** @param {function(!Array.<string>): void} callback */
6194 ChromeStringArrayEvent.prototype.removeListener = function(callback) {};
6198  * @param {function(!Array.<string>): void} callback
6199  * @return {boolean}
6200  */
6201 ChromeStringArrayEvent.prototype.hasListener = function(callback) {};
6204 /** @return {boolean} */
6205 ChromeStringArrayEvent.prototype.hasListeners = function() {};
6210  * Event whose listeners take two strings as parameters.
6211  * @constructor
6212  */
6213 function ChromeStringStringEvent() {}
6216 /** @param {function(string, string): void} callback */
6217 ChromeStringStringEvent.prototype.addListener = function(callback) {};
6220 /** @param {function(string, string): void} callback */
6221 ChromeStringStringEvent.prototype.removeListener = function(callback) {};
6225  * @param {function(string, string): void} callback
6226  * @return {boolean}
6227  */
6228 ChromeStringStringEvent.prototype.hasListener = function(callback) {};
6231 /** @return {boolean} */
6232 ChromeStringStringEvent.prototype.hasListeners = function() {};
6236  * @see http://developer.chrome.com/extensions/pushMessaging.html
6237  * @const
6238  */
6239 chrome.pushMessaging = {};
6243  * @type {!chrome.pushMessaging.PushMessageEvent}
6244  */
6245 chrome.pushMessaging.onMessage;
6249  * @param {boolean|function(!chrome.pushMessaging.ChannelIdResult)}
6250  *     interactiveOrCallback Either a flag(optional), if set to true, user will
6251  *     be asked to log in if they are not already logged in, or, when he flag is
6252  *     not given, the callback.
6253  * @param {function(!chrome.pushMessaging.ChannelIdResult)=} opt_callback
6254  *     Callback.
6255  */
6256 chrome.pushMessaging.getChannelId =
6257     function(interactiveOrCallback, opt_callback) {};
6262  * Event whose listeners take a chrome.pushMessaging.Message parameter.
6263  * @constructor
6264  */
6265 chrome.pushMessaging.PushMessageEvent = function() {};
6269  * @param {function(!chrome.pushMessaging.Message): void} callback
6270  */
6271 chrome.pushMessaging.PushMessageEvent.prototype.addListener =
6272     function(callback) {};
6276  * @param {function(!chrome.pushMessaging.Message): void} callback
6277  */
6278 chrome.pushMessaging.PushMessageEvent.prototype.removeListener =
6279     function(callback) {};
6283  * @param {function(!chrome.pushMessaging.Message): void} callback
6284  * @return {boolean}
6285  */
6286 chrome.pushMessaging.PushMessageEvent.prototype.hasListener =
6287     function(callback) {};
6291  * @return {boolean}
6292  */
6293 chrome.pushMessaging.PushMessageEvent.prototype.hasListeners = function() {};
6298  * @see http://developer.chrome.com/apps/runtime.html#type-Port
6299  * @constructor
6300  */
6301 function Port() {}
6304 /** @type {string} */
6305 Port.prototype.name;
6308 /** @type {!ChromeEvent} */
6309 Port.prototype.onDisconnect;
6312 /** @type {!ChromeEvent} */
6313 Port.prototype.onMessage;
6316 /** @type {MessageSender} */
6317 Port.prototype.sender;
6321  * @param {Object.<string>} obj Message object.
6322  */
6323 Port.prototype.postMessage = function(obj) {};
6327  * Note: as of 2012-04-12, this function is no longer documented on
6328  * the public web pages, but there are still existing usages.
6329  */
6330 Port.prototype.disconnect = function() {};
6335  * @see http://developer.chrome.com/extensions/runtime.html#type-MessageSender
6336  * @constructor
6337  */
6338 function MessageSender() {}
6341 /** @type {!Tab|undefined} */
6342 MessageSender.prototype.tab;
6345 /** @type {string|undefined} */
6346 MessageSender.prototype.id;
6349 /** @type {string|undefined} */
6350 MessageSender.prototype.url;
6353 /** @type {string|undefined} */
6354 MessageSender.prototype.tlsChannelId;
6359  * @see https://developer.chrome.com/extensions/bookmarks.html#type-BookmarkTreeNode
6360  * @constructor
6361  */
6362 function BookmarkTreeNode() {}
6365 /** @type {string} */
6366 BookmarkTreeNode.prototype.id;
6369 /** @type {string|undefined} */
6370 BookmarkTreeNode.prototype.parentId;
6373 /** @type {number|undefined} */
6374 BookmarkTreeNode.prototype.index;
6377 /** @type {string|undefined} */
6378 BookmarkTreeNode.prototype.url;
6381 /** @type {string} */
6382 BookmarkTreeNode.prototype.title;
6385 /** @type {number|undefined} */
6386 BookmarkTreeNode.prototype.dateAdded;
6389 /** @type {number|undefined} */
6390 BookmarkTreeNode.prototype.dateGroupModified;
6393 /** @type {string|undefined} */
6394 BookmarkTreeNode.prototype.unmodifiable;
6397 /** @type {!Array.<!BookmarkTreeNode>|undefined} */
6398 BookmarkTreeNode.prototype.children;
6403  * @see https://developer.chrome.com/extensions/dev/cookies.html#type-Cookie
6404  * @constructor
6405  */
6406 function Cookie() {}
6409 /** @type {string} */
6410 Cookie.prototype.name;
6413 /** @type {string} */
6414 Cookie.prototype.value;
6417 /** @type {string} */
6418 Cookie.prototype.domain;
6421 /** @type {boolean} */
6422 Cookie.prototype.hostOnly;
6425 /** @type {string} */
6426 Cookie.prototype.path;
6429 /** @type {boolean} */
6430 Cookie.prototype.secure;
6433 /** @type {boolean} */
6434 Cookie.prototype.httpOnly;
6437 /** @type {boolean} */
6438 Cookie.prototype.session;
6441 /** @type {number} */
6442 Cookie.prototype.expirationDate;
6445 /** @type {string} */
6446 Cookie.prototype.storeId;
6451  * @see https://developer.chrome.com/extensions/dev/cookies.html#type-CookieStore
6452  * @constructor
6453  */
6454 function CookieStore() {}
6457 /** @type {string} */
6458 CookieStore.prototype.id;
6461 /** @type {Array.<number>} */
6462 CookieStore.prototype.tabIds;
6467  * @see https://developer.chrome.com/extensions/dev/contextMenus.html#type-OnClickData
6468  * @constructor
6469  */
6470 function OnClickData() {}
6473 /** @type {number} */
6474 OnClickData.prototype.menuItemId;
6477 /** @type {number} */
6478 OnClickData.prototype.parentMenuItemId;
6481 /** @type {string} */
6482 OnClickData.prototype.mediaType;
6485 /** @type {string} */
6486 OnClickData.prototype.linkUrl;
6489 /** @type {string} */
6490 OnClickData.prototype.srcUrl;
6493 /** @type {string} */
6494 OnClickData.prototype.pageUrl;
6497 /** @type {string} */
6498 OnClickData.prototype.frameUrl;
6501 /** @type {string} */
6502 OnClickData.prototype.selectionText;
6505 /** @type {string} */
6506 OnClickData.prototype.editable;
6511  * @see https://developer.chrome.com/extensions/debugger.html#type-Debuggee
6512  * @constructor
6513  */
6514 function Debuggee() {}
6517 /** @type {number} */
6518 Debuggee.prototype.tabId;
6523  * @see https://developer.chrome.com/extensions/contentSettings.html#type-ResourceIdentifier
6524  * @constructor
6525  */
6526 function ResourceIdentifier() {}
6529 /** @type {string} */
6530 ResourceIdentifier.prototype.id;
6533 /** @type {string} */
6534 ResourceIdentifier.prototype.description;
6539  * @see https://developer.chrome.com/extensions/contentSettings.html#type-ContentSetting
6540  * @constructor
6541  */
6542 function ContentSetting() {}
6546  * @param {!Object.<string,string>} details Settings details.
6547  * @param {function(): void=} opt_callback Callback function.
6548  */
6549 ContentSetting.prototype.clear = function(details, opt_callback) {};
6553  * @param {!Object.<string,(string|boolean|ResourceIdentifier)>} details
6554  *     Settings details.
6555  * @param {function(): void} callback Callback function.
6556  */
6557 ContentSetting.prototype.get = function(details, callback) {};
6561  * @param {function(): void} callback Callback function.
6562  */
6563 ContentSetting.prototype.getResourceIdentifiers = function(callback) {};
6567  * @param {!Object.<string,(string|ResourceIdentifier)>} details
6568  *     Settings details.
6569  * @param {function(): void=} opt_callback Callback function.
6570  */
6571 ContentSetting.prototype.set = function(details, opt_callback) {};
6576  * @see https://developer.chrome.com/extensions/history.html#type-HistoryItem
6577  * @constructor
6578  */
6579 function HistoryItem() {}
6582 /** @type {string} */
6583 HistoryItem.prototype.id;
6586 /** @type {string} */
6587 HistoryItem.prototype.url;
6590 /** @type {string} */
6591 HistoryItem.prototype.title;
6594 /** @type {number} */
6595 HistoryItem.prototype.lastVisitTime;
6598 /** @type {number} */
6599 HistoryItem.prototype.visitCount;
6602 /** @type {number} */
6603 HistoryItem.prototype.typedCount;
6608  * @see https://developer.chrome.com/extensions/history.html#type-VisitItem
6609  * @constructor
6610  */
6611 function VisitItem() {}
6614 /** @type {string} */
6615 VisitItem.prototype.id;
6618 /** @type {string} */
6619 VisitItem.prototype.visitId;
6622 /** @type {number} */
6623 VisitItem.prototype.visitTime;
6626 /** @type {string} */
6627 VisitItem.prototype.referringVisitId;
6630 /** @type {string} */
6631 VisitItem.prototype.transition;
6636  * @see https://developer.chrome.com/extensions/fileBrowserHandler.html#type-FileHandlerExecuteEventDetails
6637  * @constructor
6638  */
6639 function FileHandlerExecuteEventDetails() {}
6642 /** @type {!Array.<!FileEntry>} */
6643 FileHandlerExecuteEventDetails.prototype.entries;
6646 /** @type {number|undefined} */
6647 FileHandlerExecuteEventDetails.prototype.tab_id;
6652  * @see https://developer.chrome.com/extensions/input.ime.html#type-KeyboardEvent
6653  * @constructor
6654  */
6655 function ChromeKeyboardEvent() {}
6658 /** @type {string} */
6659 ChromeKeyboardEvent.prototype.type;
6662 /** @type {string} */
6663 ChromeKeyboardEvent.prototype.requestId;
6666 /** @type {string|undefined} */
6667 ChromeKeyboardEvent.prototype.extensionId;
6670 /** @type {string} */
6671 ChromeKeyboardEvent.prototype.key;
6674 /** @type {string} */
6675 ChromeKeyboardEvent.prototype.code;
6678 /** @type {number|undefined} */
6679 ChromeKeyboardEvent.prototype.keyCode;
6682 /** @type {boolean|undefined} */
6683 ChromeKeyboardEvent.prototype.altKey;
6686 /** @type {boolean|undefined} */
6687 ChromeKeyboardEvent.prototype.ctrlKey;
6690 /** @type {boolean|undefined} */
6691 ChromeKeyboardEvent.prototype.shiftKey;
6694 /** @type {boolean|undefined} */
6695 ChromeKeyboardEvent.prototype.capsLock;
6700  * @see https://developer.chrome.com/extensions/input.ime.html#type-InputContext
6701  * @constructor
6702  */
6703 function InputContext() {}
6706 /** @type {number} */
6707 InputContext.prototype.contextID;
6710 /** @type {string} */
6711 InputContext.prototype.type;
6716  * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyServer
6717  * @constructor
6718  */
6719 function ProxyServer() {}
6722 /** @type {string} */
6723 ProxyServer.prototype.scheme;
6726 /** @type {string} */
6727 ProxyServer.prototype.host;
6730 /** @type {number} */
6731 ProxyServer.prototype.port;
6736  * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyRules
6737  * @constructor
6738  */
6739 function ProxyRules() {}
6742 /** @type {ProxyServer} */
6743 ProxyRules.prototype.singleProxy;
6746 /** @type {ProxyServer} */
6747 ProxyRules.prototype.proxyForHttp;
6750 /** @type {ProxyServer} */
6751 ProxyRules.prototype.proxyForHttps;
6754 /** @type {ProxyServer} */
6755 ProxyRules.prototype.proxyForFtp;
6758 /** @type {ProxyServer} */
6759 ProxyRules.prototype.fallbackProxy;
6762 /** @type {!Array.<string>} */
6763 ProxyRules.prototype.bypassList;
6768  * @see https://developer.chrome.com/extensions/proxy.html#type-PacScript
6769  * @constructor
6770  */
6771 function PacScript() {}
6774 /** @type {string} */
6775 PacScript.prototype.url;
6778 /** @type {string} */
6779 PacScript.prototype.data;
6782 /** @type {boolean} */
6783 PacScript.prototype.mandatory;
6788  * @see https://developer.chrome.com/extensions/proxy.html#type-ProxyConfig
6789  * @constructor
6790  */
6791 function ProxyConfig() {}
6794 /** @type {ProxyRules} */
6795 ProxyConfig.prototype.rules;
6798 /** @type {PacScript} */
6799 ProxyConfig.prototype.pacScript;
6802 /** @type {string} */
6803 ProxyConfig.prototype.mode;
6808  * The event listener for Storage receives an Object mapping each
6809  * key that changed to its corresponding StorageChange for that item.
6811  * @see https://developer.chrome.com/extensions/storage.html
6812  * @constructor
6813  */
6814 function StorageChangeEvent() {}
6818  * @param {function(!Object.<string, !StorageChange>, string)} callback
6819  *    Listener will receive an object that maps each key to its StorageChange,
6820  *    and the namespace ("sync" or "local") of the storage area the changes
6821  *    are for.
6822  */
6823 StorageChangeEvent.prototype.addListener = function(callback) {};
6826 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
6827 StorageChangeEvent.prototype.removeListener = function(callback) {};
6830 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
6831 StorageChangeEvent.prototype.hasListener = function(callback) {};
6834 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
6835 StorageChangeEvent.prototype.hasListeners = function(callback) {};
6840  * @see https://developer.chrome.com/extensions/storage.html#type-StorageChange
6841  * @constructor
6842  */
6843 function StorageChange() {}
6846 /** @type {?} */
6847 StorageChange.prototype.oldValue;
6850 /** @type {?} */
6851 StorageChange.prototype.newValue;
6856  * @see https://developer.chrome.com/extensions/storage.html#type-StorageArea
6857  * @constructor
6858  */
6859 function StorageArea() {}
6863  * Removes all items from storage.
6864  * @param {function(): void=} opt_callback Callback function.
6865  */
6866 StorageArea.prototype.clear = function(opt_callback) {};
6870  * @param {(string|!Array.<string>|!Object|null)=} opt_keys
6871  *    A single key to get, list of keys to get, or a dictionary
6872  *    specifying default values (see description of the
6873  *    object). An empty list or object will return an empty
6874  *    result object. Pass in null to get the entire contents of storage.
6875  * @param {function(Object)=} opt_callback Callback with storage items, or null
6876  *    on failure.
6877  */
6878 StorageArea.prototype.get = function(opt_keys, opt_callback) {};
6882  * @param {(string|!Array.<string>)} keys
6883  *    A single key or a list of keys for items to remove.
6884  * @param {function()=} opt_callback Callback.
6885  */
6886 StorageArea.prototype.remove = function(keys, opt_callback) {};
6890  * @param {!Object.<string>} keys
6891  *    Object specifying items to augment storage
6892  *    with. Values that cannot be serialized (functions, etc) will be ignored.
6893  * @param {function()=} opt_callback Callback.
6894  */
6895 StorageArea.prototype.set = function(keys, opt_callback) { };
6899  * @param {(string|!Array.<string>|null)=} opt_keys
6900  *    A single key or list of keys to get the total usage for. An empty list
6901  *    will return 0. Pass in null to get the total usage of all of storage.
6902  * @param {function(number)=} opt_callback
6903  *    Callback with the amount of space being used by storage.
6904  */
6905 StorageArea.prototype.getBytesInUse = function(opt_keys, opt_callback) { };
6910  * @see https://developer.chrome.com/extensions/types.html#type-ChromeSetting
6911  * @constructor
6912  */
6913 function ChromeSetting() {}
6917  * @param {Object} details Object with a 'scope' (string) key.
6918  * @param {function(): void=} opt_callback Callback function.
6919  */
6920 ChromeSetting.prototype.clear = function(details, opt_callback) {};
6924  * @param {Object} details Object with an 'incognito' (boolean) key.
6925  * @param {function(Object.<string, *>): void} callback Callback function.
6926  */
6927 ChromeSetting.prototype.get = function(details, callback) {};
6931  * @param {Object} details Object with a 'value' (*) key and an optional
6932  *     'scope' (string) key.
6933  * @param {function(): void=} opt_callback Callback function.
6934  */
6935 ChromeSetting.prototype.set = function(details, opt_callback) {};
6938 /** @type {!ChromeObjectEvent} */
6939 ChromeSetting.prototype.onChange;
6944  * @see https://developer.chrome.com/extensions/webRequest.html#type-RequestFilter
6945  * @constructor
6946  */
6947 function RequestFilter() {}
6950 /** @type {!Array.<string>} */
6951 RequestFilter.prototype.urls;
6954 /** @type {!Array.<string>} */
6955 RequestFilter.prototype.types;
6958 /** @type {number} */
6959 RequestFilter.prototype.tabId;
6962 /** @type {number} */
6963 RequestFilter.prototype.windowId;
6968  * @see https://developer.chrome.com/extensions/webRequest.html#type-HttpHeaders
6969  * @constructor
6970  */
6971 function HttpHeader() {}
6974 /** @type {string} */
6975 HttpHeader.prototype.name;
6978 /** @type {string} */
6979 HttpHeader.prototype.value;
6982 /** @type {!Array.<number>} */
6983 HttpHeader.prototype.binaryValue;
6987  * @see https://developer.chrome.com/extensions/webRequest.html#type-HttpHeaders
6988  * @typedef {Array.<!HttpHeader>}
6989  * @private
6990  */
6991 var HttpHeaders_;
6996  * @see https://developer.chrome.com/extensions/webRequest.html#type-BlockingResponse
6997  * @constructor
6998  */
6999 function BlockingResponse() {}
7002 /** @type {boolean} */
7003 BlockingResponse.prototype.cancel;
7006 /** @type {string} */
7007 BlockingResponse.prototype.redirectUrl;
7010 /** @type {!HttpHeaders_} */
7011 BlockingResponse.prototype.requestHeaders;
7014 /** @type {!HttpHeaders_} */
7015 BlockingResponse.prototype.responseHeaders;
7018 /** @type {Object.<string,string>} */
7019 BlockingResponse.prototype.authCredentials;
7024  * @see http://developer.chrome.com/extensions/pushMessaging.html#type-Message
7025  * @constructor
7026  */
7027 chrome.pushMessaging.Message = function() {};
7031  * @type {number}
7032  */
7033 chrome.pushMessaging.Message.prototype.subchannelId;
7037  * @type {string}
7038  */
7039 chrome.pushMessaging.Message.prototype.payload;
7044  * @see http://developer.chrome.com/extensions/pushMessaging.html#type-ChannelIdResult
7045  * @constructor
7046  */
7047 chrome.pushMessaging.ChannelIdResult = function() {};
7051  * @type {string}
7052  */
7053 chrome.pushMessaging.ChannelIdResult.prototype.channelId;
7057  * The {@code chrome.fileSystem} API makes use of the Entry and FileEntry types
7058  * defined in {@code javascript/externs/fileapi.js}.
7059  * @const
7060  * @see http://developer.chrome.com/apps/fileSystem.html
7061  */
7062 chrome.fileSystem = {};
7066  * @param {!Entry} entry The entry to get the display path for. The entry can
7067  *     originally be obtained through
7068  *     {@code chrome.fileSystem.chooseEntry} or
7069  *     {@code chrome.fileSystem.restoreEntry}.
7070  * @param {function(string)} callback A success callback.
7071  * @see http://developer.chrome.com/apps/fileSystem.html#method-getDisplayPath
7072  */
7073 chrome.fileSystem.getDisplayPath = function(entry, callback) {};
7077  * @param {!Entry} entry The entry to get a writable entry for.
7078  * @param {function(!Entry)} callback A success callback.
7079  * @see http://developer.chrome.com/apps/fileSystem.html#method-getWritableEntry
7080  */
7081 chrome.fileSystem.getWritableEntry = function(entry, callback) {};
7085  * @param {!Entry} entry The entry to query writability.
7086  * @param {function(boolean)} callback A success callback.
7087  * @see http://developer.chrome.com/apps/fileSystem.html#method-isWritableEntry
7088  */
7089 chrome.fileSystem.isWritableEntry = function(entry, callback) {};
7093  * @typedef {{
7094  *   description: (string|undefined),
7095  *   mimeTypes: (!Array.<string>|undefined),
7096  *   extensions: (!Array.<string>|undefined)
7097  * }}
7098  * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
7099  */
7100 chrome.fileSystem.AcceptsOption;
7104  * @typedef {{
7105  *   type: (string|undefined),
7106  *   suggestedName: (string|undefined),
7107  *   accepts: (!Array.<!chrome.fileSystem.AcceptsOption>|undefined),
7108  *   acceptsAllTypes: (boolean|undefined),
7109  *   acceptsMultiple: (boolean|undefined)
7110  * }}
7111  * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
7112  */
7113 chrome.fileSystem.ChooseEntryOptions;
7117  * @typedef {?{
7118  *   volumeId: string,
7119  *   writable: (boolean|undefined)
7120  * }}
7121  * @see http://developer.chrome.com/apps/fileSystem.html#method-requestFileSystem
7122  */
7123 chrome.fileSystem.RequestFileSystemOptions;
7127  * @see http://developer.chrome.com/apps/fileSystem.html#method-getVolumeList
7128  * @constructor
7129  */
7130 chrome.fileSystem.Volume = function() {};
7133 /** @type {string} */
7134 chrome.fileSystem.Volume.prototype.volumeId;
7137 /** @type {boolean} */
7138 chrome.fileSystem.Volume.prototype.writable;
7142  * @param {!chrome.fileSystem.ChooseEntryOptions|
7143  *     function(Entry=, !Array.<!FileEntry>=)} optionsOrCallback The
7144  *     options for the file prompt or the callback.
7145  * @param {function(Entry=, !Array.<!FileEntry>=)=} opt_callback A success
7146  *     callback, if arg1 is options.
7147  * @see http://developer.chrome.com/apps/fileSystem.html#method-chooseEntry
7148  */
7149 chrome.fileSystem.chooseEntry = function(optionsOrCallback, opt_callback) {};
7153  * @param {string} id The ID of the file entry to restore.
7154  * @param {function(!Entry)} callback A success callback.
7155  * @see http://developer.chrome.com/apps/fileSystem.html#method-restoreEntry
7156  */
7157 chrome.fileSystem.restoreEntry = function(id, callback) {};
7161  * @param {string} id The ID of the file entry to query restorability.
7162  * @param {function(boolean)} callback A success callback.
7163  * @see http://developer.chrome.com/apps/fileSystem.html#method-isRestorable
7164  */
7165 chrome.fileSystem.isRestorable = function(id, callback) {};
7169  * @param {!Entry} entry The entry to regain access to.
7170  * @return {string} The ID that can be passed to restoreEntry to regain access
7171  *     to the given file entry.
7172  * @see http://developer.chrome.com/apps/fileSystem.html#method-retainEntry
7173  */
7174 chrome.fileSystem.retainEntry = function(entry) {};
7178  * @param {!chrome.fileSystem.RequestFileSystemOptions} options Options for the
7179  *     request.
7180  * @param {function(!FileSystem=)} callback A completion callback with the file
7181  *     system in case of a success. Otherwise the error is passed as
7182  *     chrome.runtime.lastError.
7183  * @see http://developer.chrome.com/apps/fileSystem.html#method-requestFileSystem
7184  */
7185 chrome.fileSystem.requestFileSystem = function(options, callback) {};
7189  * @param {function(!Array<!chrome.fileSystem.Volume>=)} callback A completion
7190  *     callback with the file system list in case of a success. Otherwise the
7191  *     error is passed as chrome.runtime.lastError.
7192  * @see http://developer.chrome.com/apps/fileSystem.html#method-getVolumeList
7193  */
7194 chrome.fileSystem.getVolumeList = function(callback) {};
7198  * @const
7199  * @see https://developer.chrome.com/apps/syncFileSystem
7200  */
7201 chrome.syncFileSystem = {};
7205  * Returns a syncable filesystem backed by Google Drive. The returned
7206  * DOMFileSystem instance can be operated on in the same way as
7207  * the Temporary and Persistant file systems (see
7208  * http://www.w3.org/TR/file-system-api/), except that the filesystem
7209  * object returned for Sync FileSystem does NOT support directory
7210  * operations (yet). You can get a list of file entries by reading
7211  * the root directory (by creating a new DirectoryReader),
7212  * but cannot create a new directory in it.
7214  * <p>Calling this multiple times from the same app will return the same
7215  * handle to the same file system.
7217  * <p>Note this call can fail. For example, if the user is not signed in
7218  * to Chrome or if there is no network operation. To handle these errors
7219  * it is important chrome.runtime.lastError is checked in the callback.
7221  * @param {function(!FileSystem)} callback A callback type for
7222  *     requestFileSystem.
7223  * @see https://developer.chrome.com/apps/syncFileSystem#method-requestFileSystem
7224  */
7225 chrome.syncFileSystem.requestFileSystem = function(callback) {};
7229  * Sets the default conflict resolution policy for the 'syncable' file
7230  * storage for the app. By default it is set to 'last_write_win'.
7231  * When conflict resolution policy is set to 'last_write_win' conflicts
7232  * for existing files are automatically resolved next time the file is updated.
7233  * {@code callback} can be optionally given to know if the request has
7234  * succeeded or not.
7236  * @param {string} policy Any of 'last_write_win' or 'manual'
7237  * @param {function()=} opt_callback
7239  * @see https://developer.chrome.com/apps/syncFileSystem#method-setConflictResolutionPolicy
7240  */
7241 chrome.syncFileSystem.setConflictResolutionPolicy =
7242     function(policy, opt_callback) {};
7246  * Gets the current conflict resolution policy.
7248  * @param {function(string)} callback Accepting any of 'last_write_win'
7249  *     or 'manual'.
7250  * @see https://developer.chrome.com/apps/syncFileSystem#method-getConflictResolutionPolicy
7251  */
7252 chrome.syncFileSystem.getConflictResolutionPolicy = function(callback) {};
7256  * Returns the current usage and quota in bytes for the 'syncable' file
7257  * storage for the app.
7259  * @param {!FileSystem} fileSystem
7260  * @param {function(!Object)} callback Taking an object substantially similar
7261  *     to {@code {'usageBytes': number, quotaBytes: number}}.
7262  * @see https://developer.chrome.com/apps/syncFileSystem#method-getUsageAndQuota
7263  */
7264 chrome.syncFileSystem.getUsageAndQuota = function(fileSystem, callback) {};
7268  * Returns the FileStatus for the given fileEntry. The status value can be
7269  * 'synced', 'pending' or 'conflicting'. Note that 'conflicting' state only
7270  * happens when the service's conflict resolution policy is set to 'manual'.
7272  * @param {!Entry} fileEntry
7273  * @param {function(string)} callback Called with any of 'synced', 'pending'
7274  *     or 'conflicting'.
7276  * @see https://developer.chrome.com/apps/syncFileSystem#method-getFileStatus
7277  */
7278 chrome.syncFileSystem.getFileStatus = function(fileEntry, callback) {};
7282  * Returns each FileStatus for the given fileEntry array. Typically called
7283  * with the result from dirReader.readEntries().
7285  * @param {!Array.<!FileEntry>} fileEntries
7286  * @param {function(!Array.<!Object>)} callback Each object will look like:
7287  *     {@code {'fileEntry': Entry, 'status': string, 'error': string?}}.
7289  * @see https://developer.chrome.com/apps/syncFileSystem#method-getFileStatuses
7290  */
7291 chrome.syncFileSystem.getFileStatuses = function(fileEntries, callback) {};
7295  * Since Chrome 31.
7297  * <p>Returns the current sync backend status.
7299  * @param {function(string)} callback Arg is any of 'initializing', 'running',
7300  *     'authentication_required', 'temporary_unavailable', or 'disabled'.
7302  * @see https://developer.chrome.com/apps/syncFileSystem#method-getServiceStatus
7303  */
7304 chrome.syncFileSystem.getServiceStatus = function(callback) {};
7308  * Fired when an error or other status change has happened in the sync
7309  * backend (for example, when the sync is temporarily disabled due
7310  * to network or authentication error).
7312  * @type {!ChromeObjectEvent}
7314  * @see https://developer.chrome.com/apps/syncFileSystem#event-onServiceStatusChanged
7315  */
7316 chrome.syncFileSystem.onServiceStatusChanged;
7320  * Fired when a file has been updated by the background sync service.
7322  * @type {!ChromeObjectEvent}
7324  * @see https://developer.chrome.com/apps/syncFileSystem#event-onFileStatusChanged
7325  */
7326 chrome.syncFileSystem.onFileStatusChanged;
7330  * @const
7331  * @see http://developer.chrome.com/extensions/alarms.html
7332  */
7333 chrome.alarms = {};
7337  * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event
7338  * is fired. If there is another alarm with the same name (or no name if none is
7339  * specified), it will be cancelled and replaced by this alarm.
7340  * @param {string|!chrome.alarms.AlarmCreateInfo} nameOrAlarmCreateInfo Either
7341  *     the name to identify this alarm or the info used to create the alarm. If
7342  *     no name is passed, the empty string is used to identify the alarm.
7343  * @param {!chrome.alarms.AlarmCreateInfo=} opt_alarmInfo If a name was passed
7344  *     as arg1, the info used to create the alarm.
7345  * @see http://developer.chrome.com/extensions/alarms.html#method-create
7346  */
7347 chrome.alarms.create = function(nameOrAlarmCreateInfo, opt_alarmInfo) {};
7351  * Retrieves details about the specified alarm.
7352  * @param {string|function(!chrome.alarms.Alarm)} nameOrCallback The name
7353  *     of the alarm to get or the callback to invoke with the alarm. If no name
7354  *     is passed, the empty string is used to get the alarm.
7355  * @param {function(!chrome.alarms.Alarm)=} opt_callback If a name was passed
7356  *     as arg1, the callback to invoke with the alarm.
7357  * @see http://developer.chrome.com/extensions/alarms.html#method-get
7358  */
7359 chrome.alarms.get = function(nameOrCallback, opt_callback) {};
7363  * Gets an array of all the alarms.
7364  * @param {function(!Array.<!chrome.alarms.Alarm>)} callback
7365  * @see http://developer.chrome.com/extensions/alarms.html#method-getAll
7366  */
7367 chrome.alarms.getAll = function(callback) {};
7371  * Clears the alarm with the given name.
7372  * @param {string=} opt_name
7373  * @param {function(boolean)=} opt_callback A callback that will be called with
7374  *     a boolean for whether the alarm was cleared.
7375  * @see http://developer.chrome.com/extensions/alarms.html#method-clear
7376  */
7377 chrome.alarms.clear = function(opt_name, opt_callback) {};
7381  * Clears all alarms.
7382  * @param {function(boolean)=} opt_callback A callback that will be called with
7383  *     a boolean for whether the alarms were cleared.
7384  * @see http://developer.chrome.com/extensions/alarms.html#method-clearAll
7385  */
7386 chrome.alarms.clearAll = function(opt_callback) {};
7390  * Fired when an alarm has elapsed. Useful for event pages.
7391  * @type {!chrome.alarms.AlarmEvent}
7392  * @see http://developer.chrome.com/extensions/alarms.html#event-onAlarm
7393  */
7394 chrome.alarms.onAlarm;
7399  * @constructor
7400  */
7401 chrome.alarms.AlarmEvent = function() {};
7405  * @param {function(!chrome.alarms.Alarm): void} callback
7406  */
7407 chrome.alarms.AlarmEvent.prototype.addListener = function(callback) {};
7411  * @param {function(!chrome.alarms.Alarm): void} callback
7412  */
7413 chrome.alarms.AlarmEvent.prototype.removeListener = function(callback) {};
7417  * @param {function(!chrome.alarms.Alarm): void} callback
7418  * @return {boolean}
7419  */
7420 chrome.alarms.AlarmEvent.prototype.hasListener = function(callback) {};
7424  * @return {boolean}
7425  */
7426 chrome.alarms.AlarmEvent.prototype.hasListeners = function() {};
7431  * @interface
7432  * @see http://developer.chrome.com/extensions/alarms.html#type-Alarm
7433  */
7434 chrome.alarms.Alarm = function() {};
7438  * Name of this alarm.
7439  * @type {string}
7440  */
7441 chrome.alarms.Alarm.prototype.name;
7445  * Time at which this alarm was scheduled to fire, in milliseconds past the
7446  * epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been
7447  * delayed an arbitrary amount beyond this.
7448  * @type {number}
7449  */
7450 chrome.alarms.Alarm.prototype.scheduledTime;
7454  * If not null, the alarm is a repeating alarm and will fire again in
7455  * periodInMinutes minutes.
7456  * @type {?number}
7457  */
7458 chrome.alarms.Alarm.prototype.periodInMinutes;
7462  * @typedef {{
7463  *   when: (number|undefined),
7464  *   delayInMinutes: (number|undefined),
7465  *   periodInMinutes: (number|undefined)
7466  * }}
7467  * @see http://developer.chrome.com/extensions/alarms.html#method-create
7468  */
7469 chrome.alarms.AlarmCreateInfo;
7473  * @see https://developer.chrome.com/apps/hid
7474  * @const
7475  */
7476 chrome.hid = {};
7480  * @typedef {?{
7481  *   vendorId: number,
7482  *   productId: number
7483  * }}
7484  * @see https://developer.chrome.com/apps/hid#method-getDevices
7485  */
7486 chrome.hid.HidGetDevicesOptions;
7490  * @typedef {?{
7491  *   usagePage: number,
7492  *   usage: number,
7493  *   reportIds: !Array.<number>
7494  * }}
7495 * @see https://developer.chrome.com/apps/hid#method-getDevices
7497 chrome.hid.HidDeviceUsage;
7501  * @typedef {?{
7502  *   deviceId: number,
7503  *   vendorId: number,
7504  *   productId: number,
7505  *   collections: !Array.<!chrome.hid.HidDeviceUsage>,
7506  *   maxInputReportSize: number,
7507  *   maxOutputReportSize: number,
7508  *   maxFeatureReportSize: number
7509  * }}
7510 * @see https://developer.chrome.com/apps/hid#method-getDevices
7512 chrome.hid.HidDeviceInfo;
7516  * @typedef {?{
7517  *   connectionId: number
7518  * }}
7519  * @see https://developer.chrome.com/apps/hid#method-connect
7520  */
7521 chrome.hid.HidConnectInfo;
7525  * @see https://developer.chrome.com/apps/hid#method-getDevices
7526  * Enumerates all the connected HID devices specified by the
7527  * vendorId/productId/interfaceId tuple.
7528  * @param {!chrome.hid.HidGetDevicesOptions} options The properties to search
7529  *     for on target devices.
7530  * @param {function(!Array.<!Object>)} callback Invoked with a list of
7531  *     |HidDeviceInfo|s on complete.
7532  */
7533 chrome.hid.getDevices = function(options, callback) {};
7537  * @see https://developer.chrome.com/apps/hid#method-connect
7538  * Opens a connection to a HID device for communication.
7539  * @param {number} deviceId The ID of the device to open.
7540  * @param {function(!Object=)} callback Invoked with an |HidConnectInfo| if the
7541  *     connection succeeds, or undefined if it fails.
7542  */
7543 chrome.hid.connect = function(deviceId, callback) {};
7547  * @see https://developer.chrome.com/apps/hid#method-disconnect
7548  * Disconnects from a device.
7549  * @param {number} connectionId The connection to close.
7550  * @param {function()=} opt_callback The callback to invoke once the connection
7551  *     is closed.
7552  */
7553 chrome.hid.disconnect = function(connectionId, opt_callback) {};
7557  * @see https://developer.chrome.com/apps/hid#method-receive
7558  * Receives an input report from an HID device.
7559  * @param {number} connectionId The connection from which to receive the report.
7560  * @param {function(number, !ArrayBuffer)} callback The callback to invoke with
7561  *     the received report.
7562  */
7563 chrome.hid.receive = function(connectionId, callback) {};
7567  * @see https://developer.chrome.com/apps/hid#method-send
7568  * Sends an output report to an HID device.
7569  * @param {number} connectionId The connection to which to send the report.
7570  * @param {number} reportId The report ID to use, or 0 if none.
7571  * @param {!ArrayBuffer} data The report data.
7572  * @param {function()} callback The callback to invoke once the write is
7573  *     finished.
7574  */
7575 chrome.hid.send = function(connectionId, reportId, data, callback) {};
7579  * @see https://developer.chrome.com/apps/hid#method-receiveFeatureReport
7580  * Receives a feature report from the device.
7581  * @param {number} connectionId The connection from which to read the feature
7582  *     report.
7583  * @param {number} reportId The report ID to use, or 0 if none.
7584  * @param {number} size The size of the feature report to receive.
7585  * @param {function(!ArrayBuffer)} callback The callback to invoke with the
7586  *     received report.
7587  */
7588 chrome.hid.receiveFeatureReport =
7589     function(connectionId, reportId, size, callback) {};
7593  * @see https://developer.chrome.com/apps/hid#method-sendFeatureReport
7594  * Sends a feature report to the device.
7595  * @param {number} connectionId The connection to which to send the feature
7596  *     report.
7597  * @param {number} reportId The report ID to use, or 0 if none.
7598  * @param {!ArrayBuffer} data The report data.
7599  * @param {function()} callback The callback to invoke once the write is
7600  *     finished.
7601  */
7602 chrome.hid.sendFeatureReport =
7603     function(connectionId, reportId, data, callback) {};
7607  * @see http://developer.chrome.com/extensions/notifications.html
7608  * @const
7609  */
7610 chrome.notifications = {};
7614  * @typedef {{
7615  *   title: string,
7616  *   iconUrl: (string|undefined)
7617  * }}
7618  * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
7619  */
7620 chrome.notifications.NotificationButton;
7624  * @typedef {{
7625  *   title: string,
7626  *   message: string
7627  * }}
7628  * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
7629  */
7630 chrome.notifications.NotificationItem;
7634  * @typedef {{
7635  *   type: (string|undefined),
7636  *   iconUrl: (string|undefined),
7637  *   title: (string|undefined),
7638  *   message: (string|undefined),
7639  *   contextMessage: (string|undefined),
7640  *   priority: (number|undefined),
7641  *   eventTime: (number|undefined),
7642  *   buttons: (!Array.<!chrome.notifications.NotificationButton>|undefined),
7643  *   imageUrl: (string|undefined),
7644  *   items: (!Array.<!chrome.notifications.NotificationItem>|undefined),
7645  *   progress: (number|undefined),
7646  *   isClickable: (boolean|undefined)
7647  * }}
7648  * @see http://developer.chrome.com/extensions/notifications.html#type-NotificationOptions
7649  */
7650 chrome.notifications.NotificationOptions;
7654  * @typedef {function(boolean): void}
7655  * @see http://developer.chrome.com/extensions/notifications.html#method-update
7656  * @see http://developer.chrome.com/extensions/notifications.html#method-clear
7657  */
7658 chrome.notifications.BooleanCallback;
7662  * @typedef {function(!Object): void}
7663  * @see http://developer.chrome.com/extensions/notifications.html#method-getAll
7664  */
7665 chrome.notifications.ObjectCallback;
7669  * @typedef {function(string, boolean): void}
7670  * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
7671  */
7672 chrome.notifications.ClosedCallback;
7676  * @typedef {function(string, number): void}
7677  * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
7678  */
7679 chrome.notifications.ButtonCallback;
7683  * @param {string|!chrome.notifications.NotificationOptions}
7684  *     notificationIdOrOptions
7685  * @param {(!chrome.notifications.NotificationOptions|function(string): void)=}
7686  *     opt_optionsOrCallback
7687  * @param {(function(string): void)=} opt_callback
7688  * @see http://developer.chrome.com/extensions/notifications.html#method-create
7689  */
7690 chrome.notifications.create = function(notificationIdOrOptions,
7691     opt_optionsOrCallback, opt_callback) {};
7695  * @param {string} notificationId
7696  * @param {!chrome.notifications.NotificationOptions} options
7697  * @param {chrome.notifications.BooleanCallback=} opt_callback
7698  * @see http://developer.chrome.com/extensions/notifications.html#method-update
7699  */
7700 chrome.notifications.update =
7701     function(notificationId, options, opt_callback) {};
7705  * @param {string} notificationId
7706  * @param {!chrome.notifications.BooleanCallback=} opt_callback
7707  * @see http://developer.chrome.com/extensions/notifications.html#method-clear
7708  */
7709 chrome.notifications.clear = function(notificationId, opt_callback) {};
7713  * @see http://developer.chrome.com/extensions/notifications.html#method-getAll
7714  * @param {!chrome.notifications.ObjectCallback} callback
7715  */
7716 chrome.notifications.getAll = function(callback) {};
7720  * @see http://developer.chrome.com/extensions/notifications.html#method-getPermissionLevel
7721  * @param {function(string): void} callback takes 'granted' or 'denied'
7722  */
7723 chrome.notifications.getPermissionLevel = function(callback) {};
7727  * @type {!chrome.notifications.ClosedEvent}
7728  * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
7729  */
7730 chrome.notifications.onClosed;
7734  * The user clicked a non-button area of the notification. Callback receives a
7735  * notificationId.
7736  * @type {!ChromeStringEvent}
7737  * @see http://developer.chrome.com/extensions/notifications.html#event-onClicked
7738  */
7739 chrome.notifications.onClicked;
7743  * @type {!chrome.notifications.ButtonClickedEvent}
7744  * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
7745  */
7746 chrome.notifications.onButtonClicked;
7750  * Indicates permission level change. Callback should expect 'granted' or
7751  * 'denied'.
7752  * @type {!ChromeStringEvent}
7753  * @see http://developer.chrome.com/extensions/notifications.html#event-onPermissionLevelChanged
7754  */
7755 chrome.notifications.onPermissionLevelChanged;
7759  * @type {!ChromeEvent}
7760  * @see http://developer.chrome.com/extensions/notifications.html#event-onShowSettings
7761  */
7762 chrome.notifications.onShowSettings;
7767  * @interface
7768  * @see http://developer.chrome.com/extensions/notifications.html#event-onClosed
7769  */
7770 chrome.notifications.ClosedEvent = function() {};
7774  * @param {!chrome.notifications.ClosedCallback} callback
7775  */
7776 chrome.notifications.ClosedEvent.prototype.addListener = function(callback) {};
7780  * @param {!chrome.notifications.ClosedCallback} callback
7781  */
7782 chrome.notifications.ClosedEvent.prototype.removeListener =
7783     function(callback) {};
7787  * @param {!chrome.notifications.ClosedCallback} callback
7788  * @return {boolean}
7789  */
7790 chrome.notifications.ClosedEvent.prototype.hasListener = function(callback) {};
7794  * @return {boolean}
7795  */
7796 chrome.notifications.ClosedEvent.prototype.hasListeners = function() {};
7801  * @interface
7802  * @see http://developer.chrome.com/extensions/notifications.html#event-onButtonClicked
7803  */
7804 chrome.notifications.ButtonClickedEvent = function() {};
7808  * @param {!chrome.notifications.ButtonCallback} callback
7809  */
7810 chrome.notifications.ButtonClickedEvent.prototype.addListener =
7811     function(callback) {};
7815  * @param {!chrome.notifications.ButtonCallback} callback
7816  */
7817 chrome.notifications.ButtonClickedEvent.prototype.removeListener =
7818     function(callback) {};
7822  * @param {!chrome.notifications.ButtonCallback} callback
7823  * @return {boolean}
7824  */
7825 chrome.notifications.ButtonClickedEvent.prototype.hasListener =
7826     function(callback) {};
7830  * @return {boolean}
7831  */
7832 chrome.notifications.ButtonClickedEvent.prototype.hasListeners = function() {};
7836  * @const
7837  * @see http://developer.chrome.com/apps/system_storage.html
7838  */
7839 chrome.system.storage = {};
7843 /** @constructor */
7844 chrome.system.storage.StorageUnitInfo = function() {};
7847 /** @type {string} */
7848 chrome.system.storage.StorageUnitInfo.id;
7851 /** @type {string} */
7852 chrome.system.storage.StorageUnitInfo.name;
7855 /** @type {string} Any of 'fixed', 'removable', or 'unknown' */
7856 chrome.system.storage.StorageUnitInfo.type;
7859 /** @type {number} */
7860 chrome.system.storage.StorageUnitInfo.capacity;
7865  * Event whose listeners take a StorageUnitInfoEvent parameter.
7866  * @constructor
7867  */
7868 chrome.system.storage.StorageUnitInfoEvent = function() {};
7871 /** @param {function(!chrome.system.storage.StorageUnitInfo): void} callback */
7872 chrome.system.storage.StorageUnitInfoEvent.prototype.addListener =
7873     function(callback) {};
7876 /** @param {function(!chrome.system.storage.StorageUnitInfo): void} callback */
7877 chrome.system.storage.StorageUnitInfoEvent.prototype.removeListener =
7878     function(callback) {};
7882  * @param {function(!chrome.system.storage.StorageUnitInfo): void} callback
7883  * @return {boolean}
7884  */
7885 chrome.system.storage.StorageUnitInfoEvent.prototype.hasListener =
7886     function(callback) {};
7889 /** @return {boolean} */
7890 chrome.system.storage.StorageUnitInfoEvent.prototype.hasListeners =
7891     function() {};
7894 /** @type {chrome.system.storage.StorageUnitInfoEvent} */
7895 chrome.system.storage.onAttached;
7898 /** @type {!ChromeStringEvent} */
7899 chrome.system.storage.onDetached;
7903  * Gets the storage information from the system.
7904  * @param {function(!Array.<!chrome.system.storage.StorageUnitInfo>)} callback
7905  */
7906 chrome.system.storage.getInfo = function(callback) {};
7910  * Ejects a removable storage device.
7911  * @param {string} id The transient device ID from StorageUnitInfo.
7912  * @param {function(string)} callback Callback function where the value
7913  *     is any of: "success", "in_use", "no_such_device", "failure"
7914  */
7915 chrome.system.storage.ejectDevice = function(id, callback) {};
7919  * Gets the available capacity of a specified storage device.
7920  * @param {string} id The transient device ID from StorageUnitInfo.
7921  * @param {function(Object.<string, number>)} callback A callback function that
7922  *     accepts an object with {@code id} and {@code availableCapacity} fields.
7923  */
7924 chrome.system.storage.getAvailableCapacity = function(id, callback) {};
7928  * @see http://developer.chrome.com/apps/usb.html
7929  * @const
7930  */
7931 chrome.usb = {};
7935 /** @constructor */
7936 chrome.usb.Device = function Device() {};
7939 /** @type {number} */
7940 chrome.usb.Device.prototype.device;
7943 /** @type {number} */
7944 chrome.usb.Device.prototype.vendorId;
7947 /** @type {number} */
7948 chrome.usb.Device.prototype.productId;
7952 /** @constructor */
7953 chrome.usb.ConnectionHandle = function ConnectionHandle() {};
7956 /** @type {number} */
7957 chrome.usb.ConnectionHandle.prototype.handle;
7960 /** @type {number} */
7961 chrome.usb.ConnectionHandle.prototype.vendorId;
7964 /** @type {number} */
7965 chrome.usb.ConnectionHandle.prototype.productId;
7969  * @typedef {?{
7970  *   direction: string,
7971  *   endpoint: number,
7972  *   length: (number|undefined),
7973  *   data: (!ArrayBuffer|undefined)
7974  * }}
7975  */
7976 chrome.usb.GenericTransferInfo;
7980  * @typedef {?{
7981  *   direction: string,
7982  *   recipient: string,
7983  *   requestType: string,
7984  *   request: number,
7985  *   value: number,
7986  *   index: number,
7987  *   length: (number|undefined),
7988  *   data: (!ArrayBuffer|undefined)
7989  * }}
7990  */
7991 chrome.usb.ControlTransferInfo;
7995 /** @constructor */
7996 chrome.usb.TransferResultInfo = function() {};
7999 /** @type {number|undefined} */
8000 chrome.usb.TransferResultInfo.prototype.resultCode;
8003 /** @type {!ArrayBuffer|undefined} */
8004 chrome.usb.TransferResultInfo.prototype.data;
8008  * @typedef {?{
8009  *   deviceId: number,
8010  *   productId: number,
8011  *   interfaceId: (number|undefined)
8012  * }}
8013  */
8014 chrome.usb.FindDevicesOptions;
8018  * @see http://developer.chrome.com/apps/usb.html#method-getDevices
8019  * @param {!Object} options The properties to search for on target devices.
8020  * @param {function(!Array.<!chrome.usb.Device>)} callback Invoked with a list
8021  *     of |Device|s on complete.
8022  */
8023 chrome.usb.getDevices = function(options, callback) {};
8027  * @see http://developer.chrome.com/apps/usb.html#method-requestAccess
8028  * @param {!chrome.usb.Device} device The device to request access to.
8029  * @param {number} interfaceId
8030  * @param {function(boolean)} callback
8031  */
8032 chrome.usb.requestAccess = function(device, interfaceId, callback) {};
8036  * @see http://developer.chrome.com/apps/usb.html#method-openDevice
8037  * @param {!chrome.usb.Device} device The device to open.
8038  * @param {function(!chrome.usb.ConnectionHandle=)} callback Invoked with the
8039  *     created ConnectionHandle on complete.
8040  */
8041 chrome.usb.openDevice = function(device, callback) {};
8045  * @see http://developer.chrome.com/apps/usb.html#method-findDevices
8046  * @param {!chrome.usb.FindDevicesOptions} options The properties to search for
8047  *     on target devices.
8048  * @param {function(!Array.<!chrome.usb.ConnectionHandle>)} callback Invoked
8049  *     with the opened ConnectionHandle on complete.
8050  */
8051 chrome.usb.findDevices = function(options, callback) {};
8055  * @see http://developer.chrome.com/apps/usb.html#method-closeDevice
8056  * @param {!chrome.usb.ConnectionHandle} handle The connection handle to close.
8057  * @param {function()=} opt_callback The callback to invoke once the device is
8058  *     closed.
8059  */
8060 chrome.usb.closeDevice = function(handle, opt_callback) {};
8064  * @see http://developer.chrome.com/apps/usb.html#method-listInterfaces
8065  * @param {!chrome.usb.ConnectionHandle} handle The device from which the
8066  *     interfaces should be listed.
8067  * @param {function(!Array.<!Object>)} callback
8068  *     The callback to invoke when the interfaces are enumerated.
8069  */
8070 chrome.usb.listInterfaces = function(handle, callback) {};
8074  * @see http://developer.chrome.com/apps/usb.html#method-claimInterface
8075  * @param {!chrome.usb.ConnectionHandle} handle The device on which the
8076  *     interface is to be claimed.
8077  * @param {number} interfaceNumber
8078  * @param {function()} callback The callback to invoke once the interface is
8079  *     claimed.
8080  */
8081 chrome.usb.claimInterface = function(handle, interfaceNumber, callback) {};
8085  * @see http://developer.chrome.com/apps/usb.html#method-releaseInterface
8086  * @param {!chrome.usb.ConnectionHandle} handle The device on which the
8087  *     interface is to be released.
8088  * @param {number} interfaceNumber
8089  * @param {function()} callback The callback to invoke once the interface is
8090  *     released.
8091  */
8092 chrome.usb.releaseInterface = function(handle, interfaceNumber, callback) {};
8096  * @see http://developer.chrome.com/apps/usb.html#method-setInterfaceAlternateSetting
8097  * @param {!chrome.usb.ConnectionHandle} handle The device on which the
8098  *     interface settings are to be set.
8099  * @param {number} interfaceNumber
8100  * @param {number} alternateSetting The alternate setting to set.
8101  * @param {function()} callback The callback to invoke once the interface
8102  *     setting is set.
8103  */
8104 chrome.usb.setInterfaceAlternateSetting = function(
8105     handle, interfaceNumber, alternateSetting, callback) {};
8109  * @see http://developer.chrome.com/apps/usb.html#method-controlTransfer
8110  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
8111  *     transfer on.
8112  * @param {!chrome.usb.ControlTransferInfo} transferInfo The parameters to the
8113  *     transfer.
8114  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
8115  *     transfer has completed.
8116  */
8117 chrome.usb.controlTransfer = function(handle, transferInfo, callback) {};
8121  * @see http://developer.chrome.com/apps/usb.html#method-bulkTransfer
8122  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make
8123  *     the transfer on.
8124  * @param {!chrome.usb.GenericTransferInfo} transferInfo The parameters to the
8125  *     transfer. See GenericTransferInfo.
8126  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
8127  *     transfer has completed.
8128  */
8129 chrome.usb.bulkTransfer = function(handle, transferInfo, callback) {};
8133  * @see http://developer.chrome.com/apps/usb.html#method-interruptTransfer
8134  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
8135  *     transfer on.
8136  * @param {!chrome.usb.GenericTransferInfo} transferInfo The parameters to the
8137  *     transfer. See GenericTransferInfo.
8138  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
8139  *     transfer has completed.
8140  */
8141 chrome.usb.interruptTransfer = function(handle, transferInfo, callback) {};
8145  * @see http://developer.chrome.com/apps/usb.html#method-isochronousTransfer
8146  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to make the
8147  *     transfer on.
8148  * @param {!Object} transferInfo The parameters to the transfer. See
8149  *     IsochronousTransferInfo.
8150  * @param {function(!chrome.usb.TransferResultInfo)} callback Invoked once the
8151  *     transfer has been completed.
8152  */
8153 chrome.usb.isochronousTransfer = function(handle, transferInfo, callback) {};
8157  * @see http://developer.chrome.com/apps/usb.html#method-resetDevice
8158  * @param {!chrome.usb.ConnectionHandle} handle A connection handle to reset.
8159  * @param {function(boolean)} callback Invoked once the device is reset with a
8160  *     boolean indicating whether the reset completed successfully.
8161  */
8162 chrome.usb.resetDevice = function(handle, callback) {};
8166  * @see https://developer.chrome.com/apps/serial
8167  * @const
8168  */
8169 chrome.serial = {};
8174  * @typedef {?{
8175  *   persistent: (boolean|undefined),
8176  *   name: (string|undefined),
8177  *   bufferSize: (number|undefined),
8178  *   bitRate: (number|undefined),
8179  *   dataBits: (string|undefined),
8180  *   parityBits: (string|undefined),
8181  *   stopBits: (string|undefined),
8182  *   ctsFlowControl: (boolean|undefined),
8183  *   receiveTimeout: (number|undefined),
8184  *   sendTimeout: (number|undefined)
8185  * }}
8186  * @see https://developer.chrome.com/apps/serial#type-ConnectionOptions
8187  */
8188 chrome.serial.ConnectionOptions;
8192  * @typedef {?{
8193  *   connectionId: number,
8194  *   paused: boolean,
8195  *   persistent: boolean,
8196  *   name: string,
8197  *   bufferSize: number,
8198  *   receiveTimeout: number,
8199  *   sendTimeout: number,
8200  *   bitRate: (number|undefined),
8201  *   dataBits: (string|undefined),
8202  *   parityBits: (string|undefined),
8203  *   stopBits: (string|undefined),
8204  *   ctsFlowControl: (boolean|undefined)
8205  * }}
8206  * @see https://developer.chrome.com/apps/serial#type-ConnectionInfo
8207  */
8208 chrome.serial.ConnectionInfo;
8212  * Returns information about available serial devices on the system. The
8213  * list is regenerated each time this method is called.
8214  * @param {function(!Array<!Object>)} callback Invoked with a
8215  *     list of ports on complete.
8216  * @see https://developer.chrome.com/apps/serial#method-getDevices
8217  */
8218 chrome.serial.getDevices = function(callback) {};
8222  * Connects to a given serial port.
8223  * @param {string} path The system path of the serial port to open.
8224  * @param {!chrome.serial.ConnectionOptions|
8225  *         function(!chrome.serial.ConnectionInfo)} optionsOrCallback
8226  *     Port configuration options, or the callback invoked with the created
8227  *     ConnectionInfo on complete.
8228  * @param {function(!chrome.serial.ConnectionInfo)=} opt_callback Invoked with
8229  *     the created ConnectionInfo on complete.
8230  * @see https://developer.chrome.com/apps/serial#method-connect
8231  */
8232 chrome.serial.connect = function(path, optionsOrCallback, opt_callback) {};
8236  * Update the option settings on an open serial port connection.
8237  * @param {number} connectionId The id of the opened connection.
8238  * @param {!chrome.serial.ConnectionOptions} options Port configuration
8239  *     options.
8240  * @param {function(boolean)} callback Called when the configuration has
8241  *     completed.
8242  * @see https://developer.chrome.com/apps/serial#method-update
8243  */
8244 chrome.serial.update = function(connectionId, options, callback) {};
8248  * Disconnects from a serial port.
8249  * @param {number} connectionId The id of the opened connection.
8250  * @param {function(boolean)} callback Called when the connection
8251  *     has been closed.
8252  * @see https://developer.chrome.com/apps/serial#method-disconnect
8253  */
8254 chrome.serial.disconnect = function(connectionId, callback) {};
8258  * Pauses or unpauses an open connection.
8259  * @param {number} connectionId The id of the opened connection.
8260  * @param {boolean} paused Flag to indicate whether to pause or unpause.
8261  * @param {function()} callback Called when the configuration has completed.
8262  * @see https://developer.chrome.com/apps/serial#method-setPaused
8263  */
8264 chrome.serial.setPaused = function(connectionId, paused, callback) {};
8268  * Retrieves the state of a given connection.
8269  * @param {number} connectionId The id of the opened connection.
8270  * @param {function(!chrome.serial.ConnectionInfo)} callback
8271  *     Called with connection state information when available.
8272  * @see https://developer.chrome.com/apps/serial#method-getInfo
8273  */
8274 chrome.serial.getInfo = function(connectionId, callback) {};
8278  * Retrieves the list of currently opened serial port connections owned by
8279  * the application.
8280  * @param {function(!Array.<!chrome.serial.ConnectionInfo>)} callback
8281  *     Called with the list of |ConnectionInfo|s when available.
8282  * @see https://developer.chrome.com/apps/serial#method-getConnections
8283  */
8284 chrome.serial.getConnections = function(callback) {};
8288  * Writes data to the given connection.
8289  * @param {number} connectionId The id of the opened connection.
8290  * @param {!ArrayBuffer} data The data to send.
8291  * @param {function(!Object)} callback Called when the operation has
8292  *     completed.
8293  * @see https://developer.chrome.com/apps/serial#method-send
8294  */
8295 chrome.serial.send = function(connectionId, data, callback) {};
8299  * Flushes all bytes in the given connection's input and output buffers.
8300  * @param {number} connectionId The id of the opened connection.
8301  * @param {function(boolean)} callback
8302  * @see https://developer.chrome.com/apps/serial#method-flush
8303  */
8304 chrome.serial.flush = function(connectionId, callback) {};
8310  * Retrieves the state of control signals on a given connection.
8311  * @param {number} connectionId The id of the opened connection.
8312  * @param {function(!Object)} callback
8313  * @see https://developer.chrome.com/apps/serial#method-getControlSignals
8314  */
8315 chrome.serial.getControlSignals = function(connectionId, callback) {};
8319  * @typedef {?{
8320  *   dtr: (boolean|undefined),
8321  *   rts: (boolean|undefined)
8322  * }}
8323  */
8324 chrome.serial.ControlSignals;
8328  * Sets the state of control signals on a given connection.
8329  * @param {number} connectionId The id of the opened connection.
8330  * @param {!chrome.serial.ControlSignals} signals
8331  *     The set of signal changes to send to the device.
8332  * @param {function(boolean)} callback Called once the control signals
8333  *     have been set.
8334  * @see https://developer.chrome.com/apps/serial#method-setControlSignals
8335  */
8336 chrome.serial.setControlSignals = function(connectionId, signals, callback) {};
8340  * Event raised when data has been read from the connection.
8341  * @type {!ChromeObjectEvent}
8342  * @see https://developer.chrome.com/apps/serial#event-onReceive
8343  */
8344 chrome.serial.onReceive;
8348  * Event raised when an error occurred while the runtime was waiting for
8349  * data on the serial port. Once this event is raised, the connection may
8350  * be set to paused. A "timeout" error does not pause the connection.
8351  * @type {!ChromeObjectEvent}
8352  * @see https://developer.chrome.com/apps/serial#event-onReceiveError
8353  */
8354 chrome.serial.onReceiveError;
8358  * @const
8359  * @see https://developer.chrome.com/apps/webstore
8360  */
8361 chrome.webstore = {};
8365  * @param {string|function()|function(string)=}
8366  *     opt_urlOrSuccessCallbackOrFailureCallback Either the URL to install or
8367  *     the succcess callback taking no arg or the failure callback taking an
8368  *     error string arg.
8369  * @param {function()|function(string)=} opt_successCallbackOrFailureCallback
8370  *     Either the succcess callback taking no arg or the failure callback
8371  *     taking an error string arg.
8372  * @param {function(string)=} opt_failureCallback The failure callback.
8373  */
8374 chrome.webstore.install = function(
8375     opt_urlOrSuccessCallbackOrFailureCallback,
8376     opt_successCallbackOrFailureCallback,
8377     opt_failureCallback) {};
8380 /** @type {!ChromeStringEvent} */
8381 chrome.webstore.onInstallStageChanged;
8384 /** @type {!ChromeNumberEvent} */
8385 chrome.webstore.onDownloadProgress;
8388 ////////////////////////////////////////////////////////////////////////////////
8389 /////////////////////////// Chrome Private APIs ////////////////////////////////
8390 ////////////////////////////////////////////////////////////////////////////////
8393 /** @const */
8394 chrome.screenlockPrivate = {};
8398  * @param {string} message Displayed on the unlock screen.
8399  */
8400 chrome.screenlockPrivate.showMessage = function(message) {};
8404  * @param {function(boolean)} callback
8405  */
8406 chrome.screenlockPrivate.getLocked = function(callback) {};
8410  * @param {boolean} locked If true and the screen is unlocked, locks the screen.
8411  *     If false and the screen is locked, unlocks the screen.
8412  */
8413 chrome.screenlockPrivate.setLocked = function(locked) {};
8416 /** @type {!ChromeBooleanEvent} */
8417 chrome.screenlockPrivate.onChanged;
8421  * @const
8422  */
8423 chrome.musicManagerPrivate = {};
8427  * @param {function(string): void} callback
8428  */
8429 chrome.musicManagerPrivate.getDeviceId = function(callback) {};
8433  * @const
8434  */
8435 chrome.mediaGalleriesPrivate = {};
8439  * @typedef {function({deviceId: string, deviceName: string}): void}
8440  */
8441 chrome.mediaGalleriesPrivate.DeviceCallback;
8445  * @typedef {function({galleryId: string}): void}
8446  */
8447 chrome.mediaGalleriesPrivate.GalleryChangeCallback;
8451  * @typedef {function({galleryId: string, success: boolean}): void}
8452  */
8453 chrome.mediaGalleriesPrivate.AddGalleryWatchCallback;
8457  * @param {string} galleryId
8458  * @param {!chrome.mediaGalleriesPrivate.AddGalleryWatchCallback} callback
8459  */
8460 chrome.mediaGalleriesPrivate.addGalleryWatch = function(galleryId, callback) {};
8464  * @type {!chrome.mediaGalleriesPrivate.DeviceEvent}
8465  * @deprecated Use {chrome.system.storage.onAttach}.
8466  */
8467 chrome.mediaGalleriesPrivate.onDeviceAttached;
8471  * @type {!chrome.mediaGalleriesPrivate.DeviceEvent}
8472  * @deprecated Use {chrome.system.storage.onDetach}.
8473  */
8474 chrome.mediaGalleriesPrivate.onDeviceDetached;
8478  * @type {!chrome.mediaGalleriesPrivate.GalleryChangeEvent}
8479  */
8480 chrome.mediaGalleriesPrivate.onGalleryChanged;
8485  * @interface
8486  * @deprecated Use {chrome.system.storage.DeviceEvent}.
8487  */
8488 chrome.mediaGalleriesPrivate.DeviceEvent = function() {};
8492  * @param {!chrome.mediaGalleriesPrivate.DeviceCallback} callback
8493  * @deprecated Use {chrome.system.storage.DeviceEvent.addListener}.
8494  */
8495 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.addListener =
8496     function(callback) {};
8500  * @param {!chrome.mediaGalleriesPrivate.DeviceCallback} callback
8501  * @deprecated Use {chrome.system.storage.DeviceEvent.removeListener}.
8502  */
8503 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.removeListener =
8504     function(callback) {};
8508  * @param {!chrome.mediaGalleriesPrivate.DeviceCallback} callback
8509  * @deprecated Use {chrome.system.storage.DeviceEvent.hasListener}.
8510  */
8511 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.hasListener =
8512     function(callback) {};
8516  * @return {boolean}
8517  * @deprecated Use {chrome.system.storage.DeviceEvent.hasListener}
8518  */
8519 chrome.mediaGalleriesPrivate.DeviceEvent.prototype.hasListeners =
8520     function(callback) {};
8525  * @interface
8526  */
8527 chrome.mediaGalleriesPrivate.GalleryChangeEvent = function() {};
8531  * @param {!chrome.mediaGalleriesPrivate.GalleryChangeCallback} callback
8532  */
8533 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.addListener =
8534     function(callback) {};
8538  * @param {!chrome.mediaGalleriesPrivate.GalleryChangeCallback} callback
8539  */
8540 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.removeListener =
8541     function(callback) {};
8545  * @param {!chrome.mediaGalleriesPrivate.GalleryChangeCallback} callback
8546  */
8547 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.hasListener =
8548     function(callback) {};
8552  * @return {boolean}
8553  */
8554 chrome.mediaGalleriesPrivate.GalleryChangeEvent.prototype.hasListeners =
8555     function() {};
8559  * Externs for networking_private.idl:
8560  * https://code.google.com/p/chromium/codesearch#chromium/src/extensions/common/api/networking_private.idl
8561  * WARNING(2015/04/09): This API is still under active development and has a few
8562  * issues with typing:
8564  * 1. This API uses the ONC specification:
8565  *    http://www.chromium.org/chromium-os/chromiumos-design-docs/open-network-configuration
8566  * 2. The types for getProperties and getManagedProperties are not currently
8567  *    defined. They correspond to ONC Property dictionaries. They are treated as
8568  *    Objects rather than types.
8569  * 3. NetworkStateProperties defines a subset of NetworkProperties used by
8570  *    getState and getNetworks. Since these match ONC property names they
8571  *    use ONC PascalCase naming conventions instead of traditional JS
8572  *    camelCase naming.
8573  * 4. The types for setProperties and createNetwork are not currently defined.
8574  *    These use a subset of ONC properties and the complete set (and their
8575  *    relationship to the type for getProperties) is still being determined.
8577  * Because of the above issues, this API should not be used as an example for
8578  * other APIs. Please contact stevenjb@ for questions on and maintenance.
8579  * @const
8580  * @see https://developer.chrome.com/extensions/networkingPrivate
8581  */
8582 chrome.networkingPrivate = {};
8586  * @constructor
8587  * @struct
8588  * @see https://developer.chrome.com/extensions/networkingPrivate#type-CellularStateProperties
8589  */
8590 chrome.networkingPrivate.CellularStateProperties = function() {};
8594  * @type {string|undefined}
8595  */
8596 chrome.networkingPrivate.CellularStateProperties.prototype.ActivationState;
8600  * @type {string|undefined}
8601  */
8602 chrome.networkingPrivate.CellularStateProperties.prototype.NetworkTechnology;
8606  * @type {string|undefined}
8607  */
8608 chrome.networkingPrivate.CellularStateProperties.prototype.RoamingState;
8612  * @type {number|undefined}
8613  */
8614 chrome.networkingPrivate.CellularStateProperties.prototype.SignalStrength;
8618  * @constructor
8619  * @struct
8620  * @see https://developer.chrome.com/extensions/networkingPrivate#type-DeviceStateProperties
8621  */
8622 chrome.networkingPrivate.DeviceStateProperties = function() {};
8626  * @type {boolean|undefined}
8627  */
8628 chrome.networkingPrivate.DeviceStateProperties.prototype.Scanning;
8632  * @type {string}
8633  */
8634 chrome.networkingPrivate.DeviceStateProperties.prototype.State;
8638  * @type {string}
8639  */
8640 chrome.networkingPrivate.DeviceStateProperties.prototype.Type;
8644  * @constructor
8645  * @struct
8646  * @see https://developer.chrome.com/extensions/networkingPrivate#type-EthernetStateProperties
8647  */
8648 chrome.networkingPrivate.EthernetStateProperties = function() {};
8652  * @type {string}
8653  */
8654 chrome.networkingPrivate.EthernetStateProperties.prototype.Authentication;
8658  * @constructor
8659  * @struct
8660  * @see https://developer.chrome.com/extensions/networkingPrivate#type-IPSecProperties
8661  */
8662 chrome.networkingPrivate.IPSecProperties = function() {};
8666  * @type {string}
8667  */
8668 chrome.networkingPrivate.IPSecProperties.prototype.AuthenticationType;
8672  * @constructor
8673  * @struct
8674  * @see https://developer.chrome.com/extensions/networkingPrivate#type-ThirdPartyVPNProperties
8675  */
8676 chrome.networkingPrivate.ThirdPartyVPNProperties = function() {};
8680  * @type {string}
8681  */
8682 chrome.networkingPrivate.ThirdPartyVPNProperties.prototype.ExtensionID;
8686  * @constructor
8687  * @struct
8688  * @see https://developer.chrome.com/extensions/networkingPrivate#type-VPNStateProperties
8689  */
8690 chrome.networkingPrivate.VPNStateProperties = function() {};
8694  * @type {!chrome.networkingPrivate.IPSecProperties|undefined}
8695  */
8696 chrome.networkingPrivate.VPNStateProperties.prototype.IPSec;
8700  * @type {!chrome.networkingPrivate.ThirdPartyVPNProperties|undefined}
8701  */
8702 chrome.networkingPrivate.VPNStateProperties.prototype.ThirdPartyVPN;
8706  * @type {string}
8707  */
8708 chrome.networkingPrivate.VPNStateProperties.prototype.Type;
8712  * @constructor
8713  * @struct
8714  * @see https://developer.chrome.com/extensions/networkingPrivate#type-WiFiStateProperties
8715  */
8716 chrome.networkingPrivate.WiFiStateProperties = function() {};
8720  * @type {string}
8721  */
8722 chrome.networkingPrivate.WiFiStateProperties.prototype.Security;
8726  * @type {number|undefined}
8727  */
8728 chrome.networkingPrivate.WiFiStateProperties.prototype.SignalStrength;
8732  * @constructor
8733  * @struct
8734  * @see https://developer.chrome.com/extensions/networkingPrivate#type-WiFiStateProperties
8735  */
8736 chrome.networkingPrivate.WiMAXStateProperties = function() {};
8740  * @type {number|undefined}
8741  */
8742 chrome.networkingPrivate.WiMAXStateProperties.prototype.SignalStrength;
8746  * @typedef {?{
8747  *   Cellular: (!chrome.networkingPrivate.CellularStateProperties|undefined),
8748  *   Connectable: (boolean|undefined),
8749  *   ConnectionState: (string|undefined),
8750  *   ErrorState: (string|undefined),
8751  *   Ethernet: (!chrome.networkingPrivate.EthernetStateProperties|undefined),
8752  *   GUID: string,
8753  *   Name: (string|undefined),
8754  *   Priority: (number|undefined),
8755  *   Source: (string|undefined),
8756  *   Type: string,
8757  *   VPN: (!chrome.networkingPrivate.VPNStateProperties|undefined),
8758  *   WiFi: (!chrome.networkingPrivate.WiFiStateProperties|undefined),
8759  *   WiMAX: (!chrome.networkingPrivate.WiMAXStateProperties|undefined)
8760  * }}
8761  */
8762 chrome.networkingPrivate.NetworkStateProperties;
8766  * @typedef {?{
8767  *   certificate: string,
8768  *   intermediateCertificates: (!Array<string>|undefined),
8769  *   publicKey: string,
8770  *   nonce: string,
8771  *   signedData: string,
8772  *   deviceSerial: string,
8773  *   deviceSsid: string,
8774  *   deviceBssid: string
8775  * }}
8776  */
8777 chrome.networkingPrivate.VerificationProperties;
8781  * @typedef {?{
8782  *   networkType: string,
8783  *   visible: (boolean|undefined),
8784  *   configured: (boolean|undefined),
8785  *   limit: (number|undefined)
8786  * }}
8787  */
8788 chrome.networkingPrivate.NetworkFilter;
8792  * @param {string} guid
8793  * @param {function(!Object)} callback
8794  */
8795 chrome.networkingPrivate.getProperties = function(guid, callback) {};
8799  * @param {string} guid
8800  * @param {function(!Object)} callback
8801  */
8802 chrome.networkingPrivate.getManagedProperties = function(guid, callback) {};
8806  * @param {string} guid
8807  * @param {function(!chrome.networkingPrivate.NetworkStateProperties)} callback
8808  */
8809 chrome.networkingPrivate.getState = function(guid, callback) {};
8813  * TODO: Use NetworkConfigProperties for |properties| once fully
8814  * defined.
8815  * @param {string} guid
8816  * @param {!Object} properties
8817  * @param {function()=} opt_callback
8818  */
8819 chrome.networkingPrivate.setProperties =
8820     function(guid, properties, opt_callback) {};
8824  * TODO: Use NetworkConfigProperties for |properties| once fully
8825  * defined.
8826  * @param {boolean} shared
8827  * @param {!Object} properties
8828  * @param {function(string)=} opt_callback Returns guid of the configured
8829  *     configuration.
8830  */
8831 chrome.networkingPrivate.createNetwork =
8832     function(shared, properties, opt_callback) {};
8836  * @param {string} guid
8837  * @param {function()=} opt_callback Called when the operation has completed.
8838  */
8839 chrome.networkingPrivate.forgetNetwork = function(guid, opt_callback) {};
8843  * @param {!chrome.networkingPrivate.NetworkFilter} filter
8844  * @param {function(!Array.<!chrome.networkingPrivate.NetworkStateProperties>)}
8845  *     callback
8846  */
8847 chrome.networkingPrivate.getNetworks = function(filter, callback) {};
8851  * @param {string} type
8852  * @param {function(!Array.<!chrome.networkingPrivate.NetworkStateProperties>)}
8853  *      callback
8854  * @deprecated Use chrome.networkingPrivate.getNetworks with filter.visible=true
8855  */
8856 chrome.networkingPrivate.getVisibleNetworks = function(type, callback) {};
8860  * @param {function(!Array.<string>)} callback
8861  * @deprecated Use chrome.networkingPrivate.getDeviceStates.
8862  */
8863 chrome.networkingPrivate.getEnabledNetworkTypes = function(callback) {};
8867  * @param {function(!Array.<!chrome.networkingPrivate.DeviceStateProperties>)}
8868  *     callback
8869  */
8870 chrome.networkingPrivate.getDeviceStates = function(callback) {};
8873 /** @param {string} networkType */
8874 chrome.networkingPrivate.enableNetworkType = function(networkType) {};
8877 /** @param {string} networkType */
8878 chrome.networkingPrivate.disableNetworkType = function(networkType) {};
8882  * Requests that the networking subsystem scan for new networks and update the
8883  * list returned by getVisibleNetworks.
8884  */
8885 chrome.networkingPrivate.requestNetworkScan = function() {};
8889  * @param {string} guid
8890  * @param {function()=} opt_callback
8891  */
8892 chrome.networkingPrivate.startConnect = function(guid, opt_callback) {};
8896  * @param {string} guid
8897  * @param {function()=} opt_callback
8898  */
8899 chrome.networkingPrivate.startDisconnect = function(guid, opt_callback) {};
8903  * @param {string} guid
8904  * @param {(string|function())=} opt_carrierOrCallback
8905  * @param {function()=} opt_callback
8906  */
8907 chrome.networkingPrivate.startActivate =
8908     function(guid, opt_carrierOrCallback, opt_callback) {};
8912  * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo
8913  * @param {function(boolean)} callback
8914  */
8915 chrome.networkingPrivate.verifyDestination =
8916     function(verificationInfo, callback) {};
8920  * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo
8921  * @param {string} guid
8922  * @param {function(string)} callback
8923  */
8924 chrome.networkingPrivate.verifyAndEncryptCredentials =
8925     function(verificationInfo, guid, callback) {};
8929  * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo
8930  * @param {string} data
8931  * @param {function(string)} callback
8932  */
8933 chrome.networkingPrivate.verifyAndEncryptData =
8934     function(verificationInfo, data, callback) {};
8938  * @param {string} ipOrMacAddress
8939  * @param {boolean} enabled
8940  * @param {function(string)=} opt_callback
8941  */
8942 chrome.networkingPrivate.setWifiTDLSEnabledState =
8943     function(ipOrMacAddress, enabled, opt_callback) {};
8947  * @param {string} ipOrMacAddress
8948  * @param {function(string)} callback
8949  */
8950 chrome.networkingPrivate.getWifiTDLSStatus =
8951     function(ipOrMacAddress, callback) {};
8955  * @param {string} guid
8956  * @param {function(string)} callback
8957  */
8958 chrome.networkingPrivate.getCaptivePortalStatus = function(guid, callback) {};
8961 /** @type {!ChromeStringArrayEvent} */
8962 chrome.networkingPrivate.onNetworksChanged;
8965 /** @type {!ChromeStringArrayEvent} */
8966 chrome.networkingPrivate.onNetworkListChanged;
8969 /** @type {!ChromeEvent} */
8970 chrome.networkingPrivate.onDeviceStateListChanged;
8973 /** @type {!ChromeStringStringEvent} */
8974 chrome.networkingPrivate.onPortalDetectionCompleted;
8978  * WARNING(2014/08/14): This API is still under active initial development and
8979  * unstable. The types are not well defined or documented, and this API
8980  * definition here should not be used as an example for other APIs added to this
8981  * file. Please contact mednik@ for questions on and maintenance for this API.
8982  * @const
8983  * @see http://goo.gl/afV8wB
8984  */
8985 chrome.mdns = {};
8989  * Data type sent to the event handler of chrome.mdns.onServiceList.
8990  * @constructor
8991  */
8992 chrome.mdns.MdnsService = function() {};
8995 /** @type {string} */
8996 chrome.mdns.MdnsService.prototype.serviceName;
8999 /** @type {string} */
9000 chrome.mdns.MdnsService.prototype.serviceHostPort;
9003 /** @type {string} */
9004 chrome.mdns.MdnsService.prototype.ipAddress;
9007 /** @type {!Array.<string>} */
9008 chrome.mdns.MdnsService.prototype.serviceData;
9012  * Event whose listeners take an array of MdnsService parameter.
9013  * @constructor
9014  */
9015 chrome.mdns.ServiceListEvent = function() {};
9019  * @param {function(!Array.<!chrome.mdns.MdnsService>): void} callback
9020  * @param {!Object=} opt_filter
9021  */
9022 chrome.mdns.ServiceListEvent.prototype.addListener =
9023     function(callback, opt_filter) {};
9026 /** @param {function(!Array.<!chrome.mdns.MdnsService>): void} callback */
9027 chrome.mdns.ServiceListEvent.prototype.removeListener = function(callback) {};
9031  * @param {function(!Array.<!chrome.mdns.MdnsService>): void} callback
9032  * @return {boolean}
9033  */
9034 chrome.mdns.ServiceListEvent.prototype.hasListener = function(callback) {};
9037 /** @return {boolean} */
9038 chrome.mdns.ServiceListEvent.prototype.hasListeners = function() {};
9041 /** @type {!chrome.mdns.ServiceListEvent} */
9042 chrome.mdns.onServiceList;
9046  * @const
9047  * @see http://goo.gl/79p5h5
9048  */
9049 chrome.gcdPrivate = {};
9053  * Represents a GCD device discovered locally or registered to a given user.
9054  * deviceId: Opaque device identifier to be passed to API.
9055  * setupType: How this device was discovered.
9056  * cloudId: Cloud identifier string.
9057  * deviceName: Device human readable name.
9058  * deviceType: Device type (camera, printer, etc).
9059  * deviceDescription: Device human readable description.
9060  * @typedef {?{
9061  *   deviceId: string,
9062  *   setupType: string,
9063  *   cloudId: (string|undefined),
9064  *   deviceType: string,
9065  *   deviceName: string,
9066  *   deviceDescription: string
9067  * }}
9068  */
9069 chrome.gcdPrivate.Device;
9073  * Returns the list of cloud devices visible locally or available in the
9074  * cloud for user account.
9075  * @param {function(!Array.<!chrome.gcdPrivate.Device>): void} callback
9076  */
9077 chrome.gcdPrivate.getCloudDeviceList = function(callback) {};
9081  * Queries network for local devices. Triggers onDeviceStateChanged and
9082  * onDeviceRemoved events. Call this function *only* after registering for
9083  * onDeviceStateChanged and onDeviceRemoved events, or it will do nothing.
9084  */
9085 chrome.gcdPrivate.queryForNewLocalDevices = function() {};
9089  * Cache the WiFi password in the browser process for use during
9090  * provisioning. This is done to allow the gathering of the wifi password to
9091  * not be done while connected to the device's network. Callback is called
9092  * with true if wifi password was cached and false if it was unavailable.
9093  * @param {string} ssid
9094  * @param {function(boolean): void} callback
9095  */
9096 chrome.gcdPrivate.prefetchWifiPassword = function(ssid, callback) {};
9100  * Returns local device information.
9101  * @param {string} serviceName The mDNS service name of the device.
9102  * @param {function(string, !Object): void}
9103  *     callback Called when when the device info is available or on error.
9104  *     |status|: The status of the operation (success or type of error).
9105  *     |deviceInfo|: Content of /privet/info response.
9106  *     https://developers.google.com/cloud-devices/v1/reference/local-api/info
9107  */
9108 chrome.gcdPrivate.getDeviceInfo = function(serviceName, callback) {};
9112  * Create new pairing session.
9113  * @param {string} serviceName The mDNS service name of the device.
9114  * @param {function(number, string, !Array.<string>): void}
9115  *     callback Called when the session is established or on error. 1st param,
9116  *     |sessionId|, is the session ID (identifies the session for future calls).
9117  *     2nd param, |status|, is the status (success or type of error). 3rd param,
9118  *     |pairingTypes|, is a list of pairing types supported by this device.
9119  */
9120 chrome.gcdPrivate.createSession = function(serviceName, callback) {};
9124  * Start pairing with the selected method.
9125  * @param {number} sessionId
9126  * @param {string} pairingType
9127  * @param {function(string): void} callback
9128  */
9129 chrome.gcdPrivate.startPairing = function(sessionId, pairingType, callback) {};
9133  * Confirm pairing code.
9134  * @param {number} sessionId
9135  * @param {string} code
9136  * @param {function(string): void} callback
9137  */
9138 chrome.gcdPrivate.confirmCode = function(sessionId, code, callback) {};
9142  * Send an encrypted message to the device. If the message is a setup message
9143  * with a wifi ssid specified but no password, the password cached from
9144  * prefetchWifiPassword() will be used and the call will fail if it's not
9145  * available. For open networks use an empty string as the password.
9146  * @param {number} sessionId
9147  * @param {string} api The API path.
9148  * @param {!Object} input The input message to be sent over the encrypted
9149  *     channel.
9150  * @param {function(string, ?Object): void} callback
9151  */
9152 chrome.gcdPrivate.sendMessage = function(sessionId, api, input, callback) {};
9156  * Terminate the session with the device.
9157  * @param {number} sessionId
9158  */
9159 chrome.gcdPrivate.terminateSession = function(sessionId) {};
9163  * Returns command definitions.
9164  * @param {string} deviceId The device to get command definitions for.
9165  * @param {function(!Object): void} callback The result callback.
9166  */
9167 chrome.gcdPrivate.getCommandDefinitions = function(deviceId, callback) {};
9171  * Creates and sends a new command.
9172  * @param {string} deviceId The device to send the command to.
9173  * @param {number} expireInMs The number of milliseconds since now before the
9174  *     command expires. An expired command should not be executed by the device.
9175  *     Acceptable values are 10 sec (10000 ms) to 30 days (2592000000 ms),
9176  *     inclusive. All values outside that range will be replaced by 30 days.
9177  * @param {!Object} command Described at
9178  *     https://developers.google.com/cloud-devices/v1/reference/commands.
9179  * @param {function(!Object): void} callback  The result callback.
9180  */
9181 chrome.gcdPrivate.insertCommand = function(
9182     deviceId, expireInMs, command, callback) {};
9186  * Returns a particular command.
9187  * @param {string} commandId Unique command ID.
9188  * @param {function(!Object): void} callback  The result callback.
9189  */
9190 chrome.gcdPrivate.getCommand = function(commandId, callback) {};
9194  * Cancels a command.
9195  * @param {string} commandId Unique command ID.
9196  * @param {function(!Object): void} callback  The result callback.
9197  */
9198 chrome.gcdPrivate.cancelCommand = function(commandId, callback) {};
9202  * Lists all commands in order of creation.
9203  * @param {string} deviceId The device to send the command to.
9204  * @param {string} byUser List all the commands issued by the user. Special
9205  *     value 'me' can be used to list by the current user.
9206  * @param {string} state Command state.
9207  * @param {function(!Array.<!Object>): void} callback  The result callback.
9208  */
9209 chrome.gcdPrivate.getCommandsList = function(
9210     deviceId, byUser, state, callback) {};
9215  * Event whose listeners take a chrome.gcdPrivate.Device.
9216  * @constructor
9217  */
9218 chrome.gcdPrivate.DeviceEvent = function() {};
9221 /** @param {function(!chrome.gcdPrivate.Device): void} callback */
9222 chrome.gcdPrivate.DeviceEvent.prototype.addListener = function(callback) {};
9225 /** @param {function(!chrome.gcdPrivate.Device): void} callback */
9226 chrome.gcdPrivate.DeviceEvent.prototype.removeListener = function(callback) {};
9230  * @param {function(!chrome.gcdPrivate.Device): void} callback
9231  * @return {boolean}
9232  */
9233 chrome.gcdPrivate.DeviceEvent.prototype.hasListener = function(callback) {};
9236 /** @return {boolean} */
9237 chrome.gcdPrivate.DeviceEvent.prototype.hasListeners = function() {};
9241  * Fires when a device's state changes. When a listener is first added, this
9242  * event fires for all known devices on the network. Afterwards, it will fire
9243  * with device status updates.
9244  * @type {!chrome.gcdPrivate.DeviceEvent}
9245  */
9246 chrome.gcdPrivate.onDeviceStateChanged;
9250  * Fires when a given device disappears.
9251  * |deviceId| The device that has disappeared.
9252  * @type {!ChromeStringEvent}
9253  */
9254 chrome.gcdPrivate.onDeviceRemoved;
9258  * @const
9259  * @see http://goo.gl/bKHibo
9260  */
9261 chrome.bluetoothPrivate = {};
9265 /** @constructor */
9266 chrome.bluetoothPrivate.PairingEvent = function() {};
9269 /** @type {string} */
9270 chrome.bluetoothPrivate.PairingEvent.prototype.pairing;
9273 /** @type {!chrome.bluetooth.Device} */
9274 chrome.bluetoothPrivate.PairingEvent.prototype.device;
9277 /** @type {string|undefined} */
9278 chrome.bluetoothPrivate.PairingEvent.prototype.pincode;
9281 /** @type {number|undefined} */
9282 chrome.bluetoothPrivate.PairingEvent.prototype.passkey;
9285 /** @type {number|undefined} */
9286 chrome.bluetoothPrivate.PairingEvent.prototype.enteredKey;
9290  * @typedef {{
9291  *   name: (string|undefined),
9292  *   powered: (boolean|undefined),
9293  *   discoverable: (boolean|undefined)
9294  * }}
9295  */
9296 chrome.bluetoothPrivate.NewAdapterState;
9300  * @typedef {{
9301  *   device: !chrome.bluetooth.Device,
9302  *   response: (string|undefined),
9303  *   pincode: (string|undefined),
9304  *   passkey: (number|undefined),
9305  *   enteredKey: (number|undefined)
9306  * }}
9307  */
9308 chrome.bluetoothPrivate.SetPairingResponseOptions;
9312  * @param {!chrome.bluetoothPrivate.NewAdapterState} adapterState
9313  * @param {function()} callback
9314  */
9315 chrome.bluetoothPrivate.setAdapterState = function(adapterState, callback) {};
9319  * @param {!chrome.bluetoothPrivate.SetPairingResponseOptions} options
9320  * @param {function()} callback
9321  */
9322 chrome.bluetoothPrivate.setPairingResponse = function(options, callback) {};
9327  * Event whose listeners take a PairingEvent parameter.
9328  * @constructor
9329  */
9330 chrome.bluetoothPrivate.PairingEventEvent = function() {};
9333 /** @param {function(!chrome.bluetoothPrivate.PairingEvent): void} callback */
9334 chrome.bluetoothPrivate.PairingEventEvent.prototype.addListener =
9335     function(callback) {};
9338 /** @param {function(!chrome.bluetoothPrivate.PairingEvent): void} callback */
9339 chrome.bluetoothPrivate.PairingEventEvent.prototype.removeListener =
9340     function(callback) {};
9344  * @param {function(!chrome.bluetoothPrivate.PairingEvent): void} callback
9345  * @return {boolean}
9346  */
9347 chrome.bluetoothPrivate.PairingEventEvent.prototype.hasListener =
9348     function(callback) {};
9351 /** @return {boolean} */
9352 chrome.bluetoothPrivate.PairingEventEvent.prototype.hasListeners =
9353     function() {};
9356 /** @type {!chrome.bluetoothPrivate.PairingEventEvent} */
9357 chrome.bluetoothPrivate.onPairing;
9362  * @const
9363  * @see http://goo.gl/XmVdHm
9364  */
9365 chrome.inlineInstallPrivate = {};
9369  * Installs the given app ID.
9370  * @param {string} id
9371  * @param {function(string, string): void=} opt_callback Response callback that
9372  *     returns two string: (1) an error string (or empty string on success) and
9373  *     (2) an error code in case of error
9374  */
9375 chrome.inlineInstallPrivate.install = function(id, opt_callback) {};