Turn methods into "add()"

This commit is contained in:
Dolan
2019-06-25 23:17:56 +01:00
parent 3ef8f5311d
commit e2574ec23b
55 changed files with 253 additions and 262 deletions

View File

@ -22,13 +22,9 @@ export class TableCell extends XmlComponent {
this.root.push(this.properties);
}
public addParagraph(content: Paragraph): TableCell {
this.root.push(content);
return this;
}
public add(item: Paragraph | Table): TableCell {
this.root.push(item);
public addTable(content: Table): TableCell {
this.root.push(content);
return this;
}
@ -36,7 +32,7 @@ export class TableCell extends XmlComponent {
// Cells must end with a paragraph
if (!(this.root[this.root.length - 1] instanceof Paragraph)) {
const para = new Paragraph({});
this.addParagraph(para);
this.add(para);
}
return super.prepForXml();
}