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://code.google.com/p/chromium/wiki/ClosureCompilation. | |
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 * uuids: (!Array<string>|undefined), | |
73 * inquiryRssi: (number|undefined), | |
74 * inquiryTxPower: (number|undefined) | |
75 * }} | |
76 * @see https://developer.chrome.com/extensions/bluetooth#type-Device | |
77 */ | |
78 chrome.bluetooth.Device; | |
79 | |
80 /** | |
81 * Get information about the Bluetooth adapter. | |
82 * @param {function(!chrome.bluetooth.AdapterState):void} callback Called with | |
83 * an AdapterState object describing the adapter state. | |
84 * @see https://developer.chrome.com/extensions/bluetooth#method-getAdapterState | |
85 */ | |
86 chrome.bluetooth.getAdapterState = function(callback) {}; | |
87 | |
88 /** | |
89 * Get information about a Bluetooth device known to the system. | |
90 * @param {string} deviceAddress Address of device to get. | |
91 * @param {function(!chrome.bluetooth.Device):void} callback Called with the | |
92 * Device object describing the device. | |
93 * @see https://developer.chrome.com/extensions/bluetooth#method-getDevice | |
94 */ | |
95 chrome.bluetooth.getDevice = function(deviceAddress, callback) {}; | |
96 | |
97 /** | |
98 * Get a list of Bluetooth devices known to the system, including paired and | |
99 * recently discovered devices. | |
100 * @param {function(!Array<!chrome.bluetooth.Device>):void} callback Called when | |
101 * the search is completed. | |
102 * @see https://developer.chrome.com/extensions/bluetooth#method-getDevices | |
103 */ | |
104 chrome.bluetooth.getDevices = function(callback) {}; | |
105 | |
106 /** | |
107 * <p>Start discovery. Newly discovered devices will be returned via the | |
108 * onDeviceAdded event. Previously discovered devices already known to the | |
109 * adapter must be obtained using getDevices and will only be updated using the | |
110 * |onDeviceChanged| event if information about them changes.</p><p>Discovery | |
111 * will fail to start if this application has already called startDiscovery. | |
112 * Discovery can be resource intensive: stopDiscovery should be called as soon | |
113 * as possible.</p> | |
114 * @param {function():void=} callback Called to indicate success or failure. | |
115 * @see https://developer.chrome.com/extensions/bluetooth#method-startDiscovery | |
116 */ | |
117 chrome.bluetooth.startDiscovery = function(callback) {}; | |
118 | |
119 /** | |
120 * Stop discovery. | |
121 * @param {function():void=} callback Called to indicate success or failure. | |
122 * @see https://developer.chrome.com/extensions/bluetooth#method-stopDiscovery | |
123 */ | |
124 chrome.bluetooth.stopDiscovery = function(callback) {}; | |
125 | |
126 /** | |
127 * Fired when the state of the Bluetooth adapter changes. | |
128 * @type {!ChromeEvent} | |
129 * @see https://developer.chrome.com/extensions/bluetooth#event-onAdapterStateCh anged | |
130 */ | |
131 chrome.bluetooth.onAdapterStateChanged; | |
132 | |
133 /** | |
134 * Fired when information about a new Bluetooth device is available. | |
135 * @type {!ChromeEvent} | |
136 * @see https://developer.chrome.com/extensions/bluetooth#event-onDeviceAdded | |
137 */ | |
138 chrome.bluetooth.onDeviceAdded; | |
139 | |
140 /** | |
141 * Fired when information about a known Bluetooth device has changed. | |
142 * @type {!ChromeEvent} | |
143 * @see https://developer.chrome.com/extensions/bluetooth#event-onDeviceChanged | |
144 */ | |
145 chrome.bluetooth.onDeviceChanged; | |
146 | |
147 /** | |
148 * Fired when a Bluetooth device that was previously discovered has been out of | |
149 * range for long enough to be considered unavailable again, and when a paired | |
150 * device is removed. | |
151 * @type {!ChromeEvent} | |
152 * @see https://developer.chrome.com/extensions/bluetooth#event-onDeviceRemoved | |
153 */ | |
154 chrome.bluetooth.onDeviceRemoved; | |
155 | |
Devlin
2015/10/15 06:26:42
nit: no newlines here (we should update the script
stevenjb
2015/10/15 20:48:06
Acknowledged.
| |
156 | |
OLD | NEW |