//! Editing the metadata, the style and the structure of the files. use gpx_engine::api; use wasm_bindgen::prelude::*; use crate::session::*; use crate::ts::Outcome; // Edit commands #[wasm_bindgen] pub fn metadata(name: &str, desc: &str) -> Outcome { run(|e| api::metadata(e, name, desc)) } #[wasm_bindgen] pub fn style(color: Option, opacity: Option, width: Option) -> Outcome { run(|e| api::style(e, color.as_deref(), opacity, width)) } /// Converts the selected routes to tracks, or the selected tracks or segments to routes. #[wasm_bindgen] pub fn convert() -> Outcome { run(api::convert) } #[wasm_bindgen] pub fn new_route() -> Outcome { run(api::new_route) } #[wasm_bindgen] pub fn new_track() -> Outcome { run(api::new_track) } #[wasm_bindgen] pub fn new_track_segment() -> Outcome { run(api::new_track_segment) }