diff --git a/ts/docx/document/body/index.ts b/ts/docx/document/body/index.ts index df1cc8c166..0ca5a94dbc 100644 --- a/ts/docx/document/body/index.ts +++ b/ts/docx/document/body/index.ts @@ -16,4 +16,8 @@ export class Body { this.body.push(new Columns()); this.body.push(new DocumentGrid()); } + + push(component: XmlComponent) { + this.body.push(component); + } } diff --git a/ts/docx/document/index.ts b/ts/docx/document/index.ts index ad5ab4a955..d78fa8992d 100644 --- a/ts/docx/document/index.ts +++ b/ts/docx/document/index.ts @@ -1,16 +1,19 @@ import {XmlComponent, Attributes} from "../xml-components"; import {Body} from "./body"; +import {Paragraph} from "../paragraph"; export class Document { private document: Array; + private body: Body; constructor() { this.document = new Array(); this.document.push(new Attributes({})); - this.document.push(new Body()); + this.body = new Body(); + this.document.push(this.body); } - test() { - return "hello"; + addParagraph(paragraph: Paragraph) { + this.body.push(paragraph); } } \ No newline at end of file diff --git a/ts/export/packer/packer.ts b/ts/export/packer/packer.ts index 0421d2e6d3..461f514052 100644 --- a/ts/export/packer/packer.ts +++ b/ts/export/packer/packer.ts @@ -2,13 +2,15 @@ import * as archiver from "archiver"; import * as fs from "fs"; import {Formatter} from "../formatter"; import {Document} from "../../docx"; +import {Style} from "../../style"; +import {Properties} from "../../properties"; export abstract class Packer { protected archive: any; private formatter: Formatter; protected document: Document; - constructor(document: Document) { + constructor(document: Document, style: Style, properties: Properties) { this.formatter = new Formatter(); this.document = document; this.archive = archiver.create("zip", {}); diff --git a/ts/properties/index.ts b/ts/properties/index.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ts/style/index.ts b/ts/style/index.ts new file mode 100644 index 0000000000..e69de29bb2