@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
@@ -14,8 +14,8 @@ type UseReactPaintProps = {
14
14
  declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disabled, options }?: UseReactPaintProps) => {
15
15
  annotationsProps: {
16
16
  style: {
17
- 'user-select': string;
18
- 'touch-action': string;
17
+ userSelect: "none";
18
+ touchAction: string;
19
19
  transformOrigin: string;
20
20
  transform: string;
21
21
  '--react-paint-canvas-zoom': number;
@@ -26,7 +26,236 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
26
26
  };
27
27
  };
28
28
  editorProps: {
29
- shapesRef: import("react").RefObject<ShapeEntity[]>;
29
+ shapesRef: import("react").RefObject<(({
30
+ id: string;
31
+ computed: {
32
+ borders: import("./../../common/types/Shapes").Rect;
33
+ outerBorders: import("./../../common/types/Shapes").Rect;
34
+ center: Point;
35
+ boundingBox: import("./../../common/types/Shapes").Rect;
36
+ };
37
+ } & {
38
+ rotation?: number;
39
+ toolId?: string;
40
+ visible?: boolean;
41
+ locked?: boolean;
42
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
43
+ } & import("./../../common/types/Shapes").Line & {
44
+ type: "line";
45
+ } & {
46
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
47
+ path?: Path2D | undefined;
48
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
49
+ type: "line";
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
+ src: string;
66
+ } & {
67
+ img: HTMLImageElement;
68
+ type: "picture";
69
+ } & {
70
+ img: HTMLImageElement;
71
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
72
+ type: "picture";
73
+ }) | ({
74
+ id: string;
75
+ computed: {
76
+ borders: import("./../../common/types/Shapes").Rect;
77
+ outerBorders: import("./../../common/types/Shapes").Rect;
78
+ center: Point;
79
+ boundingBox: import("./../../common/types/Shapes").Rect;
80
+ };
81
+ } & {
82
+ rotation?: number;
83
+ toolId?: string;
84
+ visible?: boolean;
85
+ locked?: boolean;
86
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
87
+ } & import("./../../common/types/Shapes").Rect & {
88
+ value: string[];
89
+ fontSize: number;
90
+ } & {
91
+ type: "text";
92
+ } & {
93
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
94
+ type: "text";
95
+ }) | ({
96
+ id: string;
97
+ computed: {
98
+ borders: import("./../../common/types/Shapes").Rect;
99
+ outerBorders: import("./../../common/types/Shapes").Rect;
100
+ center: Point;
101
+ boundingBox: import("./../../common/types/Shapes").Rect;
102
+ };
103
+ } & {
104
+ rotation?: number;
105
+ toolId?: string;
106
+ visible?: boolean;
107
+ locked?: boolean;
108
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
109
+ } & import("./../../common/types/Shapes").Rect & {
110
+ type: "rect";
111
+ } & {
112
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
113
+ path?: Path2D | undefined;
114
+ type: "rect";
115
+ }) | ({
116
+ id: string;
117
+ computed: {
118
+ borders: import("./../../common/types/Shapes").Rect;
119
+ outerBorders: import("./../../common/types/Shapes").Rect;
120
+ center: Point;
121
+ boundingBox: import("./../../common/types/Shapes").Rect;
122
+ };
123
+ } & {
124
+ rotation?: number;
125
+ toolId?: string;
126
+ visible?: boolean;
127
+ locked?: boolean;
128
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
129
+ } & import("./../../common/types/Shapes").Rect & {
130
+ type: "square";
131
+ } & {
132
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
133
+ path?: Path2D | undefined;
134
+ type: "square";
135
+ }) | ({
136
+ id: string;
137
+ computed: {
138
+ borders: import("./../../common/types/Shapes").Rect;
139
+ outerBorders: import("./../../common/types/Shapes").Rect;
140
+ center: Point;
141
+ boundingBox: import("./../../common/types/Shapes").Rect;
142
+ };
143
+ } & {
144
+ rotation?: number;
145
+ toolId?: string;
146
+ visible?: boolean;
147
+ locked?: boolean;
148
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
149
+ } & import("./../../common/types/Shapes").Circle & {
150
+ type: "circle";
151
+ } & {
152
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
153
+ path?: Path2D | undefined;
154
+ type: "circle";
155
+ }) | ({
156
+ id: string;
157
+ computed: {
158
+ borders: import("./../../common/types/Shapes").Rect;
159
+ outerBorders: import("./../../common/types/Shapes").Rect;
160
+ center: Point;
161
+ boundingBox: import("./../../common/types/Shapes").Rect;
162
+ };
163
+ } & {
164
+ rotation?: number;
165
+ toolId?: string;
166
+ visible?: boolean;
167
+ locked?: boolean;
168
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
169
+ } & import("./../../common/types/Shapes").Ellipse & {
170
+ type: "ellipse";
171
+ } & {
172
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
173
+ path?: Path2D | undefined;
174
+ type: "ellipse";
175
+ }) | ({
176
+ id: string;
177
+ computed: {
178
+ borders: import("./../../common/types/Shapes").Rect;
179
+ outerBorders: import("./../../common/types/Shapes").Rect;
180
+ center: Point;
181
+ boundingBox: import("./../../common/types/Shapes").Rect;
182
+ };
183
+ } & {
184
+ rotation?: number;
185
+ toolId?: string;
186
+ visible?: boolean;
187
+ locked?: boolean;
188
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
189
+ } & import("./../../common/types/Shapes").Polygon & {
190
+ type: "polygon";
191
+ } & {
192
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
193
+ path?: Path2D | undefined;
194
+ type: "polygon";
195
+ }) | ({
196
+ id: string;
197
+ computed: {
198
+ borders: import("./../../common/types/Shapes").Rect;
199
+ outerBorders: import("./../../common/types/Shapes").Rect;
200
+ center: Point;
201
+ boundingBox: import("./../../common/types/Shapes").Rect;
202
+ };
203
+ } & {
204
+ rotation?: number;
205
+ toolId?: string;
206
+ visible?: boolean;
207
+ locked?: boolean;
208
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
209
+ } & import("./../../common/types/Shapes").Curve & {
210
+ type: "curve";
211
+ } & {
212
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
213
+ path?: Path2D | undefined;
214
+ type: "curve";
215
+ }) | ({
216
+ id: string;
217
+ computed: {
218
+ borders: import("./../../common/types/Shapes").Rect;
219
+ outerBorders: import("./../../common/types/Shapes").Rect;
220
+ center: Point;
221
+ boundingBox: import("./../../common/types/Shapes").Rect;
222
+ };
223
+ } & {
224
+ rotation?: number;
225
+ toolId?: string;
226
+ visible?: boolean;
227
+ locked?: boolean;
228
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
229
+ } & import("./../../common/types/Shapes").Brush & {
230
+ type: "brush";
231
+ scaleX?: number;
232
+ scaleY?: number;
233
+ } & {
234
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
235
+ path?: Path2D | undefined;
236
+ type: "brush";
237
+ }) | ({
238
+ id: string;
239
+ computed: {
240
+ borders: import("./../../common/types/Shapes").Rect;
241
+ outerBorders: import("./../../common/types/Shapes").Rect;
242
+ center: Point;
243
+ boundingBox: import("./../../common/types/Shapes").Rect;
244
+ };
245
+ } & {
246
+ rotation?: number;
247
+ toolId?: string;
248
+ visible?: boolean;
249
+ locked?: boolean;
250
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
251
+ } & import("./../../common/types/Shapes").Rect & {
252
+ shapes: ShapeEntity[];
253
+ type: "group";
254
+ } & {
255
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
256
+ path?: Path2D | undefined;
257
+ type: "group";
258
+ }))[]>;
30
259
  addPictureShape: (fileOrUrl: File | string, maxWidth?: number, maxHeight?: number) => Promise<ShapeEntity<"picture">>;
31
260
  moveShapes: (startPositionShapeId: string, endPositionShapeId: string) => void;
32
261
  toggleShapeVisibility: (shapes: ShapeEntity[]) => void;
@@ -34,7 +263,237 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
34
263
  canGoBackward: boolean;
35
264
  canGoForward: boolean;
36
265
  canClear: boolean;
37
- selectedShape: import("./../../common/types/Shapes").SelectionType | undefined;
266
+ selectedShape: ({
267
+ id: string;
268
+ computed: {
269
+ borders: import("./../../common/types/Shapes").Rect;
270
+ outerBorders: import("./../../common/types/Shapes").Rect;
271
+ center: Point;
272
+ boundingBox: import("./../../common/types/Shapes").Rect;
273
+ };
274
+ } & {
275
+ rotation?: number;
276
+ toolId?: string;
277
+ visible?: boolean;
278
+ locked?: boolean;
279
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
280
+ } & import("./../../common/types/Shapes").Line & {
281
+ type: "line";
282
+ } & {
283
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
284
+ path?: Path2D | undefined;
285
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
286
+ type: "line";
287
+ }) | ({
288
+ id: string;
289
+ computed: {
290
+ borders: import("./../../common/types/Shapes").Rect;
291
+ outerBorders: import("./../../common/types/Shapes").Rect;
292
+ center: Point;
293
+ boundingBox: import("./../../common/types/Shapes").Rect;
294
+ };
295
+ } & {
296
+ rotation?: number;
297
+ toolId?: string;
298
+ visible?: boolean;
299
+ locked?: boolean;
300
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
301
+ } & import("./../../common/types/Shapes").Rect & {
302
+ src: string;
303
+ } & {
304
+ img: HTMLImageElement;
305
+ type: "picture";
306
+ } & {
307
+ img: HTMLImageElement;
308
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
309
+ type: "picture";
310
+ }) | ({
311
+ id: string;
312
+ computed: {
313
+ borders: import("./../../common/types/Shapes").Rect;
314
+ outerBorders: import("./../../common/types/Shapes").Rect;
315
+ center: Point;
316
+ boundingBox: import("./../../common/types/Shapes").Rect;
317
+ };
318
+ } & {
319
+ rotation?: number;
320
+ toolId?: string;
321
+ visible?: boolean;
322
+ locked?: boolean;
323
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
324
+ } & import("./../../common/types/Shapes").Rect & {
325
+ value: string[];
326
+ fontSize: number;
327
+ } & {
328
+ type: "text";
329
+ } & {
330
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
331
+ type: "text";
332
+ }) | ({
333
+ id: string;
334
+ computed: {
335
+ borders: import("./../../common/types/Shapes").Rect;
336
+ outerBorders: import("./../../common/types/Shapes").Rect;
337
+ center: Point;
338
+ boundingBox: import("./../../common/types/Shapes").Rect;
339
+ };
340
+ } & {
341
+ rotation?: number;
342
+ toolId?: string;
343
+ visible?: boolean;
344
+ locked?: boolean;
345
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
346
+ } & import("./../../common/types/Shapes").Rect & {
347
+ type: "rect";
348
+ } & {
349
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
350
+ path?: Path2D | undefined;
351
+ type: "rect";
352
+ }) | ({
353
+ id: string;
354
+ computed: {
355
+ borders: import("./../../common/types/Shapes").Rect;
356
+ outerBorders: import("./../../common/types/Shapes").Rect;
357
+ center: Point;
358
+ boundingBox: import("./../../common/types/Shapes").Rect;
359
+ };
360
+ } & {
361
+ rotation?: number;
362
+ toolId?: string;
363
+ visible?: boolean;
364
+ locked?: boolean;
365
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
366
+ } & import("./../../common/types/Shapes").Rect & {
367
+ type: "square";
368
+ } & {
369
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
370
+ path?: Path2D | undefined;
371
+ type: "square";
372
+ }) | ({
373
+ id: string;
374
+ computed: {
375
+ borders: import("./../../common/types/Shapes").Rect;
376
+ outerBorders: import("./../../common/types/Shapes").Rect;
377
+ center: Point;
378
+ boundingBox: import("./../../common/types/Shapes").Rect;
379
+ };
380
+ } & {
381
+ rotation?: number;
382
+ toolId?: string;
383
+ visible?: boolean;
384
+ locked?: boolean;
385
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
386
+ } & import("./../../common/types/Shapes").Circle & {
387
+ type: "circle";
388
+ } & {
389
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
390
+ path?: Path2D | undefined;
391
+ type: "circle";
392
+ }) | ({
393
+ id: string;
394
+ computed: {
395
+ borders: import("./../../common/types/Shapes").Rect;
396
+ outerBorders: import("./../../common/types/Shapes").Rect;
397
+ center: Point;
398
+ boundingBox: import("./../../common/types/Shapes").Rect;
399
+ };
400
+ } & {
401
+ rotation?: number;
402
+ toolId?: string;
403
+ visible?: boolean;
404
+ locked?: boolean;
405
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
406
+ } & import("./../../common/types/Shapes").Ellipse & {
407
+ type: "ellipse";
408
+ } & {
409
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
410
+ path?: Path2D | undefined;
411
+ type: "ellipse";
412
+ }) | ({
413
+ id: string;
414
+ computed: {
415
+ borders: import("./../../common/types/Shapes").Rect;
416
+ outerBorders: import("./../../common/types/Shapes").Rect;
417
+ center: Point;
418
+ boundingBox: import("./../../common/types/Shapes").Rect;
419
+ };
420
+ } & {
421
+ rotation?: number;
422
+ toolId?: string;
423
+ visible?: boolean;
424
+ locked?: boolean;
425
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
426
+ } & import("./../../common/types/Shapes").Polygon & {
427
+ type: "polygon";
428
+ } & {
429
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
430
+ path?: Path2D | undefined;
431
+ type: "polygon";
432
+ }) | ({
433
+ id: string;
434
+ computed: {
435
+ borders: import("./../../common/types/Shapes").Rect;
436
+ outerBorders: import("./../../common/types/Shapes").Rect;
437
+ center: Point;
438
+ boundingBox: import("./../../common/types/Shapes").Rect;
439
+ };
440
+ } & {
441
+ rotation?: number;
442
+ toolId?: string;
443
+ visible?: boolean;
444
+ locked?: boolean;
445
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
446
+ } & import("./../../common/types/Shapes").Curve & {
447
+ type: "curve";
448
+ } & {
449
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
450
+ path?: Path2D | undefined;
451
+ type: "curve";
452
+ }) | ({
453
+ id: string;
454
+ computed: {
455
+ borders: import("./../../common/types/Shapes").Rect;
456
+ outerBorders: import("./../../common/types/Shapes").Rect;
457
+ center: Point;
458
+ boundingBox: import("./../../common/types/Shapes").Rect;
459
+ };
460
+ } & {
461
+ rotation?: number;
462
+ toolId?: string;
463
+ visible?: boolean;
464
+ locked?: boolean;
465
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
466
+ } & import("./../../common/types/Shapes").Brush & {
467
+ type: "brush";
468
+ scaleX?: number;
469
+ scaleY?: number;
470
+ } & {
471
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
472
+ path?: Path2D | undefined;
473
+ type: "brush";
474
+ }) | ({
475
+ id: string;
476
+ computed: {
477
+ borders: import("./../../common/types/Shapes").Rect;
478
+ outerBorders: import("./../../common/types/Shapes").Rect;
479
+ center: Point;
480
+ boundingBox: import("./../../common/types/Shapes").Rect;
481
+ };
482
+ } & {
483
+ rotation?: number;
484
+ toolId?: string;
485
+ visible?: boolean;
486
+ locked?: boolean;
487
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
488
+ } & import("./../../common/types/Shapes").Rect & {
489
+ shapes: ShapeEntity[];
490
+ type: "group";
491
+ } & {
492
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
493
+ path?: Path2D | undefined;
494
+ type: "group";
495
+ }) | undefined;
496
+ saveShapes: () => void;
38
497
  removeShape: (shapes: ShapeEntity[]) => void;
39
498
  updateShape: (updatedShapes: ShapeEntity[], withSave?: boolean) => void;
40
499
  backwardShape: () => void;
@@ -61,6 +520,7 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
61
520
  clearCanvas: () => void;
62
521
  settings: UtilsSettings;
63
522
  setCanvasZoom: (action: "unzoom" | "zoom" | "default") => void;
523
+ resetZoom: () => void;
64
524
  canvas: {
65
525
  canGrow: boolean;
66
526
  canShrink: boolean;
@@ -72,15 +532,1389 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
72
532
  };
73
533
  };
74
534
  canvasProps: {
75
- shapesRef: import("react").RefObject<ShapeEntity[]>;
76
- selectedShape: import("./../../common/types/Shapes").SelectionType | undefined;
535
+ shapesRef: import("react").RefObject<(({
536
+ id: string;
537
+ computed: {
538
+ borders: import("./../../common/types/Shapes").Rect;
539
+ outerBorders: import("./../../common/types/Shapes").Rect;
540
+ center: Point;
541
+ boundingBox: import("./../../common/types/Shapes").Rect;
542
+ };
543
+ } & {
544
+ rotation?: number;
545
+ toolId?: string;
546
+ visible?: boolean;
547
+ locked?: boolean;
548
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
549
+ } & import("./../../common/types/Shapes").Line & {
550
+ type: "line";
551
+ } & {
552
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
553
+ path?: Path2D | undefined;
554
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
555
+ type: "line";
556
+ }) | ({
557
+ id: string;
558
+ computed: {
559
+ borders: import("./../../common/types/Shapes").Rect;
560
+ outerBorders: import("./../../common/types/Shapes").Rect;
561
+ center: Point;
562
+ boundingBox: import("./../../common/types/Shapes").Rect;
563
+ };
564
+ } & {
565
+ rotation?: number;
566
+ toolId?: string;
567
+ visible?: boolean;
568
+ locked?: boolean;
569
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
570
+ } & import("./../../common/types/Shapes").Rect & {
571
+ src: string;
572
+ } & {
573
+ img: HTMLImageElement;
574
+ type: "picture";
575
+ } & {
576
+ img: HTMLImageElement;
577
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
578
+ type: "picture";
579
+ }) | ({
580
+ id: string;
581
+ computed: {
582
+ borders: import("./../../common/types/Shapes").Rect;
583
+ outerBorders: import("./../../common/types/Shapes").Rect;
584
+ center: Point;
585
+ boundingBox: import("./../../common/types/Shapes").Rect;
586
+ };
587
+ } & {
588
+ rotation?: number;
589
+ toolId?: string;
590
+ visible?: boolean;
591
+ locked?: boolean;
592
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
593
+ } & import("./../../common/types/Shapes").Rect & {
594
+ value: string[];
595
+ fontSize: number;
596
+ } & {
597
+ type: "text";
598
+ } & {
599
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
600
+ type: "text";
601
+ }) | ({
602
+ id: string;
603
+ computed: {
604
+ borders: import("./../../common/types/Shapes").Rect;
605
+ outerBorders: import("./../../common/types/Shapes").Rect;
606
+ center: Point;
607
+ boundingBox: import("./../../common/types/Shapes").Rect;
608
+ };
609
+ } & {
610
+ rotation?: number;
611
+ toolId?: string;
612
+ visible?: boolean;
613
+ locked?: boolean;
614
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
615
+ } & import("./../../common/types/Shapes").Rect & {
616
+ type: "rect";
617
+ } & {
618
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
619
+ path?: Path2D | undefined;
620
+ type: "rect";
621
+ }) | ({
622
+ id: string;
623
+ computed: {
624
+ borders: import("./../../common/types/Shapes").Rect;
625
+ outerBorders: import("./../../common/types/Shapes").Rect;
626
+ center: Point;
627
+ boundingBox: import("./../../common/types/Shapes").Rect;
628
+ };
629
+ } & {
630
+ rotation?: number;
631
+ toolId?: string;
632
+ visible?: boolean;
633
+ locked?: boolean;
634
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
635
+ } & import("./../../common/types/Shapes").Rect & {
636
+ type: "square";
637
+ } & {
638
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
639
+ path?: Path2D | undefined;
640
+ type: "square";
641
+ }) | ({
642
+ id: string;
643
+ computed: {
644
+ borders: import("./../../common/types/Shapes").Rect;
645
+ outerBorders: import("./../../common/types/Shapes").Rect;
646
+ center: Point;
647
+ boundingBox: import("./../../common/types/Shapes").Rect;
648
+ };
649
+ } & {
650
+ rotation?: number;
651
+ toolId?: string;
652
+ visible?: boolean;
653
+ locked?: boolean;
654
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
655
+ } & import("./../../common/types/Shapes").Circle & {
656
+ type: "circle";
657
+ } & {
658
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
659
+ path?: Path2D | undefined;
660
+ type: "circle";
661
+ }) | ({
662
+ id: string;
663
+ computed: {
664
+ borders: import("./../../common/types/Shapes").Rect;
665
+ outerBorders: import("./../../common/types/Shapes").Rect;
666
+ center: Point;
667
+ boundingBox: import("./../../common/types/Shapes").Rect;
668
+ };
669
+ } & {
670
+ rotation?: number;
671
+ toolId?: string;
672
+ visible?: boolean;
673
+ locked?: boolean;
674
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
675
+ } & import("./../../common/types/Shapes").Ellipse & {
676
+ type: "ellipse";
677
+ } & {
678
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
679
+ path?: Path2D | undefined;
680
+ type: "ellipse";
681
+ }) | ({
682
+ id: string;
683
+ computed: {
684
+ borders: import("./../../common/types/Shapes").Rect;
685
+ outerBorders: import("./../../common/types/Shapes").Rect;
686
+ center: Point;
687
+ boundingBox: import("./../../common/types/Shapes").Rect;
688
+ };
689
+ } & {
690
+ rotation?: number;
691
+ toolId?: string;
692
+ visible?: boolean;
693
+ locked?: boolean;
694
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
695
+ } & import("./../../common/types/Shapes").Polygon & {
696
+ type: "polygon";
697
+ } & {
698
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
699
+ path?: Path2D | undefined;
700
+ type: "polygon";
701
+ }) | ({
702
+ id: string;
703
+ computed: {
704
+ borders: import("./../../common/types/Shapes").Rect;
705
+ outerBorders: import("./../../common/types/Shapes").Rect;
706
+ center: Point;
707
+ boundingBox: import("./../../common/types/Shapes").Rect;
708
+ };
709
+ } & {
710
+ rotation?: number;
711
+ toolId?: string;
712
+ visible?: boolean;
713
+ locked?: boolean;
714
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
715
+ } & import("./../../common/types/Shapes").Curve & {
716
+ type: "curve";
717
+ } & {
718
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
719
+ path?: Path2D | undefined;
720
+ type: "curve";
721
+ }) | ({
722
+ id: string;
723
+ computed: {
724
+ borders: import("./../../common/types/Shapes").Rect;
725
+ outerBorders: import("./../../common/types/Shapes").Rect;
726
+ center: Point;
727
+ boundingBox: import("./../../common/types/Shapes").Rect;
728
+ };
729
+ } & {
730
+ rotation?: number;
731
+ toolId?: string;
732
+ visible?: boolean;
733
+ locked?: boolean;
734
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
735
+ } & import("./../../common/types/Shapes").Brush & {
736
+ type: "brush";
737
+ scaleX?: number;
738
+ scaleY?: number;
739
+ } & {
740
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
741
+ path?: Path2D | undefined;
742
+ type: "brush";
743
+ }) | ({
744
+ id: string;
745
+ computed: {
746
+ borders: import("./../../common/types/Shapes").Rect;
747
+ outerBorders: import("./../../common/types/Shapes").Rect;
748
+ center: Point;
749
+ boundingBox: import("./../../common/types/Shapes").Rect;
750
+ };
751
+ } & {
752
+ rotation?: number;
753
+ toolId?: string;
754
+ visible?: boolean;
755
+ locked?: boolean;
756
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
757
+ } & import("./../../common/types/Shapes").Rect & {
758
+ shapes: ShapeEntity[];
759
+ type: "group";
760
+ } & {
761
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
762
+ path?: Path2D | undefined;
763
+ type: "group";
764
+ }))[]>;
765
+ selectedShape: ({
766
+ id: string;
767
+ computed: {
768
+ borders: import("./../../common/types/Shapes").Rect;
769
+ outerBorders: import("./../../common/types/Shapes").Rect;
770
+ center: Point;
771
+ boundingBox: import("./../../common/types/Shapes").Rect;
772
+ };
773
+ } & {
774
+ rotation?: number;
775
+ toolId?: string;
776
+ visible?: boolean;
777
+ locked?: boolean;
778
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
779
+ } & import("./../../common/types/Shapes").Line & {
780
+ type: "line";
781
+ } & {
782
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
783
+ path?: Path2D | undefined;
784
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
785
+ type: "line";
786
+ }) | ({
787
+ id: string;
788
+ computed: {
789
+ borders: import("./../../common/types/Shapes").Rect;
790
+ outerBorders: import("./../../common/types/Shapes").Rect;
791
+ center: Point;
792
+ boundingBox: import("./../../common/types/Shapes").Rect;
793
+ };
794
+ } & {
795
+ rotation?: number;
796
+ toolId?: string;
797
+ visible?: boolean;
798
+ locked?: boolean;
799
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
800
+ } & import("./../../common/types/Shapes").Rect & {
801
+ src: string;
802
+ } & {
803
+ img: HTMLImageElement;
804
+ type: "picture";
805
+ } & {
806
+ img: HTMLImageElement;
807
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
808
+ type: "picture";
809
+ }) | ({
810
+ id: string;
811
+ computed: {
812
+ borders: import("./../../common/types/Shapes").Rect;
813
+ outerBorders: import("./../../common/types/Shapes").Rect;
814
+ center: Point;
815
+ boundingBox: import("./../../common/types/Shapes").Rect;
816
+ };
817
+ } & {
818
+ rotation?: number;
819
+ toolId?: string;
820
+ visible?: boolean;
821
+ locked?: boolean;
822
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
823
+ } & import("./../../common/types/Shapes").Rect & {
824
+ value: string[];
825
+ fontSize: number;
826
+ } & {
827
+ type: "text";
828
+ } & {
829
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
830
+ type: "text";
831
+ }) | ({
832
+ id: string;
833
+ computed: {
834
+ borders: import("./../../common/types/Shapes").Rect;
835
+ outerBorders: import("./../../common/types/Shapes").Rect;
836
+ center: Point;
837
+ boundingBox: import("./../../common/types/Shapes").Rect;
838
+ };
839
+ } & {
840
+ rotation?: number;
841
+ toolId?: string;
842
+ visible?: boolean;
843
+ locked?: boolean;
844
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
845
+ } & import("./../../common/types/Shapes").Rect & {
846
+ type: "rect";
847
+ } & {
848
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
849
+ path?: Path2D | undefined;
850
+ type: "rect";
851
+ }) | ({
852
+ id: string;
853
+ computed: {
854
+ borders: import("./../../common/types/Shapes").Rect;
855
+ outerBorders: import("./../../common/types/Shapes").Rect;
856
+ center: Point;
857
+ boundingBox: import("./../../common/types/Shapes").Rect;
858
+ };
859
+ } & {
860
+ rotation?: number;
861
+ toolId?: string;
862
+ visible?: boolean;
863
+ locked?: boolean;
864
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
865
+ } & import("./../../common/types/Shapes").Rect & {
866
+ type: "square";
867
+ } & {
868
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
869
+ path?: Path2D | undefined;
870
+ type: "square";
871
+ }) | ({
872
+ id: string;
873
+ computed: {
874
+ borders: import("./../../common/types/Shapes").Rect;
875
+ outerBorders: import("./../../common/types/Shapes").Rect;
876
+ center: Point;
877
+ boundingBox: import("./../../common/types/Shapes").Rect;
878
+ };
879
+ } & {
880
+ rotation?: number;
881
+ toolId?: string;
882
+ visible?: boolean;
883
+ locked?: boolean;
884
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
885
+ } & import("./../../common/types/Shapes").Circle & {
886
+ type: "circle";
887
+ } & {
888
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
889
+ path?: Path2D | undefined;
890
+ type: "circle";
891
+ }) | ({
892
+ id: string;
893
+ computed: {
894
+ borders: import("./../../common/types/Shapes").Rect;
895
+ outerBorders: import("./../../common/types/Shapes").Rect;
896
+ center: Point;
897
+ boundingBox: import("./../../common/types/Shapes").Rect;
898
+ };
899
+ } & {
900
+ rotation?: number;
901
+ toolId?: string;
902
+ visible?: boolean;
903
+ locked?: boolean;
904
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
905
+ } & import("./../../common/types/Shapes").Ellipse & {
906
+ type: "ellipse";
907
+ } & {
908
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
909
+ path?: Path2D | undefined;
910
+ type: "ellipse";
911
+ }) | ({
912
+ id: string;
913
+ computed: {
914
+ borders: import("./../../common/types/Shapes").Rect;
915
+ outerBorders: import("./../../common/types/Shapes").Rect;
916
+ center: Point;
917
+ boundingBox: import("./../../common/types/Shapes").Rect;
918
+ };
919
+ } & {
920
+ rotation?: number;
921
+ toolId?: string;
922
+ visible?: boolean;
923
+ locked?: boolean;
924
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
925
+ } & import("./../../common/types/Shapes").Polygon & {
926
+ type: "polygon";
927
+ } & {
928
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
929
+ path?: Path2D | undefined;
930
+ type: "polygon";
931
+ }) | ({
932
+ id: string;
933
+ computed: {
934
+ borders: import("./../../common/types/Shapes").Rect;
935
+ outerBorders: import("./../../common/types/Shapes").Rect;
936
+ center: Point;
937
+ boundingBox: import("./../../common/types/Shapes").Rect;
938
+ };
939
+ } & {
940
+ rotation?: number;
941
+ toolId?: string;
942
+ visible?: boolean;
943
+ locked?: boolean;
944
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
945
+ } & import("./../../common/types/Shapes").Curve & {
946
+ type: "curve";
947
+ } & {
948
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
949
+ path?: Path2D | undefined;
950
+ type: "curve";
951
+ }) | ({
952
+ id: string;
953
+ computed: {
954
+ borders: import("./../../common/types/Shapes").Rect;
955
+ outerBorders: import("./../../common/types/Shapes").Rect;
956
+ center: Point;
957
+ boundingBox: import("./../../common/types/Shapes").Rect;
958
+ };
959
+ } & {
960
+ rotation?: number;
961
+ toolId?: string;
962
+ visible?: boolean;
963
+ locked?: boolean;
964
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
965
+ } & import("./../../common/types/Shapes").Brush & {
966
+ type: "brush";
967
+ scaleX?: number;
968
+ scaleY?: number;
969
+ } & {
970
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
971
+ path?: Path2D | undefined;
972
+ type: "brush";
973
+ }) | ({
974
+ id: string;
975
+ computed: {
976
+ borders: import("./../../common/types/Shapes").Rect;
977
+ outerBorders: import("./../../common/types/Shapes").Rect;
978
+ center: Point;
979
+ boundingBox: import("./../../common/types/Shapes").Rect;
980
+ };
981
+ } & {
982
+ rotation?: number;
983
+ toolId?: string;
984
+ visible?: boolean;
985
+ locked?: boolean;
986
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
987
+ } & import("./../../common/types/Shapes").Rect & {
988
+ shapes: ShapeEntity[];
989
+ type: "group";
990
+ } & {
991
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
992
+ path?: Path2D | undefined;
993
+ type: "group";
994
+ }) | undefined;
77
995
  selectionFrame: {
78
996
  oldSelection: import("./../../common/types/Shapes").SelectionType | undefined;
79
997
  frame: [Point, Point];
80
998
  } | undefined;
81
- hoveredShape: ShapeEntity | undefined;
999
+ hoveredShape: ({
1000
+ id: string;
1001
+ computed: {
1002
+ borders: import("./../../common/types/Shapes").Rect;
1003
+ outerBorders: import("./../../common/types/Shapes").Rect;
1004
+ center: Point;
1005
+ boundingBox: import("./../../common/types/Shapes").Rect;
1006
+ };
1007
+ } & {
1008
+ rotation?: number;
1009
+ toolId?: string;
1010
+ visible?: boolean;
1011
+ locked?: boolean;
1012
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1013
+ } & import("./../../common/types/Shapes").Line & {
1014
+ type: "line";
1015
+ } & {
1016
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1017
+ path?: Path2D | undefined;
1018
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
1019
+ type: "line";
1020
+ }) | ({
1021
+ id: string;
1022
+ computed: {
1023
+ borders: import("./../../common/types/Shapes").Rect;
1024
+ outerBorders: import("./../../common/types/Shapes").Rect;
1025
+ center: Point;
1026
+ boundingBox: import("./../../common/types/Shapes").Rect;
1027
+ };
1028
+ } & {
1029
+ rotation?: number;
1030
+ toolId?: string;
1031
+ visible?: boolean;
1032
+ locked?: boolean;
1033
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1034
+ } & import("./../../common/types/Shapes").Rect & {
1035
+ src: string;
1036
+ } & {
1037
+ img: HTMLImageElement;
1038
+ type: "picture";
1039
+ } & {
1040
+ img: HTMLImageElement;
1041
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1042
+ type: "picture";
1043
+ }) | ({
1044
+ id: string;
1045
+ computed: {
1046
+ borders: import("./../../common/types/Shapes").Rect;
1047
+ outerBorders: import("./../../common/types/Shapes").Rect;
1048
+ center: Point;
1049
+ boundingBox: import("./../../common/types/Shapes").Rect;
1050
+ };
1051
+ } & {
1052
+ rotation?: number;
1053
+ toolId?: string;
1054
+ visible?: boolean;
1055
+ locked?: boolean;
1056
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1057
+ } & import("./../../common/types/Shapes").Rect & {
1058
+ value: string[];
1059
+ fontSize: number;
1060
+ } & {
1061
+ type: "text";
1062
+ } & {
1063
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1064
+ type: "text";
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").Rect & {
1080
+ type: "rect";
1081
+ } & {
1082
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1083
+ path?: Path2D | undefined;
1084
+ type: "rect";
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").Rect & {
1100
+ type: "square";
1101
+ } & {
1102
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1103
+ path?: Path2D | undefined;
1104
+ type: "square";
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").Circle & {
1120
+ type: "circle";
1121
+ } & {
1122
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1123
+ path?: Path2D | undefined;
1124
+ type: "circle";
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").Ellipse & {
1140
+ type: "ellipse";
1141
+ } & {
1142
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1143
+ path?: Path2D | undefined;
1144
+ type: "ellipse";
1145
+ }) | ({
1146
+ id: string;
1147
+ computed: {
1148
+ borders: import("./../../common/types/Shapes").Rect;
1149
+ outerBorders: import("./../../common/types/Shapes").Rect;
1150
+ center: Point;
1151
+ boundingBox: import("./../../common/types/Shapes").Rect;
1152
+ };
1153
+ } & {
1154
+ rotation?: number;
1155
+ toolId?: string;
1156
+ visible?: boolean;
1157
+ locked?: boolean;
1158
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1159
+ } & import("./../../common/types/Shapes").Polygon & {
1160
+ type: "polygon";
1161
+ } & {
1162
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1163
+ path?: Path2D | undefined;
1164
+ type: "polygon";
1165
+ }) | ({
1166
+ id: string;
1167
+ computed: {
1168
+ borders: import("./../../common/types/Shapes").Rect;
1169
+ outerBorders: import("./../../common/types/Shapes").Rect;
1170
+ center: Point;
1171
+ boundingBox: import("./../../common/types/Shapes").Rect;
1172
+ };
1173
+ } & {
1174
+ rotation?: number;
1175
+ toolId?: string;
1176
+ visible?: boolean;
1177
+ locked?: boolean;
1178
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1179
+ } & import("./../../common/types/Shapes").Curve & {
1180
+ type: "curve";
1181
+ } & {
1182
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1183
+ path?: Path2D | undefined;
1184
+ type: "curve";
1185
+ }) | ({
1186
+ id: string;
1187
+ computed: {
1188
+ borders: import("./../../common/types/Shapes").Rect;
1189
+ outerBorders: import("./../../common/types/Shapes").Rect;
1190
+ center: Point;
1191
+ boundingBox: import("./../../common/types/Shapes").Rect;
1192
+ };
1193
+ } & {
1194
+ rotation?: number;
1195
+ toolId?: string;
1196
+ visible?: boolean;
1197
+ locked?: boolean;
1198
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1199
+ } & import("./../../common/types/Shapes").Brush & {
1200
+ type: "brush";
1201
+ scaleX?: number;
1202
+ scaleY?: number;
1203
+ } & {
1204
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1205
+ path?: Path2D | undefined;
1206
+ type: "brush";
1207
+ }) | ({
1208
+ id: string;
1209
+ computed: {
1210
+ borders: import("./../../common/types/Shapes").Rect;
1211
+ outerBorders: import("./../../common/types/Shapes").Rect;
1212
+ center: Point;
1213
+ boundingBox: import("./../../common/types/Shapes").Rect;
1214
+ };
1215
+ } & {
1216
+ rotation?: number;
1217
+ toolId?: string;
1218
+ visible?: boolean;
1219
+ locked?: boolean;
1220
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1221
+ } & import("./../../common/types/Shapes").Rect & {
1222
+ shapes: ShapeEntity[];
1223
+ type: "group";
1224
+ } & {
1225
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1226
+ path?: Path2D | undefined;
1227
+ type: "group";
1228
+ }) | undefined;
82
1229
  addShape: (newShapes: ShapeEntity[]) => void;
83
- setSelectedShape: import("react").Dispatch<import("react").SetStateAction<import("./../../common/types/Shapes").SelectionType | undefined>>;
1230
+ setSelectedShape: import("react").Dispatch<({
1231
+ id: string;
1232
+ computed: {
1233
+ borders: import("./../../common/types/Shapes").Rect;
1234
+ outerBorders: import("./../../common/types/Shapes").Rect;
1235
+ center: Point;
1236
+ boundingBox: import("./../../common/types/Shapes").Rect;
1237
+ };
1238
+ } & {
1239
+ rotation?: number;
1240
+ toolId?: string;
1241
+ visible?: boolean;
1242
+ locked?: boolean;
1243
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1244
+ } & import("./../../common/types/Shapes").Line & {
1245
+ type: "line";
1246
+ } & {
1247
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1248
+ path?: Path2D | undefined;
1249
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
1250
+ type: "line";
1251
+ }) | ({
1252
+ id: string;
1253
+ computed: {
1254
+ borders: import("./../../common/types/Shapes").Rect;
1255
+ outerBorders: import("./../../common/types/Shapes").Rect;
1256
+ center: Point;
1257
+ boundingBox: import("./../../common/types/Shapes").Rect;
1258
+ };
1259
+ } & {
1260
+ rotation?: number;
1261
+ toolId?: string;
1262
+ visible?: boolean;
1263
+ locked?: boolean;
1264
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1265
+ } & import("./../../common/types/Shapes").Rect & {
1266
+ src: string;
1267
+ } & {
1268
+ img: HTMLImageElement;
1269
+ type: "picture";
1270
+ } & {
1271
+ img: HTMLImageElement;
1272
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1273
+ type: "picture";
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").Rect & {
1289
+ value: string[];
1290
+ fontSize: number;
1291
+ } & {
1292
+ type: "text";
1293
+ } & {
1294
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1295
+ type: "text";
1296
+ }) | ({
1297
+ id: string;
1298
+ computed: {
1299
+ borders: import("./../../common/types/Shapes").Rect;
1300
+ outerBorders: import("./../../common/types/Shapes").Rect;
1301
+ center: Point;
1302
+ boundingBox: import("./../../common/types/Shapes").Rect;
1303
+ };
1304
+ } & {
1305
+ rotation?: number;
1306
+ toolId?: string;
1307
+ visible?: boolean;
1308
+ locked?: boolean;
1309
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1310
+ } & import("./../../common/types/Shapes").Rect & {
1311
+ type: "rect";
1312
+ } & {
1313
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1314
+ path?: Path2D | undefined;
1315
+ type: "rect";
1316
+ }) | ({
1317
+ id: string;
1318
+ computed: {
1319
+ borders: import("./../../common/types/Shapes").Rect;
1320
+ outerBorders: import("./../../common/types/Shapes").Rect;
1321
+ center: Point;
1322
+ boundingBox: import("./../../common/types/Shapes").Rect;
1323
+ };
1324
+ } & {
1325
+ rotation?: number;
1326
+ toolId?: string;
1327
+ visible?: boolean;
1328
+ locked?: boolean;
1329
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1330
+ } & import("./../../common/types/Shapes").Rect & {
1331
+ type: "square";
1332
+ } & {
1333
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1334
+ path?: Path2D | undefined;
1335
+ type: "square";
1336
+ }) | ({
1337
+ id: string;
1338
+ computed: {
1339
+ borders: import("./../../common/types/Shapes").Rect;
1340
+ outerBorders: import("./../../common/types/Shapes").Rect;
1341
+ center: Point;
1342
+ boundingBox: import("./../../common/types/Shapes").Rect;
1343
+ };
1344
+ } & {
1345
+ rotation?: number;
1346
+ toolId?: string;
1347
+ visible?: boolean;
1348
+ locked?: boolean;
1349
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1350
+ } & import("./../../common/types/Shapes").Circle & {
1351
+ type: "circle";
1352
+ } & {
1353
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1354
+ path?: Path2D | undefined;
1355
+ type: "circle";
1356
+ }) | ({
1357
+ id: string;
1358
+ computed: {
1359
+ borders: import("./../../common/types/Shapes").Rect;
1360
+ outerBorders: import("./../../common/types/Shapes").Rect;
1361
+ center: Point;
1362
+ boundingBox: import("./../../common/types/Shapes").Rect;
1363
+ };
1364
+ } & {
1365
+ rotation?: number;
1366
+ toolId?: string;
1367
+ visible?: boolean;
1368
+ locked?: boolean;
1369
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1370
+ } & import("./../../common/types/Shapes").Ellipse & {
1371
+ type: "ellipse";
1372
+ } & {
1373
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1374
+ path?: Path2D | undefined;
1375
+ type: "ellipse";
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").Polygon & {
1391
+ type: "polygon";
1392
+ } & {
1393
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1394
+ path?: Path2D | undefined;
1395
+ type: "polygon";
1396
+ }) | ({
1397
+ id: string;
1398
+ computed: {
1399
+ borders: import("./../../common/types/Shapes").Rect;
1400
+ outerBorders: import("./../../common/types/Shapes").Rect;
1401
+ center: Point;
1402
+ boundingBox: import("./../../common/types/Shapes").Rect;
1403
+ };
1404
+ } & {
1405
+ rotation?: number;
1406
+ toolId?: string;
1407
+ visible?: boolean;
1408
+ locked?: boolean;
1409
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1410
+ } & import("./../../common/types/Shapes").Curve & {
1411
+ type: "curve";
1412
+ } & {
1413
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1414
+ path?: Path2D | undefined;
1415
+ type: "curve";
1416
+ }) | ({
1417
+ id: string;
1418
+ computed: {
1419
+ borders: import("./../../common/types/Shapes").Rect;
1420
+ outerBorders: import("./../../common/types/Shapes").Rect;
1421
+ center: Point;
1422
+ boundingBox: import("./../../common/types/Shapes").Rect;
1423
+ };
1424
+ } & {
1425
+ rotation?: number;
1426
+ toolId?: string;
1427
+ visible?: boolean;
1428
+ locked?: boolean;
1429
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1430
+ } & import("./../../common/types/Shapes").Brush & {
1431
+ type: "brush";
1432
+ scaleX?: number;
1433
+ scaleY?: number;
1434
+ } & {
1435
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1436
+ path?: Path2D | undefined;
1437
+ type: "brush";
1438
+ }) | ({
1439
+ id: string;
1440
+ computed: {
1441
+ borders: import("./../../common/types/Shapes").Rect;
1442
+ outerBorders: import("./../../common/types/Shapes").Rect;
1443
+ center: Point;
1444
+ boundingBox: import("./../../common/types/Shapes").Rect;
1445
+ };
1446
+ } & {
1447
+ rotation?: number;
1448
+ toolId?: string;
1449
+ visible?: boolean;
1450
+ locked?: boolean;
1451
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1452
+ } & import("./../../common/types/Shapes").Rect & {
1453
+ shapes: ShapeEntity[];
1454
+ type: "group";
1455
+ } & {
1456
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1457
+ path?: Path2D | undefined;
1458
+ type: "group";
1459
+ }) | ((prevState: ({
1460
+ id: string;
1461
+ computed: {
1462
+ borders: import("./../../common/types/Shapes").Rect;
1463
+ outerBorders: import("./../../common/types/Shapes").Rect;
1464
+ center: Point;
1465
+ boundingBox: import("./../../common/types/Shapes").Rect;
1466
+ };
1467
+ } & {
1468
+ rotation?: number;
1469
+ toolId?: string;
1470
+ visible?: boolean;
1471
+ locked?: boolean;
1472
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1473
+ } & import("./../../common/types/Shapes").Line & {
1474
+ type: "line";
1475
+ } & {
1476
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1477
+ path?: Path2D | undefined;
1478
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
1479
+ type: "line";
1480
+ }) | ({
1481
+ id: string;
1482
+ computed: {
1483
+ borders: import("./../../common/types/Shapes").Rect;
1484
+ outerBorders: import("./../../common/types/Shapes").Rect;
1485
+ center: Point;
1486
+ boundingBox: import("./../../common/types/Shapes").Rect;
1487
+ };
1488
+ } & {
1489
+ rotation?: number;
1490
+ toolId?: string;
1491
+ visible?: boolean;
1492
+ locked?: boolean;
1493
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1494
+ } & import("./../../common/types/Shapes").Rect & {
1495
+ src: string;
1496
+ } & {
1497
+ img: HTMLImageElement;
1498
+ type: "picture";
1499
+ } & {
1500
+ img: HTMLImageElement;
1501
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1502
+ type: "picture";
1503
+ }) | ({
1504
+ id: string;
1505
+ computed: {
1506
+ borders: import("./../../common/types/Shapes").Rect;
1507
+ outerBorders: import("./../../common/types/Shapes").Rect;
1508
+ center: Point;
1509
+ boundingBox: import("./../../common/types/Shapes").Rect;
1510
+ };
1511
+ } & {
1512
+ rotation?: number;
1513
+ toolId?: string;
1514
+ visible?: boolean;
1515
+ locked?: boolean;
1516
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1517
+ } & import("./../../common/types/Shapes").Rect & {
1518
+ value: string[];
1519
+ fontSize: number;
1520
+ } & {
1521
+ type: "text";
1522
+ } & {
1523
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1524
+ type: "text";
1525
+ }) | ({
1526
+ id: string;
1527
+ computed: {
1528
+ borders: import("./../../common/types/Shapes").Rect;
1529
+ outerBorders: import("./../../common/types/Shapes").Rect;
1530
+ center: Point;
1531
+ boundingBox: import("./../../common/types/Shapes").Rect;
1532
+ };
1533
+ } & {
1534
+ rotation?: number;
1535
+ toolId?: string;
1536
+ visible?: boolean;
1537
+ locked?: boolean;
1538
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1539
+ } & import("./../../common/types/Shapes").Rect & {
1540
+ type: "rect";
1541
+ } & {
1542
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1543
+ path?: Path2D | undefined;
1544
+ type: "rect";
1545
+ }) | ({
1546
+ id: string;
1547
+ computed: {
1548
+ borders: import("./../../common/types/Shapes").Rect;
1549
+ outerBorders: import("./../../common/types/Shapes").Rect;
1550
+ center: Point;
1551
+ boundingBox: import("./../../common/types/Shapes").Rect;
1552
+ };
1553
+ } & {
1554
+ rotation?: number;
1555
+ toolId?: string;
1556
+ visible?: boolean;
1557
+ locked?: boolean;
1558
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1559
+ } & import("./../../common/types/Shapes").Rect & {
1560
+ type: "square";
1561
+ } & {
1562
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1563
+ path?: Path2D | undefined;
1564
+ type: "square";
1565
+ }) | ({
1566
+ id: string;
1567
+ computed: {
1568
+ borders: import("./../../common/types/Shapes").Rect;
1569
+ outerBorders: import("./../../common/types/Shapes").Rect;
1570
+ center: Point;
1571
+ boundingBox: import("./../../common/types/Shapes").Rect;
1572
+ };
1573
+ } & {
1574
+ rotation?: number;
1575
+ toolId?: string;
1576
+ visible?: boolean;
1577
+ locked?: boolean;
1578
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1579
+ } & import("./../../common/types/Shapes").Circle & {
1580
+ type: "circle";
1581
+ } & {
1582
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1583
+ path?: Path2D | undefined;
1584
+ type: "circle";
1585
+ }) | ({
1586
+ id: string;
1587
+ computed: {
1588
+ borders: import("./../../common/types/Shapes").Rect;
1589
+ outerBorders: import("./../../common/types/Shapes").Rect;
1590
+ center: Point;
1591
+ boundingBox: import("./../../common/types/Shapes").Rect;
1592
+ };
1593
+ } & {
1594
+ rotation?: number;
1595
+ toolId?: string;
1596
+ visible?: boolean;
1597
+ locked?: boolean;
1598
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1599
+ } & import("./../../common/types/Shapes").Ellipse & {
1600
+ type: "ellipse";
1601
+ } & {
1602
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1603
+ path?: Path2D | undefined;
1604
+ type: "ellipse";
1605
+ }) | ({
1606
+ id: string;
1607
+ computed: {
1608
+ borders: import("./../../common/types/Shapes").Rect;
1609
+ outerBorders: import("./../../common/types/Shapes").Rect;
1610
+ center: Point;
1611
+ boundingBox: import("./../../common/types/Shapes").Rect;
1612
+ };
1613
+ } & {
1614
+ rotation?: number;
1615
+ toolId?: string;
1616
+ visible?: boolean;
1617
+ locked?: boolean;
1618
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1619
+ } & import("./../../common/types/Shapes").Polygon & {
1620
+ type: "polygon";
1621
+ } & {
1622
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1623
+ path?: Path2D | undefined;
1624
+ type: "polygon";
1625
+ }) | ({
1626
+ id: string;
1627
+ computed: {
1628
+ borders: import("./../../common/types/Shapes").Rect;
1629
+ outerBorders: import("./../../common/types/Shapes").Rect;
1630
+ center: Point;
1631
+ boundingBox: import("./../../common/types/Shapes").Rect;
1632
+ };
1633
+ } & {
1634
+ rotation?: number;
1635
+ toolId?: string;
1636
+ visible?: boolean;
1637
+ locked?: boolean;
1638
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1639
+ } & import("./../../common/types/Shapes").Curve & {
1640
+ type: "curve";
1641
+ } & {
1642
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1643
+ path?: Path2D | undefined;
1644
+ type: "curve";
1645
+ }) | ({
1646
+ id: string;
1647
+ computed: {
1648
+ borders: import("./../../common/types/Shapes").Rect;
1649
+ outerBorders: import("./../../common/types/Shapes").Rect;
1650
+ center: Point;
1651
+ boundingBox: import("./../../common/types/Shapes").Rect;
1652
+ };
1653
+ } & {
1654
+ rotation?: number;
1655
+ toolId?: string;
1656
+ visible?: boolean;
1657
+ locked?: boolean;
1658
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1659
+ } & import("./../../common/types/Shapes").Brush & {
1660
+ type: "brush";
1661
+ scaleX?: number;
1662
+ scaleY?: number;
1663
+ } & {
1664
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1665
+ path?: Path2D | undefined;
1666
+ type: "brush";
1667
+ }) | ({
1668
+ id: string;
1669
+ computed: {
1670
+ borders: import("./../../common/types/Shapes").Rect;
1671
+ outerBorders: import("./../../common/types/Shapes").Rect;
1672
+ center: Point;
1673
+ boundingBox: import("./../../common/types/Shapes").Rect;
1674
+ };
1675
+ } & {
1676
+ rotation?: number;
1677
+ toolId?: string;
1678
+ visible?: boolean;
1679
+ locked?: boolean;
1680
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1681
+ } & import("./../../common/types/Shapes").Rect & {
1682
+ shapes: ShapeEntity[];
1683
+ type: "group";
1684
+ } & {
1685
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1686
+ path?: Path2D | undefined;
1687
+ type: "group";
1688
+ }) | undefined) => ({
1689
+ id: string;
1690
+ computed: {
1691
+ borders: import("./../../common/types/Shapes").Rect;
1692
+ outerBorders: import("./../../common/types/Shapes").Rect;
1693
+ center: Point;
1694
+ boundingBox: import("./../../common/types/Shapes").Rect;
1695
+ };
1696
+ } & {
1697
+ rotation?: number;
1698
+ toolId?: string;
1699
+ visible?: boolean;
1700
+ locked?: boolean;
1701
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1702
+ } & import("./../../common/types/Shapes").Line & {
1703
+ type: "line";
1704
+ } & {
1705
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1706
+ path?: Path2D | undefined;
1707
+ arrows?: import("./../../common/types/Shapes").TriangleEntity[];
1708
+ type: "line";
1709
+ }) | ({
1710
+ id: string;
1711
+ computed: {
1712
+ borders: import("./../../common/types/Shapes").Rect;
1713
+ outerBorders: import("./../../common/types/Shapes").Rect;
1714
+ center: Point;
1715
+ boundingBox: import("./../../common/types/Shapes").Rect;
1716
+ };
1717
+ } & {
1718
+ rotation?: number;
1719
+ toolId?: string;
1720
+ visible?: boolean;
1721
+ locked?: boolean;
1722
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1723
+ } & import("./../../common/types/Shapes").Rect & {
1724
+ src: string;
1725
+ } & {
1726
+ img: HTMLImageElement;
1727
+ type: "picture";
1728
+ } & {
1729
+ img: HTMLImageElement;
1730
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1731
+ type: "picture";
1732
+ }) | ({
1733
+ id: string;
1734
+ computed: {
1735
+ borders: import("./../../common/types/Shapes").Rect;
1736
+ outerBorders: import("./../../common/types/Shapes").Rect;
1737
+ center: Point;
1738
+ boundingBox: import("./../../common/types/Shapes").Rect;
1739
+ };
1740
+ } & {
1741
+ rotation?: number;
1742
+ toolId?: string;
1743
+ visible?: boolean;
1744
+ locked?: boolean;
1745
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1746
+ } & import("./../../common/types/Shapes").Rect & {
1747
+ value: string[];
1748
+ fontSize: number;
1749
+ } & {
1750
+ type: "text";
1751
+ } & {
1752
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1753
+ type: "text";
1754
+ }) | ({
1755
+ id: string;
1756
+ computed: {
1757
+ borders: import("./../../common/types/Shapes").Rect;
1758
+ outerBorders: import("./../../common/types/Shapes").Rect;
1759
+ center: Point;
1760
+ boundingBox: import("./../../common/types/Shapes").Rect;
1761
+ };
1762
+ } & {
1763
+ rotation?: number;
1764
+ toolId?: string;
1765
+ visible?: boolean;
1766
+ locked?: boolean;
1767
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1768
+ } & import("./../../common/types/Shapes").Rect & {
1769
+ type: "rect";
1770
+ } & {
1771
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1772
+ path?: Path2D | undefined;
1773
+ type: "rect";
1774
+ }) | ({
1775
+ id: string;
1776
+ computed: {
1777
+ borders: import("./../../common/types/Shapes").Rect;
1778
+ outerBorders: import("./../../common/types/Shapes").Rect;
1779
+ center: Point;
1780
+ boundingBox: import("./../../common/types/Shapes").Rect;
1781
+ };
1782
+ } & {
1783
+ rotation?: number;
1784
+ toolId?: string;
1785
+ visible?: boolean;
1786
+ locked?: boolean;
1787
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1788
+ } & import("./../../common/types/Shapes").Rect & {
1789
+ type: "square";
1790
+ } & {
1791
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1792
+ path?: Path2D | undefined;
1793
+ type: "square";
1794
+ }) | ({
1795
+ id: string;
1796
+ computed: {
1797
+ borders: import("./../../common/types/Shapes").Rect;
1798
+ outerBorders: import("./../../common/types/Shapes").Rect;
1799
+ center: Point;
1800
+ boundingBox: import("./../../common/types/Shapes").Rect;
1801
+ };
1802
+ } & {
1803
+ rotation?: number;
1804
+ toolId?: string;
1805
+ visible?: boolean;
1806
+ locked?: boolean;
1807
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1808
+ } & import("./../../common/types/Shapes").Circle & {
1809
+ type: "circle";
1810
+ } & {
1811
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1812
+ path?: Path2D | undefined;
1813
+ type: "circle";
1814
+ }) | ({
1815
+ id: string;
1816
+ computed: {
1817
+ borders: import("./../../common/types/Shapes").Rect;
1818
+ outerBorders: import("./../../common/types/Shapes").Rect;
1819
+ center: Point;
1820
+ boundingBox: import("./../../common/types/Shapes").Rect;
1821
+ };
1822
+ } & {
1823
+ rotation?: number;
1824
+ toolId?: string;
1825
+ visible?: boolean;
1826
+ locked?: boolean;
1827
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1828
+ } & import("./../../common/types/Shapes").Ellipse & {
1829
+ type: "ellipse";
1830
+ } & {
1831
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1832
+ path?: Path2D | undefined;
1833
+ type: "ellipse";
1834
+ }) | ({
1835
+ id: string;
1836
+ computed: {
1837
+ borders: import("./../../common/types/Shapes").Rect;
1838
+ outerBorders: import("./../../common/types/Shapes").Rect;
1839
+ center: Point;
1840
+ boundingBox: import("./../../common/types/Shapes").Rect;
1841
+ };
1842
+ } & {
1843
+ rotation?: number;
1844
+ toolId?: string;
1845
+ visible?: boolean;
1846
+ locked?: boolean;
1847
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1848
+ } & import("./../../common/types/Shapes").Polygon & {
1849
+ type: "polygon";
1850
+ } & {
1851
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1852
+ path?: Path2D | undefined;
1853
+ type: "polygon";
1854
+ }) | ({
1855
+ id: string;
1856
+ computed: {
1857
+ borders: import("./../../common/types/Shapes").Rect;
1858
+ outerBorders: import("./../../common/types/Shapes").Rect;
1859
+ center: Point;
1860
+ boundingBox: import("./../../common/types/Shapes").Rect;
1861
+ };
1862
+ } & {
1863
+ rotation?: number;
1864
+ toolId?: string;
1865
+ visible?: boolean;
1866
+ locked?: boolean;
1867
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1868
+ } & import("./../../common/types/Shapes").Curve & {
1869
+ type: "curve";
1870
+ } & {
1871
+ selection?: import("./../../common/types/Shapes").SelectionLinesType | undefined;
1872
+ path?: Path2D | undefined;
1873
+ type: "curve";
1874
+ }) | ({
1875
+ id: string;
1876
+ computed: {
1877
+ borders: import("./../../common/types/Shapes").Rect;
1878
+ outerBorders: import("./../../common/types/Shapes").Rect;
1879
+ center: Point;
1880
+ boundingBox: import("./../../common/types/Shapes").Rect;
1881
+ };
1882
+ } & {
1883
+ rotation?: number;
1884
+ toolId?: string;
1885
+ visible?: boolean;
1886
+ locked?: boolean;
1887
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1888
+ } & import("./../../common/types/Shapes").Brush & {
1889
+ type: "brush";
1890
+ scaleX?: number;
1891
+ scaleY?: number;
1892
+ } & {
1893
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1894
+ path?: Path2D | undefined;
1895
+ type: "brush";
1896
+ }) | ({
1897
+ id: string;
1898
+ computed: {
1899
+ borders: import("./../../common/types/Shapes").Rect;
1900
+ outerBorders: import("./../../common/types/Shapes").Rect;
1901
+ center: Point;
1902
+ boundingBox: import("./../../common/types/Shapes").Rect;
1903
+ };
1904
+ } & {
1905
+ rotation?: number;
1906
+ toolId?: string;
1907
+ visible?: boolean;
1908
+ locked?: boolean;
1909
+ style?: import("./../../common/types/Shapes").StyleShape | undefined;
1910
+ } & import("./../../common/types/Shapes").Rect & {
1911
+ shapes: ShapeEntity[];
1912
+ type: "group";
1913
+ } & {
1914
+ selection?: import("./../../common/types/Shapes").SelectionDefaultType | undefined;
1915
+ path?: Path2D | undefined;
1916
+ type: "group";
1917
+ }) | undefined) | undefined>;
84
1918
  setSelectionFrame: import("react").Dispatch<import("react").SetStateAction<{
85
1919
  oldSelection: import("./../../common/types/Shapes").SelectionType | undefined;
86
1920
  frame: [Point, Point];
@@ -89,6 +1923,7 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
89
1923
  refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point, isInsideMask: boolean) => void;
90
1924
  removeShape: (shapes: ShapeEntity[]) => void;
91
1925
  updateShape: (updatedShapes: ShapeEntity[], withSave?: boolean) => void;
1926
+ duplicateShapes: (shapesToDuplicate: ShapeEntity[]) => void;
92
1927
  backwardShape: () => void;
93
1928
  forwardShape: () => void;
94
1929
  saveShapes: () => void;
@@ -103,10 +1938,12 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
103
1938
  setCanvasSize: import("react").Dispatch<import("react").SetStateAction<CanvasSize>>;
104
1939
  setCanvasOffset: (newOffset: Point) => void;
105
1940
  setCanvasZoom: (action: "unzoom" | "zoom" | "default") => void;
1941
+ resetZoom: () => void;
106
1942
  selectShapes: (shapes: ShapeEntity[]) => void;
107
1943
  activeTool: ToolsType;
108
1944
  setActiveTool: import("react").Dispatch<import("react").SetStateAction<ToolsType>>;
109
1945
  isInsideComponent: boolean;
1946
+ isInsideCanvas: boolean;
110
1947
  isEditMode: boolean;
111
1948
  canvas: {
112
1949
  withSkeleton: boolean;
@@ -127,8 +1964,10 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
127
1964
  setCanvasMoveAcceleration: import("react").Dispatch<import("react").SetStateAction<Point>>;
128
1965
  isShiftPressed: boolean;
129
1966
  isAltPressed: boolean;
1967
+ isSpacePressed: boolean;
130
1968
  setShiftPressed: import("react").Dispatch<import("react").SetStateAction<boolean>>;
131
1969
  setAltPressed: import("react").Dispatch<import("react").SetStateAction<boolean>>;
1970
+ setIsSpacePressed: import("react").Dispatch<import("react").SetStateAction<boolean>>;
132
1971
  };
133
1972
  registerEvent: (event: "dataChanged", fn: (data: StateData, source: "user" | "remote") => void) => void;
134
1973
  unregisterEvent: (event: "dataChanged", fn?: (data: StateData, source: "user" | "remote") => void) => void;