1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = KeyframeEffectOptions)]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `KeyframeEffectOptions` dictionary."]
9     #[doc = ""]
10     #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"]
11     pub type KeyframeEffectOptions;
12 }
13 impl KeyframeEffectOptions {
14     #[doc = "Construct a new `KeyframeEffectOptions`."]
15     #[doc = ""]
16     #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"]
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: `KeyframeEffectOptions`*"]
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: `KeyframeEffectOptions`, `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: `KeyframeEffectOptions`*"]
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: `KeyframeEffectOptions`*"]
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: `KeyframeEffectOptions`*"]
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`, `KeyframeEffectOptions`*"]
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: `KeyframeEffectOptions`*"]
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: `KeyframeEffectOptions`*"]
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     #[cfg(feature = "CompositeOperation")]
150     #[doc = "Change the `composite` field of this object."]
151     #[doc = ""]
152     #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`, `KeyframeEffectOptions`*"]
153     pub fn composite(&mut self, val: CompositeOperation) -> &mut Self {
154         use wasm_bindgen::JsValue;
155         let r = ::js_sys::Reflect::set(
156             self.as_ref(),
157             &JsValue::from("composite"),
158             &JsValue::from(val),
159         );
160         debug_assert!(
161             r.is_ok(),
162             "setting properties should never fail on our dictionary objects"
163         );
164         let _ = r;
165         self
166     }
167     #[cfg(feature = "IterationCompositeOperation")]
168     #[doc = "Change the `iterationComposite` field of this object."]
169     #[doc = ""]
170     #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`, `KeyframeEffectOptions`*"]
171     pub fn iteration_composite(&mut self, val: IterationCompositeOperation) -> &mut Self {
172         use wasm_bindgen::JsValue;
173         let r = ::js_sys::Reflect::set(
174             self.as_ref(),
175             &JsValue::from("iterationComposite"),
176             &JsValue::from(val),
177         );
178         debug_assert!(
179             r.is_ok(),
180             "setting properties should never fail on our dictionary objects"
181         );
182         let _ = r;
183         self
184     }
185 }
186 impl Default for KeyframeEffectOptions {
187     fn default() -> Self {
188         Self::new()
189     }
190 }
191