// http://officeopenxml.com/WPalignment.php // http://officeopenxml.com/WPtableAlignment.php // http://www.datypic.com/sc/ooxml/t-w_ST_Jc.html import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; // // // // // // // // // // // // // // // // /* eslint-disable @typescript-eslint/naming-convention */ export const AlignmentType = { /** Align Start */ START: "start", /** Align Center */ CENTER: "center", /** End */ END: "end", /** Justified */ BOTH: "both", /** Medium Kashida Length */ MEDIUM_KASHIDA: "mediumKashida", /** Distribute All Characters Equally */ DISTRIBUTE: "distribute", /** Align to List Tab */ NUM_TAB: "numTab", /** Widest Kashida Length */ HIGH_KASHIDA: "highKashida", /** Low Kashida Length */ LOW_KASHIDA: "lowKashida", /** Thai Language Justification */ THAI_DISTRIBUTE: "thaiDistribute", /** Align Left */ LEFT: "left", /** Align Right */ RIGHT: "right", /** Justified */ JUSTIFIED: "both", } as const; /* eslint-enable */ export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: (typeof AlignmentType)[keyof typeof AlignmentType]; }> { protected readonly xmlKeys = { val: "w:val" }; } export class Alignment extends XmlComponent { public constructor(type: (typeof AlignmentType)[keyof typeof AlignmentType]) { super("w:jc"); this.root.push(new AlignmentAttributes({ val: type })); } }