1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = RTCDataChannel , typescript_type = "RTCDataChannel" ) ]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `RtcDataChannel` class."]
9     #[doc = ""]
10     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel)"]
11     #[doc = ""]
12     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
13     pub type RtcDataChannel;
14     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = label ) ]
15     #[doc = "Getter for the `label` field of this object."]
16     #[doc = ""]
17     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/label)"]
18     #[doc = ""]
19     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
label(this: &RtcDataChannel) -> String20     pub fn label(this: &RtcDataChannel) -> String;
21     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = reliable ) ]
22     #[doc = "Getter for the `reliable` field of this object."]
23     #[doc = ""]
24     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable)"]
25     #[doc = ""]
26     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
reliable(this: &RtcDataChannel) -> bool27     pub fn reliable(this: &RtcDataChannel) -> bool;
28     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = maxPacketLifeTime ) ]
29     #[doc = "Getter for the `maxPacketLifeTime` field of this object."]
30     #[doc = ""]
31     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxPacketLifeTime)"]
32     #[doc = ""]
33     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
max_packet_life_time(this: &RtcDataChannel) -> Option<u16>34     pub fn max_packet_life_time(this: &RtcDataChannel) -> Option<u16>;
35     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = maxRetransmits ) ]
36     #[doc = "Getter for the `maxRetransmits` field of this object."]
37     #[doc = ""]
38     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxRetransmits)"]
39     #[doc = ""]
40     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
max_retransmits(this: &RtcDataChannel) -> Option<u16>41     pub fn max_retransmits(this: &RtcDataChannel) -> Option<u16>;
42     #[cfg(feature = "RtcDataChannelState")]
43     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = readyState ) ]
44     #[doc = "Getter for the `readyState` field of this object."]
45     #[doc = ""]
46     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState)"]
47     #[doc = ""]
48     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelState`*"]
ready_state(this: &RtcDataChannel) -> RtcDataChannelState49     pub fn ready_state(this: &RtcDataChannel) -> RtcDataChannelState;
50     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmount ) ]
51     #[doc = "Getter for the `bufferedAmount` field of this object."]
52     #[doc = ""]
53     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmount)"]
54     #[doc = ""]
55     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
buffered_amount(this: &RtcDataChannel) -> u3256     pub fn buffered_amount(this: &RtcDataChannel) -> u32;
57     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold ) ]
58     #[doc = "Getter for the `bufferedAmountLowThreshold` field of this object."]
59     #[doc = ""]
60     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"]
61     #[doc = ""]
62     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
buffered_amount_low_threshold(this: &RtcDataChannel) -> u3263     pub fn buffered_amount_low_threshold(this: &RtcDataChannel) -> u32;
64     # [ wasm_bindgen ( structural , method , setter , js_class = "RTCDataChannel" , js_name = bufferedAmountLowThreshold ) ]
65     #[doc = "Setter for the `bufferedAmountLowThreshold` field of this object."]
66     #[doc = ""]
67     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"]
68     #[doc = ""]
69     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
set_buffered_amount_low_threshold(this: &RtcDataChannel, value: u32)70     pub fn set_buffered_amount_low_threshold(this: &RtcDataChannel, value: u32);
71     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = onopen ) ]
72     #[doc = "Getter for the `onopen` field of this object."]
73     #[doc = ""]
74     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"]
75     #[doc = ""]
76     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
onopen(this: &RtcDataChannel) -> Option<::js_sys::Function>77     pub fn onopen(this: &RtcDataChannel) -> Option<::js_sys::Function>;
78     # [ wasm_bindgen ( structural , method , setter , js_class = "RTCDataChannel" , js_name = onopen ) ]
79     #[doc = "Setter for the `onopen` field of this object."]
80     #[doc = ""]
81     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"]
82     #[doc = ""]
83     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
set_onopen(this: &RtcDataChannel, value: Option<&::js_sys::Function>)84     pub fn set_onopen(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
85     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = onerror ) ]
86     #[doc = "Getter for the `onerror` field of this object."]
87     #[doc = ""]
88     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"]
89     #[doc = ""]
90     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
onerror(this: &RtcDataChannel) -> Option<::js_sys::Function>91     pub fn onerror(this: &RtcDataChannel) -> Option<::js_sys::Function>;
92     # [ wasm_bindgen ( structural , method , setter , js_class = "RTCDataChannel" , js_name = onerror ) ]
93     #[doc = "Setter for the `onerror` field of this object."]
94     #[doc = ""]
95     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"]
96     #[doc = ""]
97     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
set_onerror(this: &RtcDataChannel, value: Option<&::js_sys::Function>)98     pub fn set_onerror(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
99     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = onclose ) ]
100     #[doc = "Getter for the `onclose` field of this object."]
101     #[doc = ""]
102     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"]
103     #[doc = ""]
104     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
onclose(this: &RtcDataChannel) -> Option<::js_sys::Function>105     pub fn onclose(this: &RtcDataChannel) -> Option<::js_sys::Function>;
106     # [ wasm_bindgen ( structural , method , setter , js_class = "RTCDataChannel" , js_name = onclose ) ]
107     #[doc = "Setter for the `onclose` field of this object."]
108     #[doc = ""]
109     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"]
110     #[doc = ""]
111     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
set_onclose(this: &RtcDataChannel, value: Option<&::js_sys::Function>)112     pub fn set_onclose(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
113     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = onmessage ) ]
114     #[doc = "Getter for the `onmessage` field of this object."]
115     #[doc = ""]
116     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"]
117     #[doc = ""]
118     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
onmessage(this: &RtcDataChannel) -> Option<::js_sys::Function>119     pub fn onmessage(this: &RtcDataChannel) -> Option<::js_sys::Function>;
120     # [ wasm_bindgen ( structural , method , setter , js_class = "RTCDataChannel" , js_name = onmessage ) ]
121     #[doc = "Setter for the `onmessage` field of this object."]
122     #[doc = ""]
123     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"]
124     #[doc = ""]
125     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
set_onmessage(this: &RtcDataChannel, value: Option<&::js_sys::Function>)126     pub fn set_onmessage(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
127     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow ) ]
128     #[doc = "Getter for the `onbufferedamountlow` field of this object."]
129     #[doc = ""]
130     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"]
131     #[doc = ""]
132     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
onbufferedamountlow(this: &RtcDataChannel) -> Option<::js_sys::Function>133     pub fn onbufferedamountlow(this: &RtcDataChannel) -> Option<::js_sys::Function>;
134     # [ wasm_bindgen ( structural , method , setter , js_class = "RTCDataChannel" , js_name = onbufferedamountlow ) ]
135     #[doc = "Setter for the `onbufferedamountlow` field of this object."]
136     #[doc = ""]
137     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"]
138     #[doc = ""]
139     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
set_onbufferedamountlow(this: &RtcDataChannel, value: Option<&::js_sys::Function>)140     pub fn set_onbufferedamountlow(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
141     #[cfg(feature = "RtcDataChannelType")]
142     # [ wasm_bindgen ( structural , method , getter , js_class = "RTCDataChannel" , js_name = binaryType ) ]
143     #[doc = "Getter for the `binaryType` field of this object."]
144     #[doc = ""]
145     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"]
146     #[doc = ""]
147     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"]
binary_type(this: &RtcDataChannel) -> RtcDataChannelType148     pub fn binary_type(this: &RtcDataChannel) -> RtcDataChannelType;
149     #[cfg(feature = "RtcDataChannelType")]
150     # [ wasm_bindgen ( structural , method , setter , js_class = "RTCDataChannel" , js_name = binaryType ) ]
151     #[doc = "Setter for the `binaryType` field of this object."]
152     #[doc = ""]
153     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"]
154     #[doc = ""]
155     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"]
set_binary_type(this: &RtcDataChannel, value: RtcDataChannelType)156     pub fn set_binary_type(this: &RtcDataChannel, value: RtcDataChannelType);
157     # [ wasm_bindgen ( method , structural , js_class = "RTCDataChannel" , js_name = close ) ]
158     #[doc = "The `close()` method."]
159     #[doc = ""]
160     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/close)"]
161     #[doc = ""]
162     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
close(this: &RtcDataChannel)163     pub fn close(this: &RtcDataChannel);
164     # [ wasm_bindgen ( catch , method , structural , js_class = "RTCDataChannel" , js_name = send ) ]
165     #[doc = "The `send()` method."]
166     #[doc = ""]
167     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
168     #[doc = ""]
169     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
send_with_str(this: &RtcDataChannel, data: &str) -> Result<(), JsValue>170     pub fn send_with_str(this: &RtcDataChannel, data: &str) -> Result<(), JsValue>;
171     #[cfg(feature = "Blob")]
172     # [ wasm_bindgen ( catch , method , structural , js_class = "RTCDataChannel" , js_name = send ) ]
173     #[doc = "The `send()` method."]
174     #[doc = ""]
175     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
176     #[doc = ""]
177     #[doc = "*This API requires the following crate features to be activated: `Blob`, `RtcDataChannel`*"]
send_with_blob(this: &RtcDataChannel, data: &Blob) -> Result<(), JsValue>178     pub fn send_with_blob(this: &RtcDataChannel, data: &Blob) -> Result<(), JsValue>;
179     # [ wasm_bindgen ( catch , method , structural , js_class = "RTCDataChannel" , js_name = send ) ]
180     #[doc = "The `send()` method."]
181     #[doc = ""]
182     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
183     #[doc = ""]
184     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
send_with_array_buffer( this: &RtcDataChannel, data: &::js_sys::ArrayBuffer, ) -> Result<(), JsValue>185     pub fn send_with_array_buffer(
186         this: &RtcDataChannel,
187         data: &::js_sys::ArrayBuffer,
188     ) -> Result<(), JsValue>;
189     # [ wasm_bindgen ( catch , method , structural , js_class = "RTCDataChannel" , js_name = send ) ]
190     #[doc = "The `send()` method."]
191     #[doc = ""]
192     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
193     #[doc = ""]
194     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
send_with_array_buffer_view( this: &RtcDataChannel, data: &::js_sys::Object, ) -> Result<(), JsValue>195     pub fn send_with_array_buffer_view(
196         this: &RtcDataChannel,
197         data: &::js_sys::Object,
198     ) -> Result<(), JsValue>;
199     # [ wasm_bindgen ( catch , method , structural , js_class = "RTCDataChannel" , js_name = send ) ]
200     #[doc = "The `send()` method."]
201     #[doc = ""]
202     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
203     #[doc = ""]
204     #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>205     pub fn send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>;
206 }
207