Skip to main content

syntax_workout_core/
lib.rs

1pub mod node;
2pub mod measure;
3pub mod intensity;
4pub mod execution_mode;
5pub mod workout;
6pub mod stream;
7pub mod lap;
8pub mod visit;
9pub mod fold;
10pub mod validate;
11pub mod builder;
12pub mod stats;
13
14pub use node::{Node, NodeId, NodeKind, NodePayload};
15pub use measure::{Measure, WeightUnit, DistanceUnit};
16pub use intensity::Intensity;
17pub use execution_mode::ExecutionMode;
18pub use workout::Workout;
19pub use stream::{Stream, StreamData, StreamMetric, Streams, Position};
20pub use lap::{Lap, LapTrigger};
21pub use visit::{Visit, walk_node};
22pub use fold::Fold;
23pub use validate::validate;
24
25#[cfg(test)]
26mod ts_export_tests {
27    use ts_rs::TS;
28
29    /// Verify all public types implement TS and produce valid TypeScript declarations.
30    #[test]
31    fn all_public_types_export() {
32        let cfg = ts_rs::Config::default();
33        assert!(!super::Node::decl(&cfg).is_empty());
34        assert!(!super::NodeId::decl(&cfg).is_empty());
35        assert!(!super::NodeKind::decl(&cfg).is_empty());
36        assert!(!super::NodePayload::decl(&cfg).is_empty());
37        assert!(!super::Measure::decl(&cfg).is_empty());
38        assert!(!super::WeightUnit::decl(&cfg).is_empty());
39        assert!(!super::DistanceUnit::decl(&cfg).is_empty());
40        assert!(!super::Intensity::decl(&cfg).is_empty());
41        assert!(!super::ExecutionMode::decl(&cfg).is_empty());
42        assert!(!super::Workout::decl(&cfg).is_empty());
43        assert!(!super::validate::ValidationError::decl(&cfg).is_empty());
44        // v1.1.0: stream and lap types
45        assert!(!super::Stream::decl(&cfg).is_empty());
46        assert!(!super::StreamData::decl(&cfg).is_empty());
47        assert!(!super::StreamMetric::decl(&cfg).is_empty());
48        assert!(!super::Streams::decl(&cfg).is_empty());
49        assert!(!super::Position::decl(&cfg).is_empty());
50        assert!(!super::Lap::decl(&cfg).is_empty());
51        assert!(!super::LapTrigger::decl(&cfg).is_empty());
52    }
53}