Make .addSection fully declarative

This commit is contained in:
Dolan
2021-03-19 20:53:56 +00:00
parent 4783812044
commit 3299c557a0
86 changed files with 3341 additions and 3278 deletions

View File

@ -3,8 +3,6 @@
import * as fs from "fs";
import { Document, Header, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
const doc = new Document();
const table = new Table({
rows: [
new TableRow({
@ -69,13 +67,17 @@ const table = new Table({
});
// Adding same table in the body and in the header
doc.addSection({
headers: {
default: new Header({
const doc = new Document({
sections: [
{
headers: {
default: new Header({
children: [table],
}),
},
children: [table],
}),
},
children: [table],
},
],
});
Packer.toBuffer(doc).then((buffer) => {