2019-12-11 07:12:22 +02:00
|
|
|
use super::*;
|
2020-01-24 12:44:43 +02:00
|
|
|
use docx_rs;
|
2019-12-11 07:12:22 +02:00
|
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
#[derive(Debug)]
|
2020-01-24 12:44:43 +02:00
|
|
|
pub struct Insert(docx_rs::Insert);
|
2019-12-11 07:12:22 +02:00
|
|
|
|
|
|
|
#[wasm_bindgen(js_name = createInsert)]
|
2019-12-19 09:37:28 +02:00
|
|
|
pub fn create_insert(run: Run) -> Insert {
|
2020-01-24 12:44:43 +02:00
|
|
|
Insert(docx_rs::Insert::new(run.take()))
|
2019-12-11 07:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Insert {
|
2020-01-24 12:44:43 +02:00
|
|
|
pub fn take(self) -> docx_rs::Insert {
|
2019-12-11 07:12:22 +02:00
|
|
|
self.0
|
|
|
|
}
|
2019-12-20 11:02:00 +02:00
|
|
|
}
|
2019-12-19 09:37:28 +02:00
|
|
|
|
2019-12-20 11:02:00 +02:00
|
|
|
#[wasm_bindgen]
|
|
|
|
impl Insert {
|
2019-12-19 09:37:28 +02:00
|
|
|
pub fn author(mut self, author: String) -> Insert {
|
|
|
|
self.0.author = author;
|
|
|
|
self
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn date(mut self, date: String) -> Insert {
|
|
|
|
self.0.date = date;
|
|
|
|
self
|
|
|
|
}
|
2019-12-11 07:12:22 +02:00
|
|
|
}
|