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