Change image API so that it now sends Images

This commit is contained in:
Dolan
2018-08-03 00:01:42 +01:00
parent 31fdf08c27
commit 5f22950721
8 changed files with 42 additions and 58 deletions

View File

@ -1,7 +1,7 @@
import { XmlComponent } from "file/xml-components";
import { Footer } from "./footer/footer";
import { IMediaData, Media } from "./media";
import { Paragraph } from "./paragraph";
import { Media } from "./media";
import { Image, Paragraph } from "./paragraph";
import { Relationships } from "./relationships";
import { Table } from "./table";
@ -32,10 +32,6 @@ export class FooterWrapper {
return this.footer.createTable(rows, cols);
}
public addDrawing(imageData: IMediaData): void {
this.footer.addDrawing(imageData);
}
public addChildElement(childElement: XmlComponent | string): void {
this.footer.addChildElement(childElement);
}
@ -47,7 +43,12 @@ export class FooterWrapper {
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
`media/${mediaData.fileName}`,
);
this.addDrawing(mediaData);
this.insertImage(new Image(mediaData));
}
public insertImage(image: Image): FooterWrapper {
this.footer.addParagraph(image);
return this;
}
public get Footer(): Footer {