@yorab/react-paint 0.13.1 → 0.15.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.
Files changed (63) hide show
  1. package/README.md +46 -283
  2. package/dist/canvas/components/Canvas.d.ts +15 -7
  3. package/dist/canvas/components/EditTextBox.d.ts +2 -2
  4. package/dist/canvas/constants/app.d.ts +2 -0
  5. package/dist/canvas/constants/keyboard.d.ts +24 -0
  6. package/dist/canvas/constants/shapes.d.ts +1 -1
  7. package/dist/canvas/hooks/useComponent.d.ts +3 -1
  8. package/dist/canvas/hooks/useDebounce.d.ts +2 -0
  9. package/dist/canvas/hooks/useDrawableCanvas.d.ts +12 -7
  10. package/dist/canvas/hooks/useKeyboard.d.ts +15 -8
  11. package/dist/canvas/hooks/useReactPaint.d.ts +1874 -25
  12. package/dist/canvas/hooks/useShapes.d.ts +1393 -13
  13. package/dist/canvas/hooks/useZoom.d.ts +1 -0
  14. package/dist/canvas/index.d.ts +3 -3
  15. package/dist/canvas/utils/canvas.d.ts +2 -0
  16. package/dist/canvas/utils/data.d.ts +2 -2
  17. package/dist/canvas/utils/file.d.ts +233 -4
  18. package/dist/canvas/utils/intersect.d.ts +6 -6
  19. package/dist/canvas/utils/selection/groupSelection.d.ts +3 -0
  20. package/dist/canvas/utils/selection/lineSelection.d.ts +9 -3
  21. package/dist/canvas/utils/selection/rectSelection.d.ts +10 -5
  22. package/dist/canvas/utils/selection.d.ts +11 -4
  23. package/dist/canvas/utils/shapes/brush.d.ts +14 -11
  24. package/dist/canvas/utils/shapes/circle.d.ts +13 -9
  25. package/dist/canvas/utils/shapes/curve.d.ts +15 -10
  26. package/dist/canvas/utils/shapes/ellipse.d.ts +13 -9
  27. package/dist/canvas/utils/shapes/index.d.ts +30 -16
  28. package/dist/canvas/utils/shapes/line.d.ts +13 -8
  29. package/dist/canvas/utils/shapes/path.d.ts +19 -3
  30. package/dist/canvas/utils/shapes/picture.d.ts +13 -9
  31. package/dist/canvas/utils/shapes/polygon.d.ts +15 -9
  32. package/dist/canvas/utils/shapes/rectangle.d.ts +56 -11
  33. package/dist/canvas/utils/shapes/text.d.ts +13 -8
  34. package/dist/canvas/utils/shapes/triangle.d.ts +4 -3
  35. package/dist/canvas/utils/transform.d.ts +4 -4
  36. package/dist/canvas/utils/trigo.d.ts +1 -1
  37. package/dist/common/types/Mode.d.ts +5 -4
  38. package/dist/common/types/Shapes.d.ts +70 -28
  39. package/dist/common/types/tools.d.ts +5 -1
  40. package/dist/common/types/utils.d.ts +1 -1
  41. package/dist/editor/components/common/Button.d.ts +6 -6
  42. package/dist/editor/components/common/FileInput.d.ts +13 -0
  43. package/dist/editor/components/common/Panel.d.ts +1 -1
  44. package/dist/editor/components/settings/ClosedPointsField.d.ts +1 -1
  45. package/dist/editor/components/settings/ColorField.d.ts +1 -1
  46. package/dist/editor/components/settings/DeleteButton.d.ts +3 -3
  47. package/dist/editor/components/settings/FontFamilyField.d.ts +1 -1
  48. package/dist/editor/components/settings/Layouts.d.ts +7 -7
  49. package/dist/editor/components/settings/LineArrowField.d.ts +1 -1
  50. package/dist/editor/components/settings/LineTypeField.d.ts +1 -1
  51. package/dist/editor/components/settings/RangeField.d.ts +1 -1
  52. package/dist/editor/components/settings/SettingsBar.d.ts +4 -4
  53. package/dist/editor/components/settings/ToggleField.d.ts +2 -2
  54. package/dist/editor/components/settings/ZoomButton.d.ts +2 -2
  55. package/dist/editor/constants/icons.d.ts +1 -0
  56. package/dist/editor/constants/tools.d.ts +2 -2
  57. package/dist/editor/hooks/useDrag.d.ts +1 -1
  58. package/dist/editor/index.d.ts +11 -11
  59. package/dist/editor/utils/style.d.ts +1 -1
  60. package/dist/react-paint.css +1 -1
  61. package/dist/react-paint.js +1361 -1188
  62. package/dist/react-paint.umd.cjs +1 -1
  63. package/package.json +19 -15
@@ -1,24 +1,1404 @@
1
1
  import { type UtilsSettings } from './../../canvas/constants/app';
