@yorab/react-paint 0.14.0 → 0.15.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 (44) hide show
  1. package/README.md +46 -283
  2. package/dist/canvas/components/Canvas.d.ts +2 -0
  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/hooks/useComponent.d.ts +3 -1
  7. package/dist/canvas/hooks/useDebounce.d.ts +2 -0
  8. package/dist/canvas/hooks/useDrawableCanvas.d.ts +3 -1
  9. package/dist/canvas/hooks/useKeyboard.d.ts +5 -1
  10. package/dist/canvas/hooks/useReactPaint.d.ts +1847 -8
  11. package/dist/canvas/hooks/useShapes.d.ts +1379 -4
  12. package/dist/canvas/index.d.ts +3 -3
  13. package/dist/canvas/utils/data.d.ts +2 -2
  14. package/dist/canvas/utils/file.d.ts +233 -4
  15. package/dist/canvas/utils/intersect.d.ts +4 -4
  16. package/dist/canvas/utils/selection/groupSelection.d.ts +2 -2
  17. package/dist/canvas/utils/selection/lineSelection.d.ts +6 -2
  18. package/dist/canvas/utils/selection/rectSelection.d.ts +9 -4
  19. package/dist/canvas/utils/selection.d.ts +1 -1
  20. package/dist/canvas/utils/shapes/brush.d.ts +14 -11
  21. package/dist/canvas/utils/shapes/circle.d.ts +13 -9
  22. package/dist/canvas/utils/shapes/curve.d.ts +15 -10
  23. package/dist/canvas/utils/shapes/ellipse.d.ts +13 -9
  24. package/dist/canvas/utils/shapes/index.d.ts +19 -10
  25. package/dist/canvas/utils/shapes/line.d.ts +13 -8
  26. package/dist/canvas/utils/shapes/path.d.ts +18 -2
  27. package/dist/canvas/utils/shapes/picture.d.ts +13 -9
  28. package/dist/canvas/utils/shapes/polygon.d.ts +14 -8
  29. package/dist/canvas/utils/shapes/rectangle.d.ts +54 -9
  30. package/dist/canvas/utils/shapes/text.d.ts +12 -7
  31. package/dist/canvas/utils/shapes/triangle.d.ts +4 -3
  32. package/dist/canvas/utils/trigo.d.ts +1 -1
  33. package/dist/common/types/Mode.d.ts +1 -0
  34. package/dist/common/types/Shapes.d.ts +63 -26
  35. package/dist/common/types/utils.d.ts +1 -1
  36. package/dist/editor/components/common/Button.d.ts +2 -2
  37. package/dist/editor/components/common/FileInput.d.ts +13 -0
  38. package/dist/editor/components/settings/RangeField.d.ts +2 -1
  39. package/dist/editor/components/settings/SettingsBar.d.ts +2 -1
  40. package/dist/editor/index.d.ts +11 -11
  41. package/dist/react-paint.css +1 -1
  42. package/dist/react-paint.js +1362 -1312
  43. package/dist/react-paint.umd.cjs +1 -1
  44. package/package.json +19 -15
