2018-05-12 20:04:54 -04:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
|
|
|
|
2018-05-18 09:21:27 -06:00
|
|
|
class FidCharAttrs extends XmlAttributeComponent<{ type: "begin" | "end" | "separate" }> {
|
2018-05-12 20:04:54 -04:00
|
|
|
protected xmlKeys = { type: "w:fldCharType" };
|
|
|
|
}
|
|
|
|
|
|
|
|
class TextAttributes extends XmlAttributeComponent<{ space: "default" | "preserve" }> {
|
|
|
|
protected xmlKeys = { space: "xml:space" };
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Begin extends XmlComponent {
|
|
|
|
constructor() {
|
|
|
|
super("w:fldChar");
|
2018-05-18 09:21:27 -06:00
|
|
|
this.root.push(new FidCharAttrs({ type: "begin" }));
|
2018-05-12 20:04:54 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Page extends XmlComponent {
|
|
|
|
constructor() {
|
|
|
|
super("w:instrText");
|
|
|
|
this.root.push(new TextAttributes({ space: "preserve" }));
|
|
|
|
this.root.push("PAGE");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Separate extends XmlComponent {
|
|
|
|
constructor() {
|
|
|
|
super("w:fldChar");
|
2018-05-18 09:21:27 -06:00
|
|
|
this.root.push(new FidCharAttrs({ type: "separate" }));
|
2018-05-12 20:04:54 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class End extends XmlComponent {
|
|
|
|
constructor() {
|
|
|
|
super("w:fldChar");
|
2018-05-18 09:21:27 -06:00
|
|
|
this.root.push(new FidCharAttrs({ type: "end" }));
|
2018-05-12 20:04:54 -04:00
|
|
|
}
|
2018-05-18 09:21:27 -06:00
|
|
|
}
|