Inline single use interfaces
This commit is contained in:
@ -1,12 +1,10 @@
|
||||
// http://officeopenxml.com/WPtableCellProperties-Margins.php
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export interface ICellMarginProperties {
|
||||
class CellMarginAttributes extends XmlAttributeComponent<{
|
||||
readonly type: string;
|
||||
readonly width: number;
|
||||
}
|
||||
|
||||
class CellMarginAttributes extends XmlAttributeComponent<ICellMarginProperties> {
|
||||
}> {
|
||||
protected readonly xmlKeys = { width: "w:w", type: "w:type" };
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,11 @@
|
||||
import { BorderStyle } from "file/styles";
|
||||
import { IgnoreIfEmptyXmlComponent, XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
interface ICellBorder {
|
||||
class CellBorderAttributes extends XmlAttributeComponent<{
|
||||
readonly style: BorderStyle;
|
||||
readonly size: number;
|
||||
readonly color: string;
|
||||
}
|
||||
|
||||
class CellBorderAttributes extends XmlAttributeComponent<ICellBorder> {
|
||||
}> {
|
||||
protected readonly xmlKeys = { style: "w:val", size: "w:sz", color: "w:color" };
|
||||
}
|
||||
|
||||
|
@ -3,12 +3,10 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
import { WidthType } from "../table-cell";
|
||||
|
||||
interface ITableWidth {
|
||||
class TableWidthAttributes extends XmlAttributeComponent<{
|
||||
readonly type: WidthType;
|
||||
readonly w: number | string;
|
||||
}
|
||||
|
||||
class TableWidthAttributes extends XmlAttributeComponent<ITableWidth> {
|
||||
}> {
|
||||
protected readonly xmlKeys = { type: "w:type", w: "w:w" };
|
||||
}
|
||||
|
||||
|
@ -9,12 +9,10 @@ export enum HeightRule {
|
||||
EXACT = "exact",
|
||||
}
|
||||
|
||||
interface ITableRowHeight {
|
||||
export class TableRowHeightAttributes extends XmlAttributeComponent<{
|
||||
readonly value: number;
|
||||
readonly rule: HeightRule;
|
||||
}
|
||||
|
||||
export class TableRowHeightAttributes extends XmlAttributeComponent<ITableRowHeight> {
|
||||
}> {
|
||||
protected readonly xmlKeys = { value: "w:val", rule: "w:hRule" };
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user