2017-09-22 14:46:19 +01:00
|
|
|
// http://officeopenxml.com/WPalignment.php
|
2017-09-30 01:52:37 +01:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
2017-03-12 21:35:30 +01:00
|
|
|
|
2017-07-07 14:31:08 +01:00
|
|
|
export type AlignmentOptions = "left" | "center" | "right" | "both";
|
2017-03-12 21:35:30 +01:00
|
|
|
|
2017-07-07 14:31:08 +01:00
|
|
|
export class AlignmentAttributes extends XmlAttributeComponent<{val: AlignmentOptions}> {
|
2017-03-12 21:35:30 +01:00
|
|
|
protected xmlKeys = {val: "w:val"};
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Alignment extends XmlComponent {
|
|
|
|
|
2017-07-07 14:31:08 +01:00
|
|
|
constructor(type: AlignmentOptions) {
|
2017-03-12 21:35:30 +01:00
|
|
|
super("w:jc");
|
|
|
|
this.root.push(new AlignmentAttributes({val: type}));
|
|
|
|
}
|
|
|
|
}
|