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