@yorab/react-paint 0.17.1 → 0.18.1

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.
Files changed (143) hide show
  1. package/README.md +4 -0
  2. package/dist/_chunks/array-DuJem3vg.js +1 -0
  3. package/dist/_chunks/canvas-DF1RWuxW.js +1 -0
  4. package/dist/_chunks/editor-DuVskl0R.js +1 -0
  5. package/dist/canvas/components/Canvas.d.ts +1 -52
  6. package/dist/canvas/constants/app.d.ts +3 -25
  7. package/dist/canvas/constants/rendering.d.ts +3 -0
  8. package/dist/canvas/constants/tools.d.ts +4 -0
  9. package/dist/canvas/context/CanvasContext.d.ts +55 -0
  10. package/dist/canvas/hooks/useDrawableCanvas.d.ts +2 -43
  11. package/dist/canvas/hooks/useEventListener.d.ts +2 -0
  12. package/dist/canvas/hooks/useReactPaint.d.ts +8 -3
  13. package/dist/canvas/hooks/useShapes.d.ts +1 -0
  14. package/dist/canvas/index.d.ts +4 -0
  15. package/dist/canvas/index.js +1 -0
  16. package/dist/canvas/utils/canvas.d.ts +2 -1
  17. package/dist/canvas/utils/intersect.d.ts +4 -0
  18. package/dist/canvas/utils/selection.d.ts +0 -3
  19. package/dist/canvas/utils/shapes/index.d.ts +2 -3
  20. package/dist/canvas/utils/shapes/line.d.ts +2 -2
  21. package/dist/canvas/utils/shapes/path.d.ts +1 -0
  22. package/dist/canvas/utils/tools.d.ts +1 -1
  23. package/dist/canvas/utils/transform.d.ts +0 -1
  24. package/dist/common/hooks/useDebounce.d.ts +2 -0
  25. package/dist/common/types/Settings.d.ts +24 -0
  26. package/dist/common/utils/selection.d.ts +4 -0
  27. package/dist/editor/components/settings/Layouts.d.ts +1 -1
  28. package/dist/editor/components/settings/SettingsBar.d.ts +4 -2
  29. package/dist/editor/components/toolbox/ContextMenu.d.ts +4 -2
  30. package/dist/editor/components/toolbox/Toolbar.d.ts +1 -1
  31. package/dist/editor/hooks/useMenu.d.ts +2 -1
  32. package/dist/editor/index.d.ts +3 -2
  33. package/dist/editor/index.js +1 -0
  34. package/dist/editor/utils/style.d.ts +1 -1
  35. package/dist/index.d.ts +4 -6
  36. package/dist/react-paint.css +2 -1
  37. package/dist/react-paint.js +1 -1914
  38. package/dist/react-paint.umd.cjs +1 -1
  39. package/dist/src/canvas/components/Canvas.d.ts +4 -0
  40. package/dist/src/canvas/components/EditTextBox.d.ts +13 -0
  41. package/dist/src/canvas/constants/app.d.ts +37 -0
  42. package/dist/src/canvas/constants/grid.d.ts +1 -0
  43. package/dist/src/canvas/constants/keyboard.d.ts +27 -0
  44. package/dist/src/canvas/constants/picture.d.ts +1 -0
  45. package/dist/src/canvas/constants/rendering.d.ts +3 -0
  46. package/dist/src/canvas/constants/shapes.d.ts +10 -0
  47. package/dist/src/canvas/constants/tools.d.ts +4 -0
  48. package/dist/src/canvas/constants/zoom.d.ts +5 -0
  49. package/dist/src/canvas/context/CanvasContext.d.ts +55 -0
  50. package/dist/src/canvas/hooks/useComponent.d.ts +12 -0
  51. package/dist/src/canvas/hooks/useDoubleClick.d.ts +5 -0
  52. package/dist/src/canvas/hooks/useDrawableCanvas.d.ts +6 -0
  53. package/dist/src/canvas/hooks/useEventListener.d.ts +2 -0
  54. package/dist/src/canvas/hooks/useKeyboard.d.ts +33 -0
  55. package/dist/src/canvas/hooks/usePinchZoomAndMove.d.ts +17 -0
  56. package/dist/src/canvas/hooks/useReactPaint.d.ts +164 -0
  57. package/dist/src/canvas/hooks/useResizeObserver.d.ts +6 -0
  58. package/dist/src/canvas/hooks/useShapes.d.ts +44 -0
  59. package/dist/src/canvas/hooks/useZoom.d.ts +22 -0
  60. package/dist/src/canvas/index.d.ts +19 -0
  61. package/dist/src/canvas/utils/canvas.d.ts +15 -0
  62. package/dist/src/canvas/utils/data.d.ts +5 -0
  63. package/dist/src/canvas/utils/file.d.ts +274 -0
  64. package/dist/src/canvas/utils/grid.d.ts +2 -0
  65. package/dist/src/canvas/utils/intersect.d.ts +27 -0
  66. package/dist/src/canvas/utils/selection/groupSelection.d.ts +4 -0
  67. package/dist/src/canvas/utils/selection/lineSelection.d.ts +19 -0
  68. package/dist/src/canvas/utils/selection/rectSelection.d.ts +20 -0
  69. package/dist/src/canvas/utils/selection/selectionFrame.d.ts +3 -0
  70. package/dist/src/canvas/utils/selection.d.ts +12 -0
  71. package/dist/src/canvas/utils/shapes/brush.d.ts +21 -0
  72. package/dist/src/canvas/utils/shapes/circle.d.ts +18 -0
  73. package/dist/src/canvas/utils/shapes/curve.d.ts +17 -0
  74. package/dist/src/canvas/utils/shapes/ellipse.d.ts +18 -0
  75. package/dist/src/canvas/utils/shapes/group.d.ts +33 -0
  76. package/dist/src/canvas/utils/shapes/index.d.ts +35 -0
  77. package/dist/src/canvas/utils/shapes/line.d.ts +19 -0
  78. package/dist/src/canvas/utils/shapes/path.d.ts +29 -0
  79. package/dist/src/canvas/utils/shapes/picture.d.ts +13 -0
  80. package/dist/src/canvas/utils/shapes/polygon.d.ts +18 -0
  81. package/dist/src/canvas/utils/shapes/rectangle.d.ts +22 -0
  82. package/dist/src/canvas/utils/shapes/text.d.ts +27 -0
  83. package/dist/src/canvas/utils/shapes/triangle.d.ts +4 -0
  84. package/dist/src/canvas/utils/transform.d.ts +15 -0
  85. package/dist/src/canvas/utils/trigo.d.ts +19 -0
  86. package/dist/src/canvas/utils/zoom.d.ts +58 -0
  87. package/dist/src/common/hooks/useDebounce.d.ts +2 -0
  88. package/dist/src/common/types/Canvas.d.ts +8 -0
  89. package/dist/src/common/types/Mode.d.ts +64 -0
  90. package/dist/src/common/types/Settings.d.ts +24 -0
  91. package/dist/src/common/types/Shapes.d.ts +153 -0
  92. package/dist/src/common/types/react.d.ts +6 -0
  93. package/dist/src/common/types/tools.d.ts +164 -0
  94. package/dist/src/common/types/utils.d.ts +4 -0
  95. package/dist/src/common/utils/array.d.ts +2 -0
  96. package/dist/src/common/utils/dom.d.ts +1 -0
  97. package/dist/src/common/utils/object.d.ts +4 -0
  98. package/dist/src/common/utils/selection.d.ts +4 -0
  99. package/dist/src/common/utils/util.d.ts +3 -0
  100. package/dist/src/editor/components/common/Button.d.ts +16 -0
  101. package/dist/src/editor/components/common/FileInput.d.ts +13 -0
  102. package/dist/src/editor/components/common/Loading.d.ts +6 -0
  103. package/dist/src/editor/components/common/Menu.d.ts +10 -0
  104. package/dist/src/editor/components/common/Modal.d.ts +11 -0
  105. package/dist/src/editor/components/common/Panel.d.ts +15 -0
  106. package/dist/src/editor/components/common/Snackbar.d.ts +7 -0
  107. package/dist/src/editor/components/settings/ClosedPointsField.d.ts +10 -0
  108. package/dist/src/editor/components/settings/ColorField.d.ts +15 -0
  109. package/dist/src/editor/components/settings/DeleteButton.d.ts +8 -0
  110. package/dist/src/editor/components/settings/FontFamilyField.d.ts +12 -0
  111. package/dist/src/editor/components/settings/LayoutButton.d.ts +7 -0
  112. package/dist/src/editor/components/settings/Layouts.d.ts +19 -0
  113. package/dist/src/editor/components/settings/LineArrowField.d.ts +12 -0
  114. package/dist/src/editor/components/settings/LineTypeField.d.ts +16 -0
  115. package/dist/src/editor/components/settings/RangeField.d.ts +19 -0
  116. package/dist/src/editor/components/settings/SelectField.d.ts +18 -0
  117. package/dist/src/editor/components/settings/SettingsBar.d.ts +26 -0
  118. package/dist/src/editor/components/settings/ToggleField.d.ts +13 -0
  119. package/dist/src/editor/components/settings/ZoomButton.d.ts +8 -0
  120. package/dist/src/editor/components/toolbox/ContextMenu.d.ts +25 -0
  121. package/dist/src/editor/components/toolbox/ExportModal.d.ts +7 -0
  122. package/dist/src/editor/components/toolbox/LoadFileTool.d.ts +11 -0
  123. package/dist/src/editor/components/toolbox/MenuGroup.d.ts +27 -0
  124. package/dist/src/editor/components/toolbox/PictureUrlInput.d.ts +7 -0
  125. package/dist/src/editor/components/toolbox/Tool.d.ts +11 -0
  126. package/dist/src/editor/components/toolbox/Toolbar.d.ts +26 -0
  127. package/dist/src/editor/components/toolbox/ToolbarGroup.d.ts +14 -0
  128. package/dist/src/editor/constants/grid.d.ts +7 -0
  129. package/dist/src/editor/constants/icons.d.ts +43 -0
  130. package/dist/src/editor/constants/loading.d.ts +1 -0
  131. package/dist/src/editor/constants/options.d.ts +13 -0
  132. package/dist/src/editor/constants/snackbar.d.ts +7 -0
  133. package/dist/src/editor/constants/style.d.ts +14 -0
  134. package/dist/src/editor/constants/tools.d.ts +32 -0
  135. package/dist/src/editor/hooks/useDrag.d.ts +15 -0
  136. package/dist/src/editor/hooks/useMenu.d.ts +11 -0
  137. package/dist/src/editor/hooks/useSnackbar.d.ts +10 -0
  138. package/dist/src/editor/index.d.ts +25 -0
  139. package/dist/src/editor/types/snackbar.d.ts +7 -0
  140. package/dist/src/editor/utils/style.d.ts +2 -0
  141. package/dist/src/editor/utils/toolbar.d.ts +11 -0
  142. package/dist/src/index.d.ts +5 -0
  143. package/package.json +42 -24