@@ -3,9 +3,696 @@ import type { Point, SelectionType, ShapeEntity, StateData } from './../../commo
3
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: SelectionType | undefined;
8
- hoveredShape: ShapeEntity | 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;
9
696
  selectionFrame: {
10
697
  oldSelection: SelectionType | undefined;
11
698
  frame: [Point, Point];
@@ -16,10 +703,698 @@ declare const useShapes: (settings: UtilsSettings, width: number, height: number
16
703
  } | undefined>>;
17
704
  refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
18
705
  addShapes: (newShapes: ShapeEntity[]) => void;
706
+ duplicateShapes: (shapesToDuplicate: ShapeEntity[]) => void;
19
707
  addPictureShape: (fileOrUrl: File | string, maxWidth?: number, maxHeight?: number) => Promise<ShapeEntity<"picture">>;
20
708
  moveShapes: (startPositionShapeId: string, endPositionShapeId: string) => void;
21
709
  saveShapes: () => void;
22
- setSelectedShape: import("react").Dispatch<import("react").SetStateAction<SelectionType | undefined>>;
710
+ setSelectedShape: import("react").Dispatch<({
711
+ id: string;
712
+ computed: {
713
+ borders: import("./../../common/types/Shapes").Rect;
714
+ outerBorders: import("./../../common/types/Shapes").Rect;
715
+ center: Point;
716
+ boundingBox: import("./../../common/types/Shapes").Rect;
717
+ };
718
+ } & {
719
+ rotation?: number;
720
+ toolId?: string;
721
+ visible?: boolean;
722
+ locked?: boolean;
723
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
724
+ } & import("./../../common/types/Shapes").Line & {
725
+ type: "line";
726
+ } & {
727
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
728
+ path?: Path2D | undefined;
729
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
730
+ type: "line";
731
+ }) | ({
732
+ id: string;
733
+ computed: {
734
+ borders: import("./../../common/types/Shapes").Rect;
735
+ outerBorders: import("./../../common/types/Shapes").Rect;
736
+ center: Point;
737
+ boundingBox: import("./../../common/types/Shapes").Rect;
738
+ };
739
+ } & {
740
+ rotation?: number;
741
+ toolId?: string;
742
+ visible?: boolean;
743
+ locked?: boolean;
744
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
745
+ } & import("./../../common/types/Shapes").Rect & {
746
+ src: string;
747
+ } & {
748
+ img: HTMLImageElement;
749
+ type: "picture";
750
+ } & {
751
+ img: HTMLImageElement;
752
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
753
+ type: "picture";
754
+ }) | ({
755
+ id: string;
756
+ computed: {
757
+ borders: import("./../../common/types/Shapes").Rect;
758
+ outerBorders: import("./../../common/types/Shapes").Rect;
759
+ center: Point;
760
+ boundingBox: import("./../../common/types/Shapes").Rect;
761
+ };
762
+ } & {
763
+ rotation?: number;
764
+ toolId?: string;
765
+ visible?: boolean;
766
+ locked?: boolean;
767
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
768
+ } & import("./../../common/types/Shapes").Rect & {
769
+ value: string[];
770
+ fontSize: number;
771
+ } & {
772
+ type: "text";
773
+ } & {
774
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
775
+ type: "text";
776
+ }) | ({
777
+ id: string;
778
+ computed: {
779
+ borders: import("./../../common/types/Shapes").Rect;
780
+ outerBorders: import("./../../common/types/Shapes").Rect;
781
+ center: Point;
782
+ boundingBox: import("./../../common/types/Shapes").Rect;
783
+ };
784
+ } & {
785
+ rotation?: number;
786
+ toolId?: string;
787
+ visible?: boolean;
788
+ locked?: boolean;
789
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
790
+ } & import("./../../common/types/Shapes").Rect & {
791
+ type: "rect";
792
+ } & {
793
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
794
+ path?: Path2D | undefined;
795
+ type: "rect";
796
+ }) | ({
797
+ id: string;
798
+ computed: {
799
+ borders: import("./../../common/types/Shapes").Rect;
800
+ outerBorders: import("./../../common/types/Shapes").Rect;
801
+ center: Point;
802
+ boundingBox: import("./../../common/types/Shapes").Rect;
803
+ };
804
+ } & {
805
+ rotation?: number;
806
+ toolId?: string;
807
+ visible?: boolean;
808
+ locked?: boolean;
809
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
810
+ } & import("./../../common/types/Shapes").Rect & {
811
+ type: "square";
812
+ } & {
813
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
814
+ path?: Path2D | undefined;
815
+ type: "square";
816
+ }) | ({
817
+ id: string;
818
+ computed: {
819
+ borders: import("./../../common/types/Shapes").Rect;
820
+ outerBorders: import("./../../common/types/Shapes").Rect;
821
+ center: Point;
822
+ boundingBox: import("./../../common/types/Shapes").Rect;
823
+ };
824
+ } & {
825
+ rotation?: number;
826
+ toolId?: string;
827
+ visible?: boolean;
828
+ locked?: boolean;
829
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
830
+ } & import("./../../common/types/Shapes").Circle & {
831
+ type: "circle";
832
+ } & {
833
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
834
+ path?: Path2D | undefined;
835
+ type: "circle";
836
+ }) | ({
837
+ id: string;
838
+ computed: {
839
+ borders: import("./../../common/types/Shapes").Rect;
840
+ outerBorders: import("./../../common/types/Shapes").Rect;
841
+ center: Point;
842
+ boundingBox: import("./../../common/types/Shapes").Rect;
843
+ };
844
+ } & {
845
+ rotation?: number;
846
+ toolId?: string;
847
+ visible?: boolean;
848
+ locked?: boolean;
849
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
850
+ } & import("./../../common/types/Shapes").Ellipse & {
851
+ type: "ellipse";
852
+ } & {
853
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
854
+ path?: Path2D | undefined;
855
+ type: "ellipse";
856
+ }) | ({
857
+ id: string;
858
+ computed: {
859
+ borders: import("./../../common/types/Shapes").Rect;
860
+ outerBorders: import("./../../common/types/Shapes").Rect;
861
+ center: Point;
862
+ boundingBox: import("./../../common/types/Shapes").Rect;
863
+ };
864
+ } & {
865
+ rotation?: number;
866
+ toolId?: string;
867
+ visible?: boolean;
868
+ locked?: boolean;
869
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
870
+ } & import("./../../common/types/Shapes").Polygon & {
871
+ type: "polygon";
872
+ } & {
873
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
874
+ path?: Path2D | undefined;
875
+ type: "polygon";
876
+ }) | ({
877
+ id: string;
878
+ computed: {
879
+ borders: import("./../../common/types/Shapes").Rect;
880
+ outerBorders: import("./../../common/types/Shapes").Rect;
881
+ center: Point;
882
+ boundingBox: import("./../../common/types/Shapes").Rect;
883
+ };
884
+ } & {
885
+ rotation?: number;
886
+ toolId?: string;
887
+ visible?: boolean;
888
+ locked?: boolean;
889
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
890
+ } & import("./../../common/types/Shapes").Curve & {
891
+ type: "curve";
892
+ } & {
893
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
894
+ path?: Path2D | undefined;
895
+ type: "curve";
896
+ }) | ({
897
+ id: string;
898
+ computed: {
899
+ borders: import("./../../common/types/Shapes").Rect;
900
+ outerBorders: import("./../../common/types/Shapes").Rect;
901
+ center: Point;
902
+ boundingBox: import("./../../common/types/Shapes").Rect;
903
+ };
904
+ } & {
905
+ rotation?: number;
906
+ toolId?: string;
907
+ visible?: boolean;
908
+ locked?: boolean;
909
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
910
+ } & import("./../../common/types/Shapes").Brush & {
911
+ type: "brush";
912
+ scaleX?: number;
913
+ scaleY?: number;
914
+ } & {
915
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
916
+ path?: Path2D | undefined;
917
+ type: "brush";
918
+ }) | ({
919
+ id: string;
920
+ computed: {
921
+ borders: import("./../../common/types/Shapes").Rect;
922
+ outerBorders: import("./../../common/types/Shapes").Rect;
923
+ center: Point;
924
+ boundingBox: import("./../../common/types/Shapes").Rect;
925
+ };
926
+ } & {
927
+ rotation?: number;
928
+ toolId?: string;
929
+ visible?: boolean;
930
+ locked?: boolean;
931
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
932
+ } & import("./../../common/types/Shapes").Rect & {
933
+ shapes: ShapeEntity[];
934
+ type: "group";
935
+ } & {
936
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
937
+ path?: Path2D | undefined;
938
+ type: "group";
939
+ }) | ((prevState: ({
940
+ id: string;
941
+ computed: {
942
+ borders: import("./../../common/types/Shapes").Rect;
943
+ outerBorders: import("./../../common/types/Shapes").Rect;
944
+ center: Point;
945
+ boundingBox: import("./../../common/types/Shapes").Rect;
946
+ };
947
+ } & {
948
+ rotation?: number;
949
+ toolId?: string;
950
+ visible?: boolean;
951
+ locked?: boolean;
952
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
953
+ } & import("./../../common/types/Shapes").Line & {
954
+ type: "line";
955
+ } & {
956
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
957
+ path?: Path2D | undefined;
958
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
959
+ type: "line";
960
+ }) | ({
961
+ id: string;
962
+ computed: {
963
+ borders: import("./../../common/types/Shapes").Rect;
964
+ outerBorders: import("./../../common/types/Shapes").Rect;
965
+ center: Point;
966
+ boundingBox: import("./../../common/types/Shapes").Rect;
967
+ };
968
+ } & {
969
+ rotation?: number;
970
+ toolId?: string;
971
+ visible?: boolean;
972
+ locked?: boolean;
973
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
974
+ } & import("./../../common/types/Shapes").Rect & {
975
+ src: string;
976
+ } & {
977
+ img: HTMLImageElement;
978
+ type: "picture";
979
+ } & {
980
+ img: HTMLImageElement;
981
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
982
+ type: "picture";
983
+ }) | ({
984
+ id: string;
985
+ computed: {
986
+ borders: import("./../../common/types/Shapes").Rect;
987
+ outerBorders: import("./../../common/types/Shapes").Rect;
988
+ center: Point;
989
+ boundingBox: import("./../../common/types/Shapes").Rect;
990
+ };
991
+ } & {
992
+ rotation?: number;
993
+ toolId?: string;
994
+ visible?: boolean;
995
+ locked?: boolean;
996
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
997
+ } & import("./../../common/types/Shapes").Rect & {
998
+ value: string[];
999
+ fontSize: number;
1000
+ } & {
1001
+ type: "text";
1002
+ } & {
1003
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1004
+ type: "text";
1005
+ }) | ({
1006
+ id: string;
1007
+ computed: {
1008
+ borders: import("./../../common/types/Shapes").Rect;
1009
+ outerBorders: import("./../../common/types/Shapes").Rect;
1010
+ center: Point;
1011
+ boundingBox: import("./../../common/types/Shapes").Rect;
1012
+ };
1013
+ } & {
1014
+ rotation?: number;
1015
+ toolId?: string;
1016
+ visible?: boolean;
1017
+ locked?: boolean;
1018
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1019
+ } & import("./../../common/types/Shapes").Rect & {
1020
+ type: "rect";
1021
+ } & {
1022
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1023
+ path?: Path2D | undefined;
1024
+ type: "rect";
1025
+ }) | ({
1026
+ id: string;
1027
+ computed: {
1028
+ borders: import("./../../common/types/Shapes").Rect;
1029
+ outerBorders: import("./../../common/types/Shapes").Rect;
1030
+ center: Point;
1031
+ boundingBox: import("./../../common/types/Shapes").Rect;
1032
+ };
1033
+ } & {
1034
+ rotation?: number;
1035
+ toolId?: string;
1036
+ visible?: boolean;
1037
+ locked?: boolean;
1038
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1039
+ } & import("./../../common/types/Shapes").Rect & {
1040
+ type: "square";
1041
+ } & {
1042
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1043
+ path?: Path2D | undefined;
1044
+ type: "square";
1045
+ }) | ({
1046
+ id: string;
1047
+ computed: {
1048
+ borders: import("./../../common/types/Shapes").Rect;
1049
+ outerBorders: import("./../../common/types/Shapes").Rect;
1050
+ center: Point;
1051
+ boundingBox: import("./../../common/types/Shapes").Rect;
1052
+ };
1053
+ } & {
1054
+ rotation?: number;
1055
+ toolId?: string;
1056
+ visible?: boolean;
1057
+ locked?: boolean;
1058
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1059
+ } & import("./../../common/types/Shapes").Circle & {
1060
+ type: "circle";
1061
+ } & {
1062
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1063
+ path?: Path2D | undefined;
1064
+ type: "circle";
1065
+ }) | ({
1066
+ id: string;
1067
+ computed: {
1068
+ borders: import("./../../common/types/Shapes").Rect;
1069
+ outerBorders: import("./../../common/types/Shapes").Rect;
1070
+ center: Point;
1071
+ boundingBox: import("./../../common/types/Shapes").Rect;
1072
+ };
1073
+ } & {
1074
+ rotation?: number;
1075
+ toolId?: string;
1076
+ visible?: boolean;
1077
+ locked?: boolean;
1078
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1079
+ } & import("./../../common/types/Shapes").Ellipse & {
1080
+ type: "ellipse";
1081
+ } & {
1082
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1083
+ path?: Path2D | undefined;
1084
+ type: "ellipse";
1085
+ }) | ({
1086
+ id: string;
1087
+ computed: {
1088
+ borders: import("./../../common/types/Shapes").Rect;
1089
+ outerBorders: import("./../../common/types/Shapes").Rect;
1090
+ center: Point;
1091
+ boundingBox: import("./../../common/types/Shapes").Rect;
1092
+ };
1093
+ } & {
1094
+ rotation?: number;
1095
+ toolId?: string;
1096
+ visible?: boolean;
1097
+ locked?: boolean;
1098
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1099
+ } & import("./../../common/types/Shapes").Polygon & {
1100
+ type: "polygon";
1101
+ } & {
1102
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1103
+ path?: Path2D | undefined;
1104
+ type: "polygon";
1105
+ }) | ({
1106
+ id: string;
1107
+ computed: {
1108
+ borders: import("./../../common/types/Shapes").Rect;
1109
+ outerBorders: import("./../../common/types/Shapes").Rect;
1110
+ center: Point;
1111
+ boundingBox: import("./../../common/types/Shapes").Rect;
1112
+ };
1113
+ } & {
1114
+ rotation?: number;
1115
+ toolId?: string;
1116
+ visible?: boolean;
1117
+ locked?: boolean;
1118
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1119
+ } & import("./../../common/types/Shapes").Curve & {
1120
+ type: "curve";
1121
+ } & {
1122
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1123
+ path?: Path2D | undefined;
1124
+ type: "curve";
1125
+ }) | ({
1126
+ id: string;
1127
+ computed: {
1128
+ borders: import("./../../common/types/Shapes").Rect;
1129
+ outerBorders: import("./../../common/types/Shapes").Rect;
1130
+ center: Point;
1131
+ boundingBox: import("./../../common/types/Shapes").Rect;
1132
+ };
1133
+ } & {
1134
+ rotation?: number;
1135
+ toolId?: string;
1136
+ visible?: boolean;
1137
+ locked?: boolean;
1138
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1139
+ } & import("./../../common/types/Shapes").Brush & {
1140
+ type: "brush";
1141
+ scaleX?: number;
1142
+ scaleY?: number;
1143
+ } & {
1144
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1145
+ path?: Path2D | undefined;
1146
+ type: "brush";
1147
+ }) | ({
1148
+ id: string;
1149
+ computed: {
1150
+ borders: import("./../../common/types/Shapes").Rect;
1151
+ outerBorders: import("./../../common/types/Shapes").Rect;
1152
+ center: Point;
1153
+ boundingBox: import("./../../common/types/Shapes").Rect;
1154
+ };
1155
+ } & {
1156
+ rotation?: number;
1157
+ toolId?: string;
1158
+ visible?: boolean;
1159
+ locked?: boolean;
1160
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1161
+ } & import("./../../common/types/Shapes").Rect & {
1162
+ shapes: ShapeEntity[];
1163
+ type: "group";
1164
+ } & {
1165
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1166
+ path?: Path2D | undefined;
1167
+ type: "group";
1168
+ }) | undefined) => ({
1169
+ id: string;
1170
+ computed: {
1171
+ borders: import("./../../common/types/Shapes").Rect;
1172
+ outerBorders: import("./../../common/types/Shapes").Rect;
1173
+ center: Point;
1174
+ boundingBox: import("./../../common/types/Shapes").Rect;
1175
+ };
1176
+ } & {
1177
+ rotation?: number;
1178
+ toolId?: string;
1179
+ visible?: boolean;
1180
+ locked?: boolean;
1181
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1182
+ } & import("./../../common/types/Shapes").Line & {
1183
+ type: "line";
1184
+ } & {
1185
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1186
+ path?: Path2D | undefined;
1187
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
1188
+ type: "line";
1189
+ }) | ({
1190
+ id: string;
1191
+ computed: {
1192
+ borders: import("./../../common/types/Shapes").Rect;
1193
+ outerBorders: import("./../../common/types/Shapes").Rect;
1194
+ center: Point;
1195
+ boundingBox: import("./../../common/types/Shapes").Rect;
1196
+ };
1197
+ } & {
1198
+ rotation?: number;
1199
+ toolId?: string;
1200
+ visible?: boolean;
1201
+ locked?: boolean;
1202
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1203
+ } & import("./../../common/types/Shapes").Rect & {
1204
+ src: string;
1205
+ } & {
1206
+ img: HTMLImageElement;
1207
+ type: "picture";
1208
+ } & {
1209
+ img: HTMLImageElement;
1210
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1211
+ type: "picture";
1212
+ }) | ({
1213
+ id: string;
1214
+ computed: {
1215
+ borders: import("./../../common/types/Shapes").Rect;
1216
+ outerBorders: import("./../../common/types/Shapes").Rect;
1217
+ center: Point;
1218
+ boundingBox: import("./../../common/types/Shapes").Rect;
1219
+ };
1220
+ } & {
1221
+ rotation?: number;
1222
+ toolId?: string;
1223
+ visible?: boolean;
1224
+ locked?: boolean;
1225
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1226
+ } & import("./../../common/types/Shapes").Rect & {
1227
+ value: string[];
1228
+ fontSize: number;
1229
+ } & {
1230
+ type: "text";
1231
+ } & {
1232
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1233
+ type: "text";
1234
+ }) | ({
1235
+ id: string;
1236
+ computed: {
1237
+ borders: import("./../../common/types/Shapes").Rect;
1238
+ outerBorders: import("./../../common/types/Shapes").Rect;
1239
+ center: Point;
1240
+ boundingBox: import("./../../common/types/Shapes").Rect;
1241
+ };
1242
+ } & {
1243
+ rotation?: number;
1244
+ toolId?: string;
1245
+ visible?: boolean;
1246
+ locked?: boolean;
1247
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1248
+ } & import("./../../common/types/Shapes").Rect & {
1249
+ type: "rect";
1250
+ } & {
1251
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1252
+ path?: Path2D | undefined;
1253
+ type: "rect";
1254
+ }) | ({
1255
+ id: string;
1256
+ computed: {
1257
+ borders: import("./../../common/types/Shapes").Rect;
1258
+ outerBorders: import("./../../common/types/Shapes").Rect;
1259
+ center: Point;
1260
+ boundingBox: import("./../../common/types/Shapes").Rect;
1261
+ };
1262
+ } & {
1263
+ rotation?: number;
1264
+ toolId?: string;
1265
+ visible?: boolean;
1266
+ locked?: boolean;
1267
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1268
+ } & import("./../../common/types/Shapes").Rect & {
1269
+ type: "square";
1270
+ } & {
1271
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1272
+ path?: Path2D | undefined;
1273
+ type: "square";
1274
+ }) | ({
1275
+ id: string;
1276
+ computed: {
1277
+ borders: import("./../../common/types/Shapes").Rect;
1278
+ outerBorders: import("./../../common/types/Shapes").Rect;
1279
+ center: Point;
1280
+ boundingBox: import("./../../common/types/Shapes").Rect;
1281
+ };
1282
+ } & {
1283
+ rotation?: number;
1284
+ toolId?: string;
1285
+ visible?: boolean;
1286
+ locked?: boolean;
1287
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1288
+ } & import("./../../common/types/Shapes").Circle & {
1289
+ type: "circle";
1290
+ } & {
1291
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1292
+ path?: Path2D | undefined;
1293
+ type: "circle";
1294
+ }) | ({
1295
+ id: string;
1296
+ computed: {
1297
+ borders: import("./../../common/types/Shapes").Rect;
1298
+ outerBorders: import("./../../common/types/Shapes").Rect;
1299
+ center: Point;
1300
+ boundingBox: import("./../../common/types/Shapes").Rect;
1301
+ };
1302
+ } & {
1303
+ rotation?: number;
1304
+ toolId?: string;
1305
+ visible?: boolean;
1306
+ locked?: boolean;
1307
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1308
+ } & import("./../../common/types/Shapes").Ellipse & {
1309
+ type: "ellipse";
1310
+ } & {
1311
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1312
+ path?: Path2D | undefined;
1313
+ type: "ellipse";
1314
+ }) | ({
1315
+ id: string;
1316
+ computed: {
1317
+ borders: import("./../../common/types/Shapes").Rect;
1318
+ outerBorders: import("./../../common/types/Shapes").Rect;
1319
+ center: Point;
1320
+ boundingBox: import("./../../common/types/Shapes").Rect;
1321
+ };
1322
+ } & {
1323
+ rotation?: number;
1324
+ toolId?: string;
1325
+ visible?: boolean;
1326
+ locked?: boolean;
1327
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1328
+ } & import("./../../common/types/Shapes").Polygon & {
1329
+ type: "polygon";
1330
+ } & {
1331
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1332
+ path?: Path2D | undefined;
1333
+ type: "polygon";
1334
+ }) | ({
1335
+ id: string;
1336
+ computed: {
1337
+ borders: import("./../../common/types/Shapes").Rect;
1338
+ outerBorders: import("./../../common/types/Shapes").Rect;
1339
+ center: Point;
1340
+ boundingBox: import("./../../common/types/Shapes").Rect;
1341
+ };
1342
+ } & {
1343
+ rotation?: number;
1344
+ toolId?: string;
1345
+ visible?: boolean;
1346
+ locked?: boolean;
1347
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1348
+ } & import("./../../common/types/Shapes").Curve & {
1349
+ type: "curve";
1350
+ } & {
1351
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1352
+ path?: Path2D | undefined;
1353
+ type: "curve";
1354
+ }) | ({
1355
+ id: string;
1356
+ computed: {
1357
+ borders: import("./../../common/types/Shapes").Rect;
1358
+ outerBorders: import("./../../common/types/Shapes").Rect;
1359
+ center: Point;
1360
+ boundingBox: import("./../../common/types/Shapes").Rect;
1361
+ };
1362
+ } & {
1363
+ rotation?: number;
1364
+ toolId?: string;
1365
+ visible?: boolean;
1366
+ locked?: boolean;
1367
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1368
+ } & import("./../../common/types/Shapes").Brush & {
1369
+ type: "brush";
1370
+ scaleX?: number;
1371
+ scaleY?: number;
1372
+ } & {
1373
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1374
+ path?: Path2D | undefined;
1375
+ type: "brush";
1376
+ }) | ({
1377
+ id: string;
1378
+ computed: {
1379
+ borders: import("./../../common/types/Shapes").Rect;
1380
+ outerBorders: import("./../../common/types/Shapes").Rect;
1381
+ center: Point;
1382
+ boundingBox: import("./../../common/types/Shapes").Rect;
1383
+ };
1384
+ } & {
1385
+ rotation?: number;
1386
+ toolId?: string;
1387
+ visible?: boolean;
1388
+ locked?: boolean;
1389
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1390
+ } & import("./../../common/types/Shapes").Rect & {
1391
+ shapes: ShapeEntity[];
1392
+ type: "group";
1393
+ } & {
1394
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1395
+ path?: Path2D | undefined;
1396
+ type: "group";
1397
+ }) | undefined) | undefined>;
23
1398
  refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point, isInsideMask: boolean) => void;
24
1399
  toggleShapeVisibility: (shapes: ShapeEntity[]) => void;
25
1400
  toggleShapeLock: (shapeGroup: ShapeEntity[]) => void;