wordxml-builder
Version:
Librería TypeScript para construir documentos XML compatibles con Microsoft Word
109 lines (108 loc) • 2.15 kB
TypeScript
import { ParagraphStyle } from './paragraph';
/**
* Alineación de una celda
*/
export declare enum CellAlignment {
Top = "top",
Center = "center",
Bottom = "bottom",
Both = "both"
}
/**
* Dirección del texto en una celda
*/
export declare enum TextDirection {
LeftToRight = "lr",
RightToLeft = "rl",
TopToBottom = "tb",
BottomToTop = "bt"
}
/**
* Estilo de borde para celdas
*/
export interface CellBorder {
style: string;
size: number;
color: string;
space: number;
}
/**
* Configuración de bordes para una celda
*/
export interface CellBorders {
top?: CellBorder;
right?: CellBorder;
bottom?: CellBorder;
left?: CellBorder;
insideH?: CellBorder;
insideV?: CellBorder;
}
/**
* Configuración de sombreado para una celda
*/
export interface CellShading {
fill: string;
color?: string;
val?: string;
}
/**
* Configuración de una celda
*/
export interface CellStyle {
width?: number;
alignment?: CellAlignment;
textDirection?: TextDirection;
borders?: CellBorders;
shading?: CellShading;
paragraphStyle?: ParagraphStyle;
verticalMerge?: 'restart' | 'continue';
horizontalMerge?: 'restart' | 'continue';
gridSpan?: number;
}
/**
* Contenido de una celda
*/
export interface Cell {
content: string;
style?: CellStyle;
}
/**
* Configuración de una fila
*/
export interface RowStyle {
height?: number;
isHeader?: boolean;
cantSplit?: boolean;
cellStyle?: CellStyle;
}
/**
* Una fila de la tabla
*/
export interface Row {
cells: Cell[];
style?: RowStyle;
}
/**
* Configuración de la tabla
*/
export interface TableStyle {
width?: number;
alignment?: 'left' | 'center' | 'right';
borders?: CellBorders;
cellSpacing?: number;
cellPadding?: number;
headerRowStyle?: RowStyle;
rowStyle?: RowStyle;
headerCellStyle?: CellStyle;
leftHeaderCellStyle?: CellStyle;
cellStyle?: CellStyle;
}
/**
* Estructura completa de una tabla
*/
export interface Table {
headers: Cell[];
leftHeaders?: Cell[];
rows: Row[];
style?: TableStyle;
}