Files
docx-js/src/file/paragraph/formatting/alignment.ts

16 lines
543 B
TypeScript
Raw Normal View History

2017-09-22 14:46:19 +01:00
// http://officeopenxml.com/WPalignment.php
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
2018-07-25 15:02:58 +03:00
export type AlignmentOptions = "start" | "end" | "center" | "both" | "distribute" | "left" | "right";
2018-01-23 01:33:12 +00:00
export class AlignmentAttributes extends XmlAttributeComponent<{ val: AlignmentOptions }> {
protected xmlKeys = { val: "w:val" };
}
export class Alignment extends XmlComponent {
constructor(type: AlignmentOptions) {
super("w:jc");
2018-01-23 01:33:12 +00:00
this.root.push(new AlignmentAttributes({ val: type }));
}
}