Skip to main content

web_sys/features/
gen_WriteParams.rs

1#![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 = "Change the `data` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
26    #[wasm_bindgen(method, setter = "data")]
27    pub fn set_data_opt_buffer_source(this: &WriteParams, val: Option<&::js_sys::Object>);
28    #[doc = "Change the `data` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
31    #[wasm_bindgen(method, setter = "data")]
32    pub fn set_data_opt_u8_slice(this: &WriteParams, val: Option<&mut [u8]>);
33    #[doc = "Change the `data` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
36    #[wasm_bindgen(method, setter = "data")]
37    pub fn set_data_opt_u8_array(this: &WriteParams, val: Option<&::js_sys::Uint8Array>);
38    #[cfg(feature = "Blob")]
39    #[doc = "Change the `data` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
42    #[wasm_bindgen(method, setter = "data")]
43    pub fn set_data_opt_blob(this: &WriteParams, val: Option<&Blob>);
44    #[doc = "Change the `data` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
47    #[wasm_bindgen(method, setter = "data")]
48    pub fn set_data_opt_str(this: &WriteParams, val: Option<&str>);
49    #[doc = "Get the `position` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
52    #[wasm_bindgen(method, getter = "position")]
53    pub fn get_position(this: &WriteParams) -> Option<f64>;
54    #[doc = "Change the `position` field of this object."]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
57    #[wasm_bindgen(method, setter = "position")]
58    pub fn set_position(this: &WriteParams, val: Option<f64>);
59    #[doc = "Change the `position` field of this object."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
62    #[wasm_bindgen(method, setter = "position")]
63    pub fn set_position_opt_u32(this: &WriteParams, val: Option<u32>);
64    #[doc = "Change the `position` field of this object."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
67    #[wasm_bindgen(method, setter = "position")]
68    pub fn set_position_opt_f64(this: &WriteParams, val: Option<f64>);
69    #[doc = "Get the `size` field of this object."]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
72    #[wasm_bindgen(method, getter = "size")]
73    pub fn get_size(this: &WriteParams) -> Option<f64>;
74    #[doc = "Change the `size` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
77    #[wasm_bindgen(method, setter = "size")]
78    pub fn set_size(this: &WriteParams, val: Option<f64>);
79    #[doc = "Change the `size` field of this object."]
80    #[doc = ""]
81    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
82    #[wasm_bindgen(method, setter = "size")]
83    pub fn set_size_opt_u32(this: &WriteParams, val: Option<u32>);
84    #[doc = "Change the `size` field of this object."]
85    #[doc = ""]
86    #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"]
87    #[wasm_bindgen(method, setter = "size")]
88    pub fn set_size_opt_f64(this: &WriteParams, val: Option<f64>);
89    #[cfg(feature = "WriteCommandType")]
90    #[doc = "Get the `type` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"]
93    #[wasm_bindgen(method, getter = "type")]
94    pub fn get_type(this: &WriteParams) -> WriteCommandType;
95    #[cfg(feature = "WriteCommandType")]
96    #[doc = "Change the `type` field of this object."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"]
99    #[wasm_bindgen(method, setter = "type")]
100    pub fn set_type(this: &WriteParams, val: WriteCommandType);
101}
102impl WriteParams {
103    #[cfg(feature = "WriteCommandType")]
104    #[doc = "Construct a new `WriteParams`."]
105    #[doc = ""]
106    #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"]
107    pub fn new(type_: WriteCommandType) -> Self {
108        #[allow(unused_mut)]
109        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
110        ret.set_type(type_);
111        ret
112    }
113    #[deprecated = "Use `set_data()` instead."]
114    pub fn data(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self {
115        self.set_data(val.unwrap_or(&::wasm_bindgen::JsValue::NULL));
116        self
117    }
118    #[deprecated = "Use `set_position()` instead."]
119    pub fn position(&mut self, val: Option<f64>) -> &mut Self {
120        self.set_position(val);
121        self
122    }
123    #[deprecated = "Use `set_size()` instead."]
124    pub fn size(&mut self, val: Option<f64>) -> &mut Self {
125        self.set_size(val);
126        self
127    }
128    #[cfg(feature = "WriteCommandType")]
129    #[deprecated = "Use `set_type()` instead."]
130    pub fn type_(&mut self, val: WriteCommandType) -> &mut Self {
131        self.set_type(val);
132        self
133    }
134}