@@ -0,0 +1,274 @@
1
+ import type { UtilsSettings } from './../../../canvas/constants/app';
2
+ import type { DrawableShape, ExportedDrawableShape, Point, ShapeEntity } from './../../../common/types/Shapes';
3
+ export declare const addSizeAndConvertSvgToObjectUrl: (svgFileContent: string) => string;
4
+ export declare const isSvg: (fileOrUrl: File | string) => boolean;
5
+ export declare const fetchAndStringify: (url: string) => Promise<string>;
6
+ export declare const downloadFile: (content: string, fileName: string) => void;
7
+ export declare const getBase64Image: (img: HTMLImageElement) => string;
8
+ export declare const getStringifiedImage: (shape: DrawableShape<"picture">) => string;
9
+ export declare const getCanvasImage: ({ shapes, settings, view }: {
10
+ shapes: ShapeEntity[];
11
+ settings: UtilsSettings;
12
+ view: "fitToShapes" | "defaultView" | "currentZoom";
13
+ }) => string;
14
+ export declare const encodeShapesInString: (shapes: ShapeEntity[], width: number, height: number) => string;
15
+ export declare const decodeJson: (file: File) => Promise<unknown>;
16
+ export declare const decodeImportedData: (shapesForJson: ExportedDrawableShape[], settings: UtilsSettings) => Promise<(({
17
+ id: string;
18
+ computed: {
19
+ borders: import("./../../../common/types/Shapes").Rect;
20
+ outerBorders: import("./../../../common/types/Shapes").Rect;
21
+ center: Point;
22
+ boundingBox: import("./../../../common/types/Shapes").Rect;
23
+ };
24
+ path: Path2D;
25
+ } & {
26
+ rotation?: number;
27
+ toolId?: string;
28
+ visible?: boolean;
29
+ locked?: boolean;
30
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
31
+ } & import("./../../../common/types/Shapes").Line & {
32
+ type: "line";
33
+ } & {
34
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
35
+ } & {
36
+ type: "line";
37
+ selection?: import("./../../../common/types/Shapes").SelectionLinesType | undefined;
38
+ arrows?: import("./../../../common/types/Shapes").TriangleEntity[];
39
+ }) | ({
40
+ id: string;
41
+ computed: {
42
+ borders: import("./../../../common/types/Shapes").Rect;
43
+ outerBorders: import("./../../../common/types/Shapes").Rect;
44
+ center: Point;
45
+ boundingBox: import("./../../../common/types/Shapes").Rect;
46
+ };
47
+ path: Path2D;
48
+ } & {
49
+ rotation?: number;
50
+ toolId?: string;
51
+ visible?: boolean;
52
+ locked?: boolean;
53
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
54
+ } & import("./../../../common/types/Shapes").Rect & {
55
+ src: string;
56
+ } & {
57
+ type: "picture";
58
+ img: HTMLImageElement;
59
+ flipX?: boolean;
60
+ flipY?: boolean;
61
+ ratio?: number;
62
+ } & {
63
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
64
+ } & {
65
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
66
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
67
+ }) | ({
68
+ id: string;
69
+ computed: {
70
+ borders: import("./../../../common/types/Shapes").Rect;
71
+ outerBorders: import("./../../../common/types/Shapes").Rect;
72
+ center: Point;
73
+ boundingBox: import("./../../../common/types/Shapes").Rect;
74
+ };
75
+ path: Path2D;
76
+ } & {
77
+ rotation?: number;
78
+ toolId?: string;
79
+ visible?: boolean;
80
+ locked?: boolean;
81
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
82
+ } & import("./../../../common/types/Shapes").Rect & {
83
+ value: string[];
84
+ fontSize: number;
85
+ } & {
86
+ type: "text";
87
+ flipX?: boolean;
88
+ flipY?: boolean;
89
+ ratio?: number;
90
+ } & {
91
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
92
+ } & {
93
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
94
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
95
+ }) | ({
96
+ id: string;
97
+ computed: {
98
+ borders: import("./../../../common/types/Shapes").Rect;
99
+ outerBorders: import("./../../../common/types/Shapes").Rect;
100
+ center: Point;
101
+ boundingBox: import("./../../../common/types/Shapes").Rect;
102
+ };
103
+ path: Path2D;
104
+ } & {
105
+ rotation?: number;
106
+ toolId?: string;
107
+ visible?: boolean;
108
+ locked?: boolean;
109
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
110
+ } & import("./../../../common/types/Shapes").Rect & {
111
+ type: "rect";
112
+ } & {
113
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
114
+ } & {
115
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
116
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
117
+ }) | ({
118
+ id: string;
119
+ computed: {
120
+ borders: import("./../../../common/types/Shapes").Rect;
121
+ outerBorders: import("./../../../common/types/Shapes").Rect;
122
+ center: Point;
123
+ boundingBox: import("./../../../common/types/Shapes").Rect;
124
+ };
125
+ path: Path2D;
126
+ } & {
127
+ rotation?: number;
128
+ toolId?: string;
129
+ visible?: boolean;
130
+ locked?: boolean;
131
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
132
+ } & import("./../../../common/types/Shapes").Rect & {
133
+ type: "square";
134
+ } & {
135
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
136
+ } & {
137
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
138
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
139
+ }) | ({
140
+ id: string;
141
+ computed: {
142
+ borders: import("./../../../common/types/Shapes").Rect;
143
+ outerBorders: import("./../../../common/types/Shapes").Rect;
144
+ center: Point;
145
+ boundingBox: import("./../../../common/types/Shapes").Rect;
146
+ };
147
+ path: Path2D;
148
+ } & {
149
+ rotation?: number;
150
+ toolId?: string;
151
+ visible?: boolean;
152
+ locked?: boolean;
153
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
154
+ } & import("./../../../common/types/Shapes").Circle & {
155
+ type: "circle";
156
+ } & {
157
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
158
+ } & {
159
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
160
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
161
+ }) | ({
162
+ id: string;
163
+ computed: {
164
+ borders: import("./../../../common/types/Shapes").Rect;
165
+ outerBorders: import("./../../../common/types/Shapes").Rect;
166
+ center: Point;
167
+ boundingBox: import("./../../../common/types/Shapes").Rect;
168
+ };
169
+ path: Path2D;
170
+ } & {
171
+ rotation?: number;
172
+ toolId?: string;
173
+ visible?: boolean;
174
+ locked?: boolean;
175
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
176
+ } & import("./../../../common/types/Shapes").Ellipse & {
177
+ type: "ellipse";
178
+ } & {
179
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
180
+ } & {
181
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
182
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
183
+ }) | ({
184
+ id: string;
185
+ computed: {
186
+ borders: import("./../../../common/types/Shapes").Rect;
187
+ outerBorders: import("./../../../common/types/Shapes").Rect;
188
+ center: Point;
189
+ boundingBox: import("./../../../common/types/Shapes").Rect;
190
+ };
191
+ path: Path2D;
192
+ } & {
193
+ rotation?: number;
194
+ toolId?: string;
195
+ visible?: boolean;
196
+ locked?: boolean;
197
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
198
+ } & import("./../../../common/types/Shapes").Polygon & {
199
+ type: "polygon";
200
+ } & {
201
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
202
+ } & {
203
+ type: "polygon" | "curve";
204
+ selection?: import("./../../../common/types/Shapes").SelectionLinesType | undefined;
205
+ }) | ({
206
+ id: string;
207
+ computed: {
208
+ borders: import("./../../../common/types/Shapes").Rect;
209
+ outerBorders: import("./../../../common/types/Shapes").Rect;
210
+ center: Point;
211
+ boundingBox: import("./../../../common/types/Shapes").Rect;
212
+ };
213
+ path: Path2D;
214
+ } & {
215
+ rotation?: number;
216
+ toolId?: string;
217
+ visible?: boolean;
218
+ locked?: boolean;
219
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
220
+ } & import("./../../../common/types/Shapes").Curve & {
221
+ type: "curve";
222
+ } & {
223
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
224
+ } & {
225
+ type: "polygon" | "curve";
226
+ selection?: import("./../../../common/types/Shapes").SelectionLinesType | undefined;
227
+ }) | ({
228
+ id: string;
229
+ computed: {
230
+ borders: import("./../../../common/types/Shapes").Rect;
231
+ outerBorders: import("./../../../common/types/Shapes").Rect;
232
+ center: Point;
233
+ boundingBox: import("./../../../common/types/Shapes").Rect;
234
+ };
235
+ path: Path2D;
236
+ } & {
237
+ rotation?: number;
238
+ toolId?: string;
239
+ visible?: boolean;
240
+ locked?: boolean;
241
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
242
+ } & import("./../../../common/types/Shapes").Brush & {
243
+ type: "brush";
244
+ scaleX?: number;
245
+ scaleY?: number;
246
+ } & {
247
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
248
+ } & {
249
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
250
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
251
+ }) | ({
252
+ id: string;
253
+ computed: {
254
+ borders: import("./../../../common/types/Shapes").Rect;
255
+ outerBorders: import("./../../../common/types/Shapes").Rect;
256
+ center: Point;
257
+ boundingBox: import("./../../../common/types/Shapes").Rect;
258
+ };
259
+ path: Path2D;
260
+ } & {
261
+ rotation?: number;
262
+ toolId?: string;
263
+ visible?: boolean;
264
+ locked?: boolean;
265
+ style?: import("./../../../common/types/Shapes").StyleShape | undefined;
266
+ } & import("./../../../common/types/Shapes").Rect & {
267
+ type: "group";
268
+ shapes: ShapeEntity[];
269
+ } & {
270
+ type: "brush" | "rect" | "square" | "line" | "polygon" | "circle" | "curve" | "ellipse" | "picture" | "text" | "group";
271
+ } & {
272
+ type: "text" | "picture" | "rect" | "square" | "circle" | "ellipse" | "group" | "brush";
273
+ selection?: import("./../../../common/types/Shapes").SelectionDefaultType | undefined;
274
+ }))[]>;
@@ -0,0 +1,2 @@
1
+ import type { UtilsSettings } from './../../../canvas/constants/app';
2
+ export declare const drawGrid: (ctx: CanvasRenderingContext2D, settings: UtilsSettings) => void;
@@ -0,0 +1,27 @@
1
+ import type { UtilsSettings } from './../../../canvas/constants/app';
2
+ import type { CanvasSize } from './../../../common/types/Canvas';
3
+ import type { HoverModeData } from './../../../common/types/Mode';
4
+ import type { Point, Rect, SelectionType, ShapeEntity } from './../../../common/types/Shapes';
5
+ export declare const getCursorPosition: (e: MouseEvent | TouchEvent) => {
6
+ clientX: number;
7
+ clientY: number;
8
+ };
9
+ export declare const getCursorPositionInElement: (e: MouseEvent | TouchEvent, element: HTMLElement, canvasSize: CanvasSize) => Point;
10
+ export declare const getCursorPositionInTransformedCanvas: (e: MouseEvent | TouchEvent, canvas: HTMLElement | null, settings: UtilsSettings) => Point;
11
+ export declare const isTouchGesture: (e: MouseEvent | TouchEvent) => e is TouchEvent;
12
+ export declare const getPointPositionAfterCanvasTransformation: (point: Point, shapeRotation: number, [originX, originY]: Point) => Point;
13
+ export declare const getPointPositionBeforeCanvasTransformation: (point: Point, shapeRotation: number, [originX, originY]: Point) => Point;
14
+ export declare const checkSelectionIntersection: (ctx: CanvasRenderingContext2D, selection: SelectionType, position: Point, settings: UtilsSettings, checkAnchors?: boolean, radius?: number) => false | HoverModeData;
15
+ export declare const checkPolygonLinesSelectionIntersection: (ctx: CanvasRenderingContext2D, shape: ShapeEntity<"polygon" | "curve">, position: Point, settings: UtilsSettings, radius?: number) => false | {
16
+ lineIndex: number;
17
+ };
18
+ export declare const checkCurveLinesSelectionIntersection: (ctx: CanvasRenderingContext2D, shape: ShapeEntity<"curve">, position: Point, settings: UtilsSettings, radius?: number) => false | {
19
+ lineIndex: number;
20
+ };
21
+ export declare const checkPositionIntersection: (ctx: CanvasRenderingContext2D, shape: SelectionType, position: Point, settings: UtilsSettings) => false | HoverModeData;
22
+ export declare function getRectIntersection(rect1: Rect, rect2: Rect): Rect | undefined;
23
+ export declare const checkSelectionFrameCollision: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, selectionFrame: [Point, Point]) => boolean;
24
+ export declare const shouldCancelLongPress: (e: MouseEvent | TouchEvent, startPosition: {
25
+ clientX: number;
26
+ clientY: number;
27
+ }) => boolean;
@@ -0,0 +1,4 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeData } from './../../../../common/types/Mode';
3
+ import type { Point, ShapeEntity } from './../../../../common/types/Shapes';
4
+ export declare const drawSelectionGroup: (ctx: CanvasRenderingContext2D, shape: ShapeEntity<"group">, selectionColor: string, selectionWidth: number, selectionMode: SelectionModeData<number | Point>, settings: UtilsSettings, withAnchors: boolean) => void;
@@ -0,0 +1,19 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { HoverModeData } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, Rect, SelectionLinesType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ export declare const createLineSelectionPath: (path: Path2D | undefined, shape: DrawableShape<"line" | "polygon" | "curve"> & {
5
+ points: readonly Point[];
6
+ }, computed: {
7
+ borders: Rect;
8
+ outerBorders: Rect;
9
+ center: Point;
10
+ }, settings: UtilsSettings) => SelectionLinesType;
11
+ export declare const drawLineSelection: ({ ctx, shape, withAnchors, selectionWidth, selectionColor, hoverMode, settings }: {
12
+ ctx: CanvasRenderingContext2D;
13
+ shape: ShapeEntity<"line"> | ShapeEntity<"polygon"> | ShapeEntity<"curve">;
14
+ withAnchors: boolean;
15
+ selectionWidth: number;
16
+ selectionColor: string;
17
+ hoverMode: HoverModeData;
18
+ settings: UtilsSettings;
19
+ }) => void;
@@ -0,0 +1,20 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { Point, Rect, SelectionDefaultType, SelectionType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ export declare const createRecSelectionPath: (path: Path2D | undefined, computed: {
5
+ borders: Rect;
6
+ outerBorders: Rect;
7
+ center: Point;
8
+ }, settings: UtilsSettings) => SelectionDefaultType;
9
+ export declare const drawBoundingBox: (ctx: CanvasRenderingContext2D, shape: SelectionType, selectionWidth: number, settings: UtilsSettings) => void;
10
+ export declare const drawSelectionRect: (ctx: CanvasRenderingContext2D, shape: ShapeEntity & {
11
+ selection?: SelectionDefaultType | undefined;
12
+ }, selectionColor: string, selectionWidth: number, settings: UtilsSettings, withAnchors: boolean) => void;
13
+ export declare const resizeRectSelection: (cursorPosition: Point, originalShape: ShapeEntity, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio?: boolean, resizeFromCenter?: boolean) => {
14
+ borderX: number;
15
+ borderHeight: number;
16
+ borderY: number;
17
+ borderWidth: number;
18
+ isXinverted: boolean;
19
+ isYinverted: boolean;
20
+ };
@@ -0,0 +1,3 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { Point } from './../../../../common/types/Shapes';
3
+ export declare const drawFrame: (ctx: CanvasRenderingContext2D, selectionFrame: [Point, Point], settings: UtilsSettings) => void;
@@ -0,0 +1,12 @@
1
+ import type { UtilsSettings } from './../../../canvas/constants/app';
2
+ import type { HoverModeData, SelectionModeData } from './../../../common/types/Mode';
3
+ import type { Point, SelectionType, ShapeEntity } from './../../../common/types/Shapes';
4
+ export declare const getNewSelectionData: (hoverMode: HoverModeData, selectedShape: SelectionType, cursorPosition: Point) => SelectionModeData<Point | number> | undefined;
5
+ export declare const selectShape: (ctx: CanvasRenderingContext2D, shapes: ShapeEntity[], cursorPosition: Point, settings: UtilsSettings, selectedShape: SelectionType | undefined, isTouchGesture: boolean, withFrameSelection: boolean, behavior?: "add" | "remove" | "replace") => {
6
+ mode: SelectionModeData<Point | number>;
7
+ shape: SelectionType | undefined;
8
+ };
9
+ export declare const buildShapesGroup: (shapes: ShapeEntity[], settings: UtilsSettings) => SelectionType | undefined;
10
+ export declare const applyToSelectedShape: (applyToShape: (shape: ShapeEntity, settings: UtilsSettings) => ShapeEntity, settings: UtilsSettings) => (selection: SelectionType | undefined) => SelectionType | undefined;
11
+ export declare const addToSelectedShapes: (selection: SelectionType | undefined, shapes: ShapeEntity[]) => ShapeEntity[];
12
+ export declare const omitFromSelectedShapes: (selection: SelectionType | undefined, shape: ShapeEntity) => ShapeEntity[];
@@ -0,0 +1,21 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, Rect, SelectionType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ import type { ToolsSettingsType } from './../../../../common/types/tools';
5
+ import { type GroupResizeContext } from './group';
6
+ export declare const getBrushBorder: (brush: DrawableShape<"brush">, { selectionPadding }: Pick<UtilsSettings, "selectionPadding">) => Rect;
7
+ export declare const refreshBrush: <T extends DrawableShape<"brush">>(brush: T & {
8
+ id: string;
9
+ }, settings: UtilsSettings) => ShapeEntity<"brush">;
10
+ export declare const createBrush: (shape: {
11
+ id: string;
12
+ type: "brush";
13
+ settings: ToolsSettingsType<"brush">;
14
+ }, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"brush">;
15
+ export declare const drawBrush: (ctx: CanvasRenderingContext2D, shape: ShapeEntity<"brush">) => void;
16
+ export declare const resizeBrush: (cursorPosition: Point, originalShape: ShapeEntity<"brush">, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio: boolean, resizeFromCenter: boolean) => ShapeEntity<"brush">;
17
+ export declare const resizeBrushInGroup: (shape: ShapeEntity<"brush">, group: SelectionType & {
18
+ type: "group";
19
+ }, groupCtx: GroupResizeContext) => ShapeEntity<"brush">;
20
+ export declare const addNewPointToShape: (shape: ShapeEntity<"brush">, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"brush">;
21
+ export declare const addNewPointGroupToShape: (shape: ShapeEntity<"brush">, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"brush">;
@@ -0,0 +1,18 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, SelectionType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ import type { ToolsSettingsType } from './../../../../common/types/tools';
5
+ import { type GroupResizeContext } from './group';
6
+ export declare const refreshCircle: <T extends DrawableShape<"circle">>(shape: T & {
7
+ id: string;
8
+ }, settings: UtilsSettings) => ShapeEntity<"circle">;
9
+ export declare const createCircle: (shape: {
10
+ id: string;
11
+ type: "circle";
12
+ settings: ToolsSettingsType<"circle">;
13
+ }, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"circle">;
14
+ export declare const drawCircle: (ctx: CanvasRenderingContext2D, circle: ShapeEntity<"circle">) => void;
15
+ export declare const resizeCircle: (cursorPosition: Point, originalShape: ShapeEntity<"circle">, selectionMode: SelectionModeResize, settings: UtilsSettings, resizeFromCenter: boolean) => ShapeEntity<"circle">;
16
+ export declare const resizeCircleInGroup: (shape: ShapeEntity<"circle">, group: SelectionType & {
17
+ type: "group";
18
+ }, groupCtx: GroupResizeContext) => ShapeEntity<"circle">;
@@ -0,0 +1,17 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, ShapeEntity } from './../../../../common/types/Shapes';
4
+ import type { ToolsSettingsType } from './../../../../common/types/tools';
5
+ export declare const refreshCurve: <T extends DrawableShape<"curve">>(shape: T & {
6
+ id: string;
7
+ }, settings: UtilsSettings) => ShapeEntity<"curve">;
8
+ export declare const createCurve: (shape: {
9
+ id: string;
10
+ type: "curve";
11
+ settings: ToolsSettingsType<"curve">;
12
+ }, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"curve">;
13
+ export declare const resizeCurve: (cursorPosition: Point, originalShape: ShapeEntity<"curve">, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => ShapeEntity<"curve">;
14
+ export declare const drawCurve: (ctx: CanvasRenderingContext2D, curve: ShapeEntity<"curve">) => void;
15
+ export declare const addCurveLine: (shape: ShapeEntity<"curve">, lineIndex: number, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"curve">;
16
+ export declare const addCurvePoint: (shape: ShapeEntity<"curve">, cursorPosition: Point, settings: UtilsSettings, temporary?: boolean) => ShapeEntity<"curve">;
17
+ export declare const removeCurvePoint: (shape: ShapeEntity<"curve">, pointIndex: number, settings: UtilsSettings) => ShapeEntity<"curve">;
@@ -0,0 +1,18 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, SelectionType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ import type { ToolsSettingsType } from './../../../../common/types/tools';
5
+ import { type GroupResizeContext } from './group';
6
+ export declare const refreshEllipse: <T extends DrawableShape<"ellipse">>(shape: T & {
7
+ id: string;
8
+ }, settings: UtilsSettings) => ShapeEntity<"ellipse">;
9
+ export declare const createEllipse: (shape: {
10
+ id: string;
11
+ type: "ellipse";
12
+ settings: ToolsSettingsType<"ellipse">;
13
+ }, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"ellipse">;
14
+ export declare const drawEllipse: (ctx: CanvasRenderingContext2D, ellipse: ShapeEntity<"ellipse">) => void;
15
+ export declare const resizeEllipse: (cursorPosition: Point, originalShape: ShapeEntity<"ellipse">, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio?: boolean, resizeFromCenter?: boolean) => ShapeEntity<"ellipse">;
16
+ export declare const resizeEllipseInGroup: (shape: ShapeEntity<"ellipse">, group: SelectionType & {
17
+ type: "group";
18
+ }, groupCtx: GroupResizeContext) => ShapeEntity<"ellipse">;
@@ -0,0 +1,33 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { Point, SelectionType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ /** Shared context when resizing shapes inside a group */
5
+ export type GroupResizeContext = {
6
+ newBorderX: number;
7
+ newBorderY: number;
8
+ newBorderWidth: number;
9
+ newBorderHeight: number;
10
+ widthMultiplier: number;
11
+ heightMultiplier: number;
12
+ isXinverted: boolean;
13
+ isYinverted: boolean;
14
+ groupCenter: Point;
15
+ rotation: number;
16
+ settings: UtilsSettings;
17
+ originalBorders: {
18
+ x: number;
19
+ y: number;
20
+ width: number;
21
+ height: number;
22
+ };
23
+ };
24
+ export declare const getGroupResizeContext: (cursorPosition: Point, group: SelectionType & {
25
+ type: "group";
26
+ }, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio: boolean, isAltPressed: boolean) => GroupResizeContext;
27
+ export declare const getShapePositionInNewBorder: (shape: ShapeEntity, group: SelectionType & {
28
+ type: "group";
29
+ }, ctx: GroupResizeContext) => {
30
+ x: number;
31
+ y: number;
32
+ };
33
+ export declare const getPositionWithoutGroupRotation: (ctx: GroupResizeContext, positionInBorderX: number, positionInBorderY: number, sizeInBorderW: number, sizeInBorderH: number) => Point;
@@ -0,0 +1,35 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { HoverModeData, SelectionModeData, SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, Rect, SelectionType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ import type { CustomTool } from './../../../../common/types/tools';
5
+ export declare const createShape: (ctx: CanvasRenderingContext2D, shape: Exclude<CustomTool, {
6
+ type: "picture";
7
+ }>, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity | undefined;
8
+ export declare const drawShape: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, settings: UtilsSettings, currentView?: Rect) => void;
9
+ export declare const rotateShape: <T extends ShapeEntity>(shape: T, rotationToApply: number, selectionCenter: Point) => T;
10
+ export declare const resizeShape: <T extends ShapeEntity>(ctx: CanvasRenderingContext2D, cursorPosition: Point, originalShape: T, selectionMode: SelectionModeData<Point | number>, settings: UtilsSettings, isShiftPressed: boolean, isAltPressed: boolean) => T;
11
+ export declare const resizeShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point, originalShape: SelectionType, selectionMode: SelectionModeResize<Point | number>, settings: UtilsSettings, isShiftPressed: boolean, isAltPressed: boolean) => ShapeEntity[];
12
+ export declare const flipShapes: (ctx: CanvasRenderingContext2D, shapes: ShapeEntity[], selectedShapes: ShapeEntity[], center: Point, action: "flipHorizontally" | "flipVertically", settings: UtilsSettings) => ShapeEntity[];
13
+ export declare const translateShapes: (cursorPosition: Point, originalShape: SelectionType, originalCursorPosition: Point, settings: UtilsSettings, isShiftPressed: boolean) => ShapeEntity[];
14
+ export declare const refreshShape: (shape: DrawableShape & {
15
+ id: string;
16
+ }, settings: UtilsSettings) => ShapeEntity;
17
+ export declare const drawShapeSelection: ({ ctx, shape, settings, selectionWidth, selectionColor, hoverMode, selectionMode, withAnchors }: {
18
+ ctx: CanvasRenderingContext2D;
19
+ shape: SelectionType;
20
+ settings: UtilsSettings;
21
+ selectionWidth: number;
22
+ selectionColor: string;
23
+ hoverMode: HoverModeData;
24
+ selectionMode: SelectionModeData<number | Point>;
25
+ withAnchors?: boolean;
26
+ }) => void;
27
+ export declare const drawSelectionFrame: ({ ctx, selectionFrame, settings }: {
28
+ ctx: CanvasRenderingContext2D;
29
+ selectionFrame: {
30
+ oldSelection: SelectionType | undefined;
31
+ frame: [Point, Point];
32
+ };
33
+ settings: UtilsSettings;
34
+ }) => void;
35
+ export declare const copyShapes: (groupShape: SelectionType, settings: UtilsSettings) => ShapeEntity[];
@@ -0,0 +1,19 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, SelectionType, ShapeEntity, StyleShape, Triangle } from './../../../../common/types/Shapes';
4
+ import type { ToolsSettingsType } from './../../../../common/types/tools';
5
+ import { type GroupResizeContext } from './group';
6
+ export declare const refreshLine: <T extends DrawableShape<"line">>(line: T & {
7
+ id: string;
8
+ }, settings: UtilsSettings) => ShapeEntity<"line">;
9
+ export declare const createLine: (shape: {
10
+ id: string;
11
+ type: "line";
12
+ settings: ToolsSettingsType<"line">;
13
+ }, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"line">;
14
+ export declare const buildTriangleOnLine: (center: Point, rotation: number, lineStyle: StyleShape) => Triangle;
15
+ export declare const drawLine: (ctx: CanvasRenderingContext2D, shape: ShapeEntity<"line">) => void;
16
+ export declare const resizeLine: (cursorPosition: Point, originalShape: ShapeEntity<"line">, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => ShapeEntity<"line">;
17
+ export declare const resizeLinePolygonCurveInGroup: <T extends ShapeEntity<"line" | "polygon" | "curve">>(shape: T, group: SelectionType & {
18
+ type: "group";
19
+ }, groupCtx: GroupResizeContext) => T;
@@ -0,0 +1,29 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { Circle, DrawableShape, Line, Point, Rect } from './../../../../common/types/Shapes';
3
+ export declare const createRecPath: (rect: Rect) => Path2D;
4
+ export declare const createCirclePath: (shape: Circle) => Path2D;
5
+ export declare const createEllipsePath: (ellipse: DrawableShape<"ellipse">) => Path2D;
6
+ export declare const createLinePath: (line: Line) => Path2D;
7
+ export declare const createBrushPath: (brush: DrawableShape<"brush">, { brushAlgo }: UtilsSettings) => Path2D;
8
+ /** Bounding box of a cubic Bezier segment B(t) = (1-t)³P0 + 3(1-t)²t P1 + 3(1-t)t² P2 + t³ P3 */
9
+ export declare const getCubicBezierBounds: (p0: Point, p1: Point, p2: Point, p3: Point) => {
10
+ minX: number;
11
+ maxX: number;
12
+ minY: number;
13
+ maxY: number;
14
+ };
15
+ export declare const getCatmullRomPoints: (curve: DrawableShape<"curve">, points: Point[]) => Point[];
16
+ export declare const catmullRomToBezier: (p0: Point, p1: Point, p2: Point, p3: Point) => {
17
+ cp1: Point;
18
+ cp2: Point;
19
+ };
20
+ export declare const createCurvePath: (curve: DrawableShape<"curve">) => Path2D;
21
+ export declare const createPolygonPath: (polygon: DrawableShape<"polygon"> | DrawableShape<"curve">) => Path2D;
22
+ export declare const createTrianglePath: (triangle: DrawableShape<"triangle">) => Path2D;
23
+ export declare const expandRect: (rect: Rect, selectionPadding: number) => Rect;
24
+ export declare const getComputedShapeInfos: <T extends DrawableShape, U extends Pick<UtilsSettings, "selectionPadding">>(shape: T, getBorder: (shape: T, settings: U) => Rect, settings: U, getOuterBorder?: (shape: T, borders: Rect, settings: U) => Rect) => {
25
+ borders: Rect;
26
+ outerBorders: Rect;
27
+ center: Point;
28
+ boundingBox: Rect;
29
+ };
@@ -0,0 +1,13 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, SelectionType, ShapeEntity } from './../../../../common/types/Shapes';
4
+ import { type GroupResizeContext } from './group';
5
+ export declare const refreshPicture: <T extends DrawableShape<"picture">>(shape: T & {
6
+ id: string;
7
+ }, settings: UtilsSettings) => ShapeEntity<"picture">;
8
+ export declare const createPicture: (fileOrUrl: File | string, maxPictureWidth: number, maxPictureHeight: number, settings: UtilsSettings) => Promise<ShapeEntity<"picture">>;
9
+ export declare const drawPicture: (ctx: CanvasRenderingContext2D, picture: ShapeEntity<"picture">) => void;
10
+ export declare const resizePicture: (cursorPosition: Point, originalShape: ShapeEntity<"picture">, selectionMode: SelectionModeResize, settings: UtilsSettings, resizeFromCenter: boolean) => ShapeEntity<"picture">;
11
+ export declare const resizePictureInGroup: (shape: ShapeEntity<"picture">, group: SelectionType & {
12
+ type: "group";
13
+ }, groupCtx: GroupResizeContext) => ShapeEntity<"picture">;
@@ -0,0 +1,18 @@
1
+ import type { UtilsSettings } from './../../../../canvas/constants/app';
2
+ import type { SelectionModeResize } from './../../../../common/types/Mode';
3
+ import type { DrawableShape, Point, Polygon, Rect, ShapeEntity } from './../../../../common/types/Shapes';
4
+ import type { ToolsSettingsType } from './../../../../common/types/tools';
5
+ export declare const refreshPolygon: <T extends DrawableShape<"polygon">>(shape: T & {
6
+ id: string;
7
+ }, settings: UtilsSettings) => ShapeEntity<"polygon">;
8
+ export declare const createPolygon: (shape: {
9
+ id: string;
10
+ type: "polygon";
11
+ settings: ToolsSettingsType<"polygon">;
12
+ }, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"polygon">;
13
+ export declare const drawPolygon: (ctx: CanvasRenderingContext2D, polygon: ShapeEntity<"polygon">) => void;
14
+ export declare const getPolygonBorder: (polygon: Polygon, settings: Pick<UtilsSettings, "selectionPadding">) => Rect;
15
+ export declare const resizePolygon: (cursorPosition: Point, originalShape: ShapeEntity<"polygon">, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => ShapeEntity<"polygon">;
16
+ export declare const addPolygonLine: (shape: ShapeEntity<"polygon">, lineIndex: number, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"polygon">;
17
+ export declare const addPolygonPoint: (shape: ShapeEntity<"polygon">, cursorPosition: Point, settings: UtilsSettings, temporary?: boolean) => ShapeEntity<"polygon">;
18
+ export declare const removePolygonPoint: (shape: ShapeEntity<"polygon">, pointIndex: number, settings: UtilsSettings) => ShapeEntity<"polygon">;