ITableOfContentsProperties to ITableOfContentsOptions

This commit is contained in:
Dolan
2018-09-25 21:09:30 +01:00
parent 3a42f2a2f0
commit c140d2c37c
5 changed files with 16 additions and 11 deletions

View File

@ -1,19 +1,24 @@
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
import { ITableOfContentsProperties } from "./table-of-contents-properties";
import { ITableOfContentsOptions } from "./table-of-contents-properties";
class TextAttributes extends XmlAttributeComponent<{ space: "default" | "preserve" }> {
enum SpaceType {
DEFAULT = "default",
PRESERVE = "preserve",
}
class TextAttributes extends XmlAttributeComponent<{ space: SpaceType }> {
protected xmlKeys = { space: "xml:space" };
}
export class TableOfContentsInstruction extends XmlComponent {
private readonly properties: ITableOfContentsProperties;
private readonly properties: ITableOfContentsOptions;
constructor(properties: ITableOfContentsProperties = {}) {
constructor(properties: ITableOfContentsOptions = {}) {
super("w:instrText");
this.properties = properties;
this.root.push(new TextAttributes({ space: "preserve" }));
this.root.push(new TextAttributes({ space: SpaceType.PRESERVE }));
let instruction = "TOC";
if (this.properties.captionLabel) {