pub use delete::*; pub use format::*; pub use insert::*; use lib_ot::core::AttributeEntry; use lib_ot::{core::Interval, text_delta::DeltaTextOperations}; mod delete; mod format; mod helper; mod insert; pub type InsertExtension = Box; pub type FormatExtension = Box; pub type DeleteExtension = Box; pub trait InsertExt { fn ext_name(&self) -> &str; fn apply( &self, delta: &DeltaTextOperations, replace_len: usize, text: &str, index: usize, ) -> Option; } pub trait FormatExt { fn ext_name(&self) -> &str; fn apply( &self, delta: &DeltaTextOperations, interval: Interval, attribute: &AttributeEntry, ) -> Option; } pub trait DeleteExt { fn ext_name(&self) -> &str; fn apply(&self, delta: &DeltaTextOperations, interval: Interval) -> Option; }