diff --git a/engine/preprocessor/Cargo.toml b/engine/preprocessor/Cargo.toml index 84e8db8..b3bfb12 100644 --- a/engine/preprocessor/Cargo.toml +++ b/engine/preprocessor/Cargo.toml @@ -14,7 +14,12 @@ authors = ["Brady Fomegne "] [features] default = [] inhibit = [] +serde = ["dep:serde", "keyboard-types/serde"] [dependencies] -keyboard-types = "0.7.0" +keyboard-types = { version = "0.7.0", default-features = false } afrim-memory = { version = "0.3.2", path = "../../memory" } +serde = { version = "1.0.197", features = ["derive"], optional = true } + +[dev-dependencies] +keyboard-types = { version = "0.7.0", features = ["webdriver"] } diff --git a/engine/preprocessor/src/message.rs b/engine/preprocessor/src/message.rs index 279c7e3..b5b2416 100644 --- a/engine/preprocessor/src/message.rs +++ b/engine/preprocessor/src/message.rs @@ -2,6 +2,7 @@ /// Possible commands that can be generated by the `afrim-preprocessor`. #[derive(Clone, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Command { /// Request to commit a text. CommitText(String),