more alignments

This commit is contained in:
amitm02
2018-07-25 13:07:58 +03:00
parent 41308fea13
commit e136f4e987
2 changed files with 16 additions and 1 deletions

View File

@ -1,7 +1,7 @@
// http://officeopenxml.com/WPalignment.php
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export type AlignmentOptions = "left" | "center" | "right" | "both";
export type AlignmentOptions = "start" | "end" | "center" | "both" | "distribute" | "left" | "right";
export class AlignmentAttributes extends XmlAttributeComponent<{ val: AlignmentOptions }> {
protected xmlKeys = { val: "w:val" };

View File

@ -110,6 +110,21 @@ export class Paragraph extends XmlComponent {
return this;
}
public start(): Paragraph {
this.properties.push(new Alignment("start"));
return this;
}
public end(): Paragraph {
this.properties.push(new Alignment("end"));
return this;
}
public distribute(): Paragraph {
this.properties.push(new Alignment("distribute"));
return this;
}
public justified(): Paragraph {
this.properties.push(new Alignment("both"));
return this;