// http://officeopenxml.com/WPtableRowProperties.php // // // // // // // // // // // // // // // // // // // // // // // // // // // import { IgnoreIfEmptyXmlComponent, OnOffElement } from "@file/xml-components"; import { PositiveUniversalMeasure } from "@util/values"; import { HeightRule, TableRowHeight } from "./table-row-height"; export interface ITableRowPropertiesOptions { readonly cantSplit?: boolean; readonly tableHeader?: boolean; readonly height?: { readonly value: number | PositiveUniversalMeasure; readonly rule: (typeof HeightRule)[keyof typeof HeightRule]; }; } export class TableRowProperties extends IgnoreIfEmptyXmlComponent { public constructor(options: ITableRowPropertiesOptions) { super("w:trPr"); if (options.cantSplit !== undefined) { this.root.push(new OnOffElement("w:cantSplit", options.cantSplit)); } if (options.tableHeader !== undefined) { this.root.push(new OnOffElement("w:tblHeader", options.tableHeader)); } if (options.height) { this.root.push(new TableRowHeight(options.height.value, options.height.rule)); } } }