maxcountryman_web_sys/features/
gen_OptionalEffectTiming.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = OptionalEffectTiming)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `OptionalEffectTiming` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
11 pub type OptionalEffectTiming;
12}
13impl OptionalEffectTiming {
14 #[doc = "Construct a new `OptionalEffectTiming`."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
17 pub fn new() -> Self {
18 #[allow(unused_mut)]
19 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20 ret
21 }
22 #[doc = "Change the `delay` field of this object."]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
25 pub fn delay(&mut self, val: f64) -> &mut Self {
26 use wasm_bindgen::JsValue;
27 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val));
28 debug_assert!(
29 r.is_ok(),
30 "setting properties should never fail on our dictionary objects"
31 );
32 let _ = r;
33 self
34 }
35 #[cfg(feature = "PlaybackDirection")]
36 #[doc = "Change the `direction` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`, `PlaybackDirection`*"]
39 pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self {
40 use wasm_bindgen::JsValue;
41 let r = ::js_sys::Reflect::set(
42 self.as_ref(),
43 &JsValue::from("direction"),
44 &JsValue::from(val),
45 );
46 debug_assert!(
47 r.is_ok(),
48 "setting properties should never fail on our dictionary objects"
49 );
50 let _ = r;
51 self
52 }
53 #[doc = "Change the `duration` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
56 pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
57 use wasm_bindgen::JsValue;
58 let r = ::js_sys::Reflect::set(
59 self.as_ref(),
60 &JsValue::from("duration"),
61 &JsValue::from(val),
62 );
63 debug_assert!(
64 r.is_ok(),
65 "setting properties should never fail on our dictionary objects"
66 );
67 let _ = r;
68 self
69 }
70 #[doc = "Change the `easing` field of this object."]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
73 pub fn easing(&mut self, val: &str) -> &mut Self {
74 use wasm_bindgen::JsValue;
75 let r =
76 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val));
77 debug_assert!(
78 r.is_ok(),
79 "setting properties should never fail on our dictionary objects"
80 );
81 let _ = r;
82 self
83 }
84 #[doc = "Change the `endDelay` field of this object."]
85 #[doc = ""]
86 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
87 pub fn end_delay(&mut self, val: f64) -> &mut Self {
88 use wasm_bindgen::JsValue;
89 let r = ::js_sys::Reflect::set(
90 self.as_ref(),
91 &JsValue::from("endDelay"),
92 &JsValue::from(val),
93 );
94 debug_assert!(
95 r.is_ok(),
96 "setting properties should never fail on our dictionary objects"
97 );
98 let _ = r;
99 self
100 }
101 #[cfg(feature = "FillMode")]
102 #[doc = "Change the `fill` field of this object."]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `FillMode`, `OptionalEffectTiming`*"]
105 pub fn fill(&mut self, val: FillMode) -> &mut Self {
106 use wasm_bindgen::JsValue;
107 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val));
108 debug_assert!(
109 r.is_ok(),
110 "setting properties should never fail on our dictionary objects"
111 );
112 let _ = r;
113 self
114 }
115 #[doc = "Change the `iterationStart` field of this object."]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
118 pub fn iteration_start(&mut self, val: f64) -> &mut Self {
119 use wasm_bindgen::JsValue;
120 let r = ::js_sys::Reflect::set(
121 self.as_ref(),
122 &JsValue::from("iterationStart"),
123 &JsValue::from(val),
124 );
125 debug_assert!(
126 r.is_ok(),
127 "setting properties should never fail on our dictionary objects"
128 );
129 let _ = r;
130 self
131 }
132 #[doc = "Change the `iterations` field of this object."]
133 #[doc = ""]
134 #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"]
135 pub fn iterations(&mut self, val: f64) -> &mut Self {
136 use wasm_bindgen::JsValue;
137 let r = ::js_sys::Reflect::set(
138 self.as_ref(),
139 &JsValue::from("iterations"),
140 &JsValue::from(val),
141 );
142 debug_assert!(
143 r.is_ok(),
144 "setting properties should never fail on our dictionary objects"
145 );
146 let _ = r;
147 self
148 }
149}
150impl Default for OptionalEffectTiming {
151 fn default() -> Self {
152 Self::new()
153 }
154}