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,6 @@
// http://officeopenxml.com/WPdocument.php
import { IMediaData } from "file/media";
import { XmlComponent } from "file/xml-components";
import { Image, Paragraph } from "../paragraph";
import { Paragraph } from "../paragraph";
import { Table } from "../table";
import { Body } from "./body";
import { SectionPropertiesOptions } from "./body/section-properties/section-properties";
@ -37,8 +36,9 @@ export class Document extends XmlComponent {
this.root.push(this.body);
}
public addParagraph(paragraph: Paragraph): void {
public addParagraph(paragraph: Paragraph): Document {
this.body.push(paragraph);
return this;
}
public createParagraph(text?: string): Paragraph {
@ -57,13 +57,6 @@ export class Document extends XmlComponent {
return table;
}
public createDrawing(imageData: IMediaData): Image {
const image = new Image(imageData);
this.addParagraph(image);
return image;
}
get Body(): Body {
return this.body;
}