Move ts to src folder for standards

This commit is contained in:
Dolan
2017-12-15 00:01:59 +00:00
parent cf1689a3c2
commit 01950ed443
122 changed files with 5 additions and 5 deletions

View File

@ -0,0 +1,31 @@
import * as express from "express";
import { Document } from "../../docx/document";
import { Media } from "../../media";
import { Numbering } from "../../numbering";
import { Properties } from "../../properties";
import { Styles } from "../../styles";
import { Compiler } from "./compiler";
import { IPacker } from "./packer";
export class ExpressPacker implements IPacker {
private res: express.Response;
private packer: Compiler;
constructor(document: Document, res: express.Response, styles?: Styles, properties?: Properties, numbering?: Numbering, media?: Media) {
this.packer = new Compiler(document, styles, properties, numbering, media);
this.res = res;
this.res.on("close", () => {
return res.status(200).send("OK").end();
});
}
public async pack(name: string): Promise<void> {
name = name.replace(/.docx$/, "");
this.res.attachment(`${name}.docx`);
await this.packer.compile(this.res);
}
}