tree_table/args/
args_move.rs1use crate::statics::default_emit_event_for_api;
2use crate::statics::default_save_selection_for_api;
3use crate::statics::default_undo_for_api;
4use alloc::vec::Vec;
5
6#[cfg_attr(feature = "tsify", derive(tsify::Tsify))]
7#[cfg_attr(feature = "tsify", tsify(from_wasm_abi))]
8#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9#[derive(Debug, Clone, PartialEq)]
10pub struct MoveArgs {
11 pub old_to_new: Option<Vec<(u64, u64)>>,
12 #[cfg_attr(feature = "serde", serde(default))]
13 pub select: bool,
14 #[cfg_attr(feature = "serde", serde(default = "default_emit_event_for_api"))]
15 pub emit: bool,
16 #[cfg_attr(feature = "serde", serde(default = "default_undo_for_api"))]
17 pub undo: bool,
18 #[cfg_attr(feature = "serde", serde(default = "default_save_selection_for_api"))]
19 pub save_selection: bool,
20}
21
22impl Default for MoveArgs {
23 fn default() -> Self {
24 MoveArgs {
25 old_to_new: None,
26 select: false,
27 emit: default_emit_event_for_api(),
28 undo: default_undo_for_api(),
29 save_selection: default_save_selection_for_api(),
30 }
31 }
32}