Increase readability for enums

This commit is contained in:
Dolan Miu
2020-05-13 02:51:47 +01:00
parent 25a7ce3742
commit b4f1c4dd6a
3 changed files with 8 additions and 8 deletions

View File

@ -19,11 +19,11 @@ const table = new Table({
}), }),
new TableCell({ new TableCell({
children: [new Paragraph({ text: "bottom to top" }), new Paragraph({})], children: [new Paragraph({ text: "bottom to top" }), new Paragraph({})],
textDirection: TextDirection.BOTTOMTOTOPLEFTTORIGHT textDirection: TextDirection.BOTTOM_TO_TOP_LEFT_TO_RIGHT,
}), }),
new TableCell({ new TableCell({
children: [new Paragraph({ text: "top to bottom" }), new Paragraph({})], children: [new Paragraph({ text: "top to bottom" }), new Paragraph({})],
textDirection: TextDirection.TOPTOBOTTOMRIGHTTOLEFT textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
}), }),
], ],
}), }),

View File

@ -159,9 +159,9 @@ export class VAlign extends XmlComponent {
} }
export enum TextDirection { export enum TextDirection {
BOTTOMTOTOPLEFTTORIGHT = "btLr", BOTTOM_TO_TOP_LEFT_TO_RIGHT = "btLr",
LEFTTORIGHTTOPTOBOTTOM = "lrTb", LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb",
TOPTOBOTTOMRIGHTTOLEFT = "tbRl", TOP_TO_BOTTOM_RIGHT_TO_LEFT = "tbRl",
} }
class TDirectionAttributes extends XmlAttributeComponent<{ readonly val: TextDirection }> { class TDirectionAttributes extends XmlAttributeComponent<{ readonly val: TextDirection }> {

View File

@ -274,7 +274,7 @@ describe("TableCell", () => {
it("should create with text direction", () => { it("should create with text direction", () => {
const cell = new TableCell({ const cell = new TableCell({
children: [], children: [],
textDirection: TextDirection.BOTTOMTOTOPLEFTTORIGHT, textDirection: TextDirection.BOTTOM_TO_TOP_LEFT_TO_RIGHT,
}); });
const tree = new Formatter().format(cell); const tree = new Formatter().format(cell);