Files
docx-js/src/file/footnotes/footnote/footnote.ts

22 lines
633 B
TypeScript
Raw Normal View History

2018-06-11 00:45:21 +01:00
import { XmlComponent } from "file/xml-components";
import { Paragraph } from "../../paragraph";
import { FootnoteAttributes } from "./footnote-attributes";
2018-06-28 03:01:25 +01:00
import { FootnoteRefRun } from "./run/footnote-ref-run";
2018-06-11 00:45:21 +01:00
export class FootNote extends XmlComponent {
constructor(id: number, type?: string) {
super("w:footnote");
this.root.push(
new FootnoteAttributes({
type: type,
id: id,
}),
);
}
public addParagraph(paragraph: Paragraph): void {
2018-06-28 03:01:25 +01:00
paragraph.addRunToFront(new FootnoteRefRun());
2018-06-11 00:45:21 +01:00
this.root.push(paragraph);
}
}