#750 Add widow control

This commit is contained in:
Dolan
2021-03-13 04:07:44 +00:00
parent 2391375ac0
commit 8724fbe7a7
6 changed files with 93 additions and 5 deletions

View File

@ -12,6 +12,7 @@ import { ContextualSpacing, ISpacingProperties, Spacing } from "./formatting/spa
import { HeadingLevel, Style } from "./formatting/style";
import { LeaderType, TabStop, TabStopPosition, TabStopType } from "./formatting/tab-stop";
import { NumberProperties } from "./formatting/unordered-list";
import { WidowControl } from "./formatting/widow-control";
import { OutlineLevel } from "./links";
import { Shading } from "./run/formatting";
@ -53,6 +54,7 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp
readonly fill: string;
readonly color: string;
};
readonly widowControl?: boolean;
}
export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
@ -153,6 +155,10 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
if (options.shading) {
this.push(new Shading(options.shading.type, options.shading.fill, options.shading.color));
}
if (options.widowControl) {
this.push(new WidowControl(options.widowControl));
}
}
public push(item: XmlComponent): void {