2018-08-31 10:22:40 -03:00
|
|
|
// import { TableOfContentsProperties } from "./properties";
|
2018-09-10 10:01:26 -03:00
|
|
|
import { ParagraphProperties } from "file/paragraph";
|
2018-09-04 18:22:08 -03:00
|
|
|
import { Run } from "file/paragraph/run";
|
2018-09-03 11:20:36 -03:00
|
|
|
import { Begin, End, Separate } from "file/paragraph/run/field";
|
2018-09-10 10:01:26 -03:00
|
|
|
import { XmlComponent } from "file/xml-components";
|
2018-09-03 11:20:36 -03:00
|
|
|
import { TableOfContentsInstruction } from "./instruction";
|
2018-08-21 07:19:46 -03:00
|
|
|
|
2018-09-10 10:01:26 -03:00
|
|
|
export class TableOfContents extends XmlComponent {
|
2018-08-31 10:22:40 -03:00
|
|
|
// private readonly tocProperties: TableOfContentsProperties;
|
2018-09-10 10:01:26 -03:00
|
|
|
private readonly properties: ParagraphProperties;
|
2018-08-29 12:06:01 -03:00
|
|
|
|
2018-08-31 10:22:40 -03:00
|
|
|
constructor(/*tocProperties?: TableOfContentsProperties*/) {
|
2018-09-10 10:01:26 -03:00
|
|
|
super("w:p");
|
|
|
|
this.properties = new ParagraphProperties();
|
|
|
|
this.root.push(this.properties);
|
2018-08-31 10:22:40 -03:00
|
|
|
// this.tocProperties = tocProperties || new TableOfContentsProperties();
|
2018-09-04 18:22:08 -03:00
|
|
|
const firstRun = new Run();
|
|
|
|
firstRun.addChildElement(new Begin());
|
|
|
|
firstRun.addChildElement(new TableOfContentsInstruction());
|
|
|
|
firstRun.addChildElement(new Separate());
|
|
|
|
this.root.push(firstRun);
|
|
|
|
|
|
|
|
const secondRun = new Run();
|
|
|
|
secondRun.addChildElement(new End());
|
|
|
|
this.root.push(secondRun);
|
2018-08-29 12:06:01 -03:00
|
|
|
}
|
|
|
|
}
|