@plait/draw
Version:
Implementation of the core logic of the flowchart drawing tool plugin.
50 lines (49 loc) • 1.36 kB
TypeScript
import { PlaitBoard, PlaitElement, Point } from '@plait/core';
import { ParagraphElement } from '@plait/common';
import { DrawOptions } from './engine';
export declare enum TableSymbols {
table = "table"
}
export interface PlaitTableBoard extends PlaitBoard {
buildTable: (element: PlaitBaseTable) => PlaitBaseTable;
}
export interface PlaitBaseTable extends PlaitElement {
id: string;
points: Point[];
rows: {
id: string;
height?: number;
}[];
columns: {
id: string;
width?: number;
}[];
cells: PlaitTableCell[];
groupId?: string;
}
export interface PlaitTable extends PlaitBaseTable {
type: 'table';
}
export interface PlaitTableCell {
id: string;
rowId: string;
columnId: string;
colspan?: number;
rowspan?: number;
text?: PlaitTableCellParagraph;
textHeight?: number;
fill?: string;
}
export interface PlaitTableDrawOptions extends DrawOptions {
element: PlaitTable;
}
export interface PlaitTableCellWithPoints extends PlaitTableCell {
points: [Point, Point];
}
export interface PlaitTableCellParagraph extends ParagraphElement {
direction?: 'vertical' | 'horizontal';
}
export declare const PlaitTableElement: {
isTable: (value: any) => value is PlaitTable;
isVerticalText: (value: PlaitTableCell) => value is PlaitTableCell;
};