Add footnotes class
This commit is contained in:
13
src/file/footnotes/footnote/footnote-attributes.ts
Normal file
13
src/file/footnotes/footnote/footnote-attributes.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { XmlAttributeComponent } from "file/xml-components";
|
||||
|
||||
export interface IFootnoteAttributesProperties {
|
||||
type?: string;
|
||||
id: number;
|
||||
}
|
||||
|
||||
export class FootnoteAttributes extends XmlAttributeComponent<IFootnoteAttributesProperties> {
|
||||
protected xmlKeys = {
|
||||
type: "w:type",
|
||||
id: "w:id",
|
||||
};
|
||||
}
|
19
src/file/footnotes/footnote/footnote.ts
Normal file
19
src/file/footnotes/footnote/footnote.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Paragraph } from "../../paragraph";
|
||||
import { FootnoteAttributes } from "./footnote-attributes";
|
||||
|
||||
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 {
|
||||
this.root.push(paragraph);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user