aboutsummaryrefslogtreecommitdiff
path: root/third_party/closure_compiler/externs/bluetooth_private.js
blob: 76ef861a35c1d7fbc3d84cb7cfd28af849f2112f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file was generated by:
//   ./tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
//   'chrome.bluetoothPrivate.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md

// IMPORTANT:
// s/chrome.bluetoothPrivate.bluetooth.Device/chrome.bluetooth.Device/

/** @fileoverview Externs generated from namespace: bluetoothPrivate */

/**
 * @const
 */
chrome.bluetoothPrivate = {};

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

/**
 * @enum {string}
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-ConnectResultType
 */
chrome.bluetoothPrivate.ConnectResultType = {
  ALREADY_CONNECTED: 'alreadyConnected',
  AUTH_CANCELED: 'authCanceled',
  AUTH_FAILED: 'authFailed',
  AUTH_REJECTED: 'authRejected',
  AUTH_TIMEOUT: 'authTimeout',
  FAILED: 'failed',
  IN_PROGRESS: 'inProgress',
  SUCCESS: 'success',
  UNKNOWN_ERROR: 'unknownError',
  UNSUPPORTED_DEVICE: 'unsupportedDevice',
};

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

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

/**
 * @typedef {{
 *   pairing: !chrome.bluetoothPrivate.PairingEventType,
 *   device: !chrome.bluetooth.Device,
 *   pincode: (string|undefined),
 *   passkey: (number|undefined),
 *   enteredKey: (number|undefined)
 * }}
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-PairingEvent
 */
chrome.bluetoothPrivate.PairingEvent;

/**
 * @typedef {{
 *   name: (string|undefined),
 *   powered: (boolean|undefined),
 *   discoverable: (boolean|undefined)
 * }}
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-NewAdapterState
 */
chrome.bluetoothPrivate.NewAdapterState;

/**
 * @typedef {{
 *   device: !chrome.bluetooth.Device,
 *   response: !chrome.bluetoothPrivate.PairingResponse,
 *   pincode: (string|undefined),
 *   passkey: (number|undefined)
 * }}
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-SetPairingResponseOptions
 */
chrome.bluetoothPrivate.SetPairingResponseOptions;

/**
 * @typedef {{
 *   transport: (!chrome.bluetoothPrivate.TransportType|undefined),
 *   uuids: ((string|!Array<string>)|undefined),
 *   rssi: (number|undefined),
 *   pathloss: (number|undefined)
 * }}
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#type-DiscoveryFilter
 */
chrome.bluetoothPrivate.DiscoveryFilter;

/**
 * Changes the state of the Bluetooth adapter.
 * @param {!chrome.bluetoothPrivate.NewAdapterState} adapterState
 * @param {function():void=} callback
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#method-setAdapterState
 */
chrome.bluetoothPrivate.setAdapterState = function(adapterState, callback) {};

/**
 * @param {!chrome.bluetoothPrivate.SetPairingResponseOptions} options
 * @param {function():void=} callback
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#method-setPairingResponse
 */
chrome.bluetoothPrivate.setPairingResponse = function(options, callback) {};

/**
 * Tears down all connections to the given device.
 * @param {string} deviceAddress
 * @param {function():void=} callback
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#method-disconnectAll
 */
chrome.bluetoothPrivate.disconnectAll = function(deviceAddress, callback) {};

/**
 * Forgets the given device.
 * @param {string} deviceAddress
 * @param {function():void=} callback
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#method-forgetDevice
 */
chrome.bluetoothPrivate.forgetDevice = function(deviceAddress, callback) {};

/**
 * Set or clear discovery filter.
 * @param {!chrome.bluetoothPrivate.DiscoveryFilter} discoveryFilter
 * @param {function():void=} callback
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#method-setDiscoveryFilter
 */
chrome.bluetoothPrivate.setDiscoveryFilter = function(discoveryFilter, callback) {};

/**
 * Connects to the given device. This will only throw an error if the device
 * address is invalid or the device is already connected. Otherwise this will
 * succeed and invoke |callback| with ConnectResultType.
 * @param {string} deviceAddress
 * @param {function(!chrome.bluetoothPrivate.ConnectResultType):void=} callback
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#method-connect
 */
chrome.bluetoothPrivate.connect = function(deviceAddress, callback) {};

/**
 * Pairs the given device.
 * @param {string} deviceAddress
 * @param {function():void=} callback
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#method-pair
 */
chrome.bluetoothPrivate.pair = function(deviceAddress, callback) {};

/**
 * Fired when a pairing event occurs.
 * @type {!ChromeEvent}
 * @see https://developer.chrome.com/extensions/bluetoothPrivate#event-onPairing
 */
chrome.bluetoothPrivate.onPairing;