Files
docx-js/src/file/table-of-contents/table-of-contents.ts

24 lines
915 B
TypeScript
Raw Normal View History

2018-08-31 10:22:40 -03:00
// import { TableOfContentsProperties } from "./properties";
2018-09-03 11:20:36 -03:00
import { Paragraph } 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";
import { TableOfContentsInstruction } from "./instruction";
2018-08-21 07:19:46 -03:00
2018-08-31 10:22:40 -03:00
export class TableOfContents extends Paragraph {
// private readonly tocProperties: TableOfContentsProperties;
2018-08-29 12:06:01 -03:00
2018-08-31 10:22:40 -03:00
constructor(/*tocProperties?: TableOfContentsProperties*/) {
super();
// 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
}
}