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

14 lines
434 B
TypeScript
Raw Normal View History

2018-09-03 11:20:36 -03:00
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
class TextAttributes extends XmlAttributeComponent<{ space: "default" | "preserve" }> {
protected xmlKeys = { space: "xml:space" };
}
export class TableOfContentsInstruction extends XmlComponent {
constructor() {
super("w:instrText");
this.root.push(new TextAttributes({ space: "preserve" }));
this.root.push("TOC");
}
}