feature: add support to add mutiple sections to the document inc. headers and footers
- write missing tests
This commit is contained in:
@ -1,13 +1,18 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { HeaderReferenceAttributes } from "./header-reference-attributes";
|
||||
import { HeaderReferenceAttributes, HeaderReferenceType } from "./header-reference-attributes";
|
||||
|
||||
export interface HeaderOptions {
|
||||
headerType?: HeaderReferenceType;
|
||||
headerId?: number;
|
||||
}
|
||||
|
||||
export class HeaderReference extends XmlComponent {
|
||||
constructor() {
|
||||
constructor(options: HeaderOptions) {
|
||||
super("w:headerReference");
|
||||
this.root.push(
|
||||
new HeaderReferenceAttributes({
|
||||
type: "default",
|
||||
id: `rId${3}`,
|
||||
type: options.headerType || HeaderReferenceType.DEFAULT,
|
||||
id: `rId${options.headerId}`,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user