// add MHT as external file

import { CreateDocx, OptionsAltchunk } from "../../../build";
import * as fs from "fs";

const docx = new CreateDocx();

const fileMht = fs.readFileSync("../../files/Test.mht");

docx.addText(
    "Insert a MHT fike (this method is not supported by all DOCX readers):"
);

const externalFile: OptionsAltchunk = {
    file: fileMht,
    type: "mht",
};
docx.addExternalFile(externalFile);

docx.addText("A new paragraph");

docx.save().then(contents => {
    fs.writeFileSync("addExternalFile_4.docx", Buffer.from(contents));
});
