docx
Version:
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
31 lines (25 loc) • 730 B
text/typescript
import { Run } from "file/paragraph/run";
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export class FootNoteReferenceRunAttributes extends XmlAttributeComponent<{
readonly id: number;
}> {
protected readonly xmlKeys = {
id: "w:id",
};
}
export class FootnoteReference extends XmlComponent {
constructor(id: number) {
super("w:footnoteReference");
this.root.push(
new FootNoteReferenceRunAttributes({
id: id,
}),
);
}
}
export class FootnoteReferenceRun extends Run {
constructor(id: number) {
super({ style: "FootnoteReference" });
this.root.push(new FootnoteReference(id));
}
}