// Note that the border type is identical in all places,
// regardless of where it's used like paragraph/table/etc.
//
// http://officeopenxml.com/WPborders.php
// http://officeopenxml.com/WPtableBorders.php
// http://officeopenxml.com/WPtableCellProperties-Borders.php
//
// This describes the CT_Border type.
//
//
//
//
//
//
//
//
//
//
//
import { BorderStyle } from "file/styles";
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export interface IBorderOptions {
readonly style: BorderStyle;
readonly color?: string;
readonly size?: number;
readonly space?: number;
}
export class BorderElement extends XmlComponent {
constructor(elementName: string, options: IBorderOptions) {
super(elementName);
this.root.push(new TableBordersAttributes(options));
}
}
class TableBordersAttributes extends XmlAttributeComponent {
protected readonly xmlKeys = {
style: "w:val",
color: "w:color",
size: "w:sz",
space: "w:space",
};
}