Files
docx-js/src/file/paragraph/properties.ts

23 lines
608 B
TypeScript
Raw Normal View History

2017-09-21 14:56:46 +01:00
// http://officeopenxml.com/WPparagraphProperties.php
import { IgnoreIfEmptyXmlComponent, XmlComponent } from "file/xml-components";
2016-03-30 00:28:05 +01:00
2019-06-12 01:03:36 +01:00
import { Border, IBorderOptions } from "./formatting/border";
interface IParagraphPropertiesOptions {
readonly border?: IBorderOptions;
}
2019-06-12 01:03:36 +01:00
export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
constructor(options: IParagraphPropertiesOptions) {
super("w:pPr");
2019-06-12 01:03:36 +01:00
if (options.border) {
this.push(new Border(options.border));
}
2016-03-30 00:28:05 +01:00
}
2017-03-08 21:36:09 +00:00
public push(item: XmlComponent): void {
2016-04-09 20:16:35 +01:00
this.root.push(item);
2016-03-30 00:28:05 +01:00
}
2017-03-08 21:36:09 +00:00
}