Skip to content

Commit

Permalink
Rollback of "Remove chrome.bluetoothPrivate externs".
Browse files Browse the repository at this point in the history
Breaks internal projects.

Related to #3210.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230993488
  • Loading branch information
tjgq committed Jan 26, 2019
1 parent dcadfe9 commit fce0853
Showing 1 changed file with 187 additions and 0 deletions.
187 changes: 187 additions & 0 deletions contrib/externs/chrome_extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10330,6 +10330,193 @@ chrome.gcdPrivate.onDeviceStateChanged;
chrome.gcdPrivate.onDeviceRemoved;


/**
* @const
* @see https://cs.chromium.org/chromium/src/extensions/common/api/bluetooth_private.idl
*/
chrome.bluetoothPrivate = {};



/** @constructor */
chrome.bluetoothPrivate.PairingEvent = function() {};


/** @type {string} */
chrome.bluetoothPrivate.PairingEvent.prototype.pairing;


/** @type {!chrome.bluetooth.Device} */
chrome.bluetoothPrivate.PairingEvent.prototype.device;


/** @type {string|undefined} */
chrome.bluetoothPrivate.PairingEvent.prototype.pincode;


/** @type {number|undefined} */
chrome.bluetoothPrivate.PairingEvent.prototype.passkey;


/** @type {number|undefined} */
chrome.bluetoothPrivate.PairingEvent.prototype.enteredKey;


/**
* @typedef {{
* name: (string|undefined),
* powered: (boolean|undefined),
* discoverable: (boolean|undefined)
* }}
*/
chrome.bluetoothPrivate.NewAdapterState;


/**
* @typedef {{
* device: !chrome.bluetooth.Device,
* response: (string|undefined),
* pincode: (string|undefined),
* passkey: (number|undefined),
* enteredKey: (number|undefined)
* }}
*/
chrome.bluetoothPrivate.SetPairingResponseOptions;


/**
* @param {!chrome.bluetoothPrivate.NewAdapterState} adapterState
* @param {function()} callback
* @return {undefined}
*/
chrome.bluetoothPrivate.setAdapterState = function(adapterState, callback) {};


/**
* @param {!chrome.bluetoothPrivate.SetPairingResponseOptions} options
* @param {function()} callback
* @return {undefined}
*/
chrome.bluetoothPrivate.setPairingResponse = function(options, callback) {};


/**
* @param {string} deviceAddress
* @param {function():void=} callback
*/
chrome.bluetoothPrivate.disconnectAll = function(deviceAddress, callback) {};


/**
* @param {string} deviceAddress
* @param {function():void=} callback
* @return {undefined}
*/
chrome.bluetoothPrivate.forgetDevice = function(deviceAddress, callback) {};


/**
* @typedef {{
* transport: (!chrome.bluetoothPrivate.TransportType|undefined),
* uuids: ((string|!Array<string>)|undefined),
* rssi: (number|undefined),
* pathloss: (number|undefined)
* }}
*/
chrome.bluetoothPrivate.DiscoveryFilter;


/**
* Set or clear discovery filter.
* @param {!chrome.bluetoothPrivate.DiscoveryFilter} discoveryFilter
* @param {function():void=} callback
*/
chrome.bluetoothPrivate.setDiscoveryFilter = function(
discoveryFilter, callback) {};


/**
* Event whose listeners take a PairingEvent parameter.
* @interface
* @extends {ChromeBaseEvent<function(!chrome.bluetoothPrivate.PairingEvent)>}
*/
chrome.bluetoothPrivate.PairingEventEvent = function() {};


/** @type {!chrome.bluetoothPrivate.PairingEventEvent} */
chrome.bluetoothPrivate.onPairing;


/**
* @param {string} deviceAddress
* @param {function(number, string): void=} opt_callback
*/
chrome.bluetoothPrivate.pair = function(deviceAddress, opt_callback) {};


/**
* @enum {string}
* @see https://developer.chrome.com/extensions/bluetoothPrivate#type-PairingResponse
*/
chrome.bluetoothPrivate.PairingResponse = {
CONFIRM: '',
REJECT: '',
CANCEL: '',
};


/**
* @enum {string}
* @see https://developer.chrome.com/extensions/bluetoothPrivate#type-PairingEventType
*/
chrome.bluetoothPrivate.PairingEventType = {
REQUEST_PINCODE: '',
DISPLAY_PINCODE: '',
REQUEST_PASSKEY: '',
DISPLAY_PASSKEY: '',
KEYS_ENTERED: '',
CONFIRM_PASSKEY: '',
REQUEST_AUTHORIZATION: '',
COMPLETE: '',
};


/**
* @enum {string}
* @see https://developer.chrome.com/extensions/bluetoothPrivate#type-ConnectResultType
*/
chrome.bluetoothPrivate.ConnectResultType = {
ALREADY_CONNECTED: '',
ATTRIBUTE_LENGTH_INVALID: '',
AUTH_CANCELED: '',
AUTH_FAILED: '',
AUTH_REJECTED: '',
AUTH_TIMEOUT: '',
CONNECTION_CONGESTED: '',
FAILED: '',
IN_PROGRESS: '',
INSUFFICIENT_ENCRYPTION: '',
OFFSET_INVALID: '',
READ_NOT_PERMITTED: '',
REQUEST_NOT_SUPPORTED: '',
SUCCESS: '',
UNKNOWN_ERROR: '',
UNSUPPORTED_DEVICE: '',
WRITE_NOT_PERMITTED: '',
};


/**
* @enum {string}
* @see https://developer.chrome.com/extensions/bluetoothPrivate#type-TransportType
*/
chrome.bluetoothPrivate.TransportType = {
LE: '',
BREDR: '',
DUAL: '',
};


/**
* @const
* @see http://goo.gl/XmVdHm
Expand Down

0 comments on commit fce0853

Please sign in to comment.