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,6 +1,6 @@
import {
Alignment,
AlignmentOptions,
AlignmentType,
Indent,
ISpacingProperties,
KeepLines,
@ -24,7 +24,7 @@ export class ParagraphStyle extends Style {
constructor(styleId: string, name?: string) {
super({ type: "paragraph", styleId: styleId }, name);
this.paragraphProperties = new ParagraphProperties();
this.paragraphProperties = new ParagraphProperties({});
this.runProperties = new RunProperties();
this.root.push(this.paragraphProperties);
this.root.push(this.runProperties);
@ -35,7 +35,7 @@ export class ParagraphStyle extends Style {
return this;
}
public outlineLevel(level: string): ParagraphStyle {
public outlineLevel(level: number): ParagraphStyle {
this.paragraphProperties.push(new OutlineLevel(level));
return this;
}
@ -117,19 +117,19 @@ export class ParagraphStyle extends Style {
// --------------------- Paragraph formatting ------------------------ //
public center(): ParagraphStyle {
return this.addParagraphProperty(new Alignment(AlignmentOptions.CENTER));
return this.addParagraphProperty(new Alignment(AlignmentType.CENTER));
}
public left(): ParagraphStyle {
return this.addParagraphProperty(new Alignment(AlignmentOptions.LEFT));
return this.addParagraphProperty(new Alignment(AlignmentType.LEFT));
}
public right(): ParagraphStyle {
return this.addParagraphProperty(new Alignment(AlignmentOptions.RIGHT));
return this.addParagraphProperty(new Alignment(AlignmentType.RIGHT));
}
public justified(): ParagraphStyle {
return this.addParagraphProperty(new Alignment(AlignmentOptions.BOTH));
return this.addParagraphProperty(new Alignment(AlignmentType.BOTH));
}
public thematicBreak(): ParagraphStyle {