Files
docx-js/src/file/footer-wrapper.ts

49 lines
1.3 KiB
TypeScript
Raw Normal View History

2018-06-09 23:49:01 +01:00
import { XmlComponent } from "file/xml-components";
2018-10-23 00:31:51 +01:00
2018-09-17 20:06:51 +01:00
import { FooterReferenceType } from "./document";
import { Footer } from "./footer/footer";
2018-12-05 00:05:11 +00:00
import { Image, Media } from "./media";
2019-06-25 01:21:28 +01:00
import { Paragraph } from "./paragraph";
import { Relationships } from "./relationships";
import { Table } from "./table";
2018-09-17 20:06:51 +01:00
export interface IDocumentFooter {
readonly footer: FooterWrapper;
readonly type: FooterReferenceType;
2018-09-17 20:06:51 +01:00
}
2018-12-24 16:50:53 +00:00
export class FooterWrapper {
private readonly footer: Footer;
private readonly relationships: Relationships;
2018-10-23 00:31:51 +01:00
constructor(private readonly media: Media, referenceId: number, initContent?: XmlComponent) {
2018-09-04 17:16:31 +03:00
this.footer = new Footer(referenceId, initContent);
this.relationships = new Relationships();
}
public add(item: Paragraph | Table): void {
this.footer.add(item);
}
2019-06-25 01:21:28 +01:00
public addImage(image: Image): FooterWrapper {
this.footer.add(image.Paragraph);
2019-06-25 01:21:28 +01:00
return this;
}
public addChildElement(childElement: XmlComponent): void {
this.footer.addChildElement(childElement);
}
public get Footer(): Footer {
return this.footer;
}
public get Relationships(): Relationships {
return this.relationships;
}
2018-09-07 21:48:59 +01:00
public get Media(): Media {
return this.media;
}
}