Declarative styles

This commit is contained in:
Dolan
2019-10-04 01:20:41 +01:00
parent 2536fbe752
commit 591b2f4e04
20 changed files with 920 additions and 484 deletions

View File

@ -4,3 +4,4 @@ export * from "./symbol-run";
export * from "./picture-run";
export * from "./run-fonts";
export * from "./sequential-identifier";
export * from "./underline";

View File

@ -27,7 +27,7 @@ describe("Underline", () => {
});
it("should use the given style type and color", () => {
const underline = new u.Underline("double", "FF00CC");
const underline = new u.Underline(u.UnderlineType.DOUBLE, "FF00CC");
const tree = new Formatter().format(underline);
expect(tree).to.deep.equal({
"w:u": { _attr: { "w:val": "double", "w:color": "FF00CC" } },

View File

@ -33,7 +33,7 @@ export abstract class BaseUnderline extends XmlComponent {
}
export class Underline extends BaseUnderline {
constructor(underlineType: string = "single", color?: string) {
constructor(underlineType: UnderlineType = UnderlineType.SINGLE, color?: string) {
super(underlineType, color);
}
}