feature: add support to add mutiple sections to the document inc. headers and footers

- write missing tests
This commit is contained in:
Igor Bulovski
2018-06-21 12:03:34 +02:00
parent b8b5d18662
commit 0b963ec3b8
33 changed files with 611 additions and 102 deletions

View File

@ -1,13 +1,19 @@
import { XmlComponent } from "file/xml-components";
import { FooterReferenceAttributes } from "./footer-reference-attributes";
import { FooterReferenceAttributes, FooterReferenceType } from "./footer-reference-attributes";
export interface FooterOptions {
footerType?: FooterReferenceType;
footerId?: number;
}
export class FooterReference extends XmlComponent {
constructor() {
constructor(options: FooterOptions) {
super("w:footerReference");
this.root.push(
new FooterReferenceAttributes({
type: "default",
id: `rId${4}`,
type: options.footerType || FooterReferenceType.DEFAULT,
id: `rId${options.footerId}`,
}),
);
}