Skip to main content

web_sys/features/
gen_BluetoothDevice.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 = "BluetoothDevice",
12        typescript_type = "BluetoothDevice"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `BluetoothDevice` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
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 BluetoothDevice;
24    #[cfg(web_sys_unstable_apis)]
25    #[wasm_bindgen(method, getter, js_class = "BluetoothDevice", js_name = "id")]
26    #[doc = "Getter for the `id` field of this object."]
27    #[doc = ""]
28    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/id)"]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
31    #[doc = ""]
32    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
33    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
34    pub fn id(this: &BluetoothDevice) -> ::alloc::string::String;
35    #[cfg(web_sys_unstable_apis)]
36    #[wasm_bindgen(method, getter, js_class = "BluetoothDevice", js_name = "name")]
37    #[doc = "Getter for the `name` field of this object."]
38    #[doc = ""]
39    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/name)"]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
42    #[doc = ""]
43    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
45    pub fn name(this: &BluetoothDevice) -> Option<::alloc::string::String>;
46    #[cfg(web_sys_unstable_apis)]
47    #[cfg(feature = "BluetoothRemoteGattServer")]
48    #[wasm_bindgen(method, getter, js_class = "BluetoothDevice", js_name = "gatt")]
49    #[doc = "Getter for the `gatt` field of this object."]
50    #[doc = ""]
51    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/gatt)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`, `BluetoothRemoteGattServer`*"]
54    #[doc = ""]
55    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
56    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
57    pub fn gatt(this: &BluetoothDevice) -> Option<BluetoothRemoteGattServer>;
58    #[cfg(web_sys_unstable_apis)]
59    #[wasm_bindgen(
60        method,
61        getter,
62        js_class = "BluetoothDevice",
63        js_name = "watchingAdvertisements"
64    )]
65    #[doc = "Getter for the `watchingAdvertisements` field of this object."]
66    #[doc = ""]
67    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/watchingAdvertisements)"]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    pub fn watching_advertisements(this: &BluetoothDevice) -> bool;
74    #[cfg(web_sys_unstable_apis)]
75    #[wasm_bindgen(
76        method,
77        getter,
78        js_class = "BluetoothDevice",
79        js_name = "onadvertisementreceived"
80    )]
81    #[doc = "Getter for the `onadvertisementreceived` field of this object."]
82    #[doc = ""]
83    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onadvertisementreceived)"]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
86    #[doc = ""]
87    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
89    pub fn onadvertisementreceived(this: &BluetoothDevice) -> Option<::js_sys::Function>;
90    #[cfg(web_sys_unstable_apis)]
91    #[wasm_bindgen(
92        method,
93        setter,
94        js_class = "BluetoothDevice",
95        js_name = "onadvertisementreceived"
96    )]
97    #[doc = "Setter for the `onadvertisementreceived` field of this object."]
98    #[doc = ""]
99    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onadvertisementreceived)"]
100    #[doc = ""]
101    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
102    #[doc = ""]
103    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
104    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
105    pub fn set_onadvertisementreceived(this: &BluetoothDevice, value: Option<&::js_sys::Function>);
106    #[cfg(web_sys_unstable_apis)]
107    #[wasm_bindgen(
108        method,
109        getter,
110        js_class = "BluetoothDevice",
111        js_name = "ongattserverdisconnected"
112    )]
113    #[doc = "Getter for the `ongattserverdisconnected` field of this object."]
114    #[doc = ""]
115    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/ongattserverdisconnected)"]
116    #[doc = ""]
117    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
118    #[doc = ""]
119    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
120    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
121    pub fn ongattserverdisconnected(this: &BluetoothDevice) -> Option<::js_sys::Function>;
122    #[cfg(web_sys_unstable_apis)]
123    #[wasm_bindgen(
124        method,
125        setter,
126        js_class = "BluetoothDevice",
127        js_name = "ongattserverdisconnected"
128    )]
129    #[doc = "Setter for the `ongattserverdisconnected` field of this object."]
130    #[doc = ""]
131    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/ongattserverdisconnected)"]
132    #[doc = ""]
133    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
134    #[doc = ""]
135    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
136    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
137    pub fn set_ongattserverdisconnected(this: &BluetoothDevice, value: Option<&::js_sys::Function>);
138    #[cfg(web_sys_unstable_apis)]
139    #[wasm_bindgen(
140        method,
141        getter,
142        js_class = "BluetoothDevice",
143        js_name = "oncharacteristicvaluechanged"
144    )]
145    #[doc = "Getter for the `oncharacteristicvaluechanged` field of this object."]
146    #[doc = ""]
147    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/oncharacteristicvaluechanged)"]
148    #[doc = ""]
149    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
150    #[doc = ""]
151    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
152    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
153    pub fn oncharacteristicvaluechanged(this: &BluetoothDevice) -> Option<::js_sys::Function>;
154    #[cfg(web_sys_unstable_apis)]
155    #[wasm_bindgen(
156        method,
157        setter,
158        js_class = "BluetoothDevice",
159        js_name = "oncharacteristicvaluechanged"
160    )]
161    #[doc = "Setter for the `oncharacteristicvaluechanged` field of this object."]
162    #[doc = ""]
163    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/oncharacteristicvaluechanged)"]
164    #[doc = ""]
165    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
166    #[doc = ""]
167    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
168    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
169    pub fn set_oncharacteristicvaluechanged(
170        this: &BluetoothDevice,
171        value: Option<&::js_sys::Function>,
172    );
173    #[cfg(web_sys_unstable_apis)]
174    #[wasm_bindgen(
175        method,
176        getter,
177        js_class = "BluetoothDevice",
178        js_name = "onserviceadded"
179    )]
180    #[doc = "Getter for the `onserviceadded` field of this object."]
181    #[doc = ""]
182    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceadded)"]
183    #[doc = ""]
184    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
185    #[doc = ""]
186    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
187    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
188    pub fn onserviceadded(this: &BluetoothDevice) -> Option<::js_sys::Function>;
189    #[cfg(web_sys_unstable_apis)]
190    #[wasm_bindgen(
191        method,
192        setter,
193        js_class = "BluetoothDevice",
194        js_name = "onserviceadded"
195    )]
196    #[doc = "Setter for the `onserviceadded` field of this object."]
197    #[doc = ""]
198    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceadded)"]
199    #[doc = ""]
200    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
201    #[doc = ""]
202    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
203    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
204    pub fn set_onserviceadded(this: &BluetoothDevice, value: Option<&::js_sys::Function>);
205    #[cfg(web_sys_unstable_apis)]
206    #[wasm_bindgen(
207        method,
208        getter,
209        js_class = "BluetoothDevice",
210        js_name = "onservicechanged"
211    )]
212    #[doc = "Getter for the `onservicechanged` field of this object."]
213    #[doc = ""]
214    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onservicechanged)"]
215    #[doc = ""]
216    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
217    #[doc = ""]
218    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
219    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
220    pub fn onservicechanged(this: &BluetoothDevice) -> Option<::js_sys::Function>;
221    #[cfg(web_sys_unstable_apis)]
222    #[wasm_bindgen(
223        method,
224        setter,
225        js_class = "BluetoothDevice",
226        js_name = "onservicechanged"
227    )]
228    #[doc = "Setter for the `onservicechanged` field of this object."]
229    #[doc = ""]
230    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onservicechanged)"]
231    #[doc = ""]
232    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
233    #[doc = ""]
234    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
235    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
236    pub fn set_onservicechanged(this: &BluetoothDevice, value: Option<&::js_sys::Function>);
237    #[cfg(web_sys_unstable_apis)]
238    #[wasm_bindgen(
239        method,
240        getter,
241        js_class = "BluetoothDevice",
242        js_name = "onserviceremoved"
243    )]
244    #[doc = "Getter for the `onserviceremoved` field of this object."]
245    #[doc = ""]
246    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceremoved)"]
247    #[doc = ""]
248    #[doc = "*This API requires the following crate features to be activated: `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 onserviceremoved(this: &BluetoothDevice) -> Option<::js_sys::Function>;
253    #[cfg(web_sys_unstable_apis)]
254    #[wasm_bindgen(
255        method,
256        setter,
257        js_class = "BluetoothDevice",
258        js_name = "onserviceremoved"
259    )]
260    #[doc = "Setter for the `onserviceremoved` field of this object."]
261    #[doc = ""]
262    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceremoved)"]
263    #[doc = ""]
264    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
265    #[doc = ""]
266    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
267    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
268    pub fn set_onserviceremoved(this: &BluetoothDevice, value: Option<&::js_sys::Function>);
269    #[cfg(web_sys_unstable_apis)]
270    #[wasm_bindgen(method, js_class = "BluetoothDevice", js_name = "watchAdvertisements")]
271    #[doc = "The `watchAdvertisements()` method."]
272    #[doc = ""]
273    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/watchAdvertisements)"]
274    #[doc = ""]
275    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"]
276    #[doc = ""]
277    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
278    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
279    pub fn watch_advertisements(this: &BluetoothDevice) -> ::js_sys::Promise<::js_sys::Undefined>;
280    #[cfg(web_sys_unstable_apis)]
281    #[cfg(feature = "WatchAdvertisementsOptions")]
282    #[wasm_bindgen(method, js_class = "BluetoothDevice", js_name = "watchAdvertisements")]
283    #[doc = "The `watchAdvertisements()` method."]
284    #[doc = ""]
285    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/watchAdvertisements)"]
286    #[doc = ""]
287    #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`, `WatchAdvertisementsOptions`*"]
288    #[doc = ""]
289    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
290    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
291    pub fn watch_advertisements_with_options(
292        this: &BluetoothDevice,
293        options: &WatchAdvertisementsOptions,
294    ) -> ::js_sys::Promise<::js_sys::Undefined>;
295}