// create an apply a custom paragraph style

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

const docx = new CreateDocx();

// create a custom paragraph style
const paragraphStyle: OptionsParagraph = {
    align: "center",
    bold: true,
    color: "698026",
    keepNext: true,
    underline: "single",
};
docx.createParagraphStyle("myStyle", paragraphStyle);

const text = "New text content.";

const optionsParagraph: OptionsParagraph = {
    pStyle: "myStyle",
};

docx.addText(text, optionsParagraph);

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