17 lines
421 B
Rust
Raw Normal View History

2021-08-11 08:40:58 +08:00
use crate::{
2021-08-11 17:18:10 +08:00
client::Document,
2021-08-11 23:34:35 +08:00
core::{Attribute, Delta, Interval},
2021-08-11 08:40:58 +08:00
};
pub trait InsertExt {
2021-08-11 23:34:35 +08:00
fn apply(&self, delta: &Delta, replace_len: usize, text: &str, index: usize) -> Option<Delta>;
2021-08-11 08:40:58 +08:00
}
pub trait FormatExt {
2021-08-11 23:34:35 +08:00
fn apply(&self, delta: &Delta, interval: Interval, attribute: &Attribute) -> Option<Delta>;
2021-08-11 08:40:58 +08:00
}
pub trait DeleteExt {
2021-08-11 23:34:35 +08:00
fn apply(&self, delta: &Delta, interval: Interval) -> Option<Delta>;
2021-08-11 08:40:58 +08:00
}