OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** @fileoverview Externs generated from namespace: networkingPrivate */ |
| 6 |
| 7 /** |
| 8 * WARNING(2015/04/09): This API is still under active development and has a few |
| 9 * issues with typing: |
| 10 * |
| 11 * 1. See onc_spec.html for ONC property values. |
| 12 * 2. The types NetworkProperties and ManagedNetworkProperties are not currently |
| 13 * defined. They correspond to ONC Property dictionaries. They are treated as |
| 14 * Objects rather than types. |
| 15 * 3. NetworkStateProperties defines a subset of NetworkProperties used by |
| 16 * getState and getNetworks. Since these match ONC property names they |
| 17 * use ONC PascalCase naming conventions instead of traditional JS |
| 18 * camelCase naming. |
| 19 * |
| 20 * Because of the above issues, this API should not be used as an example for |
| 21 * other APIs. Please contact stevenjb@ for questions on and maintenance. |
| 22 * @const |
| 23 * @see https://developer.chrome.com/extensions/networkingPrivate |
| 24 */ |
| 25 chrome.networkingPrivate = {}; |
| 26 |
| 27 |
| 28 /** @enum {string} */ |
| 29 chrome.networkingPrivate.ActivationStateType = { |
| 30 Activated: 'Activated', |
| 31 Activating: 'Activating', |
| 32 NotActivated: 'NotActivated', |
| 33 PartiallyActivated: 'PartiallyActivated', |
| 34 }; |
| 35 |
| 36 |
| 37 /** @enum {string} */ |
| 38 chrome.networkingPrivate.ConnectionStateType = { |
| 39 Connected: 'Connected', |
| 40 Connecting: 'Connecting', |
| 41 NotConnected: 'NotConnected', |
| 42 }; |
| 43 |
| 44 |
| 45 /** @enum {string} */ |
| 46 chrome.networkingPrivate.IPConfigType = { |
| 47 DHCP: 'DHCP', |
| 48 Static: 'Static' |
| 49 }; |
| 50 |
| 51 |
| 52 /** @enum {string} */ |
| 53 chrome.networkingPrivate.NetworkType = { |
| 54 Cellular: 'Cellular', |
| 55 Ethernet: 'Ethernet', |
| 56 VPN: 'VPN', |
| 57 WiFi: 'WiFi', |
| 58 WiMAX: 'WiMAX', |
| 59 }; |
| 60 |
| 61 |
| 62 /** |
| 63 * @typedef {?{ |
| 64 * SignalStrength: number, |
| 65 * OutOfCredits: boolean, |
| 66 * RoamingState: string, |
| 67 * ActivationState: chrome.networkingPrivate.ActivationStateType, |
| 68 * NetworkTechnology: string |
| 69 * }} |
| 70 */ |
| 71 chrome.networkingPrivate.CellularStateProperties; |
| 72 |
| 73 |
| 74 /** |
| 75 * @typedef {?{ |
| 76 * Security: string, |
| 77 * SignalStrength: number |
| 78 * }} |
| 79 */ |
| 80 chrome.networkingPrivate.WiFiStateProperties; |
| 81 |
| 82 |
| 83 /** |
| 84 * @typedef {?{ |
| 85 * SignalStrength: number |
| 86 * }} |
| 87 */ |
| 88 chrome.networkingPrivate.WiMAXStateProperties; |
| 89 |
| 90 |
| 91 /** |
| 92 * @typedef {?{ |
| 93 * Cellular: chrome.networkingPrivate.CellularStateProperties, |
| 94 * Connectable: boolean, |
| 95 * ConnectionState: chrome.networkingPrivate.ConnectionStateType, |
| 96 * ErrorState: string, |
| 97 * GUID: string, |
| 98 * Name: string, |
| 99 * Source: string, |
| 100 * Type: chrome.networkingPrivate.NetworkType, |
| 101 * WiFi: chrome.networkingPrivate.WiFiStateProperties, |
| 102 * WiMAX: chrome.networkingPrivate.WiMAXStateProperties |
| 103 * }} |
| 104 */ |
| 105 chrome.networkingPrivate.NetworkStateProperties; |
| 106 |
| 107 /** |
| 108 * @typedef {?{ |
| 109 * certificate: string, |
| 110 * publicKey: string, |
| 111 * nonce: string, |
| 112 * signedData: string, |
| 113 * deviceSerial: string, |
| 114 * deviceSsid: string, |
| 115 * deviceBssid: string |
| 116 * }} |
| 117 */ |
| 118 chrome.networkingPrivate.VerificationProperties; |
| 119 |
| 120 |
| 121 /** |
| 122 * @typedef {?{ |
| 123 * networkType: string, |
| 124 * visible: (boolean|undefined), |
| 125 * configured: (boolean|undefined), |
| 126 * limit: (number|undefined) |
| 127 * }} |
| 128 */ |
| 129 chrome.networkingPrivate.NetworkFilter; |
| 130 |
| 131 |
| 132 /** |
| 133 * @param {string} guid |
| 134 * @param {function(!Object)} callback |
| 135 */ |
| 136 chrome.networkingPrivate.getProperties = function(guid, callback) {}; |
| 137 |
| 138 |
| 139 /** |
| 140 * @param {string} guid |
| 141 * @param {function(!Object)} callback |
| 142 */ |
| 143 chrome.networkingPrivate.getManagedProperties = function(guid, callback) {}; |
| 144 |
| 145 |
| 146 /** |
| 147 * @param {string} guid |
| 148 * @param {function(!chrome.networkingPrivate.NetworkStateProperties)} callback |
| 149 */ |
| 150 chrome.networkingPrivate.getState = function(guid, callback) {}; |
| 151 |
| 152 |
| 153 /** |
| 154 * @param {string} guid |
| 155 * @param {!Object} properties |
| 156 * @param {function()=} opt_callback |
| 157 */ |
| 158 chrome.networkingPrivate.setProperties = function(guid, |
| 159 properties, |
| 160 opt_callback) {}; |
| 161 |
| 162 |
| 163 /** |
| 164 * @param {boolean} shared |
| 165 * @param {!Object} properties |
| 166 * @param {function(string)=} opt_callback Returns guid of the configured |
| 167 * configuration. |
| 168 */ |
| 169 chrome.networkingPrivate.createNetwork = function(shared, |
| 170 properties, |
| 171 opt_callback) {}; |
| 172 |
| 173 |
| 174 /** |
| 175 * @param {string} guid |
| 176 * @param {function()=} opt_callback Called when the operation has completed. |
| 177 */ |
| 178 chrome.networkingPrivate.forgetNetwork = function(guid, opt_callback) {}; |
| 179 |
| 180 |
| 181 /** |
| 182 * @param {!chrome.networkingPrivate.NetworkFilter} filter |
| 183 * @param {function(!Array.<!chrome.networkingPrivate.NetworkStateProperties>)=} |
| 184 * opt_callback |
| 185 */ |
| 186 chrome.networkingPrivate.getNetworks = function(filter, opt_callback) {}; |
| 187 |
| 188 |
| 189 /** |
| 190 * @param {string} type |
| 191 * @param {function(!Array.<!chrome.networkingPrivate.NetworkStateProperties>)=} |
| 192 * opt_callback |
| 193 */ |
| 194 chrome.networkingPrivate.getVisibleNetworks = function(type, opt_callback) {}; |
| 195 |
| 196 |
| 197 /** @param {function(!Array.<string>)=} opt_callback */ |
| 198 chrome.networkingPrivate.getEnabledNetworkTypes = function(opt_callback) {}; |
| 199 |
| 200 |
| 201 /** @param {string} networkType */ |
| 202 chrome.networkingPrivate.enableNetworkType = function(networkType) {}; |
| 203 |
| 204 |
| 205 /** @param {string} networkType */ |
| 206 chrome.networkingPrivate.disableNetworkType = function(networkType) {}; |
| 207 |
| 208 |
| 209 /** |
| 210 * Requests that the networking subsystem scan for new networks and update the |
| 211 * list returned by getVisibleNetworks. |
| 212 */ |
| 213 chrome.networkingPrivate.requestNetworkScan = function() {}; |
| 214 |
| 215 |
| 216 /** |
| 217 * @param {string} guid |
| 218 * @param {function()=} opt_callback |
| 219 */ |
| 220 chrome.networkingPrivate.startConnect = function(guid, opt_callback) {}; |
| 221 |
| 222 |
| 223 /** |
| 224 * @param {string} guid |
| 225 * @param {function()=} opt_callback |
| 226 */ |
| 227 chrome.networkingPrivate.startDisconnect = function(guid, opt_callback) {}; |
| 228 |
| 229 |
| 230 /** |
| 231 * @param {string} guid |
| 232 * @param {string=} opt_carrier |
| 233 * @param {function()=} opt_callback |
| 234 */ |
| 235 chrome.networkingPrivate.startActivate = function(guid, |
| 236 opt_carrier, |
| 237 opt_callback) {}; |
| 238 |
| 239 |
| 240 /** |
| 241 * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo |
| 242 * @param {function(boolean)} callback |
| 243 */ |
| 244 chrome.networkingPrivate.verifyDestination = function(verificationInfo, |
| 245 callback) {}; |
| 246 |
| 247 |
| 248 /** |
| 249 * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo |
| 250 * @param {string} guid |
| 251 * @param {function(string)} callback |
| 252 */ |
| 253 chrome.networkingPrivate.verifyAndEncryptCredentials = |
| 254 function(verificationInfo, guid, callback) {}; |
| 255 |
| 256 |
| 257 /** |
| 258 * @param {!chrome.networkingPrivate.VerificationProperties} verificationInfo |
| 259 * @param {string} data |
| 260 * @param {function(string)} callback |
| 261 */ |
| 262 chrome.networkingPrivate.verifyAndEncryptData = function(verificationInfo, |
| 263 data, |
| 264 callback) {}; |
| 265 |
| 266 |
| 267 /** |
| 268 * @param {string} ipOrMacAddress |
| 269 * @param {boolean} enabled |
| 270 * @param {function(string)=} opt_callback |
| 271 */ |
| 272 chrome.networkingPrivate.setWifiTDLSEnabledState = function(ipOrMacAddress, |
| 273 enabled, |
| 274 opt_callback) {}; |
| 275 |
| 276 |
| 277 /** |
| 278 * @param {string} ipOrMacAddress |
| 279 * @param {function(string)} callback |
| 280 */ |
| 281 chrome.networkingPrivate.getWifiTDLSStatus = function(ipOrMacAddress, |
| 282 callback) {}; |
| 283 |
| 284 |
| 285 /** |
| 286 * @param {string} guid |
| 287 * @param {function(string)} callback |
| 288 */ |
| 289 chrome.networkingPrivate.getCaptivePortalStatus = function(guid, callback) {}; |
| 290 |
| 291 |
| 292 /** @type {!ChromeStringArrayEvent} */ |
| 293 chrome.networkingPrivate.onNetworksChanged; |
| 294 |
| 295 |
| 296 /** @type {!ChromeStringArrayEvent} */ |
| 297 chrome.networkingPrivate.onNetworkListChanged; |
| 298 |
| 299 |
| 300 /** @type {!ChromeStringStringEvent} */ |
| 301 chrome.networkingPrivate.onPortalDetectionCompleted; |
OLD | NEW |