Make Paragraph declaritive

This commit is contained in:
Dolan
2019-06-12 01:03:36 +01:00
parent 5c1a731314
commit cb42c74a8d
33 changed files with 451 additions and 497 deletions

View File

@ -1,22 +1,23 @@
// http://officeopenxml.com/WPalignment.php
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export enum AlignmentOptions {
export enum AlignmentType {
START = "start",
END = "end",
CENTER = "center",
BOTH = "both",
JUSTIFIED = "both",
DISTRIBUTE = "distribute",
LEFT = "left",
RIGHT = "right",
}
export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentOptions }> {
export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> {
protected readonly xmlKeys = { val: "w:val" };
}
export class Alignment extends XmlComponent {
constructor(type: AlignmentOptions) {
constructor(type: AlignmentType) {
super("w:jc");
this.root.push(new AlignmentAttributes({ val: type }));
}