added place holders for style and properties

This commit is contained in:
Dolan Miu
2016-04-01 04:09:24 +01:00
parent 620f275cf5
commit a70e82a7d0
5 changed files with 13 additions and 4 deletions

View File

@ -16,4 +16,8 @@ export class Body {
this.body.push(new Columns()); this.body.push(new Columns());
this.body.push(new DocumentGrid()); this.body.push(new DocumentGrid());
} }
push(component: XmlComponent) {
this.body.push(component);
}
} }

View File

@ -1,16 +1,19 @@
import {XmlComponent, Attributes} from "../xml-components"; import {XmlComponent, Attributes} from "../xml-components";
import {Body} from "./body"; import {Body} from "./body";
import {Paragraph} from "../paragraph";
export class Document { export class Document {
private document: Array<XmlComponent>; private document: Array<XmlComponent>;
private body: Body;
constructor() { constructor() {
this.document = new Array<XmlComponent>(); this.document = new Array<XmlComponent>();
this.document.push(new Attributes({})); this.document.push(new Attributes({}));
this.document.push(new Body()); this.body = new Body();
this.document.push(this.body);
} }
test() { addParagraph(paragraph: Paragraph) {
return "hello"; this.body.push(paragraph);
} }
} }

View File

@ -2,13 +2,15 @@ import * as archiver from "archiver";
import * as fs from "fs"; import * as fs from "fs";
import {Formatter} from "../formatter"; import {Formatter} from "../formatter";
import {Document} from "../../docx"; import {Document} from "../../docx";
import {Style} from "../../style";
import {Properties} from "../../properties";
export abstract class Packer { export abstract class Packer {
protected archive: any; protected archive: any;
private formatter: Formatter; private formatter: Formatter;
protected document: Document; protected document: Document;
constructor(document: Document) { constructor(document: Document, style: Style, properties: Properties) {
this.formatter = new Formatter(); this.formatter = new Formatter();
this.document = document; this.document = document;
this.archive = archiver.create("zip", {}); this.archive = archiver.create("zip", {});

0
ts/properties/index.ts Normal file
View File

0
ts/style/index.ts Normal file
View File