OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains various hacks needed to inform JSCompiler of various | 5 // This file contains various hacks needed to inform JSCompiler of various |
6 // WebKit- and Chrome-specific properties and methods. It is used only with | 6 // WebKit- and Chrome-specific properties and methods. It is used only with |
7 // JSCompiler to verify the type-correctness of our code. | 7 // JSCompiler to verify the type-correctness of our code. |
8 | 8 |
9 /** @type {Object} */ | 9 /** @type {Object} */ |
10 chrome.app = {}; | |
11 | |
12 /** @type {Object} */ | |
13 chrome.app.runtime = { | 10 chrome.app.runtime = { |
14 /** @type {chrome.Event} */ | 11 /** @type {chrome.Event} */ |
15 onLaunched: null | 12 onLaunched: null |
16 }; | 13 }; |
17 | 14 |
18 | 15 |
19 /** @type {Object} */ | 16 /** @type {Object} */ |
20 chrome.app.window = { | 17 chrome.app.window = { |
21 /** | 18 /** |
22 * @param {string} name | 19 * @param {string} name |
(...skipping 10 matching lines...) Expand all Loading... |
33 * @return {AppWindow} | 30 * @return {AppWindow} |
34 */ | 31 */ |
35 get: function(id) {}, | 32 get: function(id) {}, |
36 /** | 33 /** |
37 * @return {Array<AppWindow>} | 34 * @return {Array<AppWindow>} |
38 */ | 35 */ |
39 getAll: function() {} | 36 getAll: function() {} |
40 }; | 37 }; |
41 | 38 |
42 | 39 |
43 /** @type {Object} */ | 40 /** @type {string} */ |
44 chrome.runtime = { | 41 chrome.runtime.id; |
45 /** @type {Object} */ | 42 |
46 lastError: { | 43 /** @return {{name: string, version: string, app: {background: Object}}} */ |
47 /** @type {string} */ | 44 chrome.runtime.getManifest = function() {}; |
48 message: '' | 45 |
49 }, | 46 /** @param {function(Window):void} callback */ |
50 /** @type {string} */ | 47 chrome.runtime.getBackgroundPage = function(callback) {}; |
51 id: '', | 48 |
52 /** @return {{name: string, version: string, app: {background: Object}}} */ | 49 /** @type {chrome.Event} */ |
53 getManifest: function() {}, | 50 chrome.runtime.onSuspend; |
54 /** @param {function(Window):void} callback */ | 51 |
55 getBackgroundPage: function(callback) {}, | 52 /** @type {chrome.Event} */ |
56 /** @type {chrome.Event} */ | 53 chrome.runtime.onSuspendCanceled; |
57 onSuspend: null, | 54 |
58 /** @type {chrome.Event} */ | 55 /** @type {chrome.Event} */ |
59 onSuspendCanceled: null, | 56 chrome.runtime.onConnect; |
60 /** @type {chrome.Event} */ | 57 |
61 onConnect: null, | 58 /** @type {chrome.Event} */ |
62 /** @type {chrome.Event} */ | 59 chrome.runtime.onConnectExternal; |
63 onConnectExternal: null, | 60 |
64 /** @type {chrome.Event} */ | 61 /** @type {chrome.Event} */ |
65 onMessage: null, | 62 chrome.runtime.onMessage; |
66 /** @type {chrome.Event} */ | 63 |
67 onMessageExternal: null | 64 /** @type {chrome.Event} */ |
68 }; | 65 chrome.runtime.onMessageExternal; |
69 | 66 |
70 /** | 67 /** |
71 * @type {?function(string):chrome.runtime.Port} | 68 * @type {?function(string):chrome.runtime.Port} |
72 */ | 69 */ |
73 chrome.runtime.connectNative = function(name) {}; | 70 chrome.runtime.connectNative = function(name) {}; |
74 | 71 |
75 /** | |
76 * @param {{ name: string}} config | |
77 * @return {chrome.runtime.Port} | |
78 */ | |
79 chrome.runtime.connect = function(config) {}; | |
80 | |
81 /** | |
82 * @param {string?} extensionId | |
83 * @param {*} message | |
84 * @param {Object=} opt_options | |
85 * @param {function(*)=} opt_callback | |
86 */ | |
87 chrome.runtime.sendMessage = function( | |
88 extensionId, message, opt_options, opt_callback) {}; | |
89 | |
90 /** @constructor */ | 72 /** @constructor */ |
91 chrome.runtime.MessageSender = function(){ | 73 chrome.runtime.MessageSender = function(){ |
92 /** @type {chrome.Tab} */ | 74 /** @type {chrome.Tab} */ |
93 this.tab = null; | 75 this.tab = null; |
94 /** @type {string} */ | 76 /** @type {string} */ |
95 this.id = ''; | 77 this.id = ''; |
96 /** @type {string} */ | 78 /** @type {string} */ |
97 this.url = ''; | 79 this.url = ''; |
98 }; | 80 }; |
99 | 81 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 * @param {number} socketId | 545 * @param {number} socketId |
564 */ | 546 */ |
565 chrome.socket.destroy = function(socketId) {}; | 547 chrome.socket.destroy = function(socketId) {}; |
566 | 548 |
567 /** | 549 /** |
568 * @param {number} socketId | 550 * @param {number} socketId |
569 * @param {Object} options | 551 * @param {Object} options |
570 * @param {function(number):void} callback | 552 * @param {function(number):void} callback |
571 */ | 553 */ |
572 chrome.socket.secure = function(socketId, options, callback) {}; | 554 chrome.socket.secure = function(socketId, options, callback) {}; |
OLD | NEW |