2020-02-13 09:14:06 +02:00
|
|
|
import { ParagraphJSON } from "./paragraph";
|
|
|
|
import { BorderJSON } from "./border";
|
2021-03-02 05:31:46 +02:00
|
|
|
import { HeightRule } from "../table-row";
|
2021-03-03 03:35:50 +02:00
|
|
|
import { TextDirectionType } from "../table-cell";
|
2021-03-18 12:02:28 +02:00
|
|
|
import { ShadingJSON } from "./shading";
|
2021-03-23 05:01:09 +02:00
|
|
|
import { TableLayoutType } from "../table";
|
2024-03-25 08:37:32 +02:00
|
|
|
import { DeleteJSONData, InsertJSONData, TableCellBordersJSON } from "..";
|
2023-03-16 11:48:24 +02:00
|
|
|
import { StructuredTagJSON } from "./structured-data-tag";
|
2020-02-13 09:14:06 +02:00
|
|
|
|
2024-03-25 08:37:32 +02:00
|
|
|
export { TableCellBorder as TableCellBorderJSON } from "./bindings/TableCellBorder";
|
|
|
|
|
|
|
|
export { TableCellBorders as TableCellBordersJSON } from "./bindings/TableCellBorders";
|
|
|
|
|
2023-03-16 11:48:24 +02:00
|
|
|
export type TableCellChildJSON = ParagraphJSON | TableJSON | StructuredTagJSON;
|
2020-02-13 09:14:06 +02:00
|
|
|
|
2022-03-25 06:20:09 +02:00
|
|
|
export type WidthType = "dxa" | "auto" | "pct" | "nil";
|
|
|
|
|
2021-03-03 03:35:50 +02:00
|
|
|
export { TextDirectionType } from "../table-cell";
|
2020-02-13 09:14:06 +02:00
|
|
|
|
2021-03-02 05:31:46 +02:00
|
|
|
export { HeightRule } from "../table-row";
|
|
|
|
|
2020-02-13 09:14:06 +02:00
|
|
|
export type TableCellPropertyJSON = {
|
|
|
|
width: {
|
|
|
|
width: number;
|
|
|
|
widthType: WidthType;
|
|
|
|
} | null;
|
2024-03-25 08:37:32 +02:00
|
|
|
borders: TableCellBordersJSON | null;
|
2020-02-13 09:14:06 +02:00
|
|
|
gridSpan: number | null;
|
|
|
|
verticalMerge: "restart" | "continue" | null;
|
2020-03-19 18:19:39 +02:00
|
|
|
verticalAlign: "top" | "center" | "bottom" | null;
|
2021-03-03 03:35:50 +02:00
|
|
|
textDirection: TextDirectionType | null;
|
2021-03-18 12:02:28 +02:00
|
|
|
shading: ShadingJSON | null;
|
2024-03-25 08:37:32 +02:00
|
|
|
margins?: CellMarginsJSON;
|
2020-02-13 09:14:06 +02:00
|
|
|
};
|
|
|
|
|
2020-10-09 08:11:46 +03:00
|
|
|
export type TableRowPropertyJSON = {
|
|
|
|
gridAfter: number | null;
|
2021-05-11 05:01:35 +03:00
|
|
|
gridBefore: number | null;
|
2020-10-09 08:11:46 +03:00
|
|
|
rowHeight: number | null;
|
2021-03-02 05:31:46 +02:00
|
|
|
heightRule: HeightRule | null;
|
2020-10-09 08:11:46 +03:00
|
|
|
widthAfter: number | null;
|
2021-05-11 05:01:35 +03:00
|
|
|
widthBefore: number | null;
|
2022-10-26 11:32:07 +03:00
|
|
|
del?: DeleteJSONData;
|
|
|
|
ins?: InsertJSONData;
|
2020-10-09 08:11:46 +03:00
|
|
|
};
|
|
|
|
|
2020-02-13 09:14:06 +02:00
|
|
|
export type TableCellJSON = {
|
2022-01-24 15:48:01 +02:00
|
|
|
type: "tableCell";
|
|
|
|
data: {
|
|
|
|
children: TableCellChildJSON[];
|
|
|
|
property: TableCellPropertyJSON;
|
|
|
|
};
|
2020-02-13 09:14:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TableRowJSON = {
|
2022-01-24 15:48:01 +02:00
|
|
|
type: "tableRow";
|
|
|
|
data: {
|
|
|
|
cells: TableCellJSON[];
|
|
|
|
property: TableRowPropertyJSON;
|
|
|
|
};
|
2020-02-13 09:14:06 +02:00
|
|
|
};
|
|
|
|
|
2021-04-14 11:27:11 +03:00
|
|
|
export type TableCellMarginJSON = { val: number; widthType: WidthType };
|
|
|
|
|
|
|
|
export type TableCellMarginsJSON = {
|
|
|
|
top: TableCellMarginJSON;
|
|
|
|
left: TableCellMarginJSON;
|
|
|
|
bottom: TableCellMarginJSON;
|
|
|
|
right: TableCellMarginJSON;
|
|
|
|
};
|
|
|
|
|
2024-03-25 08:37:32 +02:00
|
|
|
export type CellMarginsJSON = {
|
|
|
|
top: TableCellMarginJSON;
|
|
|
|
left: TableCellMarginJSON;
|
|
|
|
bottom: TableCellMarginJSON;
|
|
|
|
right: TableCellMarginJSON;
|
|
|
|
};
|
|
|
|
|
2020-02-13 09:14:06 +02:00
|
|
|
export type TablePropertyJSON = {
|
|
|
|
width: {
|
|
|
|
width: number;
|
|
|
|
widthType: WidthType;
|
|
|
|
} | null;
|
|
|
|
justification: "left" | "center" | "right";
|
2022-11-02 06:58:58 +02:00
|
|
|
borders?: {
|
|
|
|
top?: BorderJSON | null;
|
|
|
|
left?: BorderJSON | null;
|
|
|
|
bottom?: BorderJSON | null;
|
|
|
|
right?: BorderJSON | null;
|
|
|
|
insideH?: BorderJSON | null;
|
|
|
|
insideV?: BorderJSON | null;
|
2020-02-13 09:14:06 +02:00
|
|
|
} | null;
|
2023-10-24 04:28:29 +03:00
|
|
|
margins?: TableCellMarginsJSON | null;
|
2022-11-02 06:58:58 +02:00
|
|
|
indent?: {
|
2020-02-13 09:14:06 +02:00
|
|
|
width: number;
|
|
|
|
widthType: WidthType;
|
2022-11-02 06:58:58 +02:00
|
|
|
} | null;
|
|
|
|
style?: string | null;
|
|
|
|
layout?: TableLayoutType | null;
|
2020-02-13 09:14:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TableJSON = {
|
|
|
|
type: "table";
|
|
|
|
data: {
|
|
|
|
rows: TableRowJSON[];
|
|
|
|
grid: number[];
|
|
|
|
hasNumbering: boolean;
|
|
|
|
property: TablePropertyJSON;
|
|
|
|
};
|
|
|
|
};
|