27 lines
752 B
TypeScript
27 lines
752 B
TypeScript
import { XmlComponent } from "file/xml-components";
|
|
import { Paragraph } from "../../paragraph";
|
|
import { FootnoteAttributes } from "./footnote-attributes";
|
|
import { FootnoteRefRun } from "./run/footnote-ref-run";
|
|
|
|
export enum FootnoteType {
|
|
SEPERATOR = "separator",
|
|
CONTINUATION_SEPERATOR = "continuationSeparator",
|
|
}
|
|
|
|
export class Footnote extends XmlComponent {
|
|
constructor(id: number, type?: FootnoteType) {
|
|
super("w:footnote");
|
|
this.root.push(
|
|
new FootnoteAttributes({
|
|
type: type,
|
|
id: id,
|
|
}),
|
|
);
|
|
}
|
|
|
|
public addParagraph(paragraph: Paragraph): void {
|
|
paragraph.addRunToFront(new FootnoteRefRun());
|
|
this.root.push(paragraph);
|
|
}
|
|
}
|