diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index e83dc769fef..e4d12cdc82e 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -41,6 +41,7 @@ AesKeyAlgorithm = [] AesKeyGenParams = [] Algorithm = [] AlignSetting = [] +AllowedBluetoothDevice = [] AnalyserNode = ["AudioNode", "EventTarget"] AnalyserOptions = [] AngleInstancedArrays = [] @@ -111,6 +112,23 @@ BlobEvent = ["Event"] BlobEventInit = [] BlobPropertyBag = [] BlockParsingOptions = [] +Bluetooth = ["EventTarget"] +BluetoothAdvertisingEvent = ["Event"] +BluetoothAdvertisingEventInit = [] +BluetoothCharacteristicProperties = [] +BluetoothDataFilterInit = [] +BluetoothDevice = ["EventTarget"] +BluetoothLeScanFilterInit = [] +BluetoothManufacturerDataMap = [] +BluetoothPermissionDescriptor = [] +BluetoothPermissionResult = ["EventTarget", "PermissionStatus"] +BluetoothPermissionStorage = [] +BluetoothRemoteGattCharacteristic = ["EventTarget"] +BluetoothRemoteGattDescriptor = [] +BluetoothRemoteGattServer = [] +BluetoothRemoteGattService = ["EventTarget"] +BluetoothServiceDataMap = [] +BluetoothUuid = [] BoxQuadOptions = [] BroadcastChannel = ["EventTarget"] BrowserElementDownloadOptions = [] @@ -892,6 +910,7 @@ Request = [] RequestCache = [] RequestCredentials = [] RequestDestination = [] +RequestDeviceOptions = [] RequestInit = [] RequestMediaKeySystemAccessNotification = [] RequestMode = [] @@ -1222,6 +1241,8 @@ UserProximityEvent = ["Event"] UserProximityEventInit = [] UserVerificationRequirement = [] ValidityState = [] +ValueEvent = ["Event"] +ValueEventInit = [] VideoConfiguration = [] VideoFacingModeEnum = [] VideoPlaybackQuality = [] @@ -1245,6 +1266,7 @@ VrStageParameters = [] VrSubmitFrameResult = [] VttCue = ["EventTarget", "TextTrackCue"] VttRegion = [] +WatchAdvertisementsOptions = [] WaveShaperNode = ["AudioNode", "EventTarget"] WaveShaperOptions = [] WebGl2RenderingContext = [] @@ -1342,4 +1364,4 @@ XrWebGlLayer = [] XrWebGlLayerInit = [] XsltProcessor = [] console = [] -css = [] +css = [] \ No newline at end of file diff --git a/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs b/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs new file mode 100644 index 00000000000..82f734e998d --- /dev/null +++ b/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs @@ -0,0 +1,100 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AllowedBluetoothDevice)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AllowedBluetoothDevice` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AllowedBluetoothDevice; +} +#[cfg(web_sys_unstable_apis)] +impl AllowedBluetoothDevice { + #[doc = "Construct a new `AllowedBluetoothDevice`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + allowed_services: &::wasm_bindgen::JsValue, + device_id: &str, + may_use_gatt: bool, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.allowed_services(allowed_services); + ret.device_id(device_id); + ret.may_use_gatt(may_use_gatt); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `allowedServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn allowed_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("allowedServices"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device_id(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("deviceId"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mayUseGATT` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn may_use_gatt(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("mayUseGATT"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_Bluetooth.rs b/crates/web-sys/src/features/gen_Bluetooth.rs new file mode 100644 index 00000000000..2ac15144899 --- /dev/null +++ b/crates/web-sys/src/features/gen_Bluetooth.rs @@ -0,0 +1,232 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = Bluetooth , typescript_type = "Bluetooth")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Bluetooth` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type Bluetooth; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = onavailabilitychanged)] + #[doc = "Getter for the `onavailabilitychanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onavailabilitychanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onavailabilitychanged(this: &Bluetooth) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Bluetooth" , js_name = onavailabilitychanged)] + #[doc = "Setter for the `onavailabilitychanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onavailabilitychanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onavailabilitychanged(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothDevice")] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = referringDevice)] + #[doc = "Getter for the `referringDevice` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/referringDevice)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`, `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn referring_device(this: &Bluetooth) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = onadvertisementreceived)] + #[doc = "Getter for the `onadvertisementreceived` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onadvertisementreceived)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onadvertisementreceived(this: &Bluetooth) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Bluetooth" , js_name = onadvertisementreceived)] + #[doc = "Setter for the `onadvertisementreceived` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onadvertisementreceived)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onadvertisementreceived(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = ongattserverdisconnected)] + #[doc = "Getter for the `ongattserverdisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/ongattserverdisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongattserverdisconnected(this: &Bluetooth) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Bluetooth" , js_name = ongattserverdisconnected)] + #[doc = "Setter for the `ongattserverdisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/ongattserverdisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongattserverdisconnected(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = oncharacteristicvaluechanged)] + #[doc = "Getter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn oncharacteristicvaluechanged(this: &Bluetooth) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Bluetooth" , js_name = oncharacteristicvaluechanged)] + #[doc = "Setter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_oncharacteristicvaluechanged(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = onserviceadded)] + #[doc = "Getter for the `onserviceadded` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceadded)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onserviceadded(this: &Bluetooth) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Bluetooth" , js_name = onserviceadded)] + #[doc = "Setter for the `onserviceadded` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceadded)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onserviceadded(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = onservicechanged)] + #[doc = "Getter for the `onservicechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onservicechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onservicechanged(this: &Bluetooth) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Bluetooth" , js_name = onservicechanged)] + #[doc = "Setter for the `onservicechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onservicechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onservicechanged(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Bluetooth" , js_name = onserviceremoved)] + #[doc = "Getter for the `onserviceremoved` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceremoved)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onserviceremoved(this: &Bluetooth) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Bluetooth" , js_name = onserviceremoved)] + #[doc = "Setter for the `onserviceremoved` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/onserviceremoved)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onserviceremoved(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Bluetooth" , js_name = getAvailability)] + #[doc = "The `getAvailability()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getAvailability)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_availability(this: &Bluetooth) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Bluetooth" , js_name = getDevices)] + #[doc = "The `getDevices()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getDevices)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_devices(this: &Bluetooth) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Bluetooth" , js_name = requestDevice)] + #[doc = "The `requestDevice()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_device(this: &Bluetooth) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RequestDeviceOptions")] + # [wasm_bindgen (method , structural , js_class = "Bluetooth" , js_name = requestDevice)] + #[doc = "The `requestDevice()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`, `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_device_with_options( + this: &Bluetooth, + options: &RequestDeviceOptions, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs b/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs new file mode 100644 index 00000000000..29a42f84b57 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs @@ -0,0 +1,98 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = BluetoothAdvertisingEvent , typescript_type = "BluetoothAdvertisingEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothAdvertisingEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothAdvertisingEvent; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothDevice")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = device)] + #[doc = "Getter for the `device` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/device)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`, `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device(this: &BluetoothAdvertisingEvent) -> BluetoothDevice; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = name)] + #[doc = "Getter for the `name` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/name)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn name(this: &BluetoothAdvertisingEvent) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = appearance)] + #[doc = "Getter for the `appearance` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/appearance)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn appearance(this: &BluetoothAdvertisingEvent) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = txPower)] + #[doc = "Getter for the `txPower` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/txPower)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tx_power(this: &BluetoothAdvertisingEvent) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = rssi)] + #[doc = "Getter for the `rssi` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/rssi)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn rssi(this: &BluetoothAdvertisingEvent) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothManufacturerDataMap")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = manufacturerData)] + #[doc = "Getter for the `manufacturerData` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/manufacturerData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`, `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn manufacturer_data(this: &BluetoothAdvertisingEvent) -> BluetoothManufacturerDataMap; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothServiceDataMap")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = serviceData)] + #[doc = "Getter for the `serviceData` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/serviceData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`, `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn service_data(this: &BluetoothAdvertisingEvent) -> BluetoothServiceDataMap; +} diff --git a/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs b/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs new file mode 100644 index 00000000000..cee141adc21 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs @@ -0,0 +1,251 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothAdvertisingEventInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothAdvertisingEventInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothAdvertisingEventInit; +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothAdvertisingEventInit { + #[cfg(feature = "BluetoothDevice")] + #[doc = "Construct a new `BluetoothAdvertisingEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(device: &BluetoothDevice) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.device(device); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bubbles"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("cancelable"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn composed(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("composed"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `appearance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn appearance(&mut self, val: u16) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("appearance"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothDevice")] + #[doc = "Change the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device(&mut self, val: &BluetoothDevice) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothManufacturerDataMap")] + #[doc = "Change the `manufacturerData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn manufacturer_data(&mut self, val: &BluetoothManufacturerDataMap) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("manufacturerData"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn name(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rssi` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn rssi(&mut self, val: i8) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rssi"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothServiceDataMap")] + #[doc = "Change the `serviceData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn service_data(&mut self, val: &BluetoothServiceDataMap) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("serviceData"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `txPower` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tx_power(&mut self, val: i8) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("txPower"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `uuids` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn uuids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uuids"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs b/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs new file mode 100644 index 00000000000..0c301b0309a --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs @@ -0,0 +1,117 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothCharacteristicProperties , typescript_type = "BluetoothCharacteristicProperties")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothCharacteristicProperties` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothCharacteristicProperties; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = broadcast)] + #[doc = "Getter for the `broadcast` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/broadcast)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn broadcast(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = read)] + #[doc = "Getter for the `read` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn read(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = writeWithoutResponse)] + #[doc = "Getter for the `writeWithoutResponse` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/writeWithoutResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_without_response(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = write)] + #[doc = "Getter for the `write` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = notify)] + #[doc = "Getter for the `notify` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/notify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn notify(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = indicate)] + #[doc = "Getter for the `indicate` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/indicate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn indicate(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = authenticatedSignedWrites)] + #[doc = "Getter for the `authenticatedSignedWrites` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/authenticatedSignedWrites)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn authenticated_signed_writes(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = reliableWrite)] + #[doc = "Getter for the `reliableWrite` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/reliableWrite)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn reliable_write(this: &BluetoothCharacteristicProperties) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothCharacteristicProperties" , js_name = writableAuxiliaries)] + #[doc = "Getter for the `writableAuxiliaries` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties/writableAuxiliaries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable_auxiliaries(this: &BluetoothCharacteristicProperties) -> bool; +} diff --git a/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs b/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs new file mode 100644 index 00000000000..661716461b6 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs @@ -0,0 +1,68 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothDataFilterInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothDataFilterInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothDataFilterInit; +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothDataFilterInit { + #[doc = "Construct a new `BluetoothDataFilterInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `dataPrefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn data_prefix(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("dataPrefix"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mask(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_BluetoothDevice.rs b/crates/web-sys/src/features/gen_BluetoothDevice.rs new file mode 100644 index 00000000000..95dfae1a0e9 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothDevice.rs @@ -0,0 +1,224 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = BluetoothDevice , typescript_type = "BluetoothDevice")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothDevice` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothDevice; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = id)] + #[doc = "Getter for the `id` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/id)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn id(this: &BluetoothDevice) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = name)] + #[doc = "Getter for the `name` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/name)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn name(this: &BluetoothDevice) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothRemoteGattServer")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = gatt)] + #[doc = "Getter for the `gatt` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/gatt)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`, `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn gatt(this: &BluetoothDevice) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = watchingAdvertisements)] + #[doc = "Getter for the `watchingAdvertisements` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/watchingAdvertisements)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn watching_advertisements(this: &BluetoothDevice) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = onadvertisementreceived)] + #[doc = "Getter for the `onadvertisementreceived` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onadvertisementreceived)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onadvertisementreceived(this: &BluetoothDevice) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothDevice" , js_name = onadvertisementreceived)] + #[doc = "Setter for the `onadvertisementreceived` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onadvertisementreceived)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onadvertisementreceived(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = ongattserverdisconnected)] + #[doc = "Getter for the `ongattserverdisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/ongattserverdisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongattserverdisconnected(this: &BluetoothDevice) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothDevice" , js_name = ongattserverdisconnected)] + #[doc = "Setter for the `ongattserverdisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/ongattserverdisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongattserverdisconnected(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = oncharacteristicvaluechanged)] + #[doc = "Getter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn oncharacteristicvaluechanged(this: &BluetoothDevice) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothDevice" , js_name = oncharacteristicvaluechanged)] + #[doc = "Setter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_oncharacteristicvaluechanged( + this: &BluetoothDevice, + value: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = onserviceadded)] + #[doc = "Getter for the `onserviceadded` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceadded)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onserviceadded(this: &BluetoothDevice) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothDevice" , js_name = onserviceadded)] + #[doc = "Setter for the `onserviceadded` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceadded)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onserviceadded(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = onservicechanged)] + #[doc = "Getter for the `onservicechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onservicechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onservicechanged(this: &BluetoothDevice) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothDevice" , js_name = onservicechanged)] + #[doc = "Setter for the `onservicechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onservicechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onservicechanged(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = onserviceremoved)] + #[doc = "Getter for the `onserviceremoved` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceremoved)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onserviceremoved(this: &BluetoothDevice) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothDevice" , js_name = onserviceremoved)] + #[doc = "Setter for the `onserviceremoved` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/onserviceremoved)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onserviceremoved(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothDevice" , js_name = watchAdvertisements)] + #[doc = "The `watchAdvertisements()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/watchAdvertisements)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn watch_advertisements(this: &BluetoothDevice) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WatchAdvertisementsOptions")] + # [wasm_bindgen (method , structural , js_class = "BluetoothDevice" , js_name = watchAdvertisements)] + #[doc = "The `watchAdvertisements()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice/watchAdvertisements)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`, `WatchAdvertisementsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn watch_advertisements_with_options( + this: &BluetoothDevice, + options: &WatchAdvertisementsOptions, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs b/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs new file mode 100644 index 00000000000..b8650ac658e --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs @@ -0,0 +1,131 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothLEScanFilterInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothLeScanFilterInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothLeScanFilterInit; +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothLeScanFilterInit { + #[doc = "Construct a new `BluetoothLeScanFilterInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `manufacturerData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn manufacturer_data(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("manufacturerData"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn name(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `namePrefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn name_prefix(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("namePrefix"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `serviceData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn service_data(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("serviceData"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `services` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("services"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs b/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs new file mode 100644 index 00000000000..db317c7dc75 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs @@ -0,0 +1,18 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothManufacturerDataMap , typescript_type = "BluetoothManufacturerDataMap")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothManufacturerDataMap` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothManufacturerDataMap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothManufacturerDataMap; +} diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs b/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs new file mode 100644 index 00000000000..9f5f22af99c --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs @@ -0,0 +1,134 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothPermissionDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothPermissionDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothPermissionDescriptor; +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothPermissionDescriptor { + #[cfg(feature = "PermissionName")] + #[doc = "Construct a new `BluetoothPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(name: PermissionName) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.name(name); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn name(&mut self, val: PermissionName) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `acceptAllDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn accept_all_devices(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("acceptAllDevices"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device_id(&mut self, val: &str) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("deviceId"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("filters"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `optionalServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn optional_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("optionalServices"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs b/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs new file mode 100644 index 00000000000..a293879e24b --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs @@ -0,0 +1,18 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = PermissionStatus , extends = EventTarget , extends = :: js_sys :: Object , js_name = BluetoothPermissionResult , typescript_type = "BluetoothPermissionResult")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothPermissionResult` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothPermissionResult)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothPermissionResult; +} diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs b/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs new file mode 100644 index 00000000000..28aab60d28a --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs @@ -0,0 +1,52 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothPermissionStorage)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothPermissionStorage` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothPermissionStorage; +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothPermissionStorage { + #[doc = "Construct a new `BluetoothPermissionStorage`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(allowed_devices: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.allowed_devices(allowed_devices); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `allowedDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn allowed_devices(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("allowedDevices"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs new file mode 100644 index 00000000000..2cec134fb4f --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs @@ -0,0 +1,266 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = BluetoothRemoteGATTCharacteristic , typescript_type = "BluetoothRemoteGATTCharacteristic")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothRemoteGattCharacteristic` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothRemoteGattCharacteristic; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothRemoteGattService")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = service)] + #[doc = "Getter for the `service` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/service)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`, `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn service(this: &BluetoothRemoteGattCharacteristic) -> BluetoothRemoteGattService; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = uuid)] + #[doc = "Getter for the `uuid` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/uuid)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn uuid(this: &BluetoothRemoteGattCharacteristic) -> String; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothCharacteristicProperties")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = properties)] + #[doc = "Getter for the `properties` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/properties)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothCharacteristicProperties`, `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn properties( + this: &BluetoothRemoteGattCharacteristic, + ) -> BluetoothCharacteristicProperties; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = oncharacteristicvaluechanged)] + #[doc = "Getter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn oncharacteristicvaluechanged( + this: &BluetoothRemoteGattCharacteristic, + ) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = oncharacteristicvaluechanged)] + #[doc = "Setter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_oncharacteristicvaluechanged( + this: &BluetoothRemoteGattCharacteristic, + value: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = getDescriptor)] + #[doc = "The `getDescriptor()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/getDescriptor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_descriptor_with_str( + this: &BluetoothRemoteGattCharacteristic, + descriptor: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = getDescriptor)] + #[doc = "The `getDescriptor()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/getDescriptor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_descriptor_with_u32( + this: &BluetoothRemoteGattCharacteristic, + descriptor: u32, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = getDescriptors)] + #[doc = "The `getDescriptors()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/getDescriptors)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_descriptors(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = getDescriptors)] + #[doc = "The `getDescriptors()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/getDescriptors)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_descriptors_with_str( + this: &BluetoothRemoteGattCharacteristic, + descriptor: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = getDescriptors)] + #[doc = "The `getDescriptors()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/getDescriptors)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_descriptors_with_u32( + this: &BluetoothRemoteGattCharacteristic, + descriptor: u32, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = readValue)] + #[doc = "The `readValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/readValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn read_value(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = startNotifications)] + #[doc = "The `startNotifications()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/startNotifications)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn start_notifications(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = stopNotifications)] + #[doc = "The `stopNotifications()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/stopNotifications)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stop_notifications(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValue)] + #[doc = "The `writeValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_buffer_source( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValue)] + #[doc = "The `writeValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &mut [u8], + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithResponse)] + #[doc = "The `writeValueWithResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_response_with_buffer_source( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithResponse)] + #[doc = "The `writeValueWithResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_response_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &mut [u8], + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithoutResponse)] + #[doc = "The `writeValueWithoutResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_without_response_with_buffer_source( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithoutResponse)] + #[doc = "The `writeValueWithoutResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_without_response_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &mut [u8], + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs new file mode 100644 index 00000000000..40103c3f321 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs @@ -0,0 +1,82 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothRemoteGATTDescriptor , typescript_type = "BluetoothRemoteGATTDescriptor")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothRemoteGattDescriptor` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothRemoteGattDescriptor; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothRemoteGattCharacteristic")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTDescriptor" , js_name = characteristic)] + #[doc = "Getter for the `characteristic` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/characteristic)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`, `BluetoothRemoteGattDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn characteristic( + this: &BluetoothRemoteGattDescriptor, + ) -> BluetoothRemoteGattCharacteristic; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTDescriptor" , js_name = uuid)] + #[doc = "Getter for the `uuid` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/uuid)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn uuid(this: &BluetoothRemoteGattDescriptor) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = readValue)] + #[doc = "The `readValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/readValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn read_value(this: &BluetoothRemoteGattDescriptor) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = writeValue)] + #[doc = "The `writeValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/writeValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_buffer_source( + this: &BluetoothRemoteGattDescriptor, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = writeValue)] + #[doc = "The `writeValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/writeValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_u8_array( + this: &BluetoothRemoteGattDescriptor, + value: &mut [u8], + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs new file mode 100644 index 00000000000..76e8d833d61 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs @@ -0,0 +1,130 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothRemoteGATTServer , typescript_type = "BluetoothRemoteGATTServer")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothRemoteGattServer` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothRemoteGattServer; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothDevice")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTServer" , js_name = device)] + #[doc = "Getter for the `device` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/device)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`, `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device(this: &BluetoothRemoteGattServer) -> BluetoothDevice; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTServer" , js_name = connected)] + #[doc = "Getter for the `connected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/connected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn connected(this: &BluetoothRemoteGattServer) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTServer" , js_name = connect)] + #[doc = "The `connect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/connect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn connect(this: &BluetoothRemoteGattServer) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTServer" , js_name = disconnect)] + #[doc = "The `disconnect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/disconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn disconnect(this: &BluetoothRemoteGattServer); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTServer" , js_name = getPrimaryService)] + #[doc = "The `getPrimaryService()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/getPrimaryService)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_primary_service_with_str( + this: &BluetoothRemoteGattServer, + service: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTServer" , js_name = getPrimaryService)] + #[doc = "The `getPrimaryService()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/getPrimaryService)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_primary_service_with_u32( + this: &BluetoothRemoteGattServer, + service: u32, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTServer" , js_name = getPrimaryServices)] + #[doc = "The `getPrimaryServices()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/getPrimaryServices)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_primary_services(this: &BluetoothRemoteGattServer) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTServer" , js_name = getPrimaryServices)] + #[doc = "The `getPrimaryServices()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/getPrimaryServices)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_primary_services_with_str( + this: &BluetoothRemoteGattServer, + service: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTServer" , js_name = getPrimaryServices)] + #[doc = "The `getPrimaryServices()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/getPrimaryServices)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattServer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_primary_services_with_u32( + this: &BluetoothRemoteGattServer, + service: u32, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs new file mode 100644 index 00000000000..852c88b1c9e --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs @@ -0,0 +1,288 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = BluetoothRemoteGATTService , typescript_type = "BluetoothRemoteGATTService")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothRemoteGattService` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothRemoteGattService; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothDevice")] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = device)] + #[doc = "Getter for the `device` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/device)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDevice`, `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device(this: &BluetoothRemoteGattService) -> BluetoothDevice; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = uuid)] + #[doc = "Getter for the `uuid` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/uuid)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn uuid(this: &BluetoothRemoteGattService) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = isPrimary)] + #[doc = "Getter for the `isPrimary` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/isPrimary)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn is_primary(this: &BluetoothRemoteGattService) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = oncharacteristicvaluechanged)] + #[doc = "Getter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn oncharacteristicvaluechanged( + this: &BluetoothRemoteGattService, + ) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothRemoteGATTService" , js_name = oncharacteristicvaluechanged)] + #[doc = "Setter for the `oncharacteristicvaluechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/oncharacteristicvaluechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_oncharacteristicvaluechanged( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = onserviceadded)] + #[doc = "Getter for the `onserviceadded` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/onserviceadded)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onserviceadded(this: &BluetoothRemoteGattService) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothRemoteGATTService" , js_name = onserviceadded)] + #[doc = "Setter for the `onserviceadded` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/onserviceadded)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onserviceadded( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = onservicechanged)] + #[doc = "Getter for the `onservicechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/onservicechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onservicechanged(this: &BluetoothRemoteGattService) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothRemoteGATTService" , js_name = onservicechanged)] + #[doc = "Setter for the `onservicechanged` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/onservicechanged)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onservicechanged( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = onserviceremoved)] + #[doc = "Getter for the `onserviceremoved` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/onserviceremoved)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onserviceremoved(this: &BluetoothRemoteGattService) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "BluetoothRemoteGATTService" , js_name = onserviceremoved)] + #[doc = "Setter for the `onserviceremoved` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/onserviceremoved)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onserviceremoved( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getCharacteristic)] + #[doc = "The `getCharacteristic()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristic)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_characteristic_with_str( + this: &BluetoothRemoteGattService, + characteristic: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getCharacteristic)] + #[doc = "The `getCharacteristic()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristic)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_characteristic_with_u32( + this: &BluetoothRemoteGattService, + characteristic: u32, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getCharacteristics)] + #[doc = "The `getCharacteristics()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristics)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_characteristics(this: &BluetoothRemoteGattService) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getCharacteristics)] + #[doc = "The `getCharacteristics()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristics)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_characteristics_with_str( + this: &BluetoothRemoteGattService, + characteristic: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getCharacteristics)] + #[doc = "The `getCharacteristics()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristics)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_characteristics_with_u32( + this: &BluetoothRemoteGattService, + characteristic: u32, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getIncludedService)] + #[doc = "The `getIncludedService()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getIncludedService)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_included_service_with_str( + this: &BluetoothRemoteGattService, + service: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getIncludedService)] + #[doc = "The `getIncludedService()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getIncludedService)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_included_service_with_u32( + this: &BluetoothRemoteGattService, + service: u32, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getIncludedServices)] + #[doc = "The `getIncludedServices()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getIncludedServices)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_included_services(this: &BluetoothRemoteGattService) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getIncludedServices)] + #[doc = "The `getIncludedServices()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getIncludedServices)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_included_services_with_str( + this: &BluetoothRemoteGattService, + service: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTService" , js_name = getIncludedServices)] + #[doc = "The `getIncludedServices()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getIncludedServices)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattService`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_included_services_with_u32( + this: &BluetoothRemoteGattService, + service: u32, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs b/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs new file mode 100644 index 00000000000..cb089efcc6a --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs @@ -0,0 +1,18 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothServiceDataMap , typescript_type = "BluetoothServiceDataMap")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothServiceDataMap` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothServiceDataMap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothServiceDataMap; +} diff --git a/crates/web-sys/src/features/gen_BluetoothUuid.rs b/crates/web-sys/src/features/gen_BluetoothUuid.rs new file mode 100644 index 00000000000..65e1505356d --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothUuid.rs @@ -0,0 +1,95 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BluetoothUUID , typescript_type = "BluetoothUUID")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `BluetoothUuid` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type BluetoothUuid; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = canonicalUUID)] + #[doc = "The `canonicalUUID()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/canonicalUUID)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn canonical_uuid(alias: u32) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getCharacteristic)] + #[doc = "The `getCharacteristic()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getCharacteristic)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_characteristic_with_str(name: &str) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getCharacteristic)] + #[doc = "The `getCharacteristic()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getCharacteristic)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_characteristic_with_u32(name: u32) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getDescriptor)] + #[doc = "The `getDescriptor()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getDescriptor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_descriptor_with_str(name: &str) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getDescriptor)] + #[doc = "The `getDescriptor()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getDescriptor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_descriptor_with_u32(name: u32) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getService)] + #[doc = "The `getService()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getService)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_service_with_str(name: &str) -> String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getService)] + #[doc = "The `getService()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getService)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_service_with_u32(name: u32) -> String; +} diff --git a/crates/web-sys/src/features/gen_Navigator.rs b/crates/web-sys/src/features/gen_Navigator.rs index 56ee39890dc..8ccb0ef4bcd 100644 --- a/crates/web-sys/src/features/gen_Navigator.rs +++ b/crates/web-sys/src/features/gen_Navigator.rs @@ -105,6 +105,18 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `CredentialsContainer`, `Navigator`*"] pub fn credentials(this: &Navigator) -> CredentialsContainer; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Bluetooth")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = bluetooth)] + #[doc = "Getter for the `bluetooth` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/bluetooth)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Bluetooth`, `Navigator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn bluetooth(this: &Navigator) -> Bluetooth; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Clipboard")] # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = clipboard)] #[doc = "Getter for the `clipboard` field of this object."] diff --git a/crates/web-sys/src/features/gen_RequestDeviceOptions.rs b/crates/web-sys/src/features/gen_RequestDeviceOptions.rs new file mode 100644 index 00000000000..203146eef6b --- /dev/null +++ b/crates/web-sys/src/features/gen_RequestDeviceOptions.rs @@ -0,0 +1,93 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RequestDeviceOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RequestDeviceOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RequestDeviceOptions; +} +#[cfg(web_sys_unstable_apis)] +impl RequestDeviceOptions { + #[doc = "Construct a new `RequestDeviceOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `acceptAllDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn accept_all_devices(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("acceptAllDevices"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("filters"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `optionalServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn optional_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("optionalServices"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_ValueEvent.rs b/crates/web-sys/src/features/gen_ValueEvent.rs new file mode 100644 index 00000000000..c98bf92c843 --- /dev/null +++ b/crates/web-sys/src/features/gen_ValueEvent.rs @@ -0,0 +1,29 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = ValueEvent , typescript_type = "ValueEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ValueEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ValueEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type ValueEvent; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "ValueEvent" , js_name = value)] + #[doc = "Getter for the `value` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ValueEvent/value)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn value(this: &ValueEvent) -> ::wasm_bindgen::JsValue; +} diff --git a/crates/web-sys/src/features/gen_ValueEventInit.rs b/crates/web-sys/src/features/gen_ValueEventInit.rs new file mode 100644 index 00000000000..4aa20634be3 --- /dev/null +++ b/crates/web-sys/src/features/gen_ValueEventInit.rs @@ -0,0 +1,110 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ValueEventInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ValueEventInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type ValueEventInit; +} +#[cfg(web_sys_unstable_apis)] +impl ValueEventInit { + #[doc = "Construct a new `ValueEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("bubbles"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("cancelable"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn composed(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("composed"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs b/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs new file mode 100644 index 00000000000..6ce5fa09b9d --- /dev/null +++ b/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs @@ -0,0 +1,49 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WatchAdvertisementsOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WatchAdvertisementsOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WatchAdvertisementsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WatchAdvertisementsOptions; +} +#[cfg(web_sys_unstable_apis)] +impl WatchAdvertisementsOptions { + #[doc = "Construct a new `WatchAdvertisementsOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WatchAdvertisementsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WatchAdvertisementsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 50859ff9783..b0f134104ff 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -64,6 +64,12 @@ mod gen_AlignSetting; #[cfg(feature = "AlignSetting")] pub use gen_AlignSetting::*; +#[cfg(feature = "AllowedBluetoothDevice")] +#[allow(non_snake_case)] +mod gen_AllowedBluetoothDevice; +#[cfg(feature = "AllowedBluetoothDevice")] +pub use gen_AllowedBluetoothDevice::*; + #[cfg(feature = "AnalyserNode")] #[allow(non_snake_case)] mod gen_AnalyserNode; @@ -484,6 +490,108 @@ mod gen_BlockParsingOptions; #[cfg(feature = "BlockParsingOptions")] pub use gen_BlockParsingOptions::*; +#[cfg(feature = "Bluetooth")] +#[allow(non_snake_case)] +mod gen_Bluetooth; +#[cfg(feature = "Bluetooth")] +pub use gen_Bluetooth::*; + +#[cfg(feature = "BluetoothAdvertisingEvent")] +#[allow(non_snake_case)] +mod gen_BluetoothAdvertisingEvent; +#[cfg(feature = "BluetoothAdvertisingEvent")] +pub use gen_BluetoothAdvertisingEvent::*; + +#[cfg(feature = "BluetoothAdvertisingEventInit")] +#[allow(non_snake_case)] +mod gen_BluetoothAdvertisingEventInit; +#[cfg(feature = "BluetoothAdvertisingEventInit")] +pub use gen_BluetoothAdvertisingEventInit::*; + +#[cfg(feature = "BluetoothCharacteristicProperties")] +#[allow(non_snake_case)] +mod gen_BluetoothCharacteristicProperties; +#[cfg(feature = "BluetoothCharacteristicProperties")] +pub use gen_BluetoothCharacteristicProperties::*; + +#[cfg(feature = "BluetoothDataFilterInit")] +#[allow(non_snake_case)] +mod gen_BluetoothDataFilterInit; +#[cfg(feature = "BluetoothDataFilterInit")] +pub use gen_BluetoothDataFilterInit::*; + +#[cfg(feature = "BluetoothDevice")] +#[allow(non_snake_case)] +mod gen_BluetoothDevice; +#[cfg(feature = "BluetoothDevice")] +pub use gen_BluetoothDevice::*; + +#[cfg(feature = "BluetoothLeScanFilterInit")] +#[allow(non_snake_case)] +mod gen_BluetoothLeScanFilterInit; +#[cfg(feature = "BluetoothLeScanFilterInit")] +pub use gen_BluetoothLeScanFilterInit::*; + +#[cfg(feature = "BluetoothManufacturerDataMap")] +#[allow(non_snake_case)] +mod gen_BluetoothManufacturerDataMap; +#[cfg(feature = "BluetoothManufacturerDataMap")] +pub use gen_BluetoothManufacturerDataMap::*; + +#[cfg(feature = "BluetoothPermissionDescriptor")] +#[allow(non_snake_case)] +mod gen_BluetoothPermissionDescriptor; +#[cfg(feature = "BluetoothPermissionDescriptor")] +pub use gen_BluetoothPermissionDescriptor::*; + +#[cfg(feature = "BluetoothPermissionResult")] +#[allow(non_snake_case)] +mod gen_BluetoothPermissionResult; +#[cfg(feature = "BluetoothPermissionResult")] +pub use gen_BluetoothPermissionResult::*; + +#[cfg(feature = "BluetoothPermissionStorage")] +#[allow(non_snake_case)] +mod gen_BluetoothPermissionStorage; +#[cfg(feature = "BluetoothPermissionStorage")] +pub use gen_BluetoothPermissionStorage::*; + +#[cfg(feature = "BluetoothRemoteGattCharacteristic")] +#[allow(non_snake_case)] +mod gen_BluetoothRemoteGattCharacteristic; +#[cfg(feature = "BluetoothRemoteGattCharacteristic")] +pub use gen_BluetoothRemoteGattCharacteristic::*; + +#[cfg(feature = "BluetoothRemoteGattDescriptor")] +#[allow(non_snake_case)] +mod gen_BluetoothRemoteGattDescriptor; +#[cfg(feature = "BluetoothRemoteGattDescriptor")] +pub use gen_BluetoothRemoteGattDescriptor::*; + +#[cfg(feature = "BluetoothRemoteGattServer")] +#[allow(non_snake_case)] +mod gen_BluetoothRemoteGattServer; +#[cfg(feature = "BluetoothRemoteGattServer")] +pub use gen_BluetoothRemoteGattServer::*; + +#[cfg(feature = "BluetoothRemoteGattService")] +#[allow(non_snake_case)] +mod gen_BluetoothRemoteGattService; +#[cfg(feature = "BluetoothRemoteGattService")] +pub use gen_BluetoothRemoteGattService::*; + +#[cfg(feature = "BluetoothServiceDataMap")] +#[allow(non_snake_case)] +mod gen_BluetoothServiceDataMap; +#[cfg(feature = "BluetoothServiceDataMap")] +pub use gen_BluetoothServiceDataMap::*; + +#[cfg(feature = "BluetoothUuid")] +#[allow(non_snake_case)] +mod gen_BluetoothUuid; +#[cfg(feature = "BluetoothUuid")] +pub use gen_BluetoothUuid::*; + #[cfg(feature = "BoxQuadOptions")] #[allow(non_snake_case)] mod gen_BoxQuadOptions; @@ -5170,6 +5278,12 @@ mod gen_RequestDestination; #[cfg(feature = "RequestDestination")] pub use gen_RequestDestination::*; +#[cfg(feature = "RequestDeviceOptions")] +#[allow(non_snake_case)] +mod gen_RequestDeviceOptions; +#[cfg(feature = "RequestDeviceOptions")] +pub use gen_RequestDeviceOptions::*; + #[cfg(feature = "RequestInit")] #[allow(non_snake_case)] mod gen_RequestInit; @@ -7150,6 +7264,18 @@ mod gen_ValidityState; #[cfg(feature = "ValidityState")] pub use gen_ValidityState::*; +#[cfg(feature = "ValueEvent")] +#[allow(non_snake_case)] +mod gen_ValueEvent; +#[cfg(feature = "ValueEvent")] +pub use gen_ValueEvent::*; + +#[cfg(feature = "ValueEventInit")] +#[allow(non_snake_case)] +mod gen_ValueEventInit; +#[cfg(feature = "ValueEventInit")] +pub use gen_ValueEventInit::*; + #[cfg(feature = "VideoConfiguration")] #[allow(non_snake_case)] mod gen_VideoConfiguration; @@ -7288,6 +7414,12 @@ mod gen_VttRegion; #[cfg(feature = "VttRegion")] pub use gen_VttRegion::*; +#[cfg(feature = "WatchAdvertisementsOptions")] +#[allow(non_snake_case)] +mod gen_WatchAdvertisementsOptions; +#[cfg(feature = "WatchAdvertisementsOptions")] +pub use gen_WatchAdvertisementsOptions::*; + #[cfg(feature = "WaveShaperNode")] #[allow(non_snake_case)] mod gen_WaveShaperNode; diff --git a/crates/web-sys/webidls/unstable/Bluetooth.webidl b/crates/web-sys/webidls/unstable/Bluetooth.webidl new file mode 100644 index 00000000000..68c2a4d4bab --- /dev/null +++ b/crates/web-sys/webidls/unstable/Bluetooth.webidl @@ -0,0 +1,236 @@ +dictionary BluetoothDataFilterInit { + BufferSource dataPrefix; + BufferSource mask; +}; + +dictionary BluetoothLEScanFilterInit { + sequence services; + DOMString name; + DOMString namePrefix; + // Maps unsigned shorts to BluetoothDataFilters. + object manufacturerData; + // Maps BluetoothServiceUUIDs to BluetoothDataFilters. + object serviceData; +}; + +dictionary RequestDeviceOptions { + sequence filters; + sequence optionalServices = []; + boolean acceptAllDevices = false; +}; + +[Exposed=Window, SecureContext] +interface Bluetooth : EventTarget { + Promise getAvailability(); + attribute EventHandler onavailabilitychanged; + [SameObject] + readonly attribute BluetoothDevice? referringDevice; + Promise> getDevices(); + Promise requestDevice(optional RequestDeviceOptions options = {}); +}; + +Bluetooth includes BluetoothDeviceEventHandlers; +Bluetooth includes CharacteristicEventHandlers; +Bluetooth includes ServiceEventHandlers; + +dictionary BluetoothPermissionDescriptor : PermissionDescriptor { + DOMString deviceId; + // These match RequestDeviceOptions. + sequence filters; + sequence optionalServices = []; + boolean acceptAllDevices = false; +}; + +dictionary AllowedBluetoothDevice { + required DOMString deviceId; + required boolean mayUseGATT; + // An allowedServices of "all" means all services are allowed. + required (DOMString or sequence) allowedServices; +}; +dictionary BluetoothPermissionStorage { + required sequence allowedDevices; +}; + +[Exposed=Window] +interface BluetoothPermissionResult : PermissionStatus { + attribute FrozenArray devices; +}; + +[ + Exposed=Window, + SecureContext +] +interface ValueEvent : Event { + constructor(DOMString type, optional ValueEventInit initDict = {}); + readonly attribute any value; +}; + +dictionary ValueEventInit : EventInit { + any value = null; +}; + +[Exposed=Window, SecureContext] +interface BluetoothDevice : EventTarget { + readonly attribute DOMString id; + readonly attribute DOMString? name; + readonly attribute BluetoothRemoteGATTServer? gatt; + + Promise watchAdvertisements( + optional WatchAdvertisementsOptions options = {}); + readonly attribute boolean watchingAdvertisements; +}; +BluetoothDevice includes BluetoothDeviceEventHandlers; +BluetoothDevice includes CharacteristicEventHandlers; +BluetoothDevice includes ServiceEventHandlers; + +dictionary WatchAdvertisementsOptions { + AbortSignal signal; +}; + +[Exposed=Window, SecureContext] +interface BluetoothManufacturerDataMap { + readonly maplike; +}; +[Exposed=Window, SecureContext] +interface BluetoothServiceDataMap { + readonly maplike; +}; +[ + Exposed=Window, + SecureContext +] +interface BluetoothAdvertisingEvent : Event { + constructor(DOMString type, BluetoothAdvertisingEventInit init); + [SameObject] + readonly attribute BluetoothDevice device; + readonly attribute FrozenArray uuids; + readonly attribute DOMString? name; + readonly attribute unsigned short? appearance; + readonly attribute byte? txPower; + readonly attribute byte? rssi; + [SameObject] + readonly attribute BluetoothManufacturerDataMap manufacturerData; + [SameObject] + readonly attribute BluetoothServiceDataMap serviceData; +}; +dictionary BluetoothAdvertisingEventInit : EventInit { + required BluetoothDevice device; + sequence<(DOMString or unsigned long)> uuids; + DOMString name; + unsigned short appearance; + byte txPower; + byte rssi; + BluetoothManufacturerDataMap manufacturerData; + BluetoothServiceDataMap serviceData; +}; + +[Exposed=Window, SecureContext] +interface BluetoothRemoteGATTServer { + [SameObject] + readonly attribute BluetoothDevice device; + readonly attribute boolean connected; + Promise connect(); + void disconnect(); + Promise getPrimaryService(BluetoothServiceUUID service); + Promise> + getPrimaryServices(optional BluetoothServiceUUID service); +}; + +[Exposed=Window, SecureContext] +interface BluetoothRemoteGATTService : EventTarget { + [SameObject] + readonly attribute BluetoothDevice device; + readonly attribute UUID uuid; + readonly attribute boolean isPrimary; + Promise + getCharacteristic(BluetoothCharacteristicUUID characteristic); + Promise> + getCharacteristics(optional BluetoothCharacteristicUUID characteristic); + Promise + getIncludedService(BluetoothServiceUUID service); + Promise> + getIncludedServices(optional BluetoothServiceUUID service); +}; +BluetoothRemoteGATTService includes CharacteristicEventHandlers; +BluetoothRemoteGATTService includes ServiceEventHandlers; + +[Exposed=Window, SecureContext] +interface BluetoothRemoteGATTCharacteristic : EventTarget { + [SameObject] + readonly attribute BluetoothRemoteGATTService service; + readonly attribute UUID uuid; + readonly attribute BluetoothCharacteristicProperties properties; + readonly attribute DataView? value; + Promise getDescriptor(BluetoothDescriptorUUID descriptor); + Promise> + getDescriptors(optional BluetoothDescriptorUUID descriptor); + Promise readValue(); + Promise writeValue(BufferSource value); + Promise writeValueWithResponse(BufferSource value); + Promise writeValueWithoutResponse(BufferSource value); + Promise startNotifications(); + Promise stopNotifications(); +}; +BluetoothRemoteGATTCharacteristic includes CharacteristicEventHandlers; + +[Exposed=Window, SecureContext] +interface BluetoothCharacteristicProperties { + readonly attribute boolean broadcast; + readonly attribute boolean read; + readonly attribute boolean writeWithoutResponse; + readonly attribute boolean write; + readonly attribute boolean notify; + readonly attribute boolean indicate; + readonly attribute boolean authenticatedSignedWrites; + readonly attribute boolean reliableWrite; + readonly attribute boolean writableAuxiliaries; +}; + +[Exposed=Window, SecureContext] +interface BluetoothRemoteGATTDescriptor { + [SameObject] + readonly attribute BluetoothRemoteGATTCharacteristic characteristic; + readonly attribute UUID uuid; + readonly attribute DataView? value; + Promise readValue(); + Promise writeValue(BufferSource value); +}; + +[SecureContext] +interface mixin CharacteristicEventHandlers { + attribute EventHandler oncharacteristicvaluechanged; +}; + +[SecureContext] +interface mixin BluetoothDeviceEventHandlers { + attribute EventHandler onadvertisementreceived; + attribute EventHandler ongattserverdisconnected; +}; + +[SecureContext] +interface mixin ServiceEventHandlers { + attribute EventHandler onserviceadded; + attribute EventHandler onservicechanged; + attribute EventHandler onserviceremoved; +}; + +typedef DOMString UUID; + +[Exposed=Window] +interface BluetoothUUID { + static UUID getService((DOMString or unsigned long) name); + static UUID getCharacteristic((DOMString or unsigned long) name); + static UUID getDescriptor((DOMString or unsigned long) name); + + static UUID canonicalUUID([EnforceRange] unsigned long alias); +}; + +typedef (DOMString or unsigned long) BluetoothServiceUUID; +typedef (DOMString or unsigned long) BluetoothCharacteristicUUID; +typedef (DOMString or unsigned long) BluetoothDescriptorUUID; + +[SecureContext] +partial interface Navigator { + [SameObject] + readonly attribute Bluetooth bluetooth; +}; \ No newline at end of file