/
footer-wrapper.ts
48 lines (39 loc) · 1.32 KB
/
footer-wrapper.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { XmlComponent } from "@file/xml-components";
import { HeaderFooterReferenceType } from "./document";
import { IViewWrapper } from "./document-wrapper";
import { Footer } from "./footer/footer";
import { Media } from "./media";
import { Paragraph } from "./paragraph";
import { Relationships } from "./relationships";
import { Table } from "./table";
export interface IDocumentFooter {
readonly footer: FooterWrapper;
readonly type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];
}
export class FooterWrapper implements IViewWrapper {
private readonly footer: Footer;
private readonly relationships: Relationships;
public constructor(
private readonly media: Media,
referenceId: number,
initContent?: XmlComponent,
) {
this.footer = new Footer(referenceId, initContent);
this.relationships = new Relationships();
}
public add(item: Paragraph | Table): void {
this.footer.add(item);
}
public addChildElement(childElement: XmlComponent): void {
this.footer.addChildElement(childElement);
}
public get View(): Footer {
return this.footer;
}
public get Relationships(): Relationships {
return this.relationships;
}
public get Media(): Media {
return this.media;
}
}