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

20 lines
600 B
TypeScript
Raw Normal View History

2018-01-29 02:56:35 +00:00
import { XmlComponent } from "file/xml-components";
import { HeaderReferenceAttributes, HeaderReferenceType } from "./header-reference-attributes";
2018-06-22 23:04:03 +01:00
export interface IHeaderOptions {
headerType?: HeaderReferenceType;
headerId?: number;
}
2018-01-29 02:56:35 +00:00
export class HeaderReference extends XmlComponent {
2018-06-22 23:04:03 +01:00
constructor(options: IHeaderOptions) {
2018-01-29 02:56:35 +00:00
super("w:headerReference");
this.root.push(
new HeaderReferenceAttributes({
type: options.headerType || HeaderReferenceType.DEFAULT,
id: `rId${options.headerId}`,
2018-01-29 02:56:35 +00:00
}),
);
}
}