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

16 lines
510 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";
export type AlignmentOptions = "left" | "center" | "right" | "both";
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 }));
}
}