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 TableRow(docx_rs::TableRow);
|
2019-12-11 07:12:22 +02:00
|
|
|
|
|
|
|
#[wasm_bindgen(js_name = createTableRow)]
|
|
|
|
pub fn create_table_row() -> TableRow {
|
2020-01-24 12:44:43 +02:00
|
|
|
TableRow(docx_rs::TableRow::new(vec![]))
|
2019-12-11 07:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
impl TableRow {
|
2020-01-24 12:44:43 +02:00
|
|
|
pub fn take(self) -> docx_rs::TableRow {
|
2019-12-11 07:12:22 +02:00
|
|
|
self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
impl TableRow {
|
|
|
|
pub fn add_cell(mut self, cell: TableCell) -> TableRow {
|
|
|
|
self.0.cells.push(cell.take());
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|