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

@ -0,0 +1,22 @@
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export interface IUpdateFieldsAttributesProperties {
enabled: boolean;
}
export class UpdateFieldsAttributes extends XmlAttributeComponent<IUpdateFieldsAttributesProperties> {
protected xmlKeys = {
enabled: "w:val",
};
}
export class UpdateFields extends XmlComponent {
constructor(enabled: boolean = true) {
super("w:updateFields");
this.root.push(
new UpdateFieldsAttributes({
enabled,
}),
);
}
}