added more boilerplate files to drawing

This commit is contained in:
Dolan Miu
2017-03-12 23:31:43 +00:00
parent 64d642b593
commit 8d72fa5542
7 changed files with 37 additions and 9 deletions

View File

@ -2,4 +2,6 @@ export { Document } from "./document";
export { Paragraph } from "./paragraph"; export { Paragraph } from "./paragraph";
export { Run } from "./run"; export { Run } from "./run";
export { TextRun } from "./run/text-run"; export { TextRun } from "./run/text-run";
export { PictureRun } from "./run/picture-run";
export { Table } from "./table"; export { Table } from "./table";
// Perhaps all run related stuff can be exported from run, instead of exporting Run, TextRun, PictureRun seperately.

View File

@ -0,0 +1,10 @@
import { Run } from "../run";
import { Drawing } from "./run-components/drawing";
export class PictureRun extends Run {
constructor(imagePath: string) {
super();
this.root.push(new Drawing(imagePath));
}
}

View File

@ -2,7 +2,7 @@ import { XmlComponent } from "../../../xml-components";
export class Drawing extends XmlComponent { export class Drawing extends XmlComponent {
constructor() { constructor(imagePath: string) {
super("w:drawing"); super("w:drawing");
} }
} }

View File

@ -1,8 +0,0 @@
import { XmlComponent } from "../../../xml-components";
export class Inline extends XmlComponent {
constructor() {
super("w:drawing");
}
}

View File

@ -0,0 +1,8 @@
import { XmlComponent } from "../../../../../../xml-components";
export class Graphic extends XmlComponent {
constructor() {
super("a:graphicData");
}
}

View File

@ -0,0 +1,8 @@
import { XmlComponent } from "../../../../../xml-components";
export class Graphic extends XmlComponent {
constructor() {
super("a:graphic");
}
}

View File

@ -0,0 +1,8 @@
import { XmlComponent } from "../../../../xml-components";
export class Inline extends XmlComponent {
constructor() {
super("wp:inline");
}
}