figma_api/models/
simple_transition.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SimpleTransition {
17 #[serde(rename = "type")]
18 pub r#type: Type,
19 #[serde(rename = "duration")]
21 pub duration: f64,
22 #[serde(rename = "easing")]
24 pub easing: Box<models::Easing>,
25}
26
27impl SimpleTransition {
28 pub fn new(r#type: Type, duration: f64, easing: models::Easing) -> SimpleTransition {
30 SimpleTransition {
31 r#type,
32 duration,
33 easing: Box::new(easing),
34 }
35 }
36}
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Type {
40 #[serde(rename = "DISSOLVE")]
41 Dissolve,
42 #[serde(rename = "SMART_ANIMATE")]
43 SmartAnimate,
44 #[serde(rename = "SCROLL_ANIMATE")]
45 ScrollAnimate,
46}
47
48impl Default for Type {
49 fn default() -> Type {
50 Self::Dissolve
51 }
52}
53