Debian Codegraph @

contrib/externs/chrome_extensions.js

raw symbols SCIP
1 /*
2 * Copyright 2009 Closure Compiler Authors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /**
18 * @fileoverview Definitions for the Chromium extensions API.
19 *
20 * There are several problematic issues regarding Chrome extension APIs and
21 * this externs files, including:
22 * A. When to add packages to this file
23 * B. Optional parameters
24 * C. Pseduo-types
25 * D. Events
26 * E. Nullability
27 *
28 * The best practices for each are described in more detail below. It
29 * should be noted that, due to historical reasons, and the evolutionary
30 * nature of this file, much this file currently violates the best practices
31 * described below. As changed are made, the changes should adhere to the
32 * best practices.
33 *
34 * A. When to Add Packages to this File?
35 * Packages in chrome.experimental.* should *not* be added to this file. The
36 * experimental APIs change very quickly, so rather than add them here, make a
37 * separate externs file for your project, then move the API here when it moves
38 * out of experimental.
39 *
40 * B. Optional Parameters
41 * The Chrome extension APIs make extensive use of optional parameters that
42 * are not at the end of the parameter list, "interior optional parameters",
43 * while the JS Compiler's type system requires optional parameters to be
44 * at the end. This creates a bit of tension:
45 *
46 * 1. If a method has N required params, then the parameter declarations
47 * should have N required params.
48 * 2. If, due to interior optional params, a parameter can be of more than
49 * one type, its at-param should:
50 * a. be named to indicate both possibilities, eg, extensionIdOrRequest,
51 * or getInfoOrCallback.
52 * b. the type should include both types, in the same order as the parts
53 * of the name, even when one type subsumes the other, eg, {string|*}
54 * or {Object|function(string)}.
55 * See chrome.runtime.sendMessage for a complex example as sendMessage
56 * takes three params with the first and third being optional.
57 *
58 * C. Pseudo-types
59 * The Chrome APIs define many types are that actually pseudo-types, that
60 * is, they can't be instantiated by name, such as Port defined at
61 * http://developer.chrome.com/extensions/extension.html#type-Port.
62 *
63 * There are two fundamentally different kinds of pseudo-types: those
64 * instantiated in extension code and those instantiated in extension
65 * library functions. The latter are returned by library functions or passed
66 * to callbacks. Currently, there are no instances of the former in Chrome
67 * Extension APIs, however, the app APIs include CreateWindowOptions, defined at
68 * http://developer.chrome.com/apps/app.window.html#type-CreateWindowOptions.
69 *
70 * Those types instantiated in extension code should be declared as typedefs
71 * so that object literals and objects created via goog.object are acceptable,
72 * for example, a subset of CreateWindowOptions would be:
73 *
74 * * at-typedef {{id: (string|undefined), singleton: (boolean|undefined)}}
75 * chrome.app.window.CreateWindowOptions;
76 *
77 * Those types instantiated in library code should be declared as classes.
78 * Always qualify the type name to reduce top-level pollution in this file:
79 *
80 * Do:
81 * function chrome.extension.Port() {}
82 * Don't:
83 * function Port() {}
84 *
85 * In both cases, when the type is used by more than one package use "shared",
86 * for example, chrome.shared.Port.
87 *
88 * D. Events
89 * Most packages define a set of events with the standard set of methods:
90 * addListener, removeListener, hasListener and hasListeners. ChromeEvent
91 * is the appropriate type when an event's listeners do not take any
92 * parameters, however, many events take parameters specific to that event:
93 *
94 * 1. Create a pseduo-type for the event, for example,
95 * chrome.runtime.PortEvent and define the four methods on it.
96 * 2. Fully describe the listener/callback's signature, for example,
97 *
98 * * at-param {function(!chrome.runtime.Port): void} callback Callback.
99 * chrome.runtime.PortEvent.prototype.addListener =
100 * function(callback) {};
101 * or
102 *
103 * * at-param {function(*, !chrome.runtime.MessageSender,
104 * * function(*): void): (boolean|undefined)} callback Callback.
105 * chrome.runtime.MessageSenderEvent.prototype.addListener =
106 * function(callback) {};
107 *
108 * E. Nullability
109 * We treat the Chrome Extension API pages as "the truth". Not-null types
110 * should be used in the following situations:
111 *
112 * 1. Parameters and return values that are not explicitly declared to handle
113 * null.
114 * 2. Static event instances, for example, chrome.runtime.onConnect's type
115 * should be: !chrome.runtime.PortEvent.
116 * 3. Optional params as there is little value to passing null when the
117 * parameter can be omitted, of course, if null is explicitly declared
118 * to be meaningful, then a nullable type should be used.
119 *
120 * @externs
121 *
122 */
123
124
125 /**
126 * namespace
127 * @const
128 */
129 var chrome = {};
130
131
132 /**
133 * @see http://code.google.com/chrome/extensions/extension.html
134 * @const
135 */
136 chrome.extension = {};
137
138
139 /** @type {!Object.<string,string>|undefined} */
140 chrome.extension.lastError;
141
142
143 /** @type {boolean|undefined} */
144 chrome.extension.inIncognitoContext;
145
146
147 // TODO: change Object to !Object when it's clear nobody is passing in null
148 // TODO: change Port to !Port since it should never be null
149 /**
150 * @param {string|Object.<string>=} opt_extensionIdOrConnectInfo Either the
151 * extensionId to connect to, in which case connectInfo params can be
152 * passed in the next optional argument, or the connectInfo params.
153 * @param {Object.<string>=} opt_connectInfo The connectInfo object,
154 * if arg1 was the extensionId to connect to.
155 * @return {Port} New port.
156 */
157 chrome.extension.connect = function(
158 opt_extensionIdOrConnectInfo, opt_connectInfo) {};
159
160
161 /**
162 * @return {Window} The global JS object for the background page.
163 */
164 chrome.extension.getBackgroundPage = function() {};
165
166
167 /**
168 * @param {string} path A path to a resource within an extension expressed
169 * relative to it's install directory.
170 * @return {string} The fully-qualified URL to the resource.
171 */
172 chrome.extension.getURL = function(path) {};
173
174
175 /**
176 * @param {Object=} opt_fetchProperties An object with optional 'type' and
177 * optional 'windowId' keys.
178 * @return {Array.<Window>} The global JS objects for each content view.
179 */
180 chrome.extension.getViews = function(opt_fetchProperties) {};
181
182
183 /**
184 * @param {function(boolean): void} callback Callback function.
185 */
186 chrome.extension.isAllowedFileSchemeAccess = function(callback) {};
187
188
189 /**
190 * @param {function(boolean): void} callback Callback function.
191 */
192 chrome.extension.isAllowedIncognitoAccess = function(callback) {};
193
194
195 /**
196 * @param {string|*} extensionIdOrRequest Either the extensionId to send the
197 * request to, in which case the request is passed as the next arg, or the
198 * request.
199 * @param {*=} opt_request The request value, if arg1 was the extensionId.
200 * @param {function(*): void=} opt_callback The callback function which
201 * takes a JSON response object sent by the handler of the request.
202 */
203 chrome.extension.sendMessage = function(
204 extensionIdOrRequest, opt_request, opt_callback) {};
205
206
207 /**
208 * @param {number|*=} opt_arg1 Either the extensionId to send the request to,
209 * in which case the request is passed as the next arg, or the request.
210 * @param {*=} opt_request The request value, if arg1 was the extensionId.
211 * @param {function(*): void=} opt_callback The callback function which
212 * takes a JSON response object sent by the handler of the request.
213 */
214 chrome.extension.sendRequest = function(opt_arg1, opt_request, opt_callback) {};
215
216
217 /**
218 * @param {string} data
219 */
220 chrome.extension.setUpdateUrlData = function(data) {};
221
222
223 /** @type {ChromeEvent} */
224 chrome.extension.onConnect;
225
226
227 /** @type {ChromeEvent} */
228 chrome.extension.onConnectExternal;
229
230
231 /** @type {ChromeEvent} */
232 chrome.extension.onMessage;
233
234
235 /** @type {ChromeEvent} */
236 chrome.extension.onRequest;
237
238
239 /** @type {ChromeEvent} */
240 chrome.extension.onRequestExternal;
241
242
243 /**
244 * @see http://code.google.com/chrome/extensions/runtime.html
245 * @const
246 */
247 chrome.runtime = {};
248
249
250 /** @type {!Object.<string,string>|undefined} */
251 chrome.runtime.lastError;
252
253
254 /** @type {string} */
255 chrome.runtime.id;
256
257
258 /**
259 * @param {function(!Window=): void} callback Callback function.
260 */
261 chrome.runtime.getBackgroundPage = function(callback) {};
262
263
264 /**
265 * @return {!Object} The full manifest file of the app or extension.
266 */
267 chrome.runtime.getManifest = function() {};
268
269
270 /**
271 * @param {string} path A path to a resource within an extension expressed
272 * relative to it's install directory.
273 * @return {string} The fully-qualified URL to the resource.
274 */
275 chrome.runtime.getURL = function(path) {};
276
277
278 /**
279 * Reloads the app or extension.
280 */
281 chrome.runtime.reload = function() {};
282
283
284 /**
285 * @param {function(string, !Object=): void} callback
286 */
287 chrome.runtime.requestUpdateCheck = function(callback) {};
288
289
290 /**
291 * @param {string|!Object.<string>=} opt_extensionIdOrConnectInfo Either the
292 * extensionId to connect to, in which case connectInfo params can be
293 * passed in the next optional argument, or the connectInfo params.
294 * @param {!Object.<string>=} opt_connectInfo The connectInfo object,
295 * if arg1 was the extensionId to connect to.
296 * @return {!Port} New port.
297 */
298 chrome.runtime.connect = function(
299 opt_extensionIdOrConnectInfo, opt_connectInfo) {};
300
301
302 /**
303 * @param {string|*} extensionIdOrMessage Either the extensionId to send the
304 * message to, in which case the message is passed as the next arg, or the
305 * message itself.
306 * @param {(*|function(*): void)=} opt_messageOrCallback The message, if arg1
307 * was the extensionId, or the callback, if arg1 was the message, or
308 * optional.
309 * @param {function(*): void=} opt_callback The callback function which
310 * takes a JSON response object sent by the handler of the request.
311 */
312 chrome.runtime.sendMessage = function(
313 extensionIdOrMessage, opt_messageOrCallback, opt_callback) {};
314
315
316 /** @type {!chrome.runtime.PortEvent} */
317 chrome.runtime.onConnect;
318
319
320 /** @type {!chrome.runtime.PortEvent} */
321 chrome.runtime.onConnectExternal;
322
323
324 /** @type {!chrome.runtime.ObjectEvent} */
325 chrome.runtime.onInstalled;
326
327
328 /** @type {!chrome.runtime.MessageSenderEvent} */
329 chrome.runtime.onMessage;
330
331
332 /** @type {!chrome.runtime.MessageSenderEvent} */
333 chrome.runtime.onMessageExternal;
334
335
336 /** @type {!ChromeEvent} */
337 chrome.runtime.onStartup;
338
339
340 /** @type {!ChromeEvent} */
341 chrome.runtime.onSuspend;
342
343
344 /** @type {!ChromeEvent} */
345 chrome.runtime.onSuspendCanceled;
346
347
348 /** @type {!chrome.runtime.ObjectEvent} */
349 chrome.runtime.onUpdateAvailable;
350
351
352
353 /**
354 * Event whose listeners take an Object parameter.
355 * @constructor
356 */
357 chrome.runtime.ObjectEvent = function() {};
358
359
360 /**
361 * @param {function(!Object): void} callback Callback.
362 */
363 chrome.runtime.ObjectEvent.prototype.addListener = function(callback) {};
364
365
366 /**
367 * @param {function(!Object): void} callback Callback.
368 */
369 chrome.runtime.ObjectEvent.prototype.removeListener = function(callback) {};
370
371
372 /**
373 * @param {function(!Object): void} callback Callback.
374 * @return {boolean}
375 */
376 chrome.runtime.ObjectEvent.prototype.hasListener = function(callback) {};
377
378
379 /**
380 * @return {boolean}
381 */
382 chrome.runtime.ObjectEvent.prototype.hasListeners = function() {};
383
384
385
386 /**
387 * Event whose listeners take a Port parameter.
388 * @constructor
389 */
390 chrome.runtime.PortEvent = function() {};
391
392
393 /**
394 * @param {function(!Port): void} callback Callback.
395 */
396 chrome.runtime.PortEvent.prototype.addListener = function(callback) {};
397
398
399 /**
400 * @param {function(!Port): void} callback Callback.
401 */
402 chrome.runtime.PortEvent.prototype.removeListener = function(callback) {};
403
404
405 /**
406 * @param {function(!Port): void} callback Callback.
407 * @return {boolean}
408 */
409 chrome.runtime.PortEvent.prototype.hasListener = function(callback) {};
410
411
412 /**
413 * @return {boolean}
414 */
415 chrome.runtime.PortEvent.prototype.hasListeners = function() {};
416
417
418
419 /**
420 * Event whose listeners take a MessageSender and additional parameters.
421 * @see https://developer.chrome.com/dev/apps/runtime.html#event-onMessage
422 * @constructor
423 */
424 chrome.runtime.MessageSenderEvent = function() {};
425
426
427 /**
428 * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
429 * callback Callback.
430 */
431 chrome.runtime.MessageSenderEvent.prototype.addListener = function(callback) {};
432
433
434 /**
435 * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
436 * callback Callback.
437 */
438 chrome.runtime.MessageSenderEvent.prototype.removeListener = function(callback)
439 {};
440
441
442 /**
443 * @param {function(*, !MessageSender, function(*): void): (boolean|undefined)}
444 * callback Callback.
445 * @return {boolean}
446 */
447 chrome.runtime.MessageSenderEvent.prototype.hasListener = function(callback) {};
448
449
450 /**
451 * @return {boolean}
452 */
453 chrome.runtime.MessageSenderEvent.prototype.hasListeners = function() {};
454
455
456 /**
457 * @const
458 * @see http://code.google.com/chrome/extensions/tabs.html
459 */
460 chrome.tabs = {};
461
462
463 /**
464 * @param {number?} windowId Window Id.
465 * @param {Object?} options parameters of image capture, such as the format of
466 * the resulting image.
467 * @param {function(string): void} callback Callback function which accepts
468 * the data URL string of a JPEG encoding of the visible area of the
469 * captured tab. May be assigned to the 'src' property of an HTML Image
470 * element for display.
471 */
472 chrome.tabs.captureVisibleTab = function(windowId, options, callback) {};
473
474
475 /**
476 * @param {number} tabId Tab Id.
477 * @param {Object.<string>=} opt_connectInfo Info Object.
478 */
479 chrome.tabs.connect = function(tabId, opt_connectInfo) {};
480
481
482 /**
483 * @param {Object} createProperties Info object.
484 * @param {function(Tab): void=} opt_callback The callback function.
485 */
486 chrome.tabs.create = function(createProperties, opt_callback) {};
487
488
489 /**
490 * @param {number?} tabId Tab id.
491 * @param {function(string): void} callback Callback function.
492 */
493 chrome.tabs.detectLanguage = function(tabId, callback) {};
494
495
496 /**
497 * @param {number?} tabId Tab id.
498 * @param {Object?} details An object which may have 'code', 'file',
499 * or 'allFrames' keys.
500 * @param {function(): void=} opt_callback Callback function.
501 */
502 chrome.tabs.executeScript = function(tabId, details, opt_callback) {};
503
504
505 /**
506 * @param {number} tabId Tab id.
507 * @param {function(Tab): void} callback Callback.
508 */
509 chrome.tabs.get = function(tabId, callback) {};
510
511
512 /**
513 * Note: as of 2012-04-12, this function is no longer documented on
514 * the public web pages, but there are still existing usages
515 *
516 * @param {number?} windowId Window id.
517 * @param {function(Array.<Tab>): void} callback Callback.
518 */
519 chrome.tabs.getAllInWindow = function(windowId, callback) {};
520
521
522 /**
523 * @param {function(Tab): void} callback Callback.
524 */
525 chrome.tabs.getCurrent = function(callback) {};
526
527
528 /**
529 * Note: as of 2012-04-12, this function is no longer documented on
530 * the public web pages, but there are still existing usages.
531 *
532 * @param {number?} windowId Window id.
533 * @param {function(Tab): void} callback Callback.
534 */
535 chrome.tabs.getSelected = function(windowId, callback) {};
536
537
538 /**
539 * @param {Object.<string, (number|Array.<number>)>} highlightInfo
540 * An object with 'windowId' (number) and 'tabs'
541 * (number or array of numbers) keys.
542 * @param {function(Window): void} callback Callback function invoked
543 * with each appropriate Window.
544 */
545 chrome.tabs.highlight = function(highlightInfo, callback) {};
546
547
548 /**
549 * @param {number?} tabId Tab id.
550 * @param {Object?} details An object which may have 'code', 'file',
551 * or 'allFrames' keys.
552 * @param {function(): void=} opt_callback Callback function.
553 */
554 chrome.tabs.insertCSS = function(tabId, details, opt_callback) {};
555
556
557 /**
558 * @param {number} tabId Tab id.
559 * @param {Object.<string, number>} moveProperties An object with 'index'
560 * and optional 'windowId' keys.
561 * @param {function(Tab): void=} opt_callback Callback.
562 */
563 chrome.tabs.move = function(tabId, moveProperties, opt_callback) {};
564
565
566 /**
567 * @param {Object.<string, (number|string)>} queryInfo An object which may have
568 * 'active', 'pinned', 'highlighted', 'status', 'title', 'url', 'windowId',
569 * and 'windowType' keys.
570 * @param {function(Array.<Tab>): void=} opt_callback Callback.
571 * @return {!Array.<Tab>}
572 */
573 chrome.tabs.query = function(queryInfo, opt_callback) {};
574
575
576 /**
577 * @param {number=} opt_tabId Tab id.
578 * @param {Object.<string, boolean>=} opt_reloadProperties An object which
579 * may have a 'bypassCache' key.
580 * @param {function(): void=} opt_callback The callback function invoked
581 * after the tab has been reloaded.
582 */
583 chrome.tabs.reload = function(opt_tabId, opt_reloadProperties, opt_callback) {};
584
585
586 /**
587 * @param {number|Array.<number>} tabIds A tab ID or an array of tab IDs.
588 * @param {function(Tab): void=} opt_callback Callback.
589 */
590 chrome.tabs.remove = function(tabIds, opt_callback) {};
591
592 /**
593 * @param {number} tabId Tab id.
594 * @param {*} request The request value of any type.
595 * @param {function(*): void=} opt_callback The callback function which
596 * takes a JSON response object sent by the handler of the request.
597 */
598 chrome.tabs.sendMessage = function(tabId, request, opt_callback) {};
599
600 /**
601 * @param {number} tabId Tab id.
602 * @param {*} request The request value of any type.
603 * @param {function(*): void=} opt_callback The callback function which
604 * takes a JSON response object sent by the handler of the request.
605 */
606 chrome.tabs.sendRequest = function(tabId, request, opt_callback) {};
607
608
609 /**
610 * @param {number} tabId Tab id.
611 * @param {Object.<string, (string|boolean)>} updateProperties An object which
612 * may have 'url' or 'selected' key.
613 * @param {function(Tab): void=} opt_callback Callback.
614 */
615 chrome.tabs.update = function(tabId, updateProperties, opt_callback) {};
616
617
618 /** @type {ChromeEvent} */
619 chrome.tabs.onActiveChanged;
620
621
622 /** @type {ChromeEvent} */
623 chrome.tabs.onAttached;
624
625
626 /** @type {ChromeEvent} */
627 chrome.tabs.onCreated;
628
629
630 /** @type {ChromeEvent} */
631 chrome.tabs.onDetached;
632
633
634 /** @type {ChromeEvent} */
635 chrome.tabs.onHighlightChanged;
636
637
638 /** @type {ChromeEvent} */
639 chrome.tabs.onMoved;
640
641
642 /** @type {ChromeEvent} */
643 chrome.tabs.onRemoved;
644
645
646 /** @type {ChromeEvent} */
647 chrome.tabs.onUpdated;
648
649 // DEPRECATED:
650 // TODO(user): Remove once all usage has been confirmed to have ended.
651
652
653 /** @type {ChromeEvent} */
654 chrome.tabs.onSelectionChanged;
655
656
657 /**
658 * @const
659 * @see http://code.google.com/chrome/extensions/windows.html
660 */
661 chrome.windows = {};
662
663
664 /**
665 * @param {Object=} opt_createData May have many keys to specify parameters.
666 * Or the callback.
667 * @param {function(ChromeWindow): void=} opt_callback Callback.
668 */
669 chrome.windows.create = function(opt_createData, opt_callback) {};
670
671
672 /**
673 * @param {number} id Window id.
674 * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
675 * @param {function(!ChromeWindow): void=} opt_callback Callback when
676 * opt_getInfo is an object.
677 */
678 chrome.windows.get = function(id, opt_getInfo, opt_callback) {};
679
680
681 /**
682 * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
683 * @param {function(!Array.<!ChromeWindow>): void=} opt_callback Callback.
684 */
685 chrome.windows.getAll = function(opt_getInfo, opt_callback) {};
686
687
688 /**
689 * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
690 * @param {function(ChromeWindow): void=} opt_callback Callback.
691 */
692 chrome.windows.getCurrent = function(opt_getInfo, opt_callback) { };
693
694
695 /**
696 * @param {Object=} opt_getInfo May have 'populate' key. Or the callback.
697 * @param {function(ChromeWindow): void=} opt_callback Callback.
698 */
699 chrome.windows.getLastFocused = function(opt_getInfo, opt_callback) { };
700
701
702 /**
703 * @param {number} tabId Tab Id.
704 * @param {function(): void=} opt_callback Callback.
705 */
706 chrome.windows.remove = function(tabId, opt_callback) {};
707
708
709 /**
710 * @param {number} tabId Tab Id.
711 * @param {Object} updateProperties An object which may have many keys for
712 * various options.
713 * @param {function(): void=} opt_callback Callback.
714 */
715 chrome.windows.update = function(tabId, updateProperties, opt_callback) {};
716
717
718 /** @type {ChromeEvent} */
719 chrome.windows.onCreated;
720
721
722 /** @type {ChromeEvent} */
723 chrome.windows.onFocusChanged;
724
725
726 /** @type {ChromeEvent} */
727 chrome.windows.onRemoved;
728
729
730 /**
731 * @see http://code.google.com/chrome/extensions/windows.html#property-WINDOW_ID_NONE
732 * @type {number}
733 */
734 chrome.windows.WINDOW_ID_NONE;
735
736
737 /**
738 * @see http://code.google.com/chrome/extensions/windows.html#property-WINDOW_ID_CURRENT
739 * @type {number}
740 */
741 chrome.windows.WINDOW_ID_CURRENT;
742
743
744 /**
745 * @const
746 * @see http://code.google.com/chrome/extensions/i18n.html
747 */
748 chrome.i18n = {};
749
750
751 /**
752 * @param {function(Array.<string>): void} callback The callback function which
753 * accepts an array of the accept languages of the browser, such as
754 * 'en-US','en','zh-CN'.
755 */
756 chrome.i18n.getAcceptLanguages = function(callback) {};
757
758
759 /**
760 * @param {string} messageName
761 * @param {(string|Array.<string>)=} opt_args
762 * @return {string}
763 */
764 chrome.i18n.getMessage = function(messageName, opt_args) {};
765
766
767 /**
768 * @const
769 * @see http://code.google.com/chrome/extensions/pageAction.html
770 */
771 chrome.pageAction = {};
772
773
774 /**
775 * @param {number} tabId Tab Id.
776 */
777 chrome.pageAction.hide = function(tabId) {};
778
779
780 /**
781 * @param {Object} details An object which has 'tabId' and either
782 * 'imageData' or 'path'.
783 */
784 chrome.pageAction.setIcon = function(details) {};
785
786
787 /**
788 * @param {Object} details An object which may have 'popup' or 'tabId' as keys.
789 */
790 chrome.pageAction.setPopup = function(details) {};
791
792
793 /**
794 * @param {Object} details An object which has 'tabId' and 'title'.
795 */
796 chrome.pageAction.setTitle = function(details) {};
797
798
799 /**
800 * @param {number} tabId Tab Id.
801 */
802 chrome.pageAction.show = function(tabId) {};
803
804
805 /** @type {ChromeEvent} */
806 chrome.pageAction.onClicked;
807
808
809 /**
810 * @const
811 * @see http://code.google.com/chrome/extensions/browserAction.html
812 */
813 chrome.browserAction = {};
814
815
816 /**
817 * @param {Object} details An object whose keys are 'color' and
818 * optionally 'tabId'.
819 */
820 chrome.browserAction.setBadgeBackgroundColor = function(details) {};
821
822
823 /**
824 * @param {Object} details An object whose keys are 'text' and
825 * optionally 'tabId'.
826 */
827 chrome.browserAction.setBadgeText = function(details) {};
828
829
830 /**
831 * @param {Object} details An object which may have 'imageData',
832 * 'path', or 'tabId' as keys.
833 */
834 chrome.browserAction.setIcon = function(details) {};
835
836
837 /**
838 * @param {Object} details An object which may have 'popup' or 'tabId' as keys.
839 */
840 chrome.browserAction.setPopup = function(details) {};
841
842
843 /**
844 * @param {Object} details An object which has 'title' and optionally
845 * 'tabId'.
846 */
847 chrome.browserAction.setTitle = function(details) {};
848
849
850 /** @type {ChromeEvent} */
851 chrome.browserAction.onClicked;
852
853
854 /**
855 * @const
856 * @see http://code.google.com/chrome/extensions/bookmarks.html
857 */
858 chrome.bookmarks = {};
859
860
861 /**
862 * @param {Object} bookmark An object which has 'parentId' and
863 * optionally 'index', 'title', and 'url'.
864 * @param {function(BookmarkTreeNode): void=} opt_callback The
865 * callback function which accepts a BookmarkTreeNode object.
866 * @return {BookmarkTreeNode}
867 */
868 chrome.bookmarks.create = function(bookmark, opt_callback) {};
869
870
871 /**
872 * @param {(string|Array.<string>)} idOrIdList
873 * @param {function(Array.<BookmarkTreeNode>): void} callback The
874 * callback function which accepts an array of BookmarkTreeNode.
875 * @return {Array.<BookmarkTreeNode>}
876 */
877 chrome.bookmarks.get = function(idOrIdList, callback) {};
878
879
880 /**
881 * @param {string} id
882 * @param {function(Array.<BookmarkTreeNode>): void} callback The
883 * callback function which accepts an array of BookmarkTreeNode.
884 * @return {Array.<BookmarkTreeNode>}
885 */
886 chrome.bookmarks.getChildren = function(id, callback) {};
887
888
889 /**
890 * @param {number} numberOfItems The number of items to return.
891 * @param {function(Array.<BookmarkTreeNode>): void} callback The
892 * callback function which accepts an array of BookmarkTreeNode.
893 * @return {Array.<BookmarkTreeNode>}
894 */
895 chrome.bookmarks.getRecent = function(numberOfItems, callback) {};
896
897
898 /**
899 * @param {string} id The ID of the root of the subtree to retrieve.
900 * @param {function(Array.<BookmarkTreeNode>): void} callback The
901 * callback function which accepts an array of BookmarkTreeNode.
902 * @return {Array.<BookmarkTreeNode>}
903 */
904 chrome.bookmarks.getSubTree = function(id, callback) {};
905
906
907 /**
908 * @param {function(Array.<BookmarkTreeNode>): void} callback The
909 * callback function which accepts an array of BookmarkTreeNode.
910 * @return {Array.<BookmarkTreeNode>}
911 */
912 chrome.bookmarks.getTree = function(callback) {};
913
914
915 /**
916 * @param {string} id
917 * @param {Object} destination An object which has 'parentId' and
918 * optionally 'index'.
919 * @param {function(Array.<BookmarkTreeNode>): void=} opt_callback
920 * The callback function which accepts an array of
921 * BookmarkTreeNode.
922 * @return {BookmarkTreeNode}
923 */
924 chrome.bookmarks.move = function(id, destination, opt_callback) {};
925
926
927 /**
928 * @param {string} id
929 * @param {function(): void=} opt_callback
930 */
931 chrome.bookmarks.remove = function(id, opt_callback) {};
932
933
934 /**
935 * @param {string} id
936 * @param {function(): void=} opt_callback
937 */
938 chrome.bookmarks.removeTree = function(id, opt_callback) {};
939
940
941 /**
942 * @param {string} query
943 * @param {function(Array.<BookmarkTreeNode>): void} callback
944 * @return {Array.<BookmarkTreeNode>}
945 */
946 chrome.bookmarks.search = function(query, callback) {};
947
948
949 /**
950 * @param {string} id
951 * @param {Object} changes An object which may have 'title' as a key.
952 * @param {function(BookmarkTreeNode): void=} opt_callback The
953 * callback function which accepts a BookmarkTreeNode object.
954 * @return {BookmarkTreeNode}
955 */
956 chrome.bookmarks.update = function(id, changes, opt_callback) {};
957
958
959 /** @type {ChromeEvent} */
960 chrome.bookmarks.onChanged;
961
962
963 /** @type {ChromeEvent} */
964 chrome.bookmarks.onChildrenReordered;
965
966
967 /** @type {ChromeEvent} */
968 chrome.bookmarks.onCreated;
969
970
971 /** @type {ChromeEvent} */
972 chrome.bookmarks.onImportBegan;
973
974
975 /** @type {ChromeEvent} */
976 chrome.bookmarks.onImportEnded;
977
978
979 /** @type {ChromeEvent} */
980 chrome.bookmarks.onMoved;
981
982
983 /** @type {ChromeEvent} */
984 chrome.bookmarks.onRemoved;
985
986
987 /**
988 * @const
989 * @see http://code.google.com/chrome/extensions/omnibox.html
990 */
991 chrome.omnibox = {};
992
993
994 /**
995 * @param {SuggestResult} suggestion A partial SuggestResult object.
996 */
997 chrome.omnibox.setDefaultSuggestion = function(suggestion) {};
998
999
1000 /** @type {ChromeEvent} */
1001 chrome.omnibox.onInputCancelled;
1002
1003
1004 /** @type {ChromeEvent} */
1005 chrome.omnibox.onInputChanged;
1006
1007
1008 /** @type {ChromeEvent} */
1009 chrome.omnibox.onInputEntered;
1010
1011
1012 /** @type {ChromeEvent} */
1013 chrome.omnibox.onInputStarted;
1014
1015
1016
1017 /**
1018 * @constructor
1019 */
1020 function SuggestResult() {}
1021
1022
1023 /** @type {string} */
1024 SuggestResult.prototype.content;
1025
1026
1027 /** @type {string} */
1028 SuggestResult.prototype.description;
1029
1030
1031 /**
1032 * @const
1033 * @see http://code.google.com/chrome/extensions/dev/contextMenus.html
1034 */
1035 chrome.contextMenus = {};
1036
1037
1038 /**
1039 * @param {!Object} createProperties
1040 * @param {function()=} opt_callback
1041 * @return {number} The id of the newly created window.
1042 */
1043 chrome.contextMenus.create = function(createProperties, opt_callback) {};
1044
1045
1046 /**
1047 * @param {number} menuItemId
1048 * @param {function()=} opt_callback
1049 */
1050 chrome.contextMenus.remove = function(menuItemId, opt_callback) {};
1051
1052
1053 /**
1054 * @param {function()=} opt_callback
1055 */
1056 chrome.contextMenus.removeAll = function(opt_callback) {};
1057
1058
1059 /**
1060 * @param {number} id
1061 * @param {!Object} updateProperties
1062 * @param {function()=} opt_callback
1063 */
1064 chrome.contextMenus.update = function(id, updateProperties, opt_callback) {};
1065
1066
1067 /**
1068 * @const
1069 * @see http://code.google.com/chrome/extensions/dev/cookies.html
1070 */
1071 chrome.cookies = {};
1072
1073
1074 /**
1075 * @param {Object} details
1076 * @param {function(Cookie=): void} callback
1077 */
1078 chrome.cookies.get = function(details, callback) {};
1079
1080
1081 /**
1082 * @param {Object} details
1083 * @param {function(Array.<Cookie>): void} callback
1084 */
1085 chrome.cookies.getAll = function(details, callback) {};
1086
1087
1088 /**
1089 * @param {function(Array.<CookieStore>): void} callback
1090 */
1091 chrome.cookies.getAllCookieStores = function(callback) {};
1092
1093
1094 /**
1095 * @param {Object} details
1096 */
1097 chrome.cookies.remove = function(details) {};
1098
1099
1100 /**
1101 * @param {Object} details
1102 */
1103 chrome.cookies.set = function(details) {};
1104
1105
1106 /**
1107 * @see http://code.google.com/chrome/extensions/cookies.html#event-onChanged
1108 * @type {ChromeEvent}
1109 */
1110 chrome.cookies.onChanged;
1111
1112
1113
1114 /** @constructor */
1115 function CookieChangeInfo() {}
1116
1117
1118 /** @type {boolean} */
1119 CookieChangeInfo.prototype.removed;
1120
1121
1122 /** @type {Cookie} */
1123 CookieChangeInfo.prototype.cookie;
1124
1125
1126 /** @type {string} */
1127 CookieChangeInfo.prototype.cause;
1128
1129 /** @const */
1130 chrome.management = {};
1131
1132
1133 /**
1134 * @param {string} id
1135 * @param {function(ExtensionInfo): void} callback
1136 */
1137 chrome.management.get = function(id, callback) {};
1138
1139
1140 /**
1141 * @param {function(Array.<ExtensionInfo>): void} callback Callback function.
1142 * @return {Array.<ExtensionInfo>}
1143 */
1144 chrome.management.getAll = function(callback) {};
1145
1146
1147 /**
1148 * @param {string} id The id of an already installed extension.
1149 * @param {function(Array.<string>)=} opt_callback Optional callback function.
1150 */
1151 chrome.management.getPermissionWarningsById = function(id, opt_callback) {};
1152
1153
1154 /**
1155 * @param {string} manifestStr Extension's manifest JSON string.
1156 * @param {function(Array.<string>)=} opt_callback An optional callback
1157 * function.
1158 */
1159 chrome.management.getPermissionWarningsByManifest =
1160 function(manifestStr, opt_callback) {};
1161
1162
1163 /**
1164 * @param {function(Array.<ExtensionInfo>): void} callback Callback function.
1165 */
1166 chrome.management.launchApp = function(id, callback) {};
1167
1168
1169 /**
1170 * @param {string} id
1171 * @param {boolean} enabled
1172 * @param {function(): void} callback
1173 */
1174 chrome.management.setEnabled = function(id, enabled, callback) {};
1175
1176
1177 /**
1178 * @param {string} id
1179 * @param {function(): void} callback
1180 */
1181 chrome.management.uninstall = function(id, callback) {};
1182
1183
1184 /** @type {ChromeEvent} */
1185 chrome.management.onDisabled;
1186
1187
1188 /** @type {ChromeEvent} */
1189 chrome.management.onEnabled;
1190
1191
1192 /** @type {ChromeEvent} */
1193 chrome.management.onInstalled;
1194
1195
1196 /** @type {ChromeEvent} */
1197 chrome.management.onUninstalled;
1198
1199
1200 /**
1201 * @const
1202 * @see http://code.google.com/chrome/extensions/idle.html
1203 */
1204 chrome.idle = {};
1205
1206
1207 /**
1208 * @param {number} thresholdSeconds Threshold in seconds, used to determine
1209 * when a machine is in the idle state.
1210 * @param {function(string): void} callback Callback to handle the state.
1211 */
1212 chrome.idle.queryState = function(thresholdSeconds, callback) {};
1213
1214
1215 /** @type {ChromeEvent} */
1216 chrome.idle.onStateChanged;
1217
1218
1219 /**
1220 * Chrome Text-to-Speech API.
1221 * @const
1222 * @see http://code.google.com/chrome/extensions/tts.html
1223 */
1224 chrome.tts = {};
1225
1226
1227
1228 /**
1229 * An event from the TTS engine to communicate the status of an utterance.
1230 * @constructor
1231 */
1232 function TtsEvent() {}
1233
1234
1235 /** @type {string} */
1236 TtsEvent.prototype.type;
1237
1238
1239 /** @type {number} */
1240 TtsEvent.prototype.charIndex;
1241
1242
1243 /** @type {string} */
1244 TtsEvent.prototype.errorMessage;
1245
1246
1247
1248 /**
1249 * A description of a voice available for speech synthesis.
1250 * @constructor
1251 */
1252 function TtsVoice() {}
1253
1254
1255 /** @type {string} */
1256 TtsVoice.prototype.voiceName;
1257
1258
1259 /** @type {string} */
1260 TtsVoice.prototype.lang;
1261
1262
1263 /** @type {string} */
1264 TtsVoice.prototype.gender;
1265
1266
1267 /** @type {string} */
1268 TtsVoice.prototype.extensionId;
1269
1270
1271 /** @type {Array.<string>} */
1272 TtsVoice.prototype.eventTypes;
1273
1274
1275 /**
1276 * Gets an array of all available voices.
1277 * @param {function(Array.<TtsVoice>)=} opt_callback An optional callback
1278 * function.
1279 */
1280 chrome.tts.getVoices = function(opt_callback) {};
1281
1282
1283 /**
1284 * Checks if the engine is currently speaking.
1285 * @param {function(boolean)=} opt_callback The callback function.
1286 */
1287 chrome.tts.isSpeaking = function(opt_callback) {};
1288
1289
1290 /**
1291 * Speaks text using a text-to-speech engine.
1292 * @param {string} utterance The text to speak, either plain text or a complete,
1293 * well-formed SSML document. Speech engines that do not support SSML will
1294 * strip away the tags and speak the text. The maximum length of the text is
1295 * 32,768 characters.
1296 * @param {Object=} opt_options The speech options.
1297 * @param {function()=} opt_callback Called right away, before speech finishes.
1298 */
1299 chrome.tts.speak = function(utterance, opt_options, opt_callback) {};
1300
1301
1302 /**
1303 * Stops any current speech.
1304 */
1305 chrome.tts.stop = function() {};
1306
1307
1308 /**
1309 * @const
1310 * @see http://code.google.com/chrome/extensions/ttsEngine.html
1311 */
1312 chrome.ttsEngine = {};
1313
1314
1315 /** @type {ChromeEvent} */
1316 chrome.ttsEngine.onSpeak;
1317
1318
1319 /** @type {ChromeEvent} */
1320 chrome.ttsEngine.onStop;
1321
1322
1323 /**
1324 * @const
1325 * @see http://code.google.com/chrome/extensions/contentSettings.html
1326 */
1327 chrome.contentSettings = {};
1328
1329
1330 /** @type {!ContentSetting} */
1331 chrome.contentSettings.cookies;
1332
1333
1334 /** @type {!ContentSetting} */
1335 chrome.contentSettings.images;
1336
1337
1338 /** @type {!ContentSetting} */
1339 chrome.contentSettings.javascript;
1340
1341
1342 /** @type {!ContentSetting} */
1343 chrome.contentSettings.plugins;
1344
1345
1346 /** @type {!ContentSetting} */
1347 chrome.contentSettings.popups;
1348
1349
1350 /** @type {!ContentSetting} */
1351 chrome.contentSettings.notifications;
1352
1353
1354 /**
1355 * @const
1356 * @see http://code.google.com/chrome/extensions/fileBrowserHandle.html
1357 */
1358 chrome.fileBrowserHandle = {};
1359
1360
1361 /** @type {ChromeEvent} */
1362 chrome.fileBrowserHandle.onExecute;
1363
1364
1365 /**
1366 * @const
1367 * @see http://code.google.com/chrome/extensions/history.html
1368 */
1369 chrome.history = {};
1370
1371
1372 /**
1373 * @param {Object.<string, string>} details Object with a 'url' key.
1374 */
1375 chrome.history.addUrl = function(details) {};
1376
1377
1378 /**
1379 * @param {function(): void} callback Callback function.
1380 */
1381 chrome.history.deleteAll = function(callback) {};
1382
1383
1384 /**
1385 * @param {Object.<string, string>} range Object with 'startTime'
1386 * and 'endTime' keys.
1387 * @param {function(): void} callback Callback function.
1388 */
1389 chrome.history.deleteRange = function(range, callback) {};
1390
1391
1392 /**
1393 * @param {Object.<string, string>} details Object with a 'url' key.
1394 */
1395 chrome.history.deleteUrl = function(details) {};
1396
1397
1398 /**
1399 * @param {Object.<string, string>} details Object with a 'url' key.
1400 * @param {function(!Array.<!VisitItem>): void} callback Callback function.
1401 * @return {!Array.<!VisitItem>}
1402 */
1403 chrome.history.getVisits = function(details, callback) {};
1404
1405
1406 /**
1407 * @param {Object.<string, string>} query Object with a 'text' (string)
1408 * key and optional 'startTime' (number), 'endTime' (number) and
1409 * 'maxResults' keys.
1410 * @param {function(!Array.<!HistoryItem>): void} callback Callback function.
1411 * @return {!Array.<!HistoryItem>}
1412 */
1413 chrome.history.search = function(query, callback) {};
1414
1415
1416 /** @type {ChromeEvent} */
1417 chrome.history.onVisitRemoved;
1418
1419
1420 /** @type {ChromeEvent} */
1421 chrome.history.onVisited;
1422
1423
1424 /**
1425 * @const
1426 * @see http://code.google.com/chrome/extensions/input.ime.html
1427 */
1428 chrome.input = {};
1429
1430 /** @const */
1431 chrome.input.ime = {};
1432
1433 /**
1434 * The OnKeyEvent event takes an extra argument.
1435 * @constructor
1436 */
1437 function ChromeInputImeOnKeyEventEvent() {}
1438
1439
1440 /**
1441 * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
1442 * callback.
1443 * @param {Array.<string>=} opt_extraInfoSpec Array of extra information.
1444 */
1445 ChromeInputImeOnKeyEventEvent.prototype.addListener =
1446 function(callback, opt_extraInfoSpec) {};
1447
1448
1449 /**
1450 * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
1451 * callback.
1452 */
1453 ChromeInputImeOnKeyEventEvent.prototype.removeListener = function(callback) {};
1454
1455 /**
1456 * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
1457 * callback.
1458 */
1459 ChromeInputImeOnKeyEventEvent.prototype.hasListener = function(callback) {};
1460
1461 /**
1462 * @param {function(string, !ChromeKeyboardEvent): (boolean|undefined)} callback
1463 * callback.
1464 */
1465 ChromeInputImeOnKeyEventEvent.prototype.hasListeners = function(callback) {};
1466
1467
1468 /**
1469 * @param {!Object.<string,number>} parameters An object with a
1470 * 'contextID' (number) key.
1471 * @param {function(boolean): void} callback Callback function.
1472 */
1473 chrome.input.ime.clearComposition = function(parameters, callback) {};
1474
1475
1476 /**
1477 * @param {!Object.<string,(string|number)>} parameters An object with
1478 * 'contextID' (number) and 'text' (string) keys.
1479 * @param {function(boolean): void=} opt_callback Callback function.
1480 */
1481 chrome.input.ime.commitText = function(parameters, opt_callback) {};
1482
1483
1484 /**
1485 * @param {!Object.<string,(number|Object.<string,(string|number|boolean)>)>}
1486 * parameters An object with 'engineID' (string) and 'properties'
1487 * (Object) keys.
1488 * @param {function(boolean): void=} opt_callback Callback function.
1489 */
1490 chrome.input.ime.setCandidateWindowProperties =
1491 function(parameters, opt_callback) {};
1492
1493
1494 /**
1495 * @param {!Object.<string,(number|Object.<string,(string|number)>)>}
1496 * parameters An object with 'contextID' (number) and 'candidates'
1497 * (array of object) keys.
1498 * @param {function(boolean): void=} opt_callback Callback function.
1499 */
1500 chrome.input.ime.setCandidates = function(parameters, opt_callback) {};
1501
1502
1503 /**
1504 * @param {!Object.<string,(string|number|Object.<string,(string|number)>)>}
1505 * parameters An object with 'contextID' (number), 'text' (string),
1506 * 'selectionStart (number), 'selectionEnd' (number), 'cursor' (number),
1507 * and 'segments' (array of object) keys.
1508 * @param {function(boolean): void=} opt_callback Callback function.
1509 */
1510 chrome.input.ime.setComposition = function(parameters, opt_callback) {};
1511
1512
1513 /**
1514 * @param {!Object.<string,number>} parameters An object with
1515 * 'contextID' (number) and 'candidateID' (number) keys.
1516 * @param {function(boolean): void=} opt_callback Callback function.
1517 */
1518 chrome.input.ime.setCursorPosition = function(parameters, opt_callback) {};
1519
1520
1521 /**
1522 * @param {!Object.<string,(string|Array.<Object.<string,(string|boolean)>>)>}
1523 * parameters An object with 'engineID' (string) and 'items'
1524 * (array of object) keys.
1525 * @param {function(): void=} opt_callback Callback function.
1526 */
1527 chrome.input.ime.setMenuItems = function(parameters, opt_callback) {};
1528
1529
1530 /**
1531 * @param {!Object.<string,(string|Array.<Object.<string,(string|boolean)>>)>}
1532 * parameters An object with 'engineID' (string) and 'items'
1533 * (array of object) keys.
1534 * @param {function(): void=} opt_callback Callback function.
1535 */
1536 chrome.input.ime.updateMenuItems = function(parameters, opt_callback) {};
1537
1538 /**
1539 * @param {string} requestId Request id of the event that was handled. This
1540 * should come from keyEvent.requestId.
1541 * @param {boolean} response True if the keystroke was handled, false if not.
1542 */
1543 chrome.input.ime.keyEventHandled = function(requestId, response) {};
1544
1545
1546 /** @type {!ChromeEvent} */
1547 chrome.input.ime.onActivate;
1548
1549
1550 /** @type {!ChromeEvent} */
1551 chrome.input.ime.onBlur;
1552
1553
1554 /** @type {!ChromeEvent} */
1555 chrome.input.ime.onCandidateClicked;
1556
1557
1558 /** @type {!ChromeEvent} */
1559 chrome.input.ime.onDeactivated;
1560
1561
1562 /** @type {!ChromeEvent} */
1563 chrome.input.ime.onFocus;
1564
1565
1566 /** @type {!ChromeEvent} */
1567 chrome.input.ime.onInputContextUpdate;
1568
1569
1570 /** @type {!ChromeInputImeOnKeyEventEvent} */
1571 chrome.input.ime.onKeyEvent;
1572
1573
1574 /** @type {!ChromeEvent} */
1575 chrome.input.ime.onMenuItemActivated;
1576
1577
1578 /** @const namespace */
1579 chrome.mediaGalleries = {};
1580
1581
1582 /**
1583 * @param {?{interactive: (string|undefined)}} details Whether the request
1584 * should be interactive if permissions haven't been granted yet.
1585 * @param {function(!Array.<!FileSystem>)} callback A success callback.
1586 */
1587 chrome.mediaGalleries.getMediaFileSystems = function(details, callback) {};
1588
1589
1590 /**
1591 * @const
1592 * @see http://code.google.com/chrome/extensions/pageCapture.html
1593 */
1594 chrome.pageCapture = {};
1595
1596
1597 /**
1598 * @param {Object.<string, number>} details Object with a 'tabId' (number) key.
1599 * @param {function(Blob=): void} callback Callback function.
1600 */
1601 chrome.pageCapture.saveAsMHTML = function(details, callback) {};
1602
1603 /**
1604 * @const
1605 * @see http://code.google.com/chrome/extensions/permissions.html
1606 */
1607 chrome.permissions = {};
1608
1609
1610 /**
1611 * @param {!Permissions} permissions Permissions.
1612 * @param {function(boolean): void} callback Callback function.
1613 */
1614 chrome.permissions.contains = function(permissions, callback) {};
1615
1616
1617 /**
1618 * @param {function(!Permissions): void} callback Callback function.
1619 */
1620 chrome.permissions.getAll = function(callback) {};
1621
1622
1623 /**
1624 * @param {!Permissions} permissions Permissions.
1625 * @param {function(boolean): void=} opt_callback Callback function.
1626 */
1627 chrome.permissions.remove = function(permissions, opt_callback) {};
1628
1629
1630 /**
1631 * @param {!Permissions} permissions Permissions.
1632 * @param {function(boolean): void=} opt_callback Callback function.
1633 */
1634 chrome.permissions.request = function(permissions, opt_callback) {};
1635
1636
1637 /** @type {!ChromeEvent} */
1638 chrome.permissions.onAdded;
1639
1640
1641 /** @type {!ChromeEvent} */
1642 chrome.permissions.onRemoved;
1643
1644
1645 /**
1646 * @const
1647 * @see http://code.google.com/chrome/extensions/privacy.html
1648 */
1649 chrome.privacy = {};
1650
1651
1652 /** @type {!Object.<string,!ChromeSetting>} */
1653 chrome.privacy.network;
1654
1655
1656 /** @type {!Object.<string,!ChromeSetting>} */
1657 chrome.privacy.services;
1658
1659
1660 /** @type {!Object.<string,!ChromeSetting>} */
1661 chrome.privacy.websites;
1662
1663
1664 /**
1665 * @const
1666 * @see http://code.google.com/chrome/extensions/proxy.html
1667 */
1668 chrome.proxy = {};
1669
1670
1671 /** @type {!Object.<string,!ChromeSetting>} */
1672 chrome.proxy.settings;
1673
1674
1675 /** @type {ChromeEvent} */
1676 chrome.proxy.onProxyError;
1677
1678
1679 /**
1680 * @const
1681 * @see http://code.google.com/chrome/extensions/storage.html
1682 */
1683 chrome.storage = {};
1684
1685
1686 /** @type {!StorageArea} */
1687 chrome.storage.sync;
1688
1689
1690 /** @type {!StorageArea} */
1691 chrome.storage.local;
1692
1693
1694 /** @type {!StorageChangeEvent} */
1695 chrome.storage.onChanged;
1696
1697
1698 /**
1699 * @const
1700 * @see http://code.google.com/chrome/extensions/types.html
1701 */
1702 chrome.chromeSetting = {};
1703
1704
1705 /** @type {ChromeEvent} */
1706 chrome.chromeSetting.onChange;
1707
1708
1709 /**
1710 * @const
1711 * @see http://code.google.com/chrome/extensions/webNavigation.html
1712 */
1713 chrome.webNavigation = {};
1714
1715
1716 /**
1717 * @param {Object} details Object with a 'tabId' (number) key.
1718 * @param {function(!Array.<Object.<string, (boolean|number|string)>>)} callback
1719 * Callback function.
1720 */
1721 chrome.webNavigation.getAllFrames = function(details, callback) {};
1722
1723
1724 /**
1725 * @param {Object} details Object with 'tabId' (number) and 'frameId' (number)
1726 * keys.
1727 * @param {function(Object.<string, (boolean|string)>)} callback
1728 * Callback function.
1729 */
1730 chrome.webNavigation.getFrame = function(details, callback) {};
1731
1732
1733 /** @type {ChromeEvent} */
1734 chrome.webNavigation.onBeforeNavigate;
1735
1736
1737 /** @type {ChromeEvent} */
1738 chrome.webNavigation.onCommitted;
1739
1740
1741 /** @type {ChromeEvent} */
1742 chrome.webNavigation.onCompleted;
1743
1744
1745 /** @type {ChromeEvent} */
1746 chrome.webNavigation.onCreatedNavigationTarget;
1747
1748
1749 /** @type {ChromeEvent} */
1750 chrome.webNavigation.onDOMContentLoaded;
1751
1752
1753 /** @type {ChromeEvent} */
1754 chrome.webNavigation.onErrorOccurred;
1755
1756
1757 /** @type {ChromeEvent} */
1758 chrome.webNavigation.onReferenceFragmentUpdated;
1759
1760
1761
1762 /**
1763 * Most event listeners for WebRequest take extra arguments.
1764 * @see http://code.google.com/chrome/extensions/webRequest.html.
1765 * @constructor
1766 */
1767 function WebRequestEvent() {}
1768
1769
1770 /**
1771 * @param {function(!Object): (void|!BlockingResponse)} listener Listener
1772 * function.
1773 * @param {!RequestFilter} filter A set of filters that restrict
1774 * the events that will be sent to this listener.
1775 * @param {Array.<string>=} opt_extraInfoSpec Array of extra information
1776 * that should be passed to the listener function.
1777 */
1778 WebRequestEvent.prototype.addListener =
1779 function(listener, filter, opt_extraInfoSpec) {};
1780
1781
1782 /**
1783 * @param {function(!Object): (void|!BlockingResponse)} listener Listener
1784 * function.
1785 */
1786 WebRequestEvent.prototype.removeListener = function(listener) {};
1787
1788
1789 /**
1790 * @param {function(!Object): (void|!BlockingResponse)} listener Listener
1791 * function.
1792 */
1793 WebRequestEvent.prototype.hasListener = function(listener) {};
1794
1795
1796 /**
1797 * @param {function(!Object): (void|!BlockingResponse)} listener Listener
1798 * function.
1799 */
1800 WebRequestEvent.prototype.hasListeners = function(listener) {};
1801
1802
1803
1804 /**
1805 * The onErrorOccurred event takes one less parameter than the others.
1806 * @see http://code.google.com/chrome/extensions/webRequest.html.
1807 * @constructor
1808 */
1809 function WebRequestOnErrorOccurredEvent() {}
1810
1811
1812 /**
1813 * @param {function(!Object): void} listener Listener function.
1814 * @param {!RequestFilter} filter A set of filters that restrict
1815 * the events that will be sent to this listener.
1816 */
1817 WebRequestOnErrorOccurredEvent.prototype.addListener =
1818 function(listener, filter) {};
1819
1820
1821 /**
1822 * @param {function(!Object): void} listener Listener function.
1823 */
1824 WebRequestOnErrorOccurredEvent.prototype.removeListener = function(listener) {};
1825
1826
1827 /**
1828 * @param {function(!Object): void} listener Listener function.
1829 */
1830 WebRequestOnErrorOccurredEvent.prototype.hasListener = function(listener) {};
1831
1832
1833 /**
1834 * @param {function(!Object): void} listener Listener function.
1835 */
1836 WebRequestOnErrorOccurredEvent.prototype.hasListeners = function(listener) {};
1837
1838
1839 /**
1840 * @const
1841 * @see http://code.google.com/chrome/extensions/webRequest.html
1842 */
1843 chrome.webRequest = {};
1844
1845
1846 /**
1847 * @param {function(): void=} opt_callback Callback function.
1848 */
1849 chrome.webRequest.handlerBehaviorChanged = function(opt_callback) {};
1850
1851
1852 /** @type {!WebRequestEvent} */
1853 chrome.webRequest.onAuthRequired;
1854
1855
1856 /** @type {!WebRequestEvent} */
1857 chrome.webRequest.onBeforeRedirect;
1858
1859
1860 /** @type {!WebRequestEvent} */
1861 chrome.webRequest.onBeforeRequest;
1862
1863
1864 /** @type {!WebRequestEvent} */
1865 chrome.webRequest.onBeforeSendHeaders;
1866
1867
1868 /** @type {!WebRequestEvent} */
1869 chrome.webRequest.onCompleted;
1870
1871
1872 /** @type {!WebRequestOnErrorOccurredEvent} */
1873 chrome.webRequest.onErrorOccurred;
1874
1875
1876 /** @type {!WebRequestEvent} */
1877 chrome.webRequest.onHeadersReceived;
1878
1879
1880 /** @type {!WebRequestEvent} */
1881 chrome.webRequest.onResponseStarted;
1882
1883
1884 /** @type {!WebRequestEvent} */
1885 chrome.webRequest.onSendHeaders;
1886
1887
1888 // Classes
1889
1890
1891
1892 /**onKeyEvent
1893 * @see http://code.google.com/chrome/extensions/management.html
1894 * @constructor
1895 */
1896 function ExtensionInfo() {}
1897
1898
1899 /** @type {string} */
1900 ExtensionInfo.prototype.id;
1901
1902
1903 /** @type {string} */
1904 ExtensionInfo.prototype.name;
1905
1906
1907 /** @type {string} */
1908 ExtensionInfo.prototype.description;
1909
1910
1911 /** @type {string} */
1912 ExtensionInfo.prototype.version;
1913
1914
1915 /** @type {boolean} */
1916 ExtensionInfo.prototype.mayDisable;
1917
1918
1919 /** @type {boolean} */
1920 ExtensionInfo.prototype.enabled;
1921
1922
1923 /** @type {string} */
1924 ExtensionInfo.prototype.disabledReason;
1925
1926
1927 /** @type {boolean} */
1928 ExtensionInfo.prototype.isApp;
1929
1930
1931 /** @type {string} */
1932 ExtensionInfo.prototype.appLaunchUrl;
1933
1934
1935 /** @type {string} */
1936 ExtensionInfo.prototype.homePageUrl;
1937
1938
1939 /** @type {string} */
1940 ExtensionInfo.prototype.updateUrl;
1941
1942
1943 /** @type {boolean} */
1944 ExtensionInfo.prototype.offlineEnabled;
1945
1946
1947 /** @type {string} */
1948 ExtensionInfo.prototype.optionsUrl;
1949
1950
1951 /** @type {Array.<IconInfo>} */
1952 ExtensionInfo.prototype.icons;
1953
1954
1955 /** @type {!Array.<string>} */
1956 ExtensionInfo.prototype.permissions;
1957
1958
1959 /** @type {!Array.<string>} */
1960 ExtensionInfo.prototype.hostPermissions;
1961
1962
1963
1964 /**
1965 * @see http://code.google.com/chrome/extensions/management.html
1966 * @constructor
1967 */
1968 function IconInfo() {}
1969
1970
1971 /** @type {number} */
1972 IconInfo.prototype.size;
1973
1974
1975 /** @type {string} */
1976 IconInfo.prototype.url;
1977
1978
1979
1980 /**
1981 * @see http://code.google.com/chrome/extensions/tabs.html
1982 * @constructor
1983 */
1984 function Tab() {}
1985
1986
1987 /** @type {number} */
1988 Tab.prototype.id;
1989
1990
1991 /** @type {number} */
1992 Tab.prototype.index;
1993
1994
1995 /** @type {number} */
1996 Tab.prototype.windowId;
1997
1998
1999 /** @type {number} */
2000 Tab.prototype.openerTabId;
2001
2002
2003 /** @type {boolean} */
2004 Tab.prototype.highlighted;
2005
2006
2007 /** @type {boolean} */
2008 Tab.prototype.active;
2009
2010
2011 /** @type {boolean} */
2012 Tab.prototype.pinned;
2013
2014
2015 /** @type {string} */
2016 Tab.prototype.url;
2017
2018
2019 /** @type {string} */
2020 Tab.prototype.title;
2021
2022
2023 /** @type {string} */
2024 Tab.prototype.favIconUrl;
2025
2026
2027 /** @type {string} */
2028 Tab.prototype.status;
2029
2030
2031 /** @type {boolean} */
2032 Tab.prototype.incognito;
2033
2034
2035
2036 /**
2037 * @see http://code.google.com/chrome/extensions/windows.html
2038 * @constructor
2039 */
2040 function ChromeWindow() {}
2041
2042
2043 /** @type {number} */
2044 ChromeWindow.prototype.id;
2045
2046
2047 /** @type {boolean} */
2048 ChromeWindow.prototype.focused;
2049
2050
2051 /** @type {number} */
2052 ChromeWindow.prototype.top;
2053
2054
2055 /** @type {number} */
2056 ChromeWindow.prototype.left;
2057
2058
2059 /** @type {number} */
2060 ChromeWindow.prototype.width;
2061
2062
2063 /** @type {number} */
2064 ChromeWindow.prototype.height;
2065
2066
2067 /** @type {Array.<Tab>} */
2068 ChromeWindow.prototype.tabs;
2069
2070
2071 /** @type {boolean} */
2072 ChromeWindow.prototype.incognito;
2073
2074
2075 /** @type {string} */
2076 ChromeWindow.prototype.type;
2077
2078
2079 /** @type {string} */
2080 ChromeWindow.prototype.state;
2081
2082
2083 /** @type {boolean} */
2084 ChromeWindow.prototype.alwaysOnTop;
2085
2086
2087
2088 /**
2089 * @see http://code.google.com/chrome/extensions/events.html
2090 * @constructor
2091 */
2092 function ChromeEvent() {}
2093
2094
2095 /** @param {Function} callback */
2096 ChromeEvent.prototype.addListener = function(callback) {};
2097
2098
2099 /** @param {Function} callback */
2100 ChromeEvent.prototype.removeListener = function(callback) {};
2101
2102
2103 // TODO: this returns boolean
2104 /** @param {Function} callback */
2105 ChromeEvent.prototype.hasListener = function(callback) {};
2106
2107
2108 // TODO: this returns boolean, and doesn't take any parameters
2109 /** @param {Function} callback */
2110 ChromeEvent.prototype.hasListeners = function(callback) {};
2111
2112
2113 /**
2114 * @see http://developer.chrome.com/extensions/pushMessaging.html
2115 * @const
2116 */
2117 chrome.pushMessaging = {};
2118
2119
2120 /**
2121 * @type {!chrome.pushMessaging.PushMessageEvent}
2122 */
2123 chrome.pushMessaging.onMessage;
2124
2125
2126 /**
2127 * @param {boolean|function(!chrome.pushMessaging.ChannelIdResult)}
2128 * interactiveOrCallback Either a flag(optional), if set to true, user will
2129 * be asked to log in if they are not already logged in, or, when he flag is
2130 * not given, the callback.
2131 * @param {function(!chrome.pushMessaging.ChannelIdResult)=} opt_callback
2132 * Callback.
2133 */
2134 chrome.pushMessaging.getChannelId =
2135 function(interactiveOrCallback, opt_callback) {};
2136
2137
2138 /**
2139 * Event whose listeners take a chrome.pushMessaging.Message parameter.
2140 * @constructor
2141 */
2142 chrome.pushMessaging.PushMessageEvent = function() {};
2143
2144
2145 /**
2146 * @param {function(!chrome.pushMessaging.Message): void} callback
2147 */
2148 chrome.pushMessaging.PushMessageEvent.prototype.addListener =
2149 function(callback) {};
2150
2151
2152 /**
2153 * @param {function(!chrome.pushMessaging.Message): void} callback
2154 */
2155 chrome.pushMessaging.PushMessageEvent.prototype.removeListener =
2156 function(callback) {};
2157
2158
2159 /**
2160 * @param {function(!chrome.pushMessaging.Message): void} callback
2161 * @return {boolean}
2162 */
2163 chrome.pushMessaging.PushMessageEvent.prototype.hasListener =
2164 function(callback) {};
2165
2166
2167 /**
2168 * @return {boolean}
2169 */
2170 chrome.pushMessaging.PushMessageEvent.prototype.hasListeners = function() {};
2171
2172
2173
2174 /**
2175 * @see http://code.google.com/chrome/extensions/extension.html#type-Port
2176 * @constructor
2177 */
2178 function Port() {}
2179
2180
2181 /** @type {string} */
2182 Port.prototype.name;
2183
2184
2185 /** @type {ChromeEvent} */
2186 Port.prototype.onDisconnect;
2187
2188
2189 /** @type {ChromeEvent} */
2190 Port.prototype.onMessage;
2191
2192
2193 /** @type {MessageSender} */
2194 Port.prototype.sender;
2195
2196
2197 /**
2198 * @param {Object.<string>} obj Message object.
2199 */
2200 Port.prototype.postMessage = function(obj) {};
2201
2202
2203 /**
2204 * Note: as of 2012-04-12, this function is no longer documented on
2205 * the public web pages, but there are still existing usages.
2206 */
2207 Port.prototype.disconnect = function() {};
2208
2209
2210
2211 /**
2212 * @see * http://code.google.com/chrome/extensions/extension.html#type-MessageSender
2213 * @constructor
2214 */
2215 function MessageSender() {}
2216
2217
2218 /** @type {Tab} */
2219 MessageSender.prototype.tab;
2220
2221
2222 /** @type {string} */
2223 MessageSender.prototype.id;
2224
2225
2226
2227 /**
2228 * @see http://code.google.com/chrome/extensions/bookmarks.html#type-BookmarkTreeNode
2229 * @constructor
2230 */
2231 function BookmarkTreeNode() {}
2232
2233
2234 /** @type {string} */
2235 BookmarkTreeNode.prototype.id;
2236
2237
2238 /** @type {string} */
2239 BookmarkTreeNode.prototype.parentId;
2240
2241
2242 /** @type {number} */
2243 BookmarkTreeNode.prototype.index;
2244
2245
2246 /** @type {string} */
2247 BookmarkTreeNode.prototype.url;
2248
2249
2250 /** @type {string} */
2251 BookmarkTreeNode.prototype.title;
2252
2253
2254 /** @type {number} */
2255 BookmarkTreeNode.prototype.dateAdded;
2256
2257
2258 /** @type {number} */
2259 BookmarkTreeNode.prototype.dateGroupModified;
2260
2261
2262 /** @type {Array.<BookmarkTreeNode>} */
2263 BookmarkTreeNode.prototype.children;
2264
2265
2266
2267 /**
2268 * @see http://code.google.com/chrome/extensions/dev/cookies.html#type-Cookie
2269 * @constructor
2270 */
2271 function Cookie() {}
2272
2273
2274 /** @type {string} */
2275 Cookie.prototype.name;
2276
2277
2278 /** @type {string} */
2279 Cookie.prototype.value;
2280
2281
2282 /** @type {string} */
2283 Cookie.prototype.domain;
2284
2285
2286 /** @type {boolean} */
2287 Cookie.prototype.hostOnly;
2288
2289
2290 /** @type {string} */
2291 Cookie.prototype.path;
2292
2293
2294 /** @type {boolean} */
2295 Cookie.prototype.secure;
2296
2297
2298 /** @type {boolean} */
2299 Cookie.prototype.httpOnly;
2300
2301
2302 /** @type {boolean} */
2303 Cookie.prototype.session;
2304
2305
2306 /** @type {number} */
2307 Cookie.prototype.expirationDate;
2308
2309
2310 /** @type {string} */
2311 Cookie.prototype.storeId;
2312
2313
2314
2315 /**
2316 * @see http://code.google.com/chrome/extensions/dev/cookies.html#type-CookieStore
2317 * @constructor
2318 */
2319 function CookieStore() {}
2320
2321
2322 /** @type {string} */
2323 CookieStore.prototype.id;
2324
2325
2326 /** @type {Array.<number>} */
2327 CookieStore.prototype.tabIds;
2328
2329
2330
2331 /**
2332 * @see http://code.google.com/chrome/extensions/dev/contextMenus.html#type-OnClickData
2333 * @constructor
2334 */
2335 function OnClickData() {}
2336
2337
2338 /** @type {number} */
2339 OnClickData.prototype.menuItemId;
2340
2341
2342 /** @type {number} */
2343 OnClickData.prototype.parentMenuItemId;
2344
2345
2346 /** @type {string} */
2347 OnClickData.prototype.mediaType;
2348
2349
2350 /** @type {string} */
2351 OnClickData.prototype.linkUrl;
2352
2353
2354 /** @type {string} */
2355 OnClickData.prototype.srcUrl;
2356
2357
2358 /** @type {string} */
2359 OnClickData.prototype.pageUrl;
2360
2361
2362 /** @type {string} */
2363 OnClickData.prototype.frameUrl;
2364
2365
2366 /** @type {string} */
2367 OnClickData.prototype.selectionText;
2368
2369
2370 /** @type {string} */
2371 OnClickData.prototype.editable;
2372
2373
2374
2375 /**
2376 * @see http://code.google.com/chrome/extensions/debugger.html#type-Debuggee
2377 * @constructor
2378 */
2379 function Debuggee() {}
2380
2381
2382 /** @type {number} */
2383 Debuggee.prototype.tabId;
2384
2385
2386
2387 /**
2388 * @see http://code.google.com/chrome/extensions/contentSettings.html#type-ResourceIdentifier
2389 * @constructor
2390 */
2391 function ResourceIdentifier() {}
2392
2393
2394 /** @type {string} */
2395 ResourceIdentifier.prototype.id;
2396
2397
2398 /** @type {string} */
2399 ResourceIdentifier.prototype.description;
2400
2401
2402
2403 /**
2404 * @see http://code.google.com/chrome/extensions/contentSettings.html#type-ContentSetting
2405 * @constructor
2406 */
2407 function ContentSetting() {}
2408
2409
2410 /**
2411 * @param {!Object.<string,string>} details Settings details.
2412 * @param {function(): void=} opt_callback Callback function.
2413 */
2414 ContentSetting.prototype.clear = function(details, opt_callback) {};
2415
2416
2417 /**
2418 * @param {!Object.<string,(string|boolean|ResourceIdentifier)>} details
2419 * Settings details.
2420 * @param {function(): void} callback Callback function.
2421 */
2422 ContentSetting.prototype.get = function(details, callback) {};
2423
2424
2425 /**
2426 * @param {function(): void} callback Callback function.
2427 */
2428 ContentSetting.prototype.getResourceIdentifiers = function(callback) {};
2429
2430
2431 /**
2432 * @param {!Object.<string,(string|ResourceIdentifier)>} details
2433 * Settings details.
2434 * @param {function(): void=} opt_callback Callback function.
2435 */
2436 ContentSetting.prototype.set = function(details, opt_callback) {};
2437
2438
2439
2440 /**
2441 * @see http://code.google.com/chrome/extensions/history.html#type-HistoryItem
2442 * @constructor
2443 */
2444 function HistoryItem() {}
2445
2446
2447 /** @type {string} */
2448 HistoryItem.prototype.id;
2449
2450
2451 /** @type {string} */
2452 HistoryItem.prototype.url;
2453
2454
2455 /** @type {string} */
2456 HistoryItem.prototype.title;
2457
2458
2459 /** @type {number} */
2460 HistoryItem.prototype.lastVisitTime;
2461
2462
2463 /** @type {number} */
2464 HistoryItem.prototype.visitCount;
2465
2466
2467 /** @type {number} */
2468 HistoryItem.prototype.typedCount;
2469
2470
2471
2472 /**
2473 * @see http://code.google.com/chrome/extensions/history.html#type-VisitItem
2474 * @constructor
2475 */
2476 function VisitItem() {}
2477
2478
2479 /** @type {string} */
2480 VisitItem.prototype.id;
2481
2482
2483 /** @type {string} */
2484 VisitItem.prototype.visitId;
2485
2486
2487 /** @type {number} */
2488 VisitItem.prototype.visitTime;
2489
2490
2491 /** @type {string} */
2492 VisitItem.prototype.referringVisitId;
2493
2494
2495 /** @type {string} */
2496 VisitItem.prototype.transition;
2497
2498
2499
2500 /**
2501 * @see http://code.google.com/chrome/extensions/fileBrowserHandler.html#type-FileHandlerExecuteEventDetails
2502 * @constructor
2503 */
2504 function FileHandlerExecuteEventDetails() {}
2505
2506
2507 /** @type {!Array.<!FileEntry>} */
2508 FileHandlerExecuteEventDetails.prototype.entries;
2509
2510
2511 /** @type {number} */
2512 FileHandlerExecuteEventDetails.prototype.tab_id;
2513
2514
2515
2516 /**
2517 * @see http://code.google.com/chrome/extensions/input.ime.html#type-KeyboardEvent
2518 * @constructor
2519 */
2520 function ChromeKeyboardEvent() {}
2521
2522
2523 /** @type {string} */
2524 ChromeKeyboardEvent.prototype.type;
2525
2526
2527 /** @type {string} */
2528 ChromeKeyboardEvent.prototype.requestId;
2529
2530
2531 /** @type {string} */
2532 ChromeKeyboardEvent.prototype.key;
2533
2534
2535 /** @type {boolean} */
2536 ChromeKeyboardEvent.prototype.altKey;
2537
2538
2539 /** @type {boolean} */
2540 ChromeKeyboardEvent.prototype.ctrlKey;
2541
2542
2543 /** @type {boolean} */
2544 ChromeKeyboardEvent.prototype.shiftKey;
2545
2546
2547
2548 /**
2549 * @see http://code.google.com/chrome/extensions/input.ime.html#type-InputContext
2550 * @constructor
2551 */
2552 function InputContext() {}
2553
2554
2555 /** @type {number} */
2556 InputContext.prototype.contextID;
2557
2558
2559 /** @type {string} */
2560 InputContext.prototype.type;
2561
2562
2563
2564 /**
2565 * @see http://code.google.com/chrome/extensions/permissions.html#type-Permissions
2566 * @constructor
2567 */
2568 function Permissions() {}
2569
2570
2571 /** @type {!Array.<string>} */
2572 Permissions.prototype.permissions;
2573
2574
2575 /** @type {!Array.<string>} */
2576 Permissions.prototype.origins;
2577
2578
2579
2580 /**
2581 * @see http://code.google.com/chrome/extensions/proxy.html#type-ProxyServer
2582 * @constructor
2583 */
2584 function ProxyServer() {}
2585
2586
2587 /** @type {string} */
2588 ProxyServer.prototype.scheme;
2589
2590
2591 /** @type {string} */
2592 ProxyServer.prototype.host;
2593
2594
2595 /** @type {number} */
2596 ProxyServer.prototype.port;
2597
2598
2599
2600 /**
2601 * @see http://code.google.com/chrome/extensions/proxy.html#type-ProxyRules
2602 * @constructor
2603 */
2604 function ProxyRules() {}
2605
2606
2607 /** @type {ProxyServer} */
2608 ProxyRules.prototype.singleProxy;
2609
2610
2611 /** @type {ProxyServer} */
2612 ProxyRules.prototype.proxyForHttp;
2613
2614
2615 /** @type {ProxyServer} */
2616 ProxyRules.prototype.proxyForHttps;
2617
2618
2619 /** @type {ProxyServer} */
2620 ProxyRules.prototype.proxyForFtp;
2621
2622
2623 /** @type {ProxyServer} */
2624 ProxyRules.prototype.fallbackProxy;
2625
2626
2627 /** @type {!Array.<string>} */
2628 ProxyRules.prototype.bypassList;
2629
2630
2631
2632 /**
2633 * @see http://code.google.com/chrome/extensions/proxy.html#type-PacScript
2634 * @constructor
2635 */
2636 function PacScript() {}
2637
2638
2639 /** @type {string} */
2640 PacScript.prototype.url;
2641
2642
2643 /** @type {string} */
2644 PacScript.prototype.data;
2645
2646
2647 /** @type {boolean} */
2648 PacScript.prototype.mandatory;
2649
2650
2651
2652 /**
2653 * @see http://code.google.com/chrome/extensions/proxy.html#type-ProxyConfig
2654 * @constructor
2655 */
2656 function ProxyConfig() {}
2657
2658
2659 /** @type {ProxyRules} */
2660 ProxyConfig.prototype.rules;
2661
2662
2663 /** @type {PacScript} */
2664 ProxyConfig.prototype.pacScript;
2665
2666
2667 /** @type {string} */
2668 ProxyConfig.prototype.mode;
2669
2670
2671
2672 /**
2673 * The event listener for Storage receives an Object mapping each
2674 * key that changed to its corresponding StorageChange for that item.
2675 *
2676 * @see http://code.google.com/chrome/extensions/storage.html
2677 * @constructor
2678 */
2679 function StorageChangeEvent() {}
2680
2681
2682 /**
2683 * @param {function(!Object.<string, !StorageChange>, string)} callback
2684 * Listener will receive an object that maps each key to its StorageChange,
2685 * and the namespace ("sync" or "local") of the storage area the changes
2686 * are for.
2687 */
2688 StorageChangeEvent.prototype.addListener = function(callback) {};
2689
2690
2691 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
2692 StorageChangeEvent.prototype.removeListener = function(callback) {};
2693
2694
2695 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
2696 StorageChangeEvent.prototype.hasListener = function(callback) {};
2697
2698
2699 /** @param {function(!Object.<string, !StorageChange>, string)} callback */
2700 StorageChangeEvent.prototype.hasListeners = function(callback) {};
2701
2702
2703
2704 /**
2705 * @see http://code.google.com/chrome/extensions/storage.html#type-StorageChange
2706 * @constructor
2707 */
2708 function StorageChange() {}
2709
2710
2711 /** @type {?} */
2712 StorageChange.prototype.oldValue;
2713
2714
2715 /** @type {?} */
2716 StorageChange.prototype.newValue;
2717
2718
2719
2720 /**
2721 * @see http://code.google.com/chrome/extensions/storage.html#type-StorageArea
2722 * @constructor
2723 */
2724 function StorageArea() {}
2725
2726
2727 /**
2728 * Removes all items from storage.
2729 * @param {function(): void=} opt_callback Callback function.
2730 */
2731 StorageArea.prototype.clear = function(opt_callback) {};
2732
2733
2734 /**
2735 * @param {(string|!Array.<string>|!Object|null)=} opt_keys
2736 * A single key to get, list of keys to get, or a dictionary
2737 * specifying default values (see description of the
2738 * object). An empty list or object will return an empty
2739 * result object. Pass in null to get the entire contents of storage.
2740 * @param {function(Object)=} opt_callback Callback with storage items, or null
2741 * on failure.
2742 */
2743 StorageArea.prototype.get = function(opt_keys, opt_callback) {};
2744
2745
2746 /**
2747 * @param {(string|!Array.<string>)} keys
2748 * A single key or a list of keys for items to remove.
2749 * @param {function()=} opt_callback Callback.
2750 */
2751 StorageArea.prototype.remove = function(keys, opt_callback) {};
2752
2753
2754 /**
2755 * @param {!Object.<string>} keys
2756 * Object specifying items to augment storage
2757 * with. Values that cannot be serialized (functions, etc) will be ignored.
2758 * @param {function()=} opt_callback Callback.
2759 */
2760 StorageArea.prototype.set = function(keys, opt_callback) { };
2761
2762
2763 /**
2764 * @param {(string|!Array.<string>|null)=} opt_keys
2765 * A single key or list of keys to get the total usage for. An empty list
2766 * will return 0. Pass in null to get the total usage of all of storage.
2767 * @param {function(number)=} opt_callback
2768 * Callback with the amount of space being used by storage.
2769 */
2770 StorageArea.prototype.getBytesInUse = function(opt_keys, opt_callback) { };
2771
2772
2773
2774 /**
2775 * @see http://code.google.com/chrome/extensions/types.html#type-ChromeSetting
2776 * @constructor
2777 */
2778 function ChromeSetting() {}
2779
2780
2781 /**
2782 * @param {Object} details Object with a 'scope' (string) key.
2783 * @param {function(): void=} opt_callback Callback function.
2784 */
2785 ChromeSetting.prototype.clear = function(details, opt_callback) {};
2786
2787
2788 /**
2789 * @param {Object} details Object with an 'incognito' (boolean) key.
2790 * @param {function(Object.<string, *>): void} callback Callback function.
2791 */
2792 ChromeSetting.prototype.get = function(details, callback) {};
2793
2794
2795 /**
2796 * @param {Object} details Object with a 'value' (*) key and an optional
2797 * 'scope' (string) key.
2798 * @param {function(): void=} opt_callback Callback function.
2799 */
2800 ChromeSetting.prototype.set = function(details, opt_callback) {};
2801
2802
2803
2804 /**
2805 * @see http://code.google.com/chrome/extensions/webRequest.html#type-RequestFilter
2806 * @constructor
2807 */
2808 function RequestFilter() {}
2809
2810
2811 /** @type {!Array.<string>} */
2812 RequestFilter.prototype.urls;
2813
2814
2815 /** @type {!Array.<string>} */
2816 RequestFilter.prototype.types;
2817
2818
2819 /** @type {number} */
2820 RequestFilter.prototype.tabId;
2821
2822
2823 /** @type {number} */
2824 RequestFilter.prototype.windowId;
2825
2826
2827
2828 /**
2829 * @see http://code.google.com/chrome/extensions/webRequest.html#type-HttpHeaders
2830 * @constructor
2831 */
2832 function HttpHeader() {}
2833
2834
2835 /** @type {string} */
2836 HttpHeader.prototype.name;
2837
2838
2839 /** @type {string} */
2840 HttpHeader.prototype.value;
2841
2842
2843 /** @type {!Array.<number>} */
2844 HttpHeader.prototype.binaryValue;
2845
2846
2847 /**
2848 * @see http://code.google.com/chrome/extensions/webRequest.html#type-HttpHeaders
2849 * @typedef {Array.<!HttpHeader>}
2850 * @private
2851 */
2852 var HttpHeaders_;
2853
2854
2855
2856 /**
2857 * @see http://code.google.com/chrome/extensions/webRequest.html#type-BlockingResponse
2858 * @constructor
2859 */
2860 function BlockingResponse() {}
2861
2862
2863 /** @type {boolean} */
2864 BlockingResponse.prototype.cancel;
2865
2866
2867 /** @type {string} */
2868 BlockingResponse.prototype.redirectUrl;
2869
2870
2871 /** @type {!HttpHeaders_} */
2872 BlockingResponse.prototype.requestHeaders;
2873
2874
2875 /** @type {!HttpHeaders_} */
2876 BlockingResponse.prototype.responseHeaders;
2877
2878
2879 /** @type {Object.<string,string>} */
2880 BlockingResponse.prototype.authCredentials;
2881
2882
2883
2884 /**
2885 * @see http://developer.chrome.com/extensions/pushMessaging.html#type-Message
2886 * @constructor
2887 */
2888 chrome.pushMessaging.Message = function() {};
2889
2890
2891 /**
2892 * @type {number}
2893 */
2894 chrome.pushMessaging.Message.prototype.subchannelId;
2895
2896
2897 /**
2898 * @type {string}
2899 */
2900 chrome.pushMessaging.Message.prototype.payload;
2901
2902
2903
2904 /**
2905 * @see http://developer.chrome.com/extensions/pushMessaging.html#type-ChannelIdResult
2906 * @constructor
2907 */
2908 chrome.pushMessaging.ChannelIdResult = function() {};
2909
2910 /**
2911 * @type {string}
2912 */
2913 chrome.pushMessaging.ChannelIdResult.prototype.channelId;
2914
2915