diff --git a/ts/docx/run/run-components/drawing/index.ts b/ts/docx/run/run-components/drawing/index.ts index 3e9d1a883d..3b1d187f0d 100644 --- a/ts/docx/run/run-components/drawing/index.ts +++ b/ts/docx/run/run-components/drawing/index.ts @@ -1,13 +1,12 @@ +import { IData } from "../../../../media/data"; import { XmlComponent } from "../../../xml-components"; import { Inline } from "./inline"; export class Drawing extends XmlComponent { - constructor(imagePath: string) { + constructor(imageData: IData) { super("w:drawing"); - // store in the document, then get Id - - this.root.push(new Inline(5)); + this.root.push(new Inline(imageData.referenceId)); } } diff --git a/ts/media/data.ts b/ts/media/data.ts new file mode 100644 index 0000000000..ada1231659 --- /dev/null +++ b/ts/media/data.ts @@ -0,0 +1,8 @@ +import * as fs from "fs"; + +export interface IData { + referenceId: number; + stream: fs.ReadStream; + path: string; + fileName: string; +} diff --git a/ts/media/index.ts b/ts/media/index.ts index f07ad69de5..7f6ef61b7e 100644 --- a/ts/media/index.ts +++ b/ts/media/index.ts @@ -1,12 +1,6 @@ import * as fs from "fs"; import * as path from "path"; - -interface IData { - referenceId: number; - stream: fs.ReadStream; - path: string; - fileName: string; -} +import { IData } from "./data"; export class Media { private map: Map;