diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index e83dc769fef9..e4d12cdc82e4 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 000000000000..98d1db1ca16f --- /dev/null +++ b/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs @@ -0,0 +1,80 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type AllowedBluetoothDevice; +} +impl AllowedBluetoothDevice { + #[doc = "Construct a new `AllowedBluetoothDevice`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + 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 + } + #[doc = "Change the `allowedServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + 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 + } + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + 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 + } + #[doc = "Change the `mayUseGATT` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + 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 000000000000..98b0c6957c34 --- /dev/null +++ b/crates/web-sys/src/features/gen_Bluetooth.rs @@ -0,0 +1,152 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type Bluetooth; + # [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`*"] + pub fn onavailabilitychanged(this: &Bluetooth) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onavailabilitychanged(this: &Bluetooth, value: Option<&::js_sys::Function>); + #[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`*"] + pub fn referring_device(this: &Bluetooth) -> Option; + # [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`*"] + pub fn onadvertisementreceived(this: &Bluetooth) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onadvertisementreceived(this: &Bluetooth, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn ongattserverdisconnected(this: &Bluetooth) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_ongattserverdisconnected(this: &Bluetooth, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn oncharacteristicvaluechanged(this: &Bluetooth) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_oncharacteristicvaluechanged(this: &Bluetooth, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn onserviceadded(this: &Bluetooth) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onserviceadded(this: &Bluetooth, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn onservicechanged(this: &Bluetooth) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onservicechanged(this: &Bluetooth, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn onserviceremoved(this: &Bluetooth) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onserviceremoved(this: &Bluetooth, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn get_availability(this: &Bluetooth) -> ::js_sys::Promise; + # [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`*"] + pub fn get_devices(this: &Bluetooth) -> ::js_sys::Promise; + # [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`*"] + pub fn request_device(this: &Bluetooth) -> ::js_sys::Promise; + #[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`*"] + 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 000000000000..ad2a2b8b32c0 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs @@ -0,0 +1,66 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothAdvertisingEvent; + #[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`*"] + pub fn device(this: &BluetoothAdvertisingEvent) -> BluetoothDevice; + # [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`*"] + pub fn name(this: &BluetoothAdvertisingEvent) -> Option; + # [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`*"] + pub fn appearance(this: &BluetoothAdvertisingEvent) -> Option; + # [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`*"] + pub fn tx_power(this: &BluetoothAdvertisingEvent) -> Option; + # [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`*"] + pub fn rssi(this: &BluetoothAdvertisingEvent) -> Option; + #[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`*"] + pub fn manufacturer_data(this: &BluetoothAdvertisingEvent) -> BluetoothManufacturerDataMap; + #[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`*"] + 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 000000000000..f43ae6fd4ae5 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs @@ -0,0 +1,199 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothAdvertisingEventInit; +} +impl BluetoothAdvertisingEventInit { + #[cfg(feature = "BluetoothDevice")] + #[doc = "Construct a new `BluetoothAdvertisingEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"] + 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 + } + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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 + } + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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 + } + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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 + } + #[doc = "Change the `appearance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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(feature = "BluetoothDevice")] + #[doc = "Change the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"] + 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(feature = "BluetoothManufacturerDataMap")] + #[doc = "Change the `manufacturerData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothManufacturerDataMap`*"] + 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 + } + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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 + } + #[doc = "Change the `rssi` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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(feature = "BluetoothServiceDataMap")] + #[doc = "Change the `serviceData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothServiceDataMap`*"] + 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 + } + #[doc = "Change the `txPower` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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 + } + #[doc = "Change the `uuids` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + 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 000000000000..367109920e0d --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs @@ -0,0 +1,77 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothCharacteristicProperties; + # [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`*"] + pub fn broadcast(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + pub fn read(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + pub fn write_without_response(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + pub fn write(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + pub fn notify(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + pub fn indicate(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + pub fn authenticated_signed_writes(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + pub fn reliable_write(this: &BluetoothCharacteristicProperties) -> bool; + # [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`*"] + 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 000000000000..5e7f196a5dde --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs @@ -0,0 +1,52 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothDataFilterInit; +} +impl BluetoothDataFilterInit { + #[doc = "Construct a new `BluetoothDataFilterInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `dataPrefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + 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 + } + #[doc = "Change the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + 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 000000000000..58fcf3bd5bc0 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothDevice.rs @@ -0,0 +1,148 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothDevice; + # [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`*"] + pub fn id(this: &BluetoothDevice) -> String; + # [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`*"] + pub fn name(this: &BluetoothDevice) -> Option; + #[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`*"] + pub fn gatt(this: &BluetoothDevice) -> Option; + # [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`*"] + pub fn watching_advertisements(this: &BluetoothDevice) -> bool; + # [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`*"] + pub fn onadvertisementreceived(this: &BluetoothDevice) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onadvertisementreceived(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn ongattserverdisconnected(this: &BluetoothDevice) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_ongattserverdisconnected(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn oncharacteristicvaluechanged(this: &BluetoothDevice) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_oncharacteristicvaluechanged( + this: &BluetoothDevice, + value: Option<&::js_sys::Function>, + ); + # [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`*"] + pub fn onserviceadded(this: &BluetoothDevice) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onserviceadded(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn onservicechanged(this: &BluetoothDevice) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onservicechanged(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn onserviceremoved(this: &BluetoothDevice) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onserviceremoved(this: &BluetoothDevice, value: Option<&::js_sys::Function>); + # [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`*"] + pub fn watch_advertisements(this: &BluetoothDevice) -> ::js_sys::Promise; + #[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`*"] + 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 000000000000..1f3cce164b1a --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs @@ -0,0 +1,103 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothLeScanFilterInit; +} +impl BluetoothLeScanFilterInit { + #[doc = "Construct a new `BluetoothLeScanFilterInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `manufacturerData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + 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 + } + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + 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 + } + #[doc = "Change the `namePrefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + 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 + } + #[doc = "Change the `serviceData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + 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 + } + #[doc = "Change the `services` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + 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 000000000000..e29a78f7e9d2 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + 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 000000000000..74c5215fe063 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs @@ -0,0 +1,106 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothPermissionDescriptor; +} +impl BluetoothPermissionDescriptor { + #[cfg(feature = "PermissionName")] + #[doc = "Construct a new `BluetoothPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"] + 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(feature = "PermissionName")] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"] + 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 + } + #[doc = "Change the `acceptAllDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + 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 + } + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + 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 + } + #[doc = "Change the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + 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 + } + #[doc = "Change the `optionalServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + 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 000000000000..de38001bae16 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + 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 000000000000..89c2f066d163 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs @@ -0,0 +1,40 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothPermissionStorage; +} +impl BluetoothPermissionStorage { + #[doc = "Construct a new `BluetoothPermissionStorage`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] + 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 + } + #[doc = "Change the `allowedDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] + 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 000000000000..1efc167eef39 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs @@ -0,0 +1,186 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothRemoteGattCharacteristic; + #[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`*"] + pub fn service(this: &BluetoothRemoteGattCharacteristic) -> BluetoothRemoteGattService; + # [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`*"] + pub fn uuid(this: &BluetoothRemoteGattCharacteristic) -> String; + #[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`*"] + pub fn properties( + this: &BluetoothRemoteGattCharacteristic, + ) -> BluetoothCharacteristicProperties; + # [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`*"] + pub fn oncharacteristicvaluechanged( + this: &BluetoothRemoteGattCharacteristic, + ) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_oncharacteristicvaluechanged( + this: &BluetoothRemoteGattCharacteristic, + value: Option<&::js_sys::Function>, + ); + # [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`*"] + pub fn get_descriptor_with_str( + this: &BluetoothRemoteGattCharacteristic, + descriptor: &str, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_descriptor_with_u32( + this: &BluetoothRemoteGattCharacteristic, + descriptor: u32, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_descriptors(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + # [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`*"] + pub fn get_descriptors_with_str( + this: &BluetoothRemoteGattCharacteristic, + descriptor: &str, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_descriptors_with_u32( + this: &BluetoothRemoteGattCharacteristic, + descriptor: u32, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn read_value(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + # [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`*"] + pub fn start_notifications(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + # [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`*"] + pub fn stop_notifications(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; + # [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`*"] + pub fn write_value_with_buffer_source( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn write_value_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &mut [u8], + ) -> ::js_sys::Promise; + # [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`*"] + pub fn write_value_with_response_with_buffer_source( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn write_value_with_response_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &mut [u8], + ) -> ::js_sys::Promise; + # [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`*"] + pub fn write_value_without_response_with_buffer_source( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + # [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`*"] + 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 000000000000..141ccffd6f9d --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs @@ -0,0 +1,58 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothRemoteGattDescriptor; + #[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`*"] + pub fn characteristic( + this: &BluetoothRemoteGattDescriptor, + ) -> BluetoothRemoteGattCharacteristic; + # [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`*"] + pub fn uuid(this: &BluetoothRemoteGattDescriptor) -> String; + # [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`*"] + pub fn read_value(this: &BluetoothRemoteGattDescriptor) -> ::js_sys::Promise; + # [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`*"] + pub fn write_value_with_buffer_source( + this: &BluetoothRemoteGattDescriptor, + value: &::js_sys::Object, + ) -> ::js_sys::Promise; + # [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`*"] + 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 000000000000..6f4004c9f437 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs @@ -0,0 +1,90 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothRemoteGattServer; + #[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`*"] + pub fn device(this: &BluetoothRemoteGattServer) -> BluetoothDevice; + # [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`*"] + pub fn connected(this: &BluetoothRemoteGattServer) -> bool; + # [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`*"] + pub fn connect(this: &BluetoothRemoteGattServer) -> ::js_sys::Promise; + # [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`*"] + pub fn disconnect(this: &BluetoothRemoteGattServer); + # [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`*"] + pub fn get_primary_service_with_str( + this: &BluetoothRemoteGattServer, + service: &str, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_primary_service_with_u32( + this: &BluetoothRemoteGattServer, + service: u32, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_primary_services(this: &BluetoothRemoteGattServer) -> ::js_sys::Promise; + # [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`*"] + pub fn get_primary_services_with_str( + this: &BluetoothRemoteGattServer, + service: &str, + ) -> ::js_sys::Promise; + # [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`*"] + 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 000000000000..eb646360c576 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs @@ -0,0 +1,200 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothRemoteGattService; + #[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`*"] + pub fn device(this: &BluetoothRemoteGattService) -> BluetoothDevice; + # [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`*"] + pub fn uuid(this: &BluetoothRemoteGattService) -> String; + # [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`*"] + pub fn is_primary(this: &BluetoothRemoteGattService) -> bool; + # [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`*"] + pub fn oncharacteristicvaluechanged( + this: &BluetoothRemoteGattService, + ) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_oncharacteristicvaluechanged( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + # [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`*"] + pub fn onserviceadded(this: &BluetoothRemoteGattService) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onserviceadded( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + # [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`*"] + pub fn onservicechanged(this: &BluetoothRemoteGattService) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onservicechanged( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + # [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`*"] + pub fn onserviceremoved(this: &BluetoothRemoteGattService) -> Option<::js_sys::Function>; + # [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`*"] + pub fn set_onserviceremoved( + this: &BluetoothRemoteGattService, + value: Option<&::js_sys::Function>, + ); + # [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`*"] + pub fn get_characteristic_with_str( + this: &BluetoothRemoteGattService, + characteristic: &str, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_characteristic_with_u32( + this: &BluetoothRemoteGattService, + characteristic: u32, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_characteristics(this: &BluetoothRemoteGattService) -> ::js_sys::Promise; + # [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`*"] + pub fn get_characteristics_with_str( + this: &BluetoothRemoteGattService, + characteristic: &str, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_characteristics_with_u32( + this: &BluetoothRemoteGattService, + characteristic: u32, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_included_service_with_str( + this: &BluetoothRemoteGattService, + service: &str, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_included_service_with_u32( + this: &BluetoothRemoteGattService, + service: u32, + ) -> ::js_sys::Promise; + # [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`*"] + pub fn get_included_services(this: &BluetoothRemoteGattService) -> ::js_sys::Promise; + # [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`*"] + pub fn get_included_services_with_str( + this: &BluetoothRemoteGattService, + service: &str, + ) -> ::js_sys::Promise; + # [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`*"] + 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 000000000000..fd30fc585521 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + 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 000000000000..11a838a11ca6 --- /dev/null +++ b/crates/web-sys/src/features/gen_BluetoothUuid.rs @@ -0,0 +1,63 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type BluetoothUuid; + # [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`*"] + pub fn canonical_uuid(alias: u32) -> String; + # [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`*"] + pub fn get_characteristic_with_str(name: &str) -> String; + # [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`*"] + pub fn get_characteristic_with_u32(name: u32) -> String; + # [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`*"] + pub fn get_descriptor_with_str(name: &str) -> String; + # [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`*"] + pub fn get_descriptor_with_u32(name: u32) -> String; + # [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`*"] + pub fn get_service_with_str(name: &str) -> String; + # [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`*"] + 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 56ee39890dc7..c5a90c9c2677 100644 --- a/crates/web-sys/src/features/gen_Navigator.rs +++ b/crates/web-sys/src/features/gen_Navigator.rs @@ -11,6 +11,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] pub type Navigator; + #[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`*"] + pub fn bluetooth(this: &Navigator) -> Bluetooth; #[cfg(feature = "Permissions")] # [wasm_bindgen (structural , catch , method , getter , js_class = "Navigator" , js_name = permissions)] #[doc = "Getter for the `permissions` 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 000000000000..e3613577fbd1 --- /dev/null +++ b/crates/web-sys/src/features/gen_RequestDeviceOptions.rs @@ -0,0 +1,73 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type RequestDeviceOptions; +} +impl RequestDeviceOptions { + #[doc = "Construct a new `RequestDeviceOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `acceptAllDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + 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 + } + #[doc = "Change the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + 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 + } + #[doc = "Change the `optionalServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + 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 000000000000..484a8f7b5d2c --- /dev/null +++ b/crates/web-sys/src/features/gen_ValueEvent.rs @@ -0,0 +1,21 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type ValueEvent; + # [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`*"] + 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 000000000000..4f1a27005b70 --- /dev/null +++ b/crates/web-sys/src/features/gen_ValueEventInit.rs @@ -0,0 +1,86 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type ValueEventInit; +} +impl ValueEventInit { + #[doc = "Construct a new `ValueEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + 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 + } + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + 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 + } + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + 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 + } + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + 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 000000000000..669cdf61a080 --- /dev/null +++ b/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[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`*"] + pub type WatchAdvertisementsOptions; +} +impl WatchAdvertisementsOptions { + #[doc = "Construct a new `WatchAdvertisementsOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WatchAdvertisementsOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[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`*"] + 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 50859ff97835..b0f134104ff9 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 000000000000..68c2a4d4babe --- /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