docx-rs/docx-wasm/js/footer.ts

30 lines
572 B
TypeScript

import { PageNum } from "./page-num";
import { Paragraph } from "./paragraph";
import { Table } from "./table";
export class Footer {
hasNumberings = false;
children: (Paragraph | Table | PageNum)[] = [];
addParagraph(p: Paragraph) {
if (p.hasNumberings) {
this.hasNumberings = true;
}
this.children.push(p);
return this;
}
addTable(t: Table) {
if (t.hasNumberings) {
this.hasNumberings = true;
}
this.children.push(t);
return this;
}
addPageNum(p: PageNum) {
this.children.push(p);
return this;
}
}