Skip to main content

web_sys/features/
gen_Bluetooth.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    #[wasm_bindgen(
9        extends = "EventTarget",
10        extends = "::js_sys::Object",
11        js_name = "Bluetooth",
12        typescript_type = "Bluetooth"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `Bluetooth` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
20    #[doc = ""]
21    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
22    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
23    pub type Bluetooth;
24    #[cfg(web_sys_unstable_apis)]
25    #[wasm_bindgen(
26        method,
27        getter,
28        js_class = "Bluetooth",
29        js_name = "onavailabilitychanged"
30    )]
31    #[doc = "Getter for the `onavailabilitychanged` field of this object."]
32    #[doc = ""]
33    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onavailabilitychanged)"]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
36    #[doc = ""]
37    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
39    pub fn onavailabilitychanged(this: &Bluetooth) -> Option<::js_sys::Function>;
40    #[cfg(web_sys_unstable_apis)]
41    #[wasm_bindgen(
42        method,
43        setter,
44        js_class = "Bluetooth",
45        js_name = "onavailabilitychanged"
46    )]
47    #[doc = "Setter for the `onavailabilitychanged` field of this object."]
48    #[doc = ""]
49    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onavailabilitychanged)"]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
52    #[doc = ""]
53    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
55    pub fn set_onavailabilitychanged(this: &Bluetooth, value: Option<&::js_sys::Function>);
56    #[cfg(web_sys_unstable_apis)]
57    #[cfg(feature = "BluetoothDevice")]
58    #[wasm_bindgen(method, getter, js_class = "Bluetooth", js_name = "referringDevice")]
59    #[doc = "Getter for the `referringDevice` field of this object."]
60    #[doc = ""]
61    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/referringDevice)"]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`, `BluetoothDevice`*"]
64    #[doc = ""]
65    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
66    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
67    pub fn referring_device(this: &Bluetooth) -> Option<BluetoothDevice>;
68    #[cfg(web_sys_unstable_apis)]
69    #[wasm_bindgen(
70        method,
71        getter,
72        js_class = "Bluetooth",
73        js_name = "onadvertisementreceived"
74    )]
75    #[doc = "Getter for the `onadvertisementreceived` field of this object."]
76    #[doc = ""]
77    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onadvertisementreceived)"]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    pub fn onadvertisementreceived(this: &Bluetooth) -> Option<::js_sys::Function>;
84    #[cfg(web_sys_unstable_apis)]
85    #[wasm_bindgen(
86        method,
87        setter,
88        js_class = "Bluetooth",
89        js_name = "onadvertisementreceived"
90    )]
91    #[doc = "Setter for the `onadvertisementreceived` field of this object."]
92    #[doc = ""]
93    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onadvertisementreceived)"]
94    #[doc = ""]
95    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
96    #[doc = ""]
97    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
98    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
99    pub fn set_onadvertisementreceived(this: &Bluetooth, value: Option<&::js_sys::Function>);
100    #[cfg(web_sys_unstable_apis)]
101    #[wasm_bindgen(
102        method,
103        getter,
104        js_class = "Bluetooth",
105        js_name = "ongattserverdisconnected"
106    )]
107    #[doc = "Getter for the `ongattserverdisconnected` field of this object."]
108    #[doc = ""]
109    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/ongattserverdisconnected)"]
110    #[doc = ""]
111    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
112    #[doc = ""]
113    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
114    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
115    pub fn ongattserverdisconnected(this: &Bluetooth) -> Option<::js_sys::Function>;
116    #[cfg(web_sys_unstable_apis)]
117    #[wasm_bindgen(
118        method,
119        setter,
120        js_class = "Bluetooth",
121        js_name = "ongattserverdisconnected"
122    )]
123    #[doc = "Setter for the `ongattserverdisconnected` field of this object."]
124    #[doc = ""]
125    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/ongattserverdisconnected)"]
126    #[doc = ""]
127    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
128    #[doc = ""]
129    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
130    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
131    pub fn set_ongattserverdisconnected(this: &Bluetooth, value: Option<&::js_sys::Function>);
132    #[cfg(web_sys_unstable_apis)]
133    #[wasm_bindgen(
134        method,
135        getter,
136        js_class = "Bluetooth",
137        js_name = "oncharacteristicvaluechanged"
138    )]
139    #[doc = "Getter for the `oncharacteristicvaluechanged` field of this object."]
140    #[doc = ""]
141    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/oncharacteristicvaluechanged)"]
142    #[doc = ""]
143    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
144    #[doc = ""]
145    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
146    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
147    pub fn oncharacteristicvaluechanged(this: &Bluetooth) -> Option<::js_sys::Function>;
148    #[cfg(web_sys_unstable_apis)]
149    #[wasm_bindgen(
150        method,
151        setter,
152        js_class = "Bluetooth",
153        js_name = "oncharacteristicvaluechanged"
154    )]
155    #[doc = "Setter for the `oncharacteristicvaluechanged` field of this object."]
156    #[doc = ""]
157    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/oncharacteristicvaluechanged)"]
158    #[doc = ""]
159    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
160    #[doc = ""]
161    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
162    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
163    pub fn set_oncharacteristicvaluechanged(this: &Bluetooth, value: Option<&::js_sys::Function>);
164    #[cfg(web_sys_unstable_apis)]
165    #[wasm_bindgen(method, getter, js_class = "Bluetooth", js_name = "onserviceadded")]
166    #[doc = "Getter for the `onserviceadded` field of this object."]
167    #[doc = ""]
168    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceadded)"]
169    #[doc = ""]
170    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
171    #[doc = ""]
172    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
173    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
174    pub fn onserviceadded(this: &Bluetooth) -> Option<::js_sys::Function>;
175    #[cfg(web_sys_unstable_apis)]
176    #[wasm_bindgen(method, setter, js_class = "Bluetooth", js_name = "onserviceadded")]
177    #[doc = "Setter for the `onserviceadded` field of this object."]
178    #[doc = ""]
179    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceadded)"]
180    #[doc = ""]
181    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
182    #[doc = ""]
183    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
184    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
185    pub fn set_onserviceadded(this: &Bluetooth, value: Option<&::js_sys::Function>);
186    #[cfg(web_sys_unstable_apis)]
187    #[wasm_bindgen(method, getter, js_class = "Bluetooth", js_name = "onservicechanged")]
188    #[doc = "Getter for the `onservicechanged` field of this object."]
189    #[doc = ""]
190    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onservicechanged)"]
191    #[doc = ""]
192    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
193    #[doc = ""]
194    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
195    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
196    pub fn onservicechanged(this: &Bluetooth) -> Option<::js_sys::Function>;
197    #[cfg(web_sys_unstable_apis)]
198    #[wasm_bindgen(method, setter, js_class = "Bluetooth", js_name = "onservicechanged")]
199    #[doc = "Setter for the `onservicechanged` field of this object."]
200    #[doc = ""]
201    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onservicechanged)"]
202    #[doc = ""]
203    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
204    #[doc = ""]
205    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
206    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
207    pub fn set_onservicechanged(this: &Bluetooth, value: Option<&::js_sys::Function>);
208    #[cfg(web_sys_unstable_apis)]
209    #[wasm_bindgen(method, getter, js_class = "Bluetooth", js_name = "onserviceremoved")]
210    #[doc = "Getter for the `onserviceremoved` field of this object."]
211    #[doc = ""]
212    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceremoved)"]
213    #[doc = ""]
214    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
215    #[doc = ""]
216    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
217    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
218    pub fn onserviceremoved(this: &Bluetooth) -> Option<::js_sys::Function>;
219    #[cfg(web_sys_unstable_apis)]
220    #[wasm_bindgen(method, setter, js_class = "Bluetooth", js_name = "onserviceremoved")]
221    #[doc = "Setter for the `onserviceremoved` field of this object."]
222    #[doc = ""]
223    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceremoved)"]
224    #[doc = ""]
225    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
226    #[doc = ""]
227    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
228    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
229    pub fn set_onserviceremoved(this: &Bluetooth, value: Option<&::js_sys::Function>);
230    #[cfg(web_sys_unstable_apis)]
231    #[wasm_bindgen(method, js_class = "Bluetooth", js_name = "getAvailability")]
232    #[doc = "The `getAvailability()` method."]
233    #[doc = ""]
234    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getAvailability)"]
235    #[doc = ""]
236    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"]
237    #[doc = ""]
238    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
239    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
240    pub fn get_availability(this: &Bluetooth) -> ::js_sys::Promise<::js_sys::Boolean>;
241    #[cfg(web_sys_unstable_apis)]
242    #[cfg(feature = "BluetoothDevice")]
243    #[wasm_bindgen(method, js_class = "Bluetooth", js_name = "getDevices")]
244    #[doc = "The `getDevices()` method."]
245    #[doc = ""]
246    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getDevices)"]
247    #[doc = ""]
248    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`, `BluetoothDevice`*"]
249    #[doc = ""]
250    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
251    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
252    pub fn get_devices(this: &Bluetooth) -> ::js_sys::Promise<::js_sys::Array<BluetoothDevice>>;
253    #[cfg(web_sys_unstable_apis)]
254    #[cfg(all(feature = "BluetoothDevice", feature = "RequestDeviceOptions",))]
255    #[wasm_bindgen(method, js_class = "Bluetooth", js_name = "requestDevice")]
256    #[doc = "The `requestDevice()` method."]
257    #[doc = ""]
258    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice)"]
259    #[doc = ""]
260    #[doc = "*This API requires the following crate features to be activated: `Bluetooth`, `BluetoothDevice`, `RequestDeviceOptions`*"]
261    #[doc = ""]
262    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
263    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
264    pub fn request_device(
265        this: &Bluetooth,
266        options: &RequestDeviceOptions,
267    ) -> ::js_sys::Promise<BluetoothDevice>;
268}