2016-03-31 18:03:16 +01:00
|
|
|
import {Packer} from "./packer";
|
2016-05-26 15:08:34 +01:00
|
|
|
import * as fs from "fs";
|
2016-03-31 23:36:42 +01:00
|
|
|
import {Document} from "../../docx/document";
|
2016-04-05 01:49:12 +01:00
|
|
|
import {Properties} from "../../properties";
|
2016-05-23 22:23:05 +01:00
|
|
|
import {Numbering} from "../../numbering";
|
2016-03-31 18:03:16 +01:00
|
|
|
|
|
|
|
export class LocalPacker extends Packer {
|
2016-05-26 15:08:34 +01:00
|
|
|
private stream: fs.WriteStream;
|
|
|
|
|
2016-05-23 22:23:05 +01:00
|
|
|
constructor(document: Document, style: any, properties: Properties, path: string, numbering?: Numbering) {
|
2016-05-26 15:08:34 +01:00
|
|
|
|
2016-05-23 22:23:05 +01:00
|
|
|
if (!numbering) {
|
|
|
|
numbering = new Numbering();
|
|
|
|
}
|
2016-05-26 15:08:34 +01:00
|
|
|
|
2016-05-23 22:23:05 +01:00
|
|
|
super(document, style, properties, numbering);
|
2016-03-31 18:03:16 +01:00
|
|
|
this.stream = fs.createWriteStream(path);
|
|
|
|
}
|
2016-05-26 15:08:34 +01:00
|
|
|
|
|
|
|
pack(): void {
|
|
|
|
super.pack(this.stream);
|
|
|
|
}
|
2016-03-31 18:03:16 +01:00
|
|
|
}
|