Files
docx-js/src/file/document/body/section-properties/header-reference/header-reference.ts

20 lines
618 B
TypeScript

import { XmlComponent } from "file/xml-components";
import { HeaderReferenceAttributes, HeaderReferenceType } from "./header-reference-attributes";
export interface IHeaderOptions {
readonly headerType?: HeaderReferenceType;
readonly headerId?: number;
}
export class HeaderReference extends XmlComponent {
constructor(options: IHeaderOptions) {
super("w:headerReference");
this.root.push(
new HeaderReferenceAttributes({
type: options.headerType || HeaderReferenceType.DEFAULT,
id: `rId${options.headerId}`,
}),
);
}
}