web_sys/features/
gen_MessageEventInit.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 = MessageEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `MessageEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
12 pub type MessageEventInit;
13 #[doc = "Get the `bubbles` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
16 #[wasm_bindgen(method, getter = "bubbles")]
17 pub fn get_bubbles(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
21 #[wasm_bindgen(method, setter = "bubbles")]
22 pub fn set_bubbles(this: &MessageEventInit, 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: `MessageEventInit`*"]
26 #[wasm_bindgen(method, getter = "cancelable")]
27 pub fn get_cancelable(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
31 #[wasm_bindgen(method, setter = "cancelable")]
32 pub fn set_cancelable(this: &MessageEventInit, 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: `MessageEventInit`*"]
36 #[wasm_bindgen(method, getter = "composed")]
37 pub fn get_composed(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
41 #[wasm_bindgen(method, setter = "composed")]
42 pub fn set_composed(this: &MessageEventInit, 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: `MessageEventInit`*"]
46 #[wasm_bindgen(method, getter = "data")]
47 pub fn get_data(this: &MessageEventInit) -> ::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: `MessageEventInit`*"]
51 #[wasm_bindgen(method, setter = "data")]
52 pub fn set_data(this: &MessageEventInit, 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: `MessageEventInit`*"]
56 #[wasm_bindgen(method, getter = "lastEventId")]
57 pub fn get_last_event_id(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
61 #[wasm_bindgen(method, setter = "lastEventId")]
62 pub fn set_last_event_id(this: &MessageEventInit, 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: `MessageEventInit`*"]
66 #[wasm_bindgen(method, getter = "origin")]
67 pub fn get_origin(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
71 #[wasm_bindgen(method, setter = "origin")]
72 pub fn set_origin(this: &MessageEventInit, 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: `MessageEventInit`*"]
76 #[wasm_bindgen(method, getter = "ports")]
77 pub fn get_ports(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
81 #[wasm_bindgen(method, setter = "ports")]
82 pub fn set_ports(this: &MessageEventInit, 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: `MessageEventInit`*"]
86 #[wasm_bindgen(method, getter = "source")]
87 pub fn get_source(this: &MessageEventInit) -> 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: `MessageEventInit`*"]
91 #[wasm_bindgen(method, setter = "source")]
92 pub fn set_source(this: &MessageEventInit, val: Option<&::js_sys::Object>);
93 #[cfg(feature = "Window")]
94 #[doc = "Change the `source` field of this object."]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
97 #[wasm_bindgen(method, setter = "source")]
98 pub fn set_source_opt_window(this: &MessageEventInit, val: Option<&Window>);
99 #[cfg(feature = "MessagePort")]
100 #[doc = "Change the `source` field of this object."]
101 #[doc = ""]
102 #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
103 #[wasm_bindgen(method, setter = "source")]
104 pub fn set_source_opt_message_port(this: &MessageEventInit, val: Option<&MessagePort>);
105 #[cfg(feature = "ServiceWorker")]
106 #[doc = "Change the `source` field of this object."]
107 #[doc = ""]
108 #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
109 #[wasm_bindgen(method, setter = "source")]
110 pub fn set_source_opt_service_worker(this: &MessageEventInit, val: Option<&ServiceWorker>);
111}
112impl MessageEventInit {
113 #[doc = "Construct a new `MessageEventInit`."]
114 #[doc = ""]
115 #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"]
116 pub fn new() -> Self {
117 #[allow(unused_mut)]
118 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
119 ret
120 }
121 #[deprecated = "Use `set_bubbles()` instead."]
122 pub fn bubbles(&mut self, val: bool) -> &mut Self {
123 self.set_bubbles(val);
124 self
125 }
126 #[deprecated = "Use `set_cancelable()` instead."]
127 pub fn cancelable(&mut self, val: bool) -> &mut Self {
128 self.set_cancelable(val);
129 self
130 }
131 #[deprecated = "Use `set_composed()` instead."]
132 pub fn composed(&mut self, val: bool) -> &mut Self {
133 self.set_composed(val);
134 self
135 }
136 #[deprecated = "Use `set_data()` instead."]
137 pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
138 self.set_data(val);
139 self
140 }
141 #[deprecated = "Use `set_last_event_id()` instead."]
142 pub fn last_event_id(&mut self, val: &str) -> &mut Self {
143 self.set_last_event_id(val);
144 self
145 }
146 #[deprecated = "Use `set_origin()` instead."]
147 pub fn origin(&mut self, val: &str) -> &mut Self {
148 self.set_origin(val);
149 self
150 }
151 #[deprecated = "Use `set_ports()` instead."]
152 pub fn ports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
153 self.set_ports(val);
154 self
155 }
156 #[deprecated = "Use `set_source()` instead."]
157 pub fn source(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
158 self.set_source(val);
159 self
160 }
161}
162impl Default for MessageEventInit {
163 fn default() -> Self {
164 Self::new()
165 }
166}