@yorab/react-paint 0.16.1 → 0.16.2

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