fixed some typescript compile issues
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { IData } from "../../media/data";
|
||||
import { Num } from "../../numbering/num";
|
||||
import { Run } from "../run";
|
||||
import { PictureRun } from "../run/picture-run";
|
||||
@ -37,8 +38,8 @@ export class Paragraph extends XmlComponent {
|
||||
return run;
|
||||
}
|
||||
|
||||
public createPictureRun(imagePath: string): PictureRun {
|
||||
const run = new PictureRun(imagePath);
|
||||
public createPictureRun(imageData: IData): PictureRun {
|
||||
const run = new PictureRun(imageData);
|
||||
this.addRun(run);
|
||||
return run;
|
||||
}
|
||||
|
@ -1,10 +1,16 @@
|
||||
import { IData } from "../../media/data";
|
||||
import { Run } from "../run";
|
||||
import { Drawing } from "./run-components/drawing";
|
||||
|
||||
export class PictureRun extends Run {
|
||||
|
||||
constructor(imagePath: string) {
|
||||
constructor(imageData: IData) {
|
||||
super();
|
||||
this.root.push(new Drawing(imagePath));
|
||||
|
||||
if (imageData === undefined) {
|
||||
throw new Error("imageData cannot be undefined");
|
||||
}
|
||||
|
||||
this.root.push(new Drawing(imageData));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user