diff --git a/src/file/paragraph/formatting/alignment.ts b/src/file/paragraph/formatting/alignment.ts index fbf0fdcdae..b1fa0ca2af 100644 --- a/src/file/paragraph/formatting/alignment.ts +++ b/src/file/paragraph/formatting/alignment.ts @@ -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" }; diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index 35faf62005..3695b70bd5 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -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;