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 { Num } from "../../numbering/num";
|
||||||
import { Run } from "../run";
|
import { Run } from "../run";
|
||||||
import { PictureRun } from "../run/picture-run";
|
import { PictureRun } from "../run/picture-run";
|
||||||
@ -37,8 +38,8 @@ export class Paragraph extends XmlComponent {
|
|||||||
return run;
|
return run;
|
||||||
}
|
}
|
||||||
|
|
||||||
public createPictureRun(imagePath: string): PictureRun {
|
public createPictureRun(imageData: IData): PictureRun {
|
||||||
const run = new PictureRun(imagePath);
|
const run = new PictureRun(imageData);
|
||||||
this.addRun(run);
|
this.addRun(run);
|
||||||
return run;
|
return run;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
|
import { IData } from "../../media/data";
|
||||||
import { Run } from "../run";
|
import { Run } from "../run";
|
||||||
import { Drawing } from "./run-components/drawing";
|
import { Drawing } from "./run-components/drawing";
|
||||||
|
|
||||||
export class PictureRun extends Run {
|
export class PictureRun extends Run {
|
||||||
|
|
||||||
constructor(imagePath: string) {
|
constructor(imageData: IData) {
|
||||||
super();
|
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