web_sys/features/
gen_ExtendableMessageEventInit.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ExtendableMessageEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `ExtendableMessageEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
12 pub type ExtendableMessageEventInit;
13 #[doc = "Get the `bubbles` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
16 #[wasm_bindgen(method, getter = "bubbles")]
17 pub fn get_bubbles(this: &ExtendableMessageEventInit) -> Option<bool>;
18 #[doc = "Change the `bubbles` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
21 #[wasm_bindgen(method, setter = "bubbles")]
22 pub fn set_bubbles(this: &ExtendableMessageEventInit, val: bool);
23 #[doc = "Get the `cancelable` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
26 #[wasm_bindgen(method, getter = "cancelable")]
27 pub fn get_cancelable(this: &ExtendableMessageEventInit) -> Option<bool>;
28 #[doc = "Change the `cancelable` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
31 #[wasm_bindgen(method, setter = "cancelable")]
32 pub fn set_cancelable(this: &ExtendableMessageEventInit, val: bool);
33 #[doc = "Get the `composed` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
36 #[wasm_bindgen(method, getter = "composed")]
37 pub fn get_composed(this: &ExtendableMessageEventInit) -> Option<bool>;
38 #[doc = "Change the `composed` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
41 #[wasm_bindgen(method, setter = "composed")]
42 pub fn set_composed(this: &ExtendableMessageEventInit, val: bool);
43 #[doc = "Get the `data` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
46 #[wasm_bindgen(method, getter = "data")]
47 pub fn get_data(this: &ExtendableMessageEventInit) -> ::wasm_bindgen::JsValue;
48 #[doc = "Change the `data` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
51 #[wasm_bindgen(method, setter = "data")]
52 pub fn set_data(this: &ExtendableMessageEventInit, val: &::wasm_bindgen::JsValue);
53 #[doc = "Get the `lastEventId` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
56 #[wasm_bindgen(method, getter = "lastEventId")]
57 pub fn get_last_event_id(this: &ExtendableMessageEventInit) -> Option<::alloc::string::String>;
58 #[doc = "Change the `lastEventId` field of this object."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
61 #[wasm_bindgen(method, setter = "lastEventId")]
62 pub fn set_last_event_id(this: &ExtendableMessageEventInit, val: &str);
63 #[doc = "Get the `origin` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
66 #[wasm_bindgen(method, getter = "origin")]
67 pub fn get_origin(this: &ExtendableMessageEventInit) -> Option<::alloc::string::String>;
68 #[doc = "Change the `origin` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
71 #[wasm_bindgen(method, setter = "origin")]
72 pub fn set_origin(this: &ExtendableMessageEventInit, val: &str);
73 #[doc = "Get the `ports` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
76 #[wasm_bindgen(method, getter = "ports")]
77 pub fn get_ports(this: &ExtendableMessageEventInit) -> Option<::js_sys::Array>;
78 #[doc = "Change the `ports` field of this object."]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
81 #[wasm_bindgen(method, setter = "ports")]
82 pub fn set_ports(this: &ExtendableMessageEventInit, val: &::wasm_bindgen::JsValue);
83 #[doc = "Get the `source` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
86 #[wasm_bindgen(method, getter = "source")]
87 pub fn get_source(this: &ExtendableMessageEventInit) -> Option<::js_sys::Object>;
88 #[doc = "Change the `source` field of this object."]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
91 #[wasm_bindgen(method, setter = "source")]
92 pub fn set_source(this: &ExtendableMessageEventInit, val: Option<&::js_sys::Object>);
93 #[cfg(feature = "Client")]
94 #[doc = "Change the `source` field of this object."]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
97 #[wasm_bindgen(method, setter = "source")]
98 pub fn set_source_opt_client(this: &ExtendableMessageEventInit, val: Option<&Client>);
99 #[cfg(feature = "ServiceWorker")]
100 #[doc = "Change the `source` field of this object."]
101 #[doc = ""]
102 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
103 #[wasm_bindgen(method, setter = "source")]
104 pub fn set_source_opt_service_worker(
105 this: &ExtendableMessageEventInit,
106 val: Option<&ServiceWorker>,
107 );
108 #[cfg(feature = "MessagePort")]
109 #[doc = "Change the `source` field of this object."]
110 #[doc = ""]
111 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
112 #[wasm_bindgen(method, setter = "source")]
113 pub fn set_source_opt_message_port(
114 this: &ExtendableMessageEventInit,
115 val: Option<&MessagePort>,
116 );
117}
118impl ExtendableMessageEventInit {
119 #[doc = "Construct a new `ExtendableMessageEventInit`."]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"]
122 pub fn new() -> Self {
123 #[allow(unused_mut)]
124 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
125 ret
126 }
127 #[deprecated = "Use `set_bubbles()` instead."]
128 pub fn bubbles(&mut self, val: bool) -> &mut Self {
129 self.set_bubbles(val);
130 self
131 }
132 #[deprecated = "Use `set_cancelable()` instead."]
133 pub fn cancelable(&mut self, val: bool) -> &mut Self {
134 self.set_cancelable(val);
135 self
136 }
137 #[deprecated = "Use `set_composed()` instead."]
138 pub fn composed(&mut self, val: bool) -> &mut Self {
139 self.set_composed(val);
140 self
141 }
142 #[deprecated = "Use `set_data()` instead."]
143 pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
144 self.set_data(val);
145 self
146 }
147 #[deprecated = "Use `set_last_event_id()` instead."]
148 pub fn last_event_id(&mut self, val: &str) -> &mut Self {
149 self.set_last_event_id(val);
150 self
151 }
152 #[deprecated = "Use `set_origin()` instead."]
153 pub fn origin(&mut self, val: &str) -> &mut Self {
154 self.set_origin(val);
155 self
156 }
157 #[deprecated = "Use `set_ports()` instead."]
158 pub fn ports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
159 self.set_ports(val);
160 self
161 }
162 #[deprecated = "Use `set_source()` instead."]
163 pub fn source(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
164 self.set_source(val);
165 self
166 }
167}
168impl Default for ExtendableMessageEventInit {
169 fn default() -> Self {
170 Self::new()
171 }
172}