// add links to URLs

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

const docx = new CreateDocx();

const linkA: OptionsLink = {
    link: "https://www.phpdocx.com",
    text: "Link to phpdocx.",
};
docx.addLink(linkA);

docx.addText("The same link with some additional formatting:");

const linkB: OptionsLink = {
    link: "https://www.phpdocx.com",
    color: "B70000",
    text: "Link to phpdocx in red color and not underlined.",
    underline: "none",
};
docx.addLink(linkB);

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