Skip to main content

web_sys/features/
gen_RtcDataChannelEvent.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "Event",
9        extends = "::js_sys::Object",
10        js_name = "RTCDataChannelEvent",
11        typescript_type = "RTCDataChannelEvent"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `RtcDataChannelEvent` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannelEvent)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEvent`*"]
19    pub type RtcDataChannelEvent;
20    #[cfg(feature = "RtcDataChannel")]
21    #[wasm_bindgen(method, getter, js_class = "RTCDataChannelEvent", js_name = "channel")]
22    #[doc = "Getter for the `channel` field of this object."]
23    #[doc = ""]
24    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannelEvent/channel)"]
25    #[doc = ""]
26    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelEvent`*"]
27    pub fn channel(this: &RtcDataChannelEvent) -> RtcDataChannel;
28    #[cfg(feature = "RtcDataChannelEventInit")]
29    #[wasm_bindgen(catch, constructor, js_class = "RTCDataChannelEvent")]
30    #[doc = "The `new RtcDataChannelEvent(..)` constructor, creating a new instance of `RtcDataChannelEvent`."]
31    #[doc = ""]
32    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannelEvent/RTCDataChannelEvent)"]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEvent`, `RtcDataChannelEventInit`*"]
35    pub fn new(
36        type_: &str,
37        event_init_dict: &RtcDataChannelEventInit,
38    ) -> Result<RtcDataChannelEvent, JsValue>;
39}