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, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
const doc = new Document();
const table = new Table({
rows: [
new TableRow({
@ -252,8 +250,12 @@ const table2 = new Table({
],
});
doc.addSection({
children: [table, new Paragraph(""), table2],
const doc = new Document({
sections: [
{
children: [table, new Paragraph(""), table2],
},
],
});
Packer.toBuffer(doc).then((buffer) => {