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 // This file was generated by: | |
6 // ./tools/json_schema_compiler/compiler.py. | |
7 // NOTE: The format of types has changed. 'FooType' is now | |
8 // 'chrome.bluetooth.FooType'. | |
9 // Please run the closure compiler before committing changes. | |
10 // See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_comp
ilation.md | |
11 | |
12 /** @fileoverview Externs generated from namespace: bluetooth */ | |
13 | |
14 /** | |
15 * @const | |
16 */ | |
17 chrome.bluetooth = {}; | |
18 | |
19 /** | |
20 * @enum {string} | |
21 * @see https://developer.chrome.com/extensions/bluetooth#type-VendorIdSource | |
22 */ | |
23 chrome.bluetooth.VendorIdSource = { | |
24 BLUETOOTH: 'bluetooth', | |
25 USB: 'usb', | |
26 }; | |
27 | |
28 /** | |
29 * @enum {string} | |
30 * @see https://developer.chrome.com/extensions/bluetooth#type-DeviceType | |
31 */ | |
32 chrome.bluetooth.DeviceType = { | |
33 COMPUTER: 'computer', | |
34 PHONE: 'phone', | |
35 MODEM: 'modem', | |
36 AUDIO: 'audio', | |
37 CAR_AUDIO: 'carAudio', | |
38 VIDEO: 'video', | |
39 PERIPHERAL: 'peripheral', | |
40 JOYSTICK: 'joystick', | |
41 GAMEPAD: 'gamepad', | |
42 KEYBOARD: 'keyboard', | |
43 MOUSE: 'mouse', | |
44 TABLET: 'tablet', | |
45 KEYBOARD_MOUSE_COMBO: 'keyboardMouseCombo', | |
46 }; | |
47 | |
48 /** | |
49 * @typedef {{ | |
50 * address: string, | |
51 * name: string, | |
52 * powered: boolean, | |
53 * available: boolean, | |
54 * discovering: boolean | |
55 * }} | |
56 * @see https://developer.chrome.com/extensions/bluetooth#type-AdapterState | |
57 */ | |
58 chrome.bluetooth.AdapterState; | |
59 | |
60 /** | |
61 * @typedef {{ | |
62 * address: string, | |
63 * name: (string|undefined), | |
64 * deviceClass: (number|undefined), | |
65 * vendorIdSource: (!chrome.bluetooth.VendorIdSource|undefined), | |
66 * vendorId: (number|undefined), | |
67 * productId: (number|undefined), | |
68 * deviceId: (number|undefined), | |
69 * type: (!chrome.bluetooth.DeviceType|undefined), | |
70 * paired: (boolean|undefined), | |
71 * connected: (boolean|undefined), | |
72 * connecting: (boolean|undefined), | |
73 * connectable: (boolean|undefined), | |
74 * uuids: (!Array<string>|undefined), | |
75 * inquiryRssi: (number|undefined), | |
76 * inquiryTxPower: (number|undefined) | |
77 * }} | |
78 * @see https://developer.chrome.com/extensions/bluetooth#type-Device | |
79 */ | |
80 chrome.bluetooth.Device; | |
81 | |
82 /** | |
83 * Get information about the Bluetooth adapter. | |
84 * @param {function(!chrome.bluetooth.AdapterState):void} callback Called with | |
85 * an AdapterState object describing the adapter state. | |
86 * @see https://developer.chrome.com/extensions/bluetooth#method-getAdapterState | |
87 */ | |
88 chrome.bluetooth.getAdapterState = function(callback) {}; | |
89 | |
90 /** | |
91 * Get information about a Bluetooth device known to the system. | |
92 * @param {string} deviceAddress Address of device to get. | |
93 * @param {function(!chrome.bluetooth.Device):void} callback Called with the | |
94 * Device object describing the device. | |
95 * @see https://developer.chrome.com/extensions/bluetooth#method-getDevice | |
96 */ | |
97 chrome.bluetooth.getDevice = function(deviceAddress, callback) {}; | |
98 | |
99 /** | |
100 * Get a list of Bluetooth devices known to the system, including paired and | |
101 * recently discovered devices. | |
102 * @param {function(!Array<!chrome.bluetooth.Device>):void} callback Called when | |
103 * the search is completed. | |
104 * @see https://developer.chrome.com/extensions/bluetooth#method-getDevices | |
105 */ | |
106 chrome.bluetooth.getDevices = function(callback) {}; | |
107 | |
108 /** | |
109 * <p>Start discovery. Newly discovered devices will be returned via the | |
110 * onDeviceAdded event. Previously discovered devices already known to the | |
111 * adapter must be obtained using getDevices and will only be updated using the | |
112 * |onDeviceChanged| event if information about them changes.</p><p>Discovery | |
113 * will fail to start if this application has already called startDiscovery. | |
114 * Discovery can be resource intensive: stopDiscovery should be called as soon | |
115 * as possible.</p> | |
116 * @param {function():void=} callback Called to indicate success or failure. | |
117 * @see https://developer.chrome.com/extensions/bluetooth#method-startDiscovery | |
118 */ | |
119 chrome.bluetooth.startDiscovery = function(callback) {}; | |
120 | |
121 /** | |
122 * Stop discovery. | |
123 * @param {function():void=} callback Called to indicate success or failure. | |
124 * @see https://developer.chrome.com/extensions/bluetooth#method-stopDiscovery | |
125 */ | |
126 chrome.bluetooth.stopDiscovery = function(callback) {}; | |
127 | |
128 /** | |
129 * Fired when the state of the Bluetooth adapter changes. | |
130 * @type {!ChromeEvent} | |
131 * @see https://developer.chrome.com/extensions/bluetooth#event-onAdapterStateCh
anged | |
132 */ | |
133 chrome.bluetooth.onAdapterStateChanged; | |
134 | |
135 /** | |
136 * Fired when information about a new Bluetooth device is available. | |
137 * @type {!ChromeEvent} | |
138 * @see https://developer.chrome.com/extensions/bluetooth#event-onDeviceAdded | |
139 */ | |
140 chrome.bluetooth.onDeviceAdded; | |
141 | |
142 /** | |
143 * Fired when information about a known Bluetooth device has changed. | |
144 * @type {!ChromeEvent} | |
145 * @see https://developer.chrome.com/extensions/bluetooth#event-onDeviceChanged | |
146 */ | |
147 chrome.bluetooth.onDeviceChanged; | |
148 | |
149 /** | |
150 * Fired when a Bluetooth device that was previously discovered has been out of | |
151 * range for long enough to be considered unavailable again, and when a paired | |
152 * device is removed. | |
153 * @type {!ChromeEvent} | |
154 * @see https://developer.chrome.com/extensions/bluetooth#event-onDeviceRemoved | |
155 */ | |
156 chrome.bluetooth.onDeviceRemoved; | |
OLD | NEW |