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

@ -114,11 +114,11 @@ export class File {
public add(item: Paragraph | Table | TableOfContents): File {
if (item instanceof Paragraph) {
this.document.addParagraph(item);
this.document.add(item);
}
if (item instanceof Table) {
this.document.addTable(item);
this.document.add(item);
}
if (item instanceof TableOfContents) {
@ -136,7 +136,7 @@ export class File {
): Paragraph {
const image = Media.addImage(this, buffer, width, height, drawingOptions);
const paragraph = new Paragraph(image);
this.document.addParagraph(paragraph);
this.document.add(paragraph);
return paragraph;
}