2
- import type { Point, ShapeEntity, StateData } from './../../common/types/Shapes';
3
- declare const useShapes: (settings: UtilsSettings, width: number, height: number) => {
2
+ import type { Point, SelectionType, ShapeEntity, StateData } from './../../common/types/Shapes';
3
+ declare const useShapes: (settings: UtilsSettings, width: number, height: number, isShiftPressed: boolean) => {
4
4
  registerEvent: (event: "dataChanged", fn: (data: StateData, source: "user" | "remote") => void) => void;
5
5
  unregisterEvent: (event: "dataChanged", fn?: (data: StateData, source: "user" | "remote") => void) => void;
6
- shapesRef: import("react").RefObject<ShapeEntity[]>;
7
- selectedShape: ShapeEntity | undefined;
8
- hoveredShape: ShapeEntity | undefined;
9
- selectionFrame: [Point, Point] | undefined;
10
- setSelectionFrame: import("react").Dispatch<import("react").SetStateAction<[Point, Point] | undefined>>;
6
+ shapesRef: import("react").RefObject<(({
7
+ id: string;
8
+ computed: {
9
+ borders: import("./../../common/types/Shapes").Rect;
10
+ outerBorders: import("./../../common/types/Shapes").Rect;
11
+ center: Point;
12
+ boundingBox: import("./../../common/types/Shapes").Rect;
13
+ };
14
+ } & {
15
+ rotation?: number;
16
+ toolId?: string;
17
+ visible?: boolean;
18
+ locked?: boolean;
19
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
20
+ } & import("./../../common/types/Shapes").Line & {
21
+ type: "line";
22
+ } & {
23
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
24
+ path?: Path2D | undefined;
25
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
26
+ type: "line";
27
+ }) | ({
28
+ id: string;
29
+ computed: {
30
+ borders: import("./../../common/types/Shapes").Rect;
31
+ outerBorders: import("./../../common/types/Shapes").Rect;
32
+ center: Point;
33
+ boundingBox: import("./../../common/types/Shapes").Rect;
34
+ };
35
+ } & {
36
+ rotation?: number;
37
+ toolId?: string;
38
+ visible?: boolean;
39
+ locked?: boolean;
40
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
41
+ } & import("./../../common/types/Shapes").Rect & {
42
+ src: string;
43
+ } & {
44
+ img: HTMLImageElement;
45
+ type: "picture";
46
+ } & {
47
+ img: HTMLImageElement;
48
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
49
+ type: "picture";
50
+ }) | ({
51
+ id: string;
52
+ computed: {
53
+ borders: import("./../../common/types/Shapes").Rect;
54
+ outerBorders: import("./../../common/types/Shapes").Rect;
55
+ center: Point;
56
+ boundingBox: import("./../../common/types/Shapes").Rect;
57
+ };
58
+ } & {
59
+ rotation?: number;
60
+ toolId?: string;
61
+ visible?: boolean;
62
+ locked?: boolean;
63
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
64
+ } & import("./../../common/types/Shapes").Rect & {
65
+ value: string[];
66
+ fontSize: number;
67
+ } & {
68
+ type: "text";
69
+ } & {
70
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
71
+ type: "text";
72
+ }) | ({
73
+ id: string;
74
+ computed: {
75
+ borders: import("./../../common/types/Shapes").Rect;
76
+ outerBorders: import("./../../common/types/Shapes").Rect;
77
+ center: Point;
78
+ boundingBox: import("./../../common/types/Shapes").Rect;
79
+ };
80
+ } & {
81
+ rotation?: number;
82
+ toolId?: string;
83
+ visible?: boolean;
84
+ locked?: boolean;
85
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
86
+ } & import("./../../common/types/Shapes").Rect & {
87
+ type: "rect";
88
+ } & {
89
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
90
+ path?: Path2D | undefined;
91
+ type: "rect";
92
+ }) | ({
93
+ id: string;
94
+ computed: {
95
+ borders: import("./../../common/types/Shapes").Rect;
96
+ outerBorders: import("./../../common/types/Shapes").Rect;
97
+ center: Point;
98
+ boundingBox: import("./../../common/types/Shapes").Rect;
99
+ };
100
+ } & {
101
+ rotation?: number;
102
+ toolId?: string;
103
+ visible?: boolean;
104
+ locked?: boolean;
105
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
106
+ } & import("./../../common/types/Shapes").Rect & {
107
+ type: "square";
108
+ } & {
109
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
110
+ path?: Path2D | undefined;
111
+ type: "square";
112
+ }) | ({
113
+ id: string;
114
+ computed: {
115
+ borders: import("./../../common/types/Shapes").Rect;
116
+ outerBorders: import("./../../common/types/Shapes").Rect;
117
+ center: Point;
118
+ boundingBox: import("./../../common/types/Shapes").Rect;
119
+ };
120
+ } & {
121
+ rotation?: number;
122
+ toolId?: string;
123
+ visible?: boolean;
124
+ locked?: boolean;
125
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
126
+ } & import("./../../common/types/Shapes").Circle & {
127
+ type: "circle";
128
+ } & {
129
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
130
+ path?: Path2D | undefined;
131
+ type: "circle";
132
+ }) | ({
133
+ id: string;
134
+ computed: {
135
+ borders: import("./../../common/types/Shapes").Rect;
136
+ outerBorders: import("./../../common/types/Shapes").Rect;
137
+ center: Point;
138
+ boundingBox: import("./../../common/types/Shapes").Rect;
139
+ };
140
+ } & {
141
+ rotation?: number;
142
+ toolId?: string;
143
+ visible?: boolean;
144
+ locked?: boolean;
145
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
146
+ } & import("./../../common/types/Shapes").Ellipse & {
147
+ type: "ellipse";
148
+ } & {
149
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
150
+ path?: Path2D | undefined;
151
+ type: "ellipse";
152
+ }) | ({
153
+ id: string;
154
+ computed: {
155
+ borders: import("./../../common/types/Shapes").Rect;
156
+ outerBorders: import("./../../common/types/Shapes").Rect;
157
+ center: Point;
158
+ boundingBox: import("./../../common/types/Shapes").Rect;
159
+ };
160
+ } & {
161
+ rotation?: number;
162
+ toolId?: string;
163
+ visible?: boolean;
164
+ locked?: boolean;
165
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
166
+ } & import("./../../common/types/Shapes").Polygon & {
167
+ type: "polygon";
168
+ } & {
169
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
170
+ path?: Path2D | undefined;
171
+ type: "polygon";
172
+ }) | ({
173
+ id: string;
174
+ computed: {
175
+ borders: import("./../../common/types/Shapes").Rect;
176
+ outerBorders: import("./../../common/types/Shapes").Rect;
177
+ center: Point;
178
+ boundingBox: import("./../../common/types/Shapes").Rect;
179
+ };
180
+ } & {
181
+ rotation?: number;
182
+ toolId?: string;
183
+ visible?: boolean;
184
+ locked?: boolean;
185
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
186
+ } & import("./../../common/types/Shapes").Curve & {
187
+ type: "curve";
188
+ } & {
189
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
190
+ path?: Path2D | undefined;
191
+ type: "curve";
192
+ }) | ({
193
+ id: string;
194
+ computed: {
195
+ borders: import("./../../common/types/Shapes").Rect;
196
+ outerBorders: import("./../../common/types/Shapes").Rect;
197
+ center: Point;
198
+ boundingBox: import("./../../common/types/Shapes").Rect;
199
+ };
200
+ } & {
201
+ rotation?: number;
202
+ toolId?: string;
203
+ visible?: boolean;
204
+ locked?: boolean;
205
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
206
+ } & import("./../../common/types/Shapes").Brush & {
207
+ type: "brush";
208
+ scaleX?: number;
209
+ scaleY?: number;
210
+ } & {
211
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
212
+ path?: Path2D | undefined;
213
+ type: "brush";
214
+ }) | ({
215
+ id: string;
216
+ computed: {
217
+ borders: import("./../../common/types/Shapes").Rect;
218
+ outerBorders: import("./../../common/types/Shapes").Rect;
219
+ center: Point;
220
+ boundingBox: import("./../../common/types/Shapes").Rect;
221
+ };
222
+ } & {
223
+ rotation?: number;
224
+ toolId?: string;
225
+ visible?: boolean;
226
+ locked?: boolean;
227
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
228
+ } & import("./../../common/types/Shapes").Rect & {
229
+ shapes: ShapeEntity[];
230
+ type: "group";
231
+ } & {
232
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
233
+ path?: Path2D | undefined;
234
+ type: "group";
235
+ }))[]>;
236
+ selectedShape: ({
237
+ id: string;
238
+ computed: {
239
+ borders: import("./../../common/types/Shapes").Rect;
240
+ outerBorders: import("./../../common/types/Shapes").Rect;
241
+ center: Point;
242
+ boundingBox: import("./../../common/types/Shapes").Rect;
243
+ };
244
+ } & {
245
+ rotation?: number;
246
+ toolId?: string;
247
+ visible?: boolean;
248
+ locked?: boolean;
249
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
250
+ } & import("./../../common/types/Shapes").Line & {
251
+ type: "line";
252
+ } & {
253
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
254
+ path?: Path2D | undefined;
255
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
256
+ type: "line";
257
+ }) | ({
258
+ id: string;
259
+ computed: {
260
+ borders: import("./../../common/types/Shapes").Rect;
261
+ outerBorders: import("./../../common/types/Shapes").Rect;
262
+ center: Point;
263
+ boundingBox: import("./../../common/types/Shapes").Rect;
264
+ };
265
+ } & {
266
+ rotation?: number;
267
+ toolId?: string;
268
+ visible?: boolean;
269
+ locked?: boolean;
270
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
271
+ } & import("./../../common/types/Shapes").Rect & {
272
+ src: string;
273
+ } & {
274
+ img: HTMLImageElement;
275
+ type: "picture";
276
+ } & {
277
+ img: HTMLImageElement;
278
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
279
+ type: "picture";
280
+ }) | ({
281
+ id: string;
282
+ computed: {
283
+ borders: import("./../../common/types/Shapes").Rect;
284
+ outerBorders: import("./../../common/types/Shapes").Rect;
285
+ center: Point;
286
+ boundingBox: import("./../../common/types/Shapes").Rect;
287
+ };
288
+ } & {
289
+ rotation?: number;
290
+ toolId?: string;
291
+ visible?: boolean;
292
+ locked?: boolean;
293
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
294
+ } & import("./../../common/types/Shapes").Rect & {
295
+ value: string[];
296
+ fontSize: number;
297
+ } & {
298
+ type: "text";
299
+ } & {
300
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
301
+ type: "text";
302
+ }) | ({
303
+ id: string;
304
+ computed: {
305
+ borders: import("./../../common/types/Shapes").Rect;
306
+ outerBorders: import("./../../common/types/Shapes").Rect;
307
+ center: Point;
308
+ boundingBox: import("./../../common/types/Shapes").Rect;
309
+ };
310
+ } & {
311
+ rotation?: number;
312
+ toolId?: string;
313
+ visible?: boolean;
314
+ locked?: boolean;
315
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
316
+ } & import("./../../common/types/Shapes").Rect & {
317
+ type: "rect";
318
+ } & {
319
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
320
+ path?: Path2D | undefined;
321
+ type: "rect";
322
+ }) | ({
323
+ id: string;
324
+ computed: {
325
+ borders: import("./../../common/types/Shapes").Rect;
326
+ outerBorders: import("./../../common/types/Shapes").Rect;
327
+ center: Point;
328
+ boundingBox: import("./../../common/types/Shapes").Rect;
329
+ };
330
+ } & {
331
+ rotation?: number;
332
+ toolId?: string;
333
+ visible?: boolean;
334
+ locked?: boolean;
335
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
336
+ } & import("./../../common/types/Shapes").Rect & {
337
+ type: "square";
338
+ } & {
339
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
340
+ path?: Path2D | undefined;
341
+ type: "square";
342
+ }) | ({
343
+ id: string;
344
+ computed: {
345
+ borders: import("./../../common/types/Shapes").Rect;
346
+ outerBorders: import("./../../common/types/Shapes").Rect;
347
+ center: Point;
348
+ boundingBox: import("./../../common/types/Shapes").Rect;
349
+ };
350
+ } & {
351
+ rotation?: number;
352
+ toolId?: string;
353
+ visible?: boolean;
354
+ locked?: boolean;
355
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
356
+ } & import("./../../common/types/Shapes").Circle & {
357
+ type: "circle";
358
+ } & {
359
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
360
+ path?: Path2D | undefined;
361
+ type: "circle";
362
+ }) | ({
363
+ id: string;
364
+ computed: {
365
+ borders: import("./../../common/types/Shapes").Rect;
366
+ outerBorders: import("./../../common/types/Shapes").Rect;
367
+ center: Point;
368
+ boundingBox: import("./../../common/types/Shapes").Rect;
369
+ };
370
+ } & {
371
+ rotation?: number;
372
+ toolId?: string;
373
+ visible?: boolean;
374
+ locked?: boolean;
375
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
376
+ } & import("./../../common/types/Shapes").Ellipse & {
377
+ type: "ellipse";
378
+ } & {
379
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
380
+ path?: Path2D | undefined;
381
+ type: "ellipse";
382
+ }) | ({
383
+ id: string;
384
+ computed: {
385
+ borders: import("./../../common/types/Shapes").Rect;
386
+ outerBorders: import("./../../common/types/Shapes").Rect;
387
+ center: Point;
388
+ boundingBox: import("./../../common/types/Shapes").Rect;
389
+ };
390
+ } & {
391
+ rotation?: number;
392
+ toolId?: string;
393
+ visible?: boolean;
394
+ locked?: boolean;
395
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
396
+ } & import("./../../common/types/Shapes").Polygon & {
397
+ type: "polygon";
398
+ } & {
399
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
400
+ path?: Path2D | undefined;
401
+ type: "polygon";
402
+ }) | ({
403
+ id: string;
404
+ computed: {
405
+ borders: import("./../../common/types/Shapes").Rect;
406
+ outerBorders: import("./../../common/types/Shapes").Rect;
407
+ center: Point;
408
+ boundingBox: import("./../../common/types/Shapes").Rect;
409
+ };
410
+ } & {
411
+ rotation?: number;
412
+ toolId?: string;
413
+ visible?: boolean;
414
+ locked?: boolean;
415
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
416
+ } & import("./../../common/types/Shapes").Curve & {
417
+ type: "curve";
418
+ } & {
419
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
420
+ path?: Path2D | undefined;
421
+ type: "curve";
422
+ }) | ({
423
+ id: string;
424
+ computed: {
425
+ borders: import("./../../common/types/Shapes").Rect;
426
+ outerBorders: import("./../../common/types/Shapes").Rect;
427
+ center: Point;
428
+ boundingBox: import("./../../common/types/Shapes").Rect;
429
+ };
430
+ } & {
431
+ rotation?: number;
432
+ toolId?: string;
433
+ visible?: boolean;
434
+ locked?: boolean;
435
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
436
+ } & import("./../../common/types/Shapes").Brush & {
437
+ type: "brush";
438
+ scaleX?: number;
439
+ scaleY?: number;
440
+ } & {
441
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
442
+ path?: Path2D | undefined;
443
+ type: "brush";
444
+ }) | ({
445
+ id: string;
446
+ computed: {
447
+ borders: import("./../../common/types/Shapes").Rect;
448
+ outerBorders: import("./../../common/types/Shapes").Rect;
449
+ center: Point;
450
+ boundingBox: import("./../../common/types/Shapes").Rect;
451
+ };
452
+ } & {
453
+ rotation?: number;
454
+ toolId?: string;
455
+ visible?: boolean;
456
+ locked?: boolean;
457
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
458
+ } & import("./../../common/types/Shapes").Rect & {
459
+ shapes: ShapeEntity[];
460
+ type: "group";
461
+ } & {
462
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
463
+ path?: Path2D | undefined;
464
+ type: "group";
465
+ }) | undefined;
466
+ hoveredShape: ({
467
+ id: string;
468
+ computed: {
469
+ borders: import("./../../common/types/Shapes").Rect;
470
+ outerBorders: import("./../../common/types/Shapes").Rect;
471
+ center: Point;
472
+ boundingBox: import("./../../common/types/Shapes").Rect;
473
+ };
474
+ } & {
475
+ rotation?: number;
476
+ toolId?: string;
477
+ visible?: boolean;
478
+ locked?: boolean;
479
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
480
+ } & import("./../../common/types/Shapes").Line & {
481
+ type: "line";
482
+ } & {
483
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
484
+ path?: Path2D | undefined;
485
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
486
+ type: "line";
487
+ }) | ({
488
+ id: string;
489
+ computed: {
490
+ borders: import("./../../common/types/Shapes").Rect;
491
+ outerBorders: import("./../../common/types/Shapes").Rect;
492
+ center: Point;
493
+ boundingBox: import("./../../common/types/Shapes").Rect;
494
+ };
495
+ } & {
496
+ rotation?: number;
497
+ toolId?: string;
498
+ visible?: boolean;
499
+ locked?: boolean;
500
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
501
+ } & import("./../../common/types/Shapes").Rect & {
502
+ src: string;
503
+ } & {
504
+ img: HTMLImageElement;
505
+ type: "picture";
506
+ } & {
507
+ img: HTMLImageElement;
508
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
509
+ type: "picture";
510
+ }) | ({
511
+ id: string;
512
+ computed: {
513
+ borders: import("./../../common/types/Shapes").Rect;
514
+ outerBorders: import("./../../common/types/Shapes").Rect;
515
+ center: Point;
516
+ boundingBox: import("./../../common/types/Shapes").Rect;
517
+ };
518
+ } & {
519
+ rotation?: number;
520
+ toolId?: string;
521
+ visible?: boolean;
522
+ locked?: boolean;
523
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
524
+ } & import("./../../common/types/Shapes").Rect & {
525
+ value: string[];
526
+ fontSize: number;
527
+ } & {
528
+ type: "text";
529
+ } & {
530
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
531
+ type: "text";
532
+ }) | ({
533
+ id: string;
534
+ computed: {
535
+ borders: import("./../../common/types/Shapes").Rect;
536
+ outerBorders: import("./../../common/types/Shapes").Rect;
537
+ center: Point;
538
+ boundingBox: import("./../../common/types/Shapes").Rect;
539
+ };
540
+ } & {
541
+ rotation?: number;
542
+ toolId?: string;
543
+ visible?: boolean;
544
+ locked?: boolean;
545
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
546
+ } & import("./../../common/types/Shapes").Rect & {
547
+ type: "rect";
548
+ } & {
549
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
550
+ path?: Path2D | undefined;
551
+ type: "rect";
552
+ }) | ({
553
+ id: string;
554
+ computed: {
555
+ borders: import("./../../common/types/Shapes").Rect;
556
+ outerBorders: import("./../../common/types/Shapes").Rect;
557
+ center: Point;
558
+ boundingBox: import("./../../common/types/Shapes").Rect;
559
+ };
560
+ } & {
561
+ rotation?: number;
562
+ toolId?: string;
563
+ visible?: boolean;
564
+ locked?: boolean;
565
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
566
+ } & import("./../../common/types/Shapes").Rect & {
567
+ type: "square";
568
+ } & {
569
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
570
+ path?: Path2D | undefined;
571
+ type: "square";
572
+ }) | ({
573
+ id: string;
574
+ computed: {
575
+ borders: import("./../../common/types/Shapes").Rect;
576
+ outerBorders: import("./../../common/types/Shapes").Rect;
577
+ center: Point;
578
+ boundingBox: import("./../../common/types/Shapes").Rect;
579
+ };
580
+ } & {
581
+ rotation?: number;
582
+ toolId?: string;
583
+ visible?: boolean;
584
+ locked?: boolean;
585
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
586
+ } & import("./../../common/types/Shapes").Circle & {
587
+ type: "circle";
588
+ } & {
589
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
590
+ path?: Path2D | undefined;
591
+ type: "circle";
592
+ }) | ({
593
+ id: string;
594
+ computed: {
595
+ borders: import("./../../common/types/Shapes").Rect;
596
+ outerBorders: import("./../../common/types/Shapes").Rect;
597
+ center: Point;
598
+ boundingBox: import("./../../common/types/Shapes").Rect;
599
+ };
600
+ } & {
601
+ rotation?: number;
602
+ toolId?: string;
603
+ visible?: boolean;
604
+ locked?: boolean;
605
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
606
+ } & import("./../../common/types/Shapes").Ellipse & {
607
+ type: "ellipse";
608
+ } & {
609
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
610
+ path?: Path2D | undefined;
611
+ type: "ellipse";
612
+ }) | ({
613
+ id: string;
614
+ computed: {
615
+ borders: import("./../../common/types/Shapes").Rect;
616
+ outerBorders: import("./../../common/types/Shapes").Rect;
617
+ center: Point;
618
+ boundingBox: import("./../../common/types/Shapes").Rect;
619
+ };
620
+ } & {
621
+ rotation?: number;
622
+ toolId?: string;
623
+ visible?: boolean;
624
+ locked?: boolean;
625
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
626
+ } & import("./../../common/types/Shapes").Polygon & {
627
+ type: "polygon";
628
+ } & {
629
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
630
+ path?: Path2D | undefined;
631
+ type: "polygon";
632
+ }) | ({
633
+ id: string;
634
+ computed: {
635
+ borders: import("./../../common/types/Shapes").Rect;
636
+ outerBorders: import("./../../common/types/Shapes").Rect;
637
+ center: Point;
638
+ boundingBox: import("./../../common/types/Shapes").Rect;
639
+ };
640
+ } & {
641
+ rotation?: number;
642
+ toolId?: string;
643
+ visible?: boolean;
644
+ locked?: boolean;
645
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
646
+ } & import("./../../common/types/Shapes").Curve & {
647
+ type: "curve";
648
+ } & {
649
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
650
+ path?: Path2D | undefined;
651
+ type: "curve";
652
+ }) | ({
653
+ id: string;
654
+ computed: {
655
+ borders: import("./../../common/types/Shapes").Rect;
656
+ outerBorders: import("./../../common/types/Shapes").Rect;
657
+ center: Point;
658
+ boundingBox: import("./../../common/types/Shapes").Rect;
659
+ };
660
+ } & {
661
+ rotation?: number;
662
+ toolId?: string;
663
+ visible?: boolean;
664
+ locked?: boolean;
665
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
666
+ } & import("./../../common/types/Shapes").Brush & {
667
+ type: "brush";
668
+ scaleX?: number;
669
+ scaleY?: number;
670
+ } & {
671
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
672
+ path?: Path2D | undefined;
673
+ type: "brush";
674
+ }) | ({
675
+ id: string;
676
+ computed: {
677
+ borders: import("./../../common/types/Shapes").Rect;
678
+ outerBorders: import("./../../common/types/Shapes").Rect;
679
+ center: Point;
680
+ boundingBox: import("./../../common/types/Shapes").Rect;
681
+ };
682
+ } & {
683
+ rotation?: number;
684
+ toolId?: string;
685
+ visible?: boolean;
686
+ locked?: boolean;
687
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
688
+ } & import("./../../common/types/Shapes").Rect & {
689
+ shapes: ShapeEntity[];
690
+ type: "group";
691
+ } & {
692
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
693
+ path?: Path2D | undefined;
694
+ type: "group";
695
+ }) | undefined;
696
+ selectionFrame: {
697
+ oldSelection: SelectionType | undefined;
698
+ frame: [Point, Point];
699
+ } | undefined;
700
+ setSelectionFrame: import("react").Dispatch<import("react").SetStateAction<{
701
+ oldSelection: SelectionType | undefined;
702
+ frame: [Point, Point];
703
+ } | undefined>>;
11
704
  refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
12
- addShape: (newShape: ShapeEntity) => void;
705
+ addShapes: (newShapes: ShapeEntity[]) => void;
13
706
  addPictureShape: (fileOrUrl: File | string, maxWidth?: number, maxHeight?: number) => Promise<ShapeEntity<"picture">>;
14
707
  moveShapes: (startPositionShapeId: string, endPositionShapeId: string) => void;
15
708
  saveShapes: () => void;
16
- setSelectedShape: import("react").Dispatch<import("react").SetStateAction<ShapeEntity | undefined>>;
709
+ setSelectedShape: import("react").Dispatch<({
710
+ id: string;
711
+ computed: {
712
+ borders: import("./../../common/types/Shapes").Rect;
713
+ outerBorders: import("./../../common/types/Shapes").Rect;
714
+ center: Point;
715
+ boundingBox: import("./../../common/types/Shapes").Rect;
716
+ };
717
+ } & {
718
+ rotation?: number;
719
+ toolId?: string;
720
+ visible?: boolean;
721
+ locked?: boolean;
722
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
723
+ } & import("./../../common/types/Shapes").Line & {
724
+ type: "line";
725
+ } & {
726
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
727
+ path?: Path2D | undefined;
728
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
729
+ type: "line";
730
+ }) | ({
731
+ id: string;
732
+ computed: {
733
+ borders: import("./../../common/types/Shapes").Rect;
734
+ outerBorders: import("./../../common/types/Shapes").Rect;
735
+ center: Point;
736
+ boundingBox: import("./../../common/types/Shapes").Rect;
737
+ };
738
+ } & {
739
+ rotation?: number;
740
+ toolId?: string;
741
+ visible?: boolean;
742
+ locked?: boolean;
743
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
744
+ } & import("./../../common/types/Shapes").Rect & {
745
+ src: string;
746
+ } & {
747
+ img: HTMLImageElement;
748
+ type: "picture";
749
+ } & {
750
+ img: HTMLImageElement;
751
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
752
+ type: "picture";
753
+ }) | ({
754
+ id: string;
755
+ computed: {
756
+ borders: import("./../../common/types/Shapes").Rect;
757
+ outerBorders: import("./../../common/types/Shapes").Rect;
758
+ center: Point;
759
+ boundingBox: import("./../../common/types/Shapes").Rect;
760
+ };
761
+ } & {
762
+ rotation?: number;
763
+ toolId?: string;
764
+ visible?: boolean;
765
+ locked?: boolean;
766
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
767
+ } & import("./../../common/types/Shapes").Rect & {
768
+ value: string[];
769
+ fontSize: number;
770
+ } & {
771
+ type: "text";
772
+ } & {
773
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
774
+ type: "text";
775
+ }) | ({
776
+ id: string;
777
+ computed: {
778
+ borders: import("./../../common/types/Shapes").Rect;
779
+ outerBorders: import("./../../common/types/Shapes").Rect;
780
+ center: Point;
781
+ boundingBox: import("./../../common/types/Shapes").Rect;
782
+ };
783
+ } & {
784
+ rotation?: number;
785
+ toolId?: string;
786
+ visible?: boolean;
787
+ locked?: boolean;
788
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
789
+ } & import("./../../common/types/Shapes").Rect & {
790
+ type: "rect";
791
+ } & {
792
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
793
+ path?: Path2D | undefined;
794
+ type: "rect";
795
+ }) | ({
796
+ id: string;
797
+ computed: {
798
+ borders: import("./../../common/types/Shapes").Rect;
799
+ outerBorders: import("./../../common/types/Shapes").Rect;
800
+ center: Point;
801
+ boundingBox: import("./../../common/types/Shapes").Rect;
802
+ };
803
+ } & {
804
+ rotation?: number;
805
+ toolId?: string;
806
+ visible?: boolean;
807
+ locked?: boolean;
808
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
809
+ } & import("./../../common/types/Shapes").Rect & {
810
+ type: "square";
811
+ } & {
812
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
813
+ path?: Path2D | undefined;
814
+ type: "square";
815
+ }) | ({
816
+ id: string;
817
+ computed: {
818
+ borders: import("./../../common/types/Shapes").Rect;
819
+ outerBorders: import("./../../common/types/Shapes").Rect;
820
+ center: Point;
821
+ boundingBox: import("./../../common/types/Shapes").Rect;
822
+ };
823
+ } & {
824
+ rotation?: number;
825
+ toolId?: string;
826
+ visible?: boolean;
827
+ locked?: boolean;
828
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
829
+ } & import("./../../common/types/Shapes").Circle & {
830
+ type: "circle";
831
+ } & {
832
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
833
+ path?: Path2D | undefined;
834
+ type: "circle";
835
+ }) | ({
836
+ id: string;
837
+ computed: {
838
+ borders: import("./../../common/types/Shapes").Rect;
839
+ outerBorders: import("./../../common/types/Shapes").Rect;
840
+ center: Point;
841
+ boundingBox: import("./../../common/types/Shapes").Rect;
842
+ };
843
+ } & {
844
+ rotation?: number;
845
+ toolId?: string;
846
+ visible?: boolean;
847
+ locked?: boolean;
848
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
849
+ } & import("./../../common/types/Shapes").Ellipse & {
850
+ type: "ellipse";
851
+ } & {
852
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
853
+ path?: Path2D | undefined;
854
+ type: "ellipse";
855
+ }) | ({
856
+ id: string;
857
+ computed: {
858
+ borders: import("./../../common/types/Shapes").Rect;
859
+ outerBorders: import("./../../common/types/Shapes").Rect;
860
+ center: Point;
861
+ boundingBox: import("./../../common/types/Shapes").Rect;
862
+ };
863
+ } & {
864
+ rotation?: number;
865
+ toolId?: string;
866
+ visible?: boolean;
867
+ locked?: boolean;
868
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
869
+ } & import("./../../common/types/Shapes").Polygon & {
870
+ type: "polygon";
871
+ } & {
872
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
873
+ path?: Path2D | undefined;
874
+ type: "polygon";
875
+ }) | ({
876
+ id: string;
877
+ computed: {
878
+ borders: import("./../../common/types/Shapes").Rect;
879
+ outerBorders: import("./../../common/types/Shapes").Rect;
880
+ center: Point;
881
+ boundingBox: import("./../../common/types/Shapes").Rect;
882
+ };
883
+ } & {
884
+ rotation?: number;
885
+ toolId?: string;
886
+ visible?: boolean;
887
+ locked?: boolean;
888
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
889
+ } & import("./../../common/types/Shapes").Curve & {
890
+ type: "curve";
891
+ } & {
892
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
893
+ path?: Path2D | undefined;
894
+ type: "curve";
895
+ }) | ({
896
+ id: string;
897
+ computed: {
898
+ borders: import("./../../common/types/Shapes").Rect;
899
+ outerBorders: import("./../../common/types/Shapes").Rect;
900
+ center: Point;
901
+ boundingBox: import("./../../common/types/Shapes").Rect;
902
+ };
903
+ } & {
904
+ rotation?: number;
905
+ toolId?: string;
906
+ visible?: boolean;
907
+ locked?: boolean;
908
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
909
+ } & import("./../../common/types/Shapes").Brush & {
910
+ type: "brush";
911
+ scaleX?: number;
912
+ scaleY?: number;
913
+ } & {
914
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
915
+ path?: Path2D | undefined;
916
+ type: "brush";
917
+ }) | ({
918
+ id: string;
919
+ computed: {
920
+ borders: import("./../../common/types/Shapes").Rect;
921
+ outerBorders: import("./../../common/types/Shapes").Rect;
922
+ center: Point;
923
+ boundingBox: import("./../../common/types/Shapes").Rect;
924
+ };
925
+ } & {
926
+ rotation?: number;
927
+ toolId?: string;
928
+ visible?: boolean;
929
+ locked?: boolean;
930
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
931
+ } & import("./../../common/types/Shapes").Rect & {
932
+ shapes: ShapeEntity[];
933
+ type: "group";
934
+ } & {
935
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
936
+ path?: Path2D | undefined;
937
+ type: "group";
938
+ }) | ((prevState: ({
939
+ id: string;
940
+ computed: {
941
+ borders: import("./../../common/types/Shapes").Rect;
942
+ outerBorders: import("./../../common/types/Shapes").Rect;
943
+ center: Point;
944
+ boundingBox: import("./../../common/types/Shapes").Rect;
945
+ };
946
+ } & {
947
+ rotation?: number;
948
+ toolId?: string;
949
+ visible?: boolean;
950
+ locked?: boolean;
951
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
952
+ } & import("./../../common/types/Shapes").Line & {
953
+ type: "line";
954
+ } & {
955
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
956
+ path?: Path2D | undefined;
957
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
958
+ type: "line";
959
+ }) | ({
960
+ id: string;
961
+ computed: {
962
+ borders: import("./../../common/types/Shapes").Rect;
963
+ outerBorders: import("./../../common/types/Shapes").Rect;
964
+ center: Point;
965
+ boundingBox: import("./../../common/types/Shapes").Rect;
966
+ };
967
+ } & {
968
+ rotation?: number;
969
+ toolId?: string;
970
+ visible?: boolean;
971
+ locked?: boolean;
972
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
973
+ } & import("./../../common/types/Shapes").Rect & {
974
+ src: string;
975
+ } & {
976
+ img: HTMLImageElement;
977
+ type: "picture";
978
+ } & {
979
+ img: HTMLImageElement;
980
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
981
+ type: "picture";
982
+ }) | ({
983
+ id: string;
984
+ computed: {
985
+ borders: import("./../../common/types/Shapes").Rect;
986
+ outerBorders: import("./../../common/types/Shapes").Rect;
987
+ center: Point;
988
+ boundingBox: import("./../../common/types/Shapes").Rect;
989
+ };
990
+ } & {
991
+ rotation?: number;
992
+ toolId?: string;
993
+ visible?: boolean;
994
+ locked?: boolean;
995
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
996
+ } & import("./../../common/types/Shapes").Rect & {
997
+ value: string[];
998
+ fontSize: number;
999
+ } & {
1000
+ type: "text";
1001
+ } & {
1002
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1003
+ type: "text";
1004
+ }) | ({
1005
+ id: string;
1006
+ computed: {
1007
+ borders: import("./../../common/types/Shapes").Rect;
1008
+ outerBorders: import("./../../common/types/Shapes").Rect;
1009
+ center: Point;
1010
+ boundingBox: import("./../../common/types/Shapes").Rect;
1011
+ };
1012
+ } & {
1013
+ rotation?: number;
1014
+ toolId?: string;
1015
+ visible?: boolean;
1016
+ locked?: boolean;
1017
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1018
+ } & import("./../../common/types/Shapes").Rect & {
1019
+ type: "rect";
1020
+ } & {
1021
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1022
+ path?: Path2D | undefined;
1023
+ type: "rect";
1024
+ }) | ({
1025
+ id: string;
1026
+ computed: {
1027
+ borders: import("./../../common/types/Shapes").Rect;
1028
+ outerBorders: import("./../../common/types/Shapes").Rect;
1029
+ center: Point;
1030
+ boundingBox: import("./../../common/types/Shapes").Rect;
1031
+ };
1032
+ } & {
1033
+ rotation?: number;
1034
+ toolId?: string;
1035
+ visible?: boolean;
1036
+ locked?: boolean;
1037
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1038
+ } & import("./../../common/types/Shapes").Rect & {
1039
+ type: "square";
1040
+ } & {
1041
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1042
+ path?: Path2D | undefined;
1043
+ type: "square";
1044
+ }) | ({
1045
+ id: string;
1046
+ computed: {
1047
+ borders: import("./../../common/types/Shapes").Rect;
1048
+ outerBorders: import("./../../common/types/Shapes").Rect;
1049
+ center: Point;
1050
+ boundingBox: import("./../../common/types/Shapes").Rect;
1051
+ };
1052
+ } & {
1053
+ rotation?: number;
1054
+ toolId?: string;
1055
+ visible?: boolean;
1056
+ locked?: boolean;
1057
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1058
+ } & import("./../../common/types/Shapes").Circle & {
1059
+ type: "circle";
1060
+ } & {
1061
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1062
+ path?: Path2D | undefined;
1063
+ type: "circle";
1064
+ }) | ({
1065
+ id: string;
1066
+ computed: {
1067
+ borders: import("./../../common/types/Shapes").Rect;
1068
+ outerBorders: import("./../../common/types/Shapes").Rect;
1069
+ center: Point;
1070
+ boundingBox: import("./../../common/types/Shapes").Rect;
1071
+ };
1072
+ } & {
1073
+ rotation?: number;
1074
+ toolId?: string;
1075
+ visible?: boolean;
1076
+ locked?: boolean;
1077
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1078
+ } & import("./../../common/types/Shapes").Ellipse & {
1079
+ type: "ellipse";
1080
+ } & {
1081
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1082
+ path?: Path2D | undefined;
1083
+ type: "ellipse";
1084
+ }) | ({
1085
+ id: string;
1086
+ computed: {
1087
+ borders: import("./../../common/types/Shapes").Rect;
1088
+ outerBorders: import("./../../common/types/Shapes").Rect;
1089
+ center: Point;
1090
+ boundingBox: import("./../../common/types/Shapes").Rect;
1091
+ };
1092
+ } & {
1093
+ rotation?: number;
1094
+ toolId?: string;
1095
+ visible?: boolean;
1096
+ locked?: boolean;
1097
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1098
+ } & import("./../../common/types/Shapes").Polygon & {
1099
+ type: "polygon";
1100
+ } & {
1101
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1102
+ path?: Path2D | undefined;
1103
+ type: "polygon";
1104
+ }) | ({
1105
+ id: string;
1106
+ computed: {
1107
+ borders: import("./../../common/types/Shapes").Rect;
1108
+ outerBorders: import("./../../common/types/Shapes").Rect;
1109
+ center: Point;
1110
+ boundingBox: import("./../../common/types/Shapes").Rect;
1111
+ };
1112
+ } & {
1113
+ rotation?: number;
1114
+ toolId?: string;
1115
+ visible?: boolean;
1116
+ locked?: boolean;
1117
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1118
+ } & import("./../../common/types/Shapes").Curve & {
1119
+ type: "curve";
1120
+ } & {
1121
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1122
+ path?: Path2D | undefined;
1123
+ type: "curve";
1124
+ }) | ({
1125
+ id: string;
1126
+ computed: {
1127
+ borders: import("./../../common/types/Shapes").Rect;
1128
+ outerBorders: import("./../../common/types/Shapes").Rect;
1129
+ center: Point;
1130
+ boundingBox: import("./../../common/types/Shapes").Rect;
1131
+ };
1132
+ } & {
1133
+ rotation?: number;
1134
+ toolId?: string;
1135
+ visible?: boolean;
1136
+ locked?: boolean;
1137
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1138
+ } & import("./../../common/types/Shapes").Brush & {
1139
+ type: "brush";
1140
+ scaleX?: number;
1141
+ scaleY?: number;
1142
+ } & {
1143
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1144
+ path?: Path2D | undefined;
1145
+ type: "brush";
1146
+ }) | ({
1147
+ id: string;
1148
+ computed: {
1149
+ borders: import("./../../common/types/Shapes").Rect;
1150
+ outerBorders: import("./../../common/types/Shapes").Rect;
1151
+ center: Point;
1152
+ boundingBox: import("./../../common/types/Shapes").Rect;
1153
+ };
1154
+ } & {
1155
+ rotation?: number;
1156
+ toolId?: string;
1157
+ visible?: boolean;
1158
+ locked?: boolean;
1159
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1160
+ } & import("./../../common/types/Shapes").Rect & {
1161
+ shapes: ShapeEntity[];
1162
+ type: "group";
1163
+ } & {
1164
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1165
+ path?: Path2D | undefined;
1166
+ type: "group";
1167
+ }) | undefined) => ({
1168
+ id: string;
1169
+ computed: {
1170
+ borders: import("./../../common/types/Shapes").Rect;
1171
+ outerBorders: import("./../../common/types/Shapes").Rect;
1172
+ center: Point;
1173
+ boundingBox: import("./../../common/types/Shapes").Rect;
1174
+ };
1175
+ } & {
1176
+ rotation?: number;
1177
+ toolId?: string;
1178
+ visible?: boolean;
1179
+ locked?: boolean;
1180
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1181
+ } & import("./../../common/types/Shapes").Line & {
1182
+ type: "line";
1183
+ } & {
1184
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1185
+ path?: Path2D | undefined;
1186
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
1187
+ type: "line";
1188
+ }) | ({
1189
+ id: string;
1190
+ computed: {
1191
+ borders: import("./../../common/types/Shapes").Rect;
1192
+ outerBorders: import("./../../common/types/Shapes").Rect;
1193
+ center: Point;
1194
+ boundingBox: import("./../../common/types/Shapes").Rect;
1195
+ };
1196
+ } & {
1197
+ rotation?: number;
1198
+ toolId?: string;
1199
+ visible?: boolean;
1200
+ locked?: boolean;
1201
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1202
+ } & import("./../../common/types/Shapes").Rect & {
1203
+ src: string;
1204
+ } & {
1205
+ img: HTMLImageElement;
1206
+ type: "picture";
1207
+ } & {
1208
+ img: HTMLImageElement;
1209
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1210
+ type: "picture";
1211
+ }) | ({
1212
+ id: string;
1213
+ computed: {
1214
+ borders: import("./../../common/types/Shapes").Rect;
1215
+ outerBorders: import("./../../common/types/Shapes").Rect;
1216
+ center: Point;
1217
+ boundingBox: import("./../../common/types/Shapes").Rect;
1218
+ };
1219
+ } & {
1220
+ rotation?: number;
1221
+ toolId?: string;
1222
+ visible?: boolean;
1223
+ locked?: boolean;
1224
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1225
+ } & import("./../../common/types/Shapes").Rect & {
1226
+ value: string[];
1227
+ fontSize: number;
1228
+ } & {
1229
+ type: "text";
1230
+ } & {
1231
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1232
+ type: "text";
1233
+ }) | ({
1234
+ id: string;
1235
+ computed: {
1236
+ borders: import("./../../common/types/Shapes").Rect;
1237
+ outerBorders: import("./../../common/types/Shapes").Rect;
1238
+ center: Point;
1239
+ boundingBox: import("./../../common/types/Shapes").Rect;
1240
+ };
1241
+ } & {
1242
+ rotation?: number;
1243
+ toolId?: string;
1244
+ visible?: boolean;
1245
+ locked?: boolean;
1246
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1247
+ } & import("./../../common/types/Shapes").Rect & {
1248
+ type: "rect";
1249
+ } & {
1250
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1251
+ path?: Path2D | undefined;
1252
+ type: "rect";
1253
+ }) | ({
1254
+ id: string;
1255
+ computed: {
1256
+ borders: import("./../../common/types/Shapes").Rect;
1257
+ outerBorders: import("./../../common/types/Shapes").Rect;
1258
+ center: Point;
1259
+ boundingBox: import("./../../common/types/Shapes").Rect;
1260
+ };
1261
+ } & {
1262
+ rotation?: number;
1263
+ toolId?: string;
1264
+ visible?: boolean;
1265
+ locked?: boolean;
1266
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1267
+ } & import("./../../common/types/Shapes").Rect & {
1268
+ type: "square";
1269
+ } & {
1270
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1271
+ path?: Path2D | undefined;
1272
+ type: "square";
1273
+ }) | ({
1274
+ id: string;
1275
+ computed: {
1276
+ borders: import("./../../common/types/Shapes").Rect;
1277
+ outerBorders: import("./../../common/types/Shapes").Rect;
1278
+ center: Point;
1279
+ boundingBox: import("./../../common/types/Shapes").Rect;
1280
+ };
1281
+ } & {
1282
+ rotation?: number;
1283
+ toolId?: string;
1284
+ visible?: boolean;
1285
+ locked?: boolean;
1286
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1287
+ } & import("./../../common/types/Shapes").Circle & {
1288
+ type: "circle";
1289
+ } & {
1290
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1291
+ path?: Path2D | undefined;
1292
+ type: "circle";
1293
+ }) | ({
1294
+ id: string;
1295
+ computed: {
1296
+ borders: import("./../../common/types/Shapes").Rect;
1297
+ outerBorders: import("./../../common/types/Shapes").Rect;
1298
+ center: Point;
1299
+ boundingBox: import("./../../common/types/Shapes").Rect;
1300
+ };
1301
+ } & {
1302
+ rotation?: number;
1303
+ toolId?: string;
1304
+ visible?: boolean;
1305
+ locked?: boolean;
1306
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1307
+ } & import("./../../common/types/Shapes").Ellipse & {
1308
+ type: "ellipse";
1309
+ } & {
1310
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1311
+ path?: Path2D | undefined;
1312
+ type: "ellipse";
1313
+ }) | ({
1314
+ id: string;
1315
+ computed: {
1316
+ borders: import("./../../common/types/Shapes").Rect;
1317
+ outerBorders: import("./../../common/types/Shapes").Rect;
1318
+ center: Point;
1319
+ boundingBox: import("./../../common/types/Shapes").Rect;
1320
+ };
1321
+ } & {
1322
+ rotation?: number;
1323
+ toolId?: string;
1324
+ visible?: boolean;
1325
+ locked?: boolean;
1326
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1327
+ } & import("./../../common/types/Shapes").Polygon & {
1328
+ type: "polygon";
1329
+ } & {
1330
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1331
+ path?: Path2D | undefined;
1332
+ type: "polygon";
1333
+ }) | ({
1334
+ id: string;
1335
+ computed: {
1336
+ borders: import("./../../common/types/Shapes").Rect;
1337
+ outerBorders: import("./../../common/types/Shapes").Rect;
1338
+ center: Point;
1339
+ boundingBox: import("./../../common/types/Shapes").Rect;
1340
+ };
1341
+ } & {
1342
+ rotation?: number;
1343
+ toolId?: string;
1344
+ visible?: boolean;
1345
+ locked?: boolean;
1346
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1347
+ } & import("./../../common/types/Shapes").Curve & {
1348
+ type: "curve";
1349
+ } & {
1350
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1351
+ path?: Path2D | undefined;
1352
+ type: "curve";
1353
+ }) | ({
1354
+ id: string;
1355
+ computed: {
1356
+ borders: import("./../../common/types/Shapes").Rect;
1357
+ outerBorders: import("./../../common/types/Shapes").Rect;
1358
+ center: Point;
1359
+ boundingBox: import("./../../common/types/Shapes").Rect;
1360
+ };
1361
+ } & {
1362
+ rotation?: number;
1363
+ toolId?: string;
1364
+ visible?: boolean;
1365
+ locked?: boolean;
1366
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1367
+ } & import("./../../common/types/Shapes").Brush & {
1368
+ type: "brush";
1369
+ scaleX?: number;
1370
+ scaleY?: number;
1371
+ } & {
1372
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1373
+ path?: Path2D | undefined;
1374
+ type: "brush";
1375
+ }) | ({
1376
+ id: string;
1377
+ computed: {
1378
+ borders: import("./../../common/types/Shapes").Rect;
1379
+ outerBorders: import("./../../common/types/Shapes").Rect;
1380
+ center: Point;
1381
+ boundingBox: import("./../../common/types/Shapes").Rect;
1382
+ };
1383
+ } & {
1384
+ rotation?: number;
1385
+ toolId?: string;
1386
+ visible?: boolean;
1387
+ locked?: boolean;
1388
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1389
+ } & import("./../../common/types/Shapes").Rect & {
1390
+ shapes: ShapeEntity[];
1391
+ type: "group";
1392
+ } & {
1393
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1394
+ path?: Path2D | undefined;
1395
+ type: "group";
1396
+ }) | undefined) | undefined>;
17
1397
  refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point, isInsideMask: boolean) => void;
18
- toggleShapeVisibility: (shape: ShapeEntity) => void;
19
- toggleShapeLock: (shape: ShapeEntity) => void;
20
- removeShape: (shape: ShapeEntity) => void;
21
- updateShape: (updatedShape: ShapeEntity, withSave?: boolean) => void;
1398
+ toggleShapeVisibility: (shapes: ShapeEntity[]) => void;
1399
+ toggleShapeLock: (shapeGroup: ShapeEntity[]) => void;
1400
+ removeShape: (shapes: ShapeEntity[]) => void;
1401
+ updateShape: (updatedShapes: ShapeEntity[], withSave?: boolean) => void;
22
1402
  backwardShape: () => void;
23
1403
  forwardShape: () => void;
24
1404
  clearShapes: (shapesToInit: ShapeEntity[], options: {