2020-04-27 04:41:23 +03:00
|
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct TableCellBorder(docx_rs::TableCellBorder);
|
|
|
|
|
|
|
|
#[wasm_bindgen(js_name = createTableCellBorder)]
|
|
|
|
pub fn create_table_cell_border(position: docx_rs::BorderPosition) -> TableCellBorder {
|
|
|
|
TableCellBorder(docx_rs::TableCellBorder::new(position))
|
|
|
|
}
|
|
|
|
|
|
|
|
impl TableCellBorder {
|
|
|
|
pub fn take(self) -> docx_rs::TableCellBorder {
|
|
|
|
self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
impl TableCellBorder {
|
2020-04-30 07:39:56 +03:00
|
|
|
pub fn size(mut self, size: usize) -> TableCellBorder {
|
|
|
|
self.0.size = size;
|
|
|
|
self
|
|
|
|
}
|
|
|
|
|
2020-04-27 04:41:23 +03:00
|
|
|
pub fn color(mut self, color: String) -> TableCellBorder {
|
|
|
|
self.0.color = color;
|
|
|
|
self
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn border_type(mut self, border_type: docx_rs::BorderType) -> TableCellBorder {
|
|
|
|
self.0.border_type = border_type;
|
|
|
|
self
|
|
|
|
}
|
2020-04-30 07:39:56 +03:00
|
|
|
|
|
|
|
pub fn get_size(&self) -> usize {
|
|
|
|
self.0.get_size()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_color(&self) -> String {
|
|
|
|
self.0.get_color()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_border_type(&self) -> docx_rs::BorderType {
|
|
|
|
self.0.get_border_type()
|
|
|
|
}
|
2020-04-27 04:41:23 +03:00
|
|
|
}
|