leptos_motion_core/
lib.rs1#![warn(missing_docs)]
7#![forbid(unsafe_code)]
8
9pub mod animation;
10pub mod easing;
11pub mod engine;
12pub mod interpolation;
13pub mod math;
14pub mod spring;
15pub mod time;
16pub mod types;
17pub mod values;
18
19pub use animation::{AnimationBuilder, AnimationConfig, Variants};
21pub use easing::EasingFn;
22pub use engine::{AnimationEngine, HybridEngine, WaapiEngine, RafEngine, PlaybackState};
23pub use interpolation::Interpolate;
24pub use math::{clamp, map_range, distance_2d, smooth_step, smoother_step};
25pub use spring::{SpringSimulator, SpringState};
26pub use time::Timer;
27pub use types::{
28 AnimationHandle, AnimationValue, AnimationTarget, Transition,
29 Transform, ComplexValue, SpringConfig, RepeatConfig, StaggerConfig, StaggerFrom, Easing
30};
31pub use values::{MotionValue, MotionNumber, MotionTransform, MotionValues};
32
33pub type Result<T> = std::result::Result<T, AnimationError>;
35
36#[derive(Debug, thiserror::Error)]
38pub enum AnimationError {
39 #[error("Animation engine not available: {0}")]
41 EngineUnavailable(String),
42
43 #[error("Invalid animation property: {property}")]
45 InvalidProperty { property: String },
46
47 #[error("Animation already running with handle: {handle:?}")]
49 AlreadyRunning { handle: AnimationHandle },
50
51 #[error("Animation not found: {handle:?}")]
53 NotFound { handle: AnimationHandle },
54
55 #[error("DOM operation failed: {0}")]
57 DomError(String),
58
59 #[error("Math error: {0}")]
61 MathError(String),
62}