Turn Run into a declaritive API

This commit is contained in:
Dolan
2019-06-17 01:51:57 +01:00
parent a1cd5e9573
commit fb65bb4207
27 changed files with 411 additions and 183 deletions

View File

@ -241,8 +241,14 @@ class DocumentCreator {
maxRight: {},
},
});
const institution = new TextRun(institutionName).bold();
const date = new TextRun(dateText).tab().bold();
const institution = new TextRun({
text: institutionName,
bold: true,
});
const date = new TextRun({
text: dateText,
bold: true,
}).tab();
paragraph.addRun(institution);
paragraph.addRun(date);
@ -252,7 +258,10 @@ class DocumentCreator {
public createRoleText(roleText: string): Paragraph {
const paragraph = new Paragraph({});
const role = new TextRun(roleText).italics();
const role = new TextRun({
text: roleText,
italics: true,
});
paragraph.addRun(role);