Files
gpx.studio/gpx-rs/wasm/src/command/history.rs
T

30 lines
477 B
Rust
Raw Normal View History

2026-10-08 21:04:29 +02:00
//! Undo and redo.
use gpx_engine::Action;
use wasm_bindgen::prelude::*;
use crate::ts::Outcome;
use crate::session::*;
// Undo-redo
#[wasm_bindgen]
pub fn undo() -> Outcome {
execute(Action::Undo)
}
#[wasm_bindgen]
pub fn redo() -> Outcome {
execute(Action::Redo)
}
#[wasm_bindgen]
pub fn can_undo() -> bool {
with_engine(|e| e.can_undo()).unwrap_or(false)
}
#[wasm_bindgen]
pub fn can_redo() -> bool {
with_engine(|e| e.can_redo()).unwrap_or(false)
}