add document.createParagraph method

This commit is contained in:
felipe
2017-03-10 14:11:28 +01:00
parent 8c91c04afa
commit ea647d84df
2 changed files with 31 additions and 1 deletions

View File

@ -33,4 +33,10 @@ export class Document extends XmlComponent {
public addParagraph(paragraph: Paragraph): void {
this.body.push(paragraph);
}
public createParagraph(text?: string): Paragraph {
const para = new Paragraph(text);
this.addParagraph(para);
return para;
}
}