Moved addTableOfContents to File and creating a settings.xml and applying updateFields=true when there is a table of contents

This commit is contained in:
Sergio Mendonça
2018-09-10 10:01:26 -03:00
parent aedfca377f
commit 146d0ad9e5
13 changed files with 268 additions and 14 deletions

View File

@ -1,14 +1,18 @@
// import { TableOfContentsProperties } from "./properties";
import { Paragraph } from "file/paragraph";
import { ParagraphProperties } from "file/paragraph";
import { Run } from "file/paragraph/run";
import { Begin, End, Separate } from "file/paragraph/run/field";
import { XmlComponent } from "file/xml-components";
import { TableOfContentsInstruction } from "./instruction";
export class TableOfContents extends Paragraph {
export class TableOfContents extends XmlComponent {
// private readonly tocProperties: TableOfContentsProperties;
private readonly properties: ParagraphProperties;
constructor(/*tocProperties?: TableOfContentsProperties*/) {
super();
super("w:p");
this.properties = new ParagraphProperties();
this.root.push(this.properties);
// this.tocProperties = tocProperties || new TableOfContentsProperties();
const firstRun = new Run();
firstRun.addChildElement(new Begin());