@plait/draw 0.86.1 → 0.87.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { PlaitGeometry, ShapeEngine } from '../../interfaces';
3
3
  import { Options } from 'roughjs/bin/core';
4
4
  export interface CreateEllipseOptions {
5
5
  draw?: (board: PlaitBoard, rectangle: RectangleClient, options: Options) => SVGGElement;
6
- getTextRectangle?: (element: PlaitGeometry) => RectangleClient;
6
+ getTextRectangle?: (board: PlaitBoard, element: PlaitGeometry) => RectangleClient;
7
7
  }
8
8
  export declare function createEllipseEngine(createOptions?: CreateEllipseOptions): ShapeEngine;
9
9
  export declare const EllipseEngine: ShapeEngine;
@@ -1,8 +1,8 @@
1
- import { Point, RectangleClient } from '@plait/core';
1
+ import { PlaitBoard, Point, RectangleClient } from '@plait/core';
2
2
  import { PlaitGeometry, ShapeEngine } from '../../interfaces';
3
3
  export interface CreateOptions {
4
4
  getPolygonPoints: (rectangle: RectangleClient) => Point[];
5
5
  getConnectorPoints?: (rectangle: RectangleClient) => Point[];
6
- getTextRectangle?: (element: PlaitGeometry) => RectangleClient;
6
+ getTextRectangle?: (board: PlaitBoard, element: PlaitGeometry) => RectangleClient;
7
7
  }
8
8
  export declare function createPolygonEngine(options: CreateOptions): ShapeEngine;
@@ -1,16 +1,24 @@
1
+ import { PlaitBoard, RectangleClient } from '@plait/core';
1
2
  import { ShapeEngine } from '../../interfaces';
2
3
  import { DrawTextInfo } from '../../generators/text.generator';
3
4
  import { PlaitTable, PlaitTableCellWithPoints, PlaitTableDrawOptions } from '../../interfaces/table';
4
5
  export declare const TableEngine: ShapeEngine<PlaitTable, PlaitTableDrawOptions, DrawTextInfo>;
5
- export declare function getVerticalTextRectangle(cell: PlaitTableCellWithPoints): {
6
+ export declare function getVerticalTextRectangle(board: PlaitBoard, cell: PlaitTableCellWithPoints): {
6
7
  width: number;
7
8
  height: number;
8
9
  x: number;
9
10
  y: number;
10
11
  };
11
- export declare function getHorizontalTextRectangle(cell: PlaitTableCellWithPoints): {
12
+ export declare function getHorizontalTextRectangle(board: PlaitBoard, cell: PlaitTableCellWithPoints): {
13
+ width: number;
12
14
  height: number;
15
+ x: number;
16
+ y: number;
17
+ };
18
+ export declare function getTextRectangle(board: PlaitBoard, cell: PlaitTableCellWithPoints, width: number, cellRectangle: RectangleClient): {
13
19
  width: number;
14
- x: any;
20
+ height: number;
21
+ x: number;
15
22
  y: number;
16
23
  };
24
+ export declare const getCellTextHeight: (board: PlaitBoard, cell: PlaitTableCellWithPoints, isVertical?: boolean) => number;