2018-01-29 21:53:22 +00:00
|
|
|
import { XmlComponent } from "file/xml-components";
|
2018-06-21 12:03:34 +02:00
|
|
|
import { FooterReferenceAttributes, FooterReferenceType } from "./footer-reference-attributes";
|
|
|
|
|
2018-06-22 23:04:03 +01:00
|
|
|
export interface IFooterOptions {
|
2018-06-21 12:03:34 +02:00
|
|
|
footerType?: FooterReferenceType;
|
|
|
|
footerId?: number;
|
|
|
|
}
|
2018-01-29 21:53:22 +00:00
|
|
|
|
|
|
|
export class FooterReference extends XmlComponent {
|
2018-06-22 23:04:03 +01:00
|
|
|
constructor(options: IFooterOptions) {
|
2018-01-29 21:53:22 +00:00
|
|
|
super("w:footerReference");
|
2018-06-21 12:03:34 +02:00
|
|
|
|
2018-01-29 21:53:22 +00:00
|
|
|
this.root.push(
|
|
|
|
new FooterReferenceAttributes({
|
2018-06-21 12:03:34 +02:00
|
|
|
type: options.footerType || FooterReferenceType.DEFAULT,
|
|
|
|
id: `rId${options.footerId}`,
|
2018-01-29 21:53:22 +00:00
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|