pub use delete::*; pub use format::*; pub use insert::*; use lib_ot::{ core::Interval, rich_text::{RichTextAttribute, RichTextDelta}, }; mod delete; mod format; 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: &RichTextDelta, replace_len: usize, text: &str, index: usize) -> Option; } pub trait FormatExt { fn ext_name(&self) -> &str; fn apply(&self, delta: &RichTextDelta, interval: Interval, attribute: &RichTextAttribute) -> Option; } pub trait DeleteExt { fn ext_name(&self) -> &str; fn apply(&self, delta: &RichTextDelta, interval: Interval) -> Option; }