Add footnote classes

This commit is contained in:
Dolan
2018-06-25 19:50:19 +01:00
parent 99290d646e
commit 044442b0d7
5 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,35 @@
import { Run } from "file/paragraph/run";
import { Style } from "file/paragraph/run/style";
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export interface IFootNoteReferenceRunAttributesProperties {
id: number;
}
export class FootNoteReferenceRunAttributes extends XmlAttributeComponent<IFootNoteReferenceRunAttributesProperties> {
protected 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();
this.properties.push(new Style("FootnoteReference"));
this.root.push(new FootnoteReference(id));
}
}