Files
gpx.studio/wasm/src/command/edit.rs
T

29 lines
637 B
Rust
Raw Normal View History

2026-10-08 21:04:29 +02:00
//! Editing the metadata, the style and the structure of the files.
2026-10-14 09:22:07 +02:00
use gpx_engine::api;
2026-10-08 21:04:29 +02:00
use wasm_bindgen::prelude::*;
use crate::session::*;
2026-10-14 09:22:07 +02:00
use crate::ts::Outcome;
2026-10-08 21:04:29 +02:00
// Edit commands
#[wasm_bindgen]
pub fn metadata(name: &str, desc: &str) -> Outcome {
2026-10-14 09:22:07 +02:00
run(|e| api::metadata(e, name, desc))
2026-10-08 21:04:29 +02:00
}
#[wasm_bindgen]
pub fn style(color: Option<String>, opacity: Option<f64>, width: Option<f64>) -> Outcome {
2026-10-14 09:22:07 +02:00
run(|e| api::style(e, color.as_deref(), opacity, width))
2026-10-08 21:04:29 +02:00
}
#[wasm_bindgen]
pub fn new_track() -> Outcome {
2026-10-14 09:22:07 +02:00
run(api::new_track)
2026-10-08 21:04:29 +02:00
}
#[wasm_bindgen]
pub fn new_track_segment() -> Outcome {
2026-10-14 09:22:07 +02:00
run(api::new_track_segment)
2026-10-08 21:04:29 +02:00
}