web_sys/features/
gen_WriteParams.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 = WriteParams)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `WriteParams` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
12 pub type WriteParams;
13 #[doc = "Get the `data` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
16 #[wasm_bindgen(method, getter = "data")]
17 pub fn get_data(this: &WriteParams) -> ::wasm_bindgen::JsValue;
18 #[doc = "Change the `data` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
21 #[wasm_bindgen(method, setter = "data")]
22 pub fn set_data(this: &WriteParams, val: &::wasm_bindgen::JsValue);
23 #[doc = "Get the `position` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
26 #[wasm_bindgen(method, getter = "position")]
27 pub fn get_position(this: &WriteParams) -> Option<f64>;
28 #[doc = "Change the `position` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
31 #[wasm_bindgen(method, setter = "position")]
32 pub fn set_position(this: &WriteParams, val: Option<f64>);
33 #[doc = "Get the `size` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
36 #[wasm_bindgen(method, getter = "size")]
37 pub fn get_size(this: &WriteParams) -> Option<f64>;
38 #[doc = "Change the `size` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
41 #[wasm_bindgen(method, setter = "size")]
42 pub fn set_size(this: &WriteParams, val: Option<f64>);
43 #[cfg(feature = "WriteCommandType")]
44 #[doc = "Get the `type` field of this object."]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"]
47 #[wasm_bindgen(method, getter = "type")]
48 pub fn get_type(this: &WriteParams) -> WriteCommandType;
49 #[cfg(feature = "WriteCommandType")]
50 #[doc = "Change the `type` field of this object."]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"]
53 #[wasm_bindgen(method, setter = "type")]
54 pub fn set_type(this: &WriteParams, val: WriteCommandType);
55}
56impl WriteParams {
57 #[cfg(feature = "WriteCommandType")]
58 #[doc = "Construct a new `WriteParams`."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"]
61 pub fn new(type_: WriteCommandType) -> Self {
62 #[allow(unused_mut)]
63 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
64 ret.set_type(type_);
65 ret
66 }
67 #[deprecated = "Use `set_data()` instead."]
68 pub fn data(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self {
69 self.set_data(val.unwrap_or(&::wasm_bindgen::JsValue::NULL));
70 self
71 }
72 #[deprecated = "Use `set_position()` instead."]
73 pub fn position(&mut self, val: Option<f64>) -> &mut Self {
74 self.set_position(val);
75 self
76 }
77 #[deprecated = "Use `set_size()` instead."]
78 pub fn size(&mut self, val: Option<f64>) -> &mut Self {
79 self.set_size(val);
80 self
81 }
82 #[cfg(feature = "WriteCommandType")]
83 #[deprecated = "Use `set_type()` instead."]
84 pub fn type_(&mut self, val: WriteCommandType) -> &mut Self {
85 self.set_type(val);
86 self
87 }
88}