2021-08-11 08:40:58 +08:00
|
|
|
use crate::{
|
2021-08-11 17:18:10 +08:00
|
|
|
client::Document,
|
2021-08-11 11:42:46 +08:00
|
|
|
core::{Attributes, Delta, Interval},
|
2021-08-11 08:40:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
pub trait InsertExt {
|
2021-08-11 17:18:10 +08:00
|
|
|
fn apply(&self, delta: &Delta, s: &str, index: usize) -> Delta;
|
2021-08-11 08:40:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
pub trait FormatExt {
|
2021-08-11 11:42:46 +08:00
|
|
|
fn apply(&self, document: &Document, interval: Interval, attributes: Attributes);
|
2021-08-11 08:40:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
pub trait DeleteExt {
|
2021-08-11 11:42:46 +08:00
|
|
|
fn apply(&self, document: &Document, interval: Interval);
|
2021-08-11 08:40:58 +08:00
|
|
|
}
|