From 348ff572536e9c05e7b3490f96e736e8958159df Mon Sep 17 00:00:00 2001 From: evdokimovs Date: Wed, 7 Feb 2024 14:47:44 +0100 Subject: [PATCH 1/3] Add RtcPeerConnectionIceErrorEvent WebIDL --- crates/web-sys/Cargo.toml | 1 + .../gen_RtcPeerConnectionIceErrorEvent.rs | 50 +++++++++++++++++++ crates/web-sys/src/features/mod.rs | 7 +++ .../RTCPeerConnectionIceErrorEvent.webidl | 18 +++++++ 4 files changed, 76 insertions(+) create mode 100644 crates/web-sys/src/features/gen_RtcPeerConnectionIceErrorEvent.rs create mode 100644 crates/web-sys/webidls/enabled/RTCPeerConnectionIceErrorEvent.webidl diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index 11f287f5c24..66ce7b01134 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -1102,6 +1102,7 @@ RtcOfferAnswerOptions = [] RtcOfferOptions = [] RtcOutboundRtpStreamStats = [] RtcPeerConnection = ["EventTarget"] +RtcPeerConnectionIceErrorEvent = ["Event"] RtcPeerConnectionIceEvent = ["Event"] RtcPeerConnectionIceEventInit = [] RtcPeerConnectionState = [] diff --git a/crates/web-sys/src/features/gen_RtcPeerConnectionIceErrorEvent.rs b/crates/web-sys/src/features/gen_RtcPeerConnectionIceErrorEvent.rs new file mode 100644 index 00000000000..fd0fc4a29ac --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcPeerConnectionIceErrorEvent.rs @@ -0,0 +1,50 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = RTCPeerConnectionIceErrorEvent , typescript_type = "RTCPeerConnectionIceErrorEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcPeerConnectionIceErrorEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub type RtcPeerConnectionIceErrorEvent; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = address)] + #[doc = "Getter for the `address` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/address)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn address(this: &RtcPeerConnectionIceErrorEvent) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = port)] + #[doc = "Getter for the `port` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/port)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn port(this: &RtcPeerConnectionIceErrorEvent) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = url)] + #[doc = "Getter for the `url` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/url)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn url(this: &RtcPeerConnectionIceErrorEvent) -> String; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = errorCode)] + #[doc = "Getter for the `errorCode` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorCode)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn error_code(this: &RtcPeerConnectionIceErrorEvent) -> u16; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = errorText)] + #[doc = "Getter for the `errorText` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn error_text(this: &RtcPeerConnectionIceErrorEvent) -> String; +} diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index c3bb7d92089..9e5d51569e5 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -7495,6 +7495,13 @@ mod gen_RtcPeerConnection; #[allow(unused_imports)] pub use gen_RtcPeerConnection::*; +#[cfg(feature = "RtcPeerConnectionIceErrorEvent")] +#[allow(non_snake_case)] +mod gen_RtcPeerConnectionIceErrorEvent; +#[cfg(feature = "RtcPeerConnectionIceErrorEvent")] +#[allow(unused_imports)] +pub use gen_RtcPeerConnectionIceErrorEvent::*; + #[cfg(feature = "RtcPeerConnectionIceEvent")] #[allow(non_snake_case)] mod gen_RtcPeerConnectionIceEvent; diff --git a/crates/web-sys/webidls/enabled/RTCPeerConnectionIceErrorEvent.webidl b/crates/web-sys/webidls/enabled/RTCPeerConnectionIceErrorEvent.webidl new file mode 100644 index 00000000000..91e148ca8e5 --- /dev/null +++ b/crates/web-sys/webidls/enabled/RTCPeerConnectionIceErrorEvent.webidl @@ -0,0 +1,18 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is + * https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerrorevent + */ + +[Exposed=Window] +interface RTCPeerConnectionIceErrorEvent : Event { + constructor(DOMString type, RTCPeerConnectionIceErrorEventInit eventInitDict); + readonly attribute DOMString? address; + readonly attribute unsigned short? port; + readonly attribute DOMString url; + readonly attribute unsigned short errorCode; + readonly attribute USVString errorText; +}; From 9ac05687ce8bf2902443fdfa24813ff5f6c2e81a Mon Sep 17 00:00:00 2001 From: evdokimovs Date: Thu, 8 Feb 2024 11:58:09 +0100 Subject: [PATCH 2/3] Upd changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8282284769f..7ebe9e5ef52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ Released 2024-02-06 * Add bindings for `USBDevice.forget()`. [#3821](https://github.com/rustwasm/wasm-bindgen/pull/3821) +* Add bindings for `RTCPeerConnectionIceErrorEvent`. + [#3835](https://github.com/rustwasm/wasm-bindgen/pull/3835) + ### Changed * Stabilize `ClipboardEvent`. From 1d96133b5cfa1692ccddb874393ac2a3468251cb Mon Sep 17 00:00:00 2001 From: daxpedda Date: Thu, 8 Feb 2024 14:14:55 +0100 Subject: [PATCH 3/3] Fix changelog --- CHANGELOG.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ebe9e5ef52..1650b86efb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # `wasm-bindgen` Change Log -------------------------------------------------------------------------------- +## Unreleased + +### Added + +* Add bindings for `RTCPeerConnectionIceErrorEvent`. + [#3835](https://github.com/rustwasm/wasm-bindgen/pull/3835) + +-------------------------------------------------------------------------------- + ## [0.2.91](https://github.com/rustwasm/wasm-bindgen/compare/0.2.90...0.2.91) Released 2024-02-06 @@ -25,9 +34,6 @@ Released 2024-02-06 * Add bindings for `USBDevice.forget()`. [#3821](https://github.com/rustwasm/wasm-bindgen/pull/3821) -* Add bindings for `RTCPeerConnectionIceErrorEvent`. - [#3835](https://github.com/rustwasm/wasm-bindgen/pull/3835) - ### Changed * Stabilize `ClipboardEvent`. @@ -59,6 +65,8 @@ Released 2024-02-06 * Fixed nighly build of `wasm-bindgen-futures`. [#3827](https://github.com/rustwasm/wasm-bindgen/pull/3827) +-------------------------------------------------------------------------------- + ## [0.2.90](https://github.com/rustwasm/wasm-bindgen/compare/0.2.89...0.2.90) Released 2024-01-06 @@ -101,6 +109,8 @@ Released 2024-01-06 `RtcLifecycleEvent` and `WebrtcGlobalStatisticsReport` features. [#3723](https://github.com/rustwasm/wasm-bindgen/pull/3723) +-------------------------------------------------------------------------------- + ## [0.2.89](https://github.com/rustwasm/wasm-bindgen/compare/0.2.88...0.2.89) Released 2023-11-27. @@ -129,6 +139,8 @@ Released 2023-11-27. * Removed Gecko-internal dictionary bindings `Csp`, `CspPolicies`, `CspReport` and `CspReportProperties`. [#3721](https://github.com/rustwasm/wasm-bindgen/pull/3721) +-------------------------------------------------------------------------------- + ## [0.2.88](https://github.com/rustwasm/wasm-bindgen/compare/0.2.87...0.2.88) Released 2023-11-01 @@ -293,6 +305,8 @@ Released 2023-11-01 * Removed `GetNotificationOptions`, `NotificationBehavior` and `Notification.get()` because they don't exist anymore. +-------------------------------------------------------------------------------- + ## [0.2.87](https://github.com/rustwasm/wasm-bindgen/compare/0.2.86...0.2.87) Released 2023-06-12.