From 20e1596ab0cbdfbc53cdd309be41145212c74d7b Mon Sep 17 00:00:00 2001 From: Doug A Date: Fri, 4 Aug 2023 14:53:43 -0300 Subject: [PATCH 1/4] feat: add RTCDataChannel id --- crates/web-sys/webidls/enabled/RTCDataChannel.webidl | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/web-sys/webidls/enabled/RTCDataChannel.webidl b/crates/web-sys/webidls/enabled/RTCDataChannel.webidl index 016a9da326a..787208eb230 100644 --- a/crates/web-sys/webidls/enabled/RTCDataChannel.webidl +++ b/crates/web-sys/webidls/enabled/RTCDataChannel.webidl @@ -17,6 +17,7 @@ enum RTCDataChannelType { interface RTCDataChannel : EventTarget { readonly attribute DOMString label; + readonly attribute unsigned short id; readonly attribute boolean reliable; readonly attribute unsigned short? maxPacketLifeTime; readonly attribute unsigned short? maxRetransmits; From 1531c32e9de2faa7e59c096b249e2b37997647d3 Mon Sep 17 00:00:00 2001 From: Doug A Date: Fri, 4 Aug 2023 15:06:52 -0300 Subject: [PATCH 2/4] commit generated code update --- .../src/features/gen_RtcDataChannel.rs | 421 +++++++++--------- 1 file changed, 214 insertions(+), 207 deletions(-) diff --git a/crates/web-sys/src/features/gen_RtcDataChannel.rs b/crates/web-sys/src/features/gen_RtcDataChannel.rs index 59b3aad432b..00c9b4763a4 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannel.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannel.rs @@ -1,207 +1,214 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = RTCDataChannel , typescript_type = "RTCDataChannel")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `RtcDataChannel` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub type RtcDataChannel; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = label)] - #[doc = "Getter for the `label` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/label)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn label(this: &RtcDataChannel) -> String; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = reliable)] - #[doc = "Getter for the `reliable` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn reliable(this: &RtcDataChannel) -> bool; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxPacketLifeTime)] - #[doc = "Getter for the `maxPacketLifeTime` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxPacketLifeTime)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn max_packet_life_time(this: &RtcDataChannel) -> Option; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxRetransmits)] - #[doc = "Getter for the `maxRetransmits` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxRetransmits)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn max_retransmits(this: &RtcDataChannel) -> Option; - #[cfg(feature = "RtcDataChannelState")] - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = readyState)] - #[doc = "Getter for the `readyState` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelState`*"] - pub fn ready_state(this: &RtcDataChannel) -> RtcDataChannelState; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmount)] - #[doc = "Getter for the `bufferedAmount` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmount)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn buffered_amount(this: &RtcDataChannel) -> u32; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] - #[doc = "Getter for the `bufferedAmountLowThreshold` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn buffered_amount_low_threshold(this: &RtcDataChannel) -> u32; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] - #[doc = "Setter for the `bufferedAmountLowThreshold` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_buffered_amount_low_threshold(this: &RtcDataChannel, value: u32); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onopen)] - #[doc = "Getter for the `onopen` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onopen(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onopen)] - #[doc = "Setter for the `onopen` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onopen(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onerror)] - #[doc = "Getter for the `onerror` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onerror(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onerror)] - #[doc = "Setter for the `onerror` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onerror(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onclose)] - #[doc = "Getter for the `onclose` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onclose(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onclose)] - #[doc = "Setter for the `onclose` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onclose(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onmessage)] - #[doc = "Getter for the `onmessage` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onmessage(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onmessage)] - #[doc = "Setter for the `onmessage` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onmessage(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] - #[doc = "Getter for the `onbufferedamountlow` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onbufferedamountlow(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] - #[doc = "Setter for the `onbufferedamountlow` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onbufferedamountlow(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - #[cfg(feature = "RtcDataChannelType")] - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = binaryType)] - #[doc = "Getter for the `binaryType` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] - pub fn binary_type(this: &RtcDataChannel) -> RtcDataChannelType; - #[cfg(feature = "RtcDataChannelType")] - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = binaryType)] - #[doc = "Setter for the `binaryType` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] - pub fn set_binary_type(this: &RtcDataChannel, value: RtcDataChannelType); - # [wasm_bindgen (method , structural , js_class = "RTCDataChannel" , js_name = close)] - #[doc = "The `close()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/close)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn close(this: &RtcDataChannel); - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_str(this: &RtcDataChannel, data: &str) -> Result<(), JsValue>; - #[cfg(feature = "Blob")] - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Blob`, `RtcDataChannel`*"] - pub fn send_with_blob(this: &RtcDataChannel, data: &Blob) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_array_buffer( - this: &RtcDataChannel, - data: &::js_sys::ArrayBuffer, - ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_array_buffer_view( - this: &RtcDataChannel, - data: &::js_sys::Object, - ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>; -} +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = RTCDataChannel , typescript_type = "RTCDataChannel")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcDataChannel` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub type RtcDataChannel; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn label(this: &RtcDataChannel) -> String; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , 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/RTCDataChannel/id)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn id(this: &RtcDataChannel) -> u16; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = reliable)] + #[doc = "Getter for the `reliable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn reliable(this: &RtcDataChannel) -> bool; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxPacketLifeTime)] + #[doc = "Getter for the `maxPacketLifeTime` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxPacketLifeTime)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn max_packet_life_time(this: &RtcDataChannel) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxRetransmits)] + #[doc = "Getter for the `maxRetransmits` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxRetransmits)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn max_retransmits(this: &RtcDataChannel) -> Option; + #[cfg(feature = "RtcDataChannelState")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = readyState)] + #[doc = "Getter for the `readyState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelState`*"] + pub fn ready_state(this: &RtcDataChannel) -> RtcDataChannelState; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmount)] + #[doc = "Getter for the `bufferedAmount` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmount)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn buffered_amount(this: &RtcDataChannel) -> u32; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] + #[doc = "Getter for the `bufferedAmountLowThreshold` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn buffered_amount_low_threshold(this: &RtcDataChannel) -> u32; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] + #[doc = "Setter for the `bufferedAmountLowThreshold` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_buffered_amount_low_threshold(this: &RtcDataChannel, value: u32); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onopen)] + #[doc = "Getter for the `onopen` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onopen(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onopen)] + #[doc = "Setter for the `onopen` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onopen(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onerror)] + #[doc = "Getter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onerror(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onerror)] + #[doc = "Setter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onerror(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onclose)] + #[doc = "Getter for the `onclose` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onclose(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onclose)] + #[doc = "Setter for the `onclose` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onclose(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onmessage)] + #[doc = "Getter for the `onmessage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onmessage(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onmessage)] + #[doc = "Setter for the `onmessage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onmessage(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] + #[doc = "Getter for the `onbufferedamountlow` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onbufferedamountlow(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] + #[doc = "Setter for the `onbufferedamountlow` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onbufferedamountlow(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + #[cfg(feature = "RtcDataChannelType")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = binaryType)] + #[doc = "Getter for the `binaryType` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] + pub fn binary_type(this: &RtcDataChannel) -> RtcDataChannelType; + #[cfg(feature = "RtcDataChannelType")] + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = binaryType)] + #[doc = "Setter for the `binaryType` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] + pub fn set_binary_type(this: &RtcDataChannel, value: RtcDataChannelType); + # [wasm_bindgen (method , structural , js_class = "RTCDataChannel" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn close(this: &RtcDataChannel); + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_str(this: &RtcDataChannel, data: &str) -> Result<(), JsValue>; + #[cfg(feature = "Blob")] + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `RtcDataChannel`*"] + pub fn send_with_blob(this: &RtcDataChannel, data: &Blob) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_array_buffer( + this: &RtcDataChannel, + data: &::js_sys::ArrayBuffer, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_array_buffer_view( + this: &RtcDataChannel, + data: &::js_sys::Object, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>; +} From 2a0282204d21a87db4fdda045b3f69a71feae959 Mon Sep 17 00:00:00 2001 From: Doug A Date: Sat, 5 Aug 2023 09:02:47 -0300 Subject: [PATCH 3/4] Update crates/web-sys/webidls/enabled/RTCDataChannel.webidl Co-authored-by: daxpedda --- crates/web-sys/webidls/enabled/RTCDataChannel.webidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/web-sys/webidls/enabled/RTCDataChannel.webidl b/crates/web-sys/webidls/enabled/RTCDataChannel.webidl index 787208eb230..69efe2fd0a6 100644 --- a/crates/web-sys/webidls/enabled/RTCDataChannel.webidl +++ b/crates/web-sys/webidls/enabled/RTCDataChannel.webidl @@ -17,7 +17,7 @@ enum RTCDataChannelType { interface RTCDataChannel : EventTarget { readonly attribute DOMString label; - readonly attribute unsigned short id; + readonly attribute unsigned short? id; readonly attribute boolean reliable; readonly attribute unsigned short? maxPacketLifeTime; readonly attribute unsigned short? maxRetransmits; From 14956b53e5352aa0198785d132a8973eb35afe46 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Sat, 5 Aug 2023 19:30:11 +0200 Subject: [PATCH 4/4] Fix WebIDL code generation --- .../src/features/gen_RtcDataChannel.rs | 428 +++++++++--------- 1 file changed, 214 insertions(+), 214 deletions(-) diff --git a/crates/web-sys/src/features/gen_RtcDataChannel.rs b/crates/web-sys/src/features/gen_RtcDataChannel.rs index 00c9b4763a4..09913d28b0a 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannel.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannel.rs @@ -1,214 +1,214 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = RTCDataChannel , typescript_type = "RTCDataChannel")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `RtcDataChannel` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub type RtcDataChannel; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = label)] - #[doc = "Getter for the `label` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/label)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn label(this: &RtcDataChannel) -> String; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , 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/RTCDataChannel/id)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn id(this: &RtcDataChannel) -> u16; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = reliable)] - #[doc = "Getter for the `reliable` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn reliable(this: &RtcDataChannel) -> bool; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxPacketLifeTime)] - #[doc = "Getter for the `maxPacketLifeTime` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxPacketLifeTime)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn max_packet_life_time(this: &RtcDataChannel) -> Option; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxRetransmits)] - #[doc = "Getter for the `maxRetransmits` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxRetransmits)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn max_retransmits(this: &RtcDataChannel) -> Option; - #[cfg(feature = "RtcDataChannelState")] - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = readyState)] - #[doc = "Getter for the `readyState` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelState`*"] - pub fn ready_state(this: &RtcDataChannel) -> RtcDataChannelState; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmount)] - #[doc = "Getter for the `bufferedAmount` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmount)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn buffered_amount(this: &RtcDataChannel) -> u32; - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] - #[doc = "Getter for the `bufferedAmountLowThreshold` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn buffered_amount_low_threshold(this: &RtcDataChannel) -> u32; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] - #[doc = "Setter for the `bufferedAmountLowThreshold` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_buffered_amount_low_threshold(this: &RtcDataChannel, value: u32); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onopen)] - #[doc = "Getter for the `onopen` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onopen(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onopen)] - #[doc = "Setter for the `onopen` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onopen(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onerror)] - #[doc = "Getter for the `onerror` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onerror(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onerror)] - #[doc = "Setter for the `onerror` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onerror(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onclose)] - #[doc = "Getter for the `onclose` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onclose(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onclose)] - #[doc = "Setter for the `onclose` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onclose(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onmessage)] - #[doc = "Getter for the `onmessage` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onmessage(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onmessage)] - #[doc = "Setter for the `onmessage` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onmessage(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] - #[doc = "Getter for the `onbufferedamountlow` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn onbufferedamountlow(this: &RtcDataChannel) -> Option<::js_sys::Function>; - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] - #[doc = "Setter for the `onbufferedamountlow` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn set_onbufferedamountlow(this: &RtcDataChannel, value: Option<&::js_sys::Function>); - #[cfg(feature = "RtcDataChannelType")] - # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = binaryType)] - #[doc = "Getter for the `binaryType` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] - pub fn binary_type(this: &RtcDataChannel) -> RtcDataChannelType; - #[cfg(feature = "RtcDataChannelType")] - # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = binaryType)] - #[doc = "Setter for the `binaryType` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] - pub fn set_binary_type(this: &RtcDataChannel, value: RtcDataChannelType); - # [wasm_bindgen (method , structural , js_class = "RTCDataChannel" , js_name = close)] - #[doc = "The `close()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/close)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn close(this: &RtcDataChannel); - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_str(this: &RtcDataChannel, data: &str) -> Result<(), JsValue>; - #[cfg(feature = "Blob")] - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Blob`, `RtcDataChannel`*"] - pub fn send_with_blob(this: &RtcDataChannel, data: &Blob) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_array_buffer( - this: &RtcDataChannel, - data: &::js_sys::ArrayBuffer, - ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_array_buffer_view( - this: &RtcDataChannel, - data: &::js_sys::Object, - ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] - #[doc = "The `send()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>; -} +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = RTCDataChannel , typescript_type = "RTCDataChannel")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcDataChannel` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub type RtcDataChannel; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = label)] + #[doc = "Getter for the `label` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/label)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn label(this: &RtcDataChannel) -> String; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , 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/RTCDataChannel/id)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn id(this: &RtcDataChannel) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = reliable)] + #[doc = "Getter for the `reliable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn reliable(this: &RtcDataChannel) -> bool; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxPacketLifeTime)] + #[doc = "Getter for the `maxPacketLifeTime` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxPacketLifeTime)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn max_packet_life_time(this: &RtcDataChannel) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = maxRetransmits)] + #[doc = "Getter for the `maxRetransmits` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxRetransmits)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn max_retransmits(this: &RtcDataChannel) -> Option; + #[cfg(feature = "RtcDataChannelState")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = readyState)] + #[doc = "Getter for the `readyState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelState`*"] + pub fn ready_state(this: &RtcDataChannel) -> RtcDataChannelState; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmount)] + #[doc = "Getter for the `bufferedAmount` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmount)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn buffered_amount(this: &RtcDataChannel) -> u32; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] + #[doc = "Getter for the `bufferedAmountLowThreshold` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn buffered_amount_low_threshold(this: &RtcDataChannel) -> u32; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold)] + #[doc = "Setter for the `bufferedAmountLowThreshold` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_buffered_amount_low_threshold(this: &RtcDataChannel, value: u32); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onopen)] + #[doc = "Getter for the `onopen` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onopen(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onopen)] + #[doc = "Setter for the `onopen` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onopen(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onerror)] + #[doc = "Getter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onerror(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onerror)] + #[doc = "Setter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onerror(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onclose)] + #[doc = "Getter for the `onclose` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onclose(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onclose)] + #[doc = "Setter for the `onclose` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onclose(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onmessage)] + #[doc = "Getter for the `onmessage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onmessage(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onmessage)] + #[doc = "Setter for the `onmessage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onmessage(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] + #[doc = "Getter for the `onbufferedamountlow` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn onbufferedamountlow(this: &RtcDataChannel) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow)] + #[doc = "Setter for the `onbufferedamountlow` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn set_onbufferedamountlow(this: &RtcDataChannel, value: Option<&::js_sys::Function>); + #[cfg(feature = "RtcDataChannelType")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = binaryType)] + #[doc = "Getter for the `binaryType` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] + pub fn binary_type(this: &RtcDataChannel) -> RtcDataChannelType; + #[cfg(feature = "RtcDataChannelType")] + # [wasm_bindgen (structural , method , setter , js_class = "RTCDataChannel" , js_name = binaryType)] + #[doc = "Setter for the `binaryType` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"] + pub fn set_binary_type(this: &RtcDataChannel, value: RtcDataChannelType); + # [wasm_bindgen (method , structural , js_class = "RTCDataChannel" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn close(this: &RtcDataChannel); + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_str(this: &RtcDataChannel, data: &str) -> Result<(), JsValue>; + #[cfg(feature = "Blob")] + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `RtcDataChannel`*"] + pub fn send_with_blob(this: &RtcDataChannel, data: &Blob) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_array_buffer( + this: &RtcDataChannel, + data: &::js_sys::ArrayBuffer, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_array_buffer_view( + this: &RtcDataChannel, + data: &::js_sys::Object, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>; +}