Consolidate highlight and shadow API

This commit is contained in:
Dolan
2019-08-06 21:37:33 +01:00
parent 099eb1d202
commit e45e7ffe06
4 changed files with 86 additions and 90 deletions

View File

@ -1,24 +1,32 @@
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build";
import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "../build";
const doc = new Document();
const header = doc.Header.createTable(1, 3)
// @ts-ignore
header.properties.root[1] = []
header.getCell(0, 2).addParagraph(
new Paragraph()
.addRun(
new TextRun('W.P. 660')
.color('red')
.bold()
.size(12 * 2)
.font('Garamond')
.highlight('yellow')
)
.right()
)
doc.addSection({
headers: {
default: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [
new TextRun({
text: "Hello World",
color: "red",
bold: true,
size: 24,
font: {
name: "Garamond",
},
highlight: "yellow",
}),
],
}),
],
}),
},
children: [],
});
const packer = new Packer();