react-design-editor 0.0.37 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/react-design-editor.js +773 -726
  2. package/dist/react-design-editor.min.js +1 -1
  3. package/lib/Canvas.d.ts +18 -0
  4. package/lib/Canvas.js +172 -0
  5. package/lib/CanvasObject.d.ts +10 -0
  6. package/lib/CanvasObject.js +96 -0
  7. package/lib/constants/code.d.ts +19 -0
  8. package/lib/constants/code.js +22 -0
  9. package/lib/constants/defaults.d.ts +38 -0
  10. package/lib/constants/defaults.js +69 -0
  11. package/lib/constants/index.d.ts +3 -0
  12. package/lib/constants/index.js +26 -0
  13. package/lib/handlers/AlignmentHandler.d.ts +18 -0
  14. package/lib/handlers/AlignmentHandler.js +58 -0
  15. package/lib/handlers/AnimationHandler.d.ts +50 -0
  16. package/lib/handlers/AnimationHandler.js +323 -0
  17. package/lib/handlers/ChartHandler.d.ts +8 -0
  18. package/lib/handlers/ChartHandler.js +8 -0
  19. package/lib/handlers/ContextmenuHandler.d.ts +28 -0
  20. package/lib/handlers/ContextmenuHandler.js +65 -0
  21. package/lib/handlers/CropHandler.d.ts +43 -0
  22. package/lib/handlers/CropHandler.js +261 -0
  23. package/lib/handlers/CustomHandler.d.ts +7 -0
  24. package/lib/handlers/CustomHandler.js +10 -0
  25. package/lib/handlers/DrawingHandler.d.ts +28 -0
  26. package/lib/handlers/DrawingHandler.js +318 -0
  27. package/lib/handlers/ElementHandler.d.ts +80 -0
  28. package/lib/handlers/ElementHandler.js +154 -0
  29. package/lib/handlers/EventHandler.d.ts +170 -0
  30. package/lib/handlers/EventHandler.js +880 -0
  31. package/lib/handlers/FiberHandler.d.ts +6 -0
  32. package/lib/handlers/FiberHandler.js +23 -0
  33. package/lib/handlers/GridHandler.d.ts +19 -0
  34. package/lib/handlers/GridHandler.js +77 -0
  35. package/lib/handlers/GuidelineHandler.d.ts +61 -0
  36. package/lib/handlers/GuidelineHandler.js +315 -0
  37. package/lib/handlers/Handler.d.ts +622 -0
  38. package/lib/handlers/Handler.js +1640 -0
  39. package/lib/handlers/ImageHandler.d.ts +307 -0
  40. package/lib/handlers/ImageHandler.js +529 -0
  41. package/lib/handlers/InteractionHandler.d.ts +45 -0
  42. package/lib/handlers/InteractionHandler.js +164 -0
  43. package/lib/handlers/LinkHandler.d.ts +115 -0
  44. package/lib/handlers/LinkHandler.js +247 -0
  45. package/lib/handlers/NodeHandler.d.ts +50 -0
  46. package/lib/handlers/NodeHandler.js +274 -0
  47. package/lib/handlers/PortHandler.d.ts +22 -0
  48. package/lib/handlers/PortHandler.js +179 -0
  49. package/lib/handlers/ShortcutHandler.d.ts +119 -0
  50. package/lib/handlers/ShortcutHandler.js +151 -0
  51. package/lib/handlers/TooltipHandler.d.ts +33 -0
  52. package/lib/handlers/TooltipHandler.js +91 -0
  53. package/lib/handlers/TransactionHandler.d.ts +59 -0
  54. package/lib/handlers/TransactionHandler.js +137 -0
  55. package/lib/handlers/WorkareaHandler.d.ts +43 -0
  56. package/lib/handlers/WorkareaHandler.js +354 -0
  57. package/lib/handlers/ZoomHandler.d.ts +48 -0
  58. package/lib/handlers/ZoomHandler.js +143 -0
  59. package/lib/handlers/index.d.ts +23 -0
  60. package/lib/handlers/index.js +48 -0
  61. package/lib/index.d.ts +6 -0
  62. package/lib/index.js +20 -0
  63. package/lib/objects/Arrow.d.ts +2 -0
  64. package/lib/objects/Arrow.js +40 -0
  65. package/lib/objects/Chart.d.ts +10 -0
  66. package/lib/objects/Chart.js +124 -0
  67. package/lib/objects/CirclePort.d.ts +2 -0
  68. package/lib/objects/CirclePort.js +28 -0
  69. package/lib/objects/Cube.d.ts +5 -0
  70. package/lib/objects/Cube.js +71 -0
  71. package/lib/objects/CurvedLink.d.ts +2 -0
  72. package/lib/objects/CurvedLink.js +51 -0
  73. package/lib/objects/Element.d.ts +13 -0
  74. package/lib/objects/Element.js +84 -0
  75. package/lib/objects/Gif.d.ts +3 -0
  76. package/lib/objects/Gif.js +41 -0
  77. package/lib/objects/Iframe.d.ts +9 -0
  78. package/lib/objects/Iframe.js +70 -0
  79. package/lib/objects/Line.d.ts +2 -0
  80. package/lib/objects/Line.js +24 -0
  81. package/lib/objects/Link.d.ts +15 -0
  82. package/lib/objects/Link.js +106 -0
  83. package/lib/objects/Node.d.ts +59 -0
  84. package/lib/objects/Node.js +271 -0
  85. package/lib/objects/OrthogonalLink.d.ts +2 -0
  86. package/lib/objects/OrthogonalLink.js +54 -0
  87. package/lib/objects/Port.d.ts +12 -0
  88. package/lib/objects/Port.js +28 -0
  89. package/lib/objects/Svg.d.ts +8 -0
  90. package/lib/objects/Svg.js +77 -0
  91. package/lib/objects/Video.d.ts +14 -0
  92. package/lib/objects/Video.js +120 -0
  93. package/lib/objects/index.d.ts +15 -0
  94. package/lib/objects/index.js +32 -0
  95. package/lib/utils/ObjectUtil.d.ts +407 -0
  96. package/lib/utils/ObjectUtil.js +13 -0
  97. package/lib/utils/index.d.ts +1 -0
  98. package/lib/utils/index.js +13 -0
  99. package/package.json +1 -1
@@ -0,0 +1,622 @@
1
+ /// <reference types="react" />
2
+ import { fabric } from 'fabric';
3
+ import { AlignmentHandler, AnimationHandler, ChartHandler, ContextmenuHandler, CropHandler, CustomHandler, DrawingHandler, ElementHandler, EventHandler, GridHandler, GuidelineHandler, ImageHandler, InteractionHandler, LinkHandler, NodeHandler, PortHandler, ShortcutHandler, TooltipHandler, TransactionHandler, WorkareaHandler, ZoomHandler } from '.';
4
+ import { CanvasOption, FabricCanvas, FabricGroup, FabricImage, FabricObject, FabricObjectOption, FabricObjects, GridOption, GuidelineOption, InteractionMode, KeyEvent, WorkareaObject, WorkareaOption } from '../utils';
5
+ import { TransactionEvent } from './TransactionHandler';
6
+ export interface HandlerCallback {
7
+ /**
8
+ * When has been added object in Canvas, Called function
9
+ *
10
+ */
11
+ onAdd?: (object: FabricObject) => void;
12
+ /**
13
+ * Return contextmenu element
14
+ *
15
+ */
16
+ onContext?: (el: HTMLDivElement, e: React.MouseEvent, target?: FabricObject) => Promise<any> | any;
17
+ /**
18
+ * Return tooltip element
19
+ *
20
+ */
21
+ onTooltip?: (el: HTMLDivElement, target?: FabricObject) => Promise<any> | any;
22
+ /**
23
+ * When zoom, Called function
24
+ */
25
+ onZoom?: (zoomRatio: number) => void;
26
+ /**
27
+ * When clicked object, Called function
28
+ *
29
+ */
30
+ onClick?: (canvas: FabricCanvas, target: FabricObject) => void;
31
+ /**
32
+ * When double clicked object, Called function
33
+ *
34
+ */
35
+ onDblClick?: (canvas: FabricCanvas, target: FabricObject) => void;
36
+ /**
37
+ * When modified object, Called function
38
+ */
39
+ onModified?: (target: FabricObject) => void;
40
+ /**
41
+ * When select object, Called function
42
+ *
43
+ */
44
+ onSelect?: (target: FabricObject) => void;
45
+ /**
46
+ * When has been removed object in Canvas, Called function
47
+ *
48
+ */
49
+ onRemove?: (target: FabricObject) => void;
50
+ /**
51
+ * When has been undo or redo, Called function
52
+ *
53
+ */
54
+ onTransaction?: (transaction: TransactionEvent) => void;
55
+ /**
56
+ * When has been changed interaction mode, Called function
57
+ *
58
+ */
59
+ onInteraction?: (interactionMode: InteractionMode) => void;
60
+ /**
61
+ * When canvas has been loaded
62
+ *
63
+ */
64
+ onLoad?: (handler: Handler, canvas?: fabric.Canvas) => void;
65
+ }
66
+ export interface HandlerOption {
67
+ /**
68
+ * Canvas id
69
+ * @type {string}
70
+ */
71
+ id?: string;
72
+ /**
73
+ * Canvas object
74
+ * @type {FabricCanvas}
75
+ */
76
+ canvas?: FabricCanvas;
77
+ /**
78
+ * Canvas parent element
79
+ * @type {HTMLDivElement}
80
+ */
81
+ container?: HTMLDivElement;
82
+ /**
83
+ * Canvas editable
84
+ * @type {boolean}
85
+ */
86
+ editable?: boolean;
87
+ /**
88
+ * Canvas interaction mode
89
+ * @type {InteractionMode}
90
+ */
91
+ interactionMode?: InteractionMode;
92
+ /**
93
+ * Persist properties for object
94
+ * @type {string[]}
95
+ */
96
+ propertiesToInclude?: string[];
97
+ /**
98
+ * Minimum zoom ratio
99
+ * @type {number}
100
+ */
101
+ minZoom?: number;
102
+ /**
103
+ * Maximum zoom ratio
104
+ * @type {number}
105
+ */
106
+ maxZoom?: number;
107
+ /**
108
+ * Workarea option
109
+ * @type {WorkareaOption}
110
+ */
111
+ workareaOption?: WorkareaOption;
112
+ /**
113
+ * Canvas option
114
+ * @type {CanvasOption}
115
+ */
116
+ canvasOption?: CanvasOption;
117
+ /**
118
+ * Grid option
119
+ * @type {GridOption}
120
+ */
121
+ gridOption?: GridOption;
122
+ /**
123
+ * Default option for Fabric Object
124
+ * @type {FabricObjectOption}
125
+ */
126
+ objectOption?: FabricObjectOption;
127
+ /**
128
+ * Guideline option
129
+ * @type {GuidelineOption}
130
+ */
131
+ guidelineOption?: GuidelineOption;
132
+ /**
133
+ * Whether to use zoom
134
+ * @type {boolean}
135
+ */
136
+ zoomEnabled?: boolean;
137
+ /**
138
+ * ActiveSelection option
139
+ * @type {Partial<FabricObjectOption<fabric.ActiveSelection>>}
140
+ */
141
+ activeSelectionOption?: Partial<FabricObjectOption<fabric.ActiveSelection>>;
142
+ /**
143
+ * Canvas width
144
+ * @type {number}
145
+ */
146
+ width?: number;
147
+ /**
148
+ * Canvas height
149
+ * @type {number}
150
+ */
151
+ height?: number;
152
+ /**
153
+ * Keyboard event in Canvas
154
+ * @type {KeyEvent}
155
+ */
156
+ keyEvent?: KeyEvent;
157
+ /**
158
+ * Append custom objects
159
+ * @type {{ [key: string]: any }}
160
+ */
161
+ fabricObjects?: FabricObjects;
162
+ handlers?: {
163
+ [key: string]: CustomHandler;
164
+ };
165
+ [key: string]: any;
166
+ }
167
+ export declare type HandlerOptions = HandlerOption & HandlerCallback;
168
+ /**
169
+ * Main handler for Canvas
170
+ * @class Handler
171
+ * @implements {HandlerOptions}
172
+ */
173
+ declare class Handler implements HandlerOptions {
174
+ id: string;
175
+ canvas: FabricCanvas;
176
+ workarea: WorkareaObject;
177
+ container: HTMLDivElement;
178
+ editable: boolean;
179
+ interactionMode: InteractionMode;
180
+ minZoom: number;
181
+ maxZoom: number;
182
+ propertiesToInclude?: string[];
183
+ workareaOption?: WorkareaOption;
184
+ canvasOption?: CanvasOption;
185
+ gridOption?: GridOption;
186
+ objectOption?: FabricObjectOption;
187
+ guidelineOption?: GuidelineOption;
188
+ keyEvent?: KeyEvent;
189
+ activeSelectionOption?: Partial<FabricObjectOption<fabric.ActiveSelection>>;
190
+ fabricObjects?: FabricObjects;
191
+ zoomEnabled?: boolean;
192
+ width?: number;
193
+ height?: number;
194
+ onAdd?: (object: FabricObject) => void;
195
+ onContext?: (el: HTMLDivElement, e: React.MouseEvent, target?: FabricObject) => Promise<any>;
196
+ onTooltip?: (el: HTMLDivElement, target?: FabricObject) => Promise<any>;
197
+ onZoom?: (zoomRatio: number) => void;
198
+ onClick?: (canvas: FabricCanvas, target: FabricObject) => void;
199
+ onDblClick?: (canvas: FabricCanvas, target: FabricObject) => void;
200
+ onModified?: (target: FabricObject) => void;
201
+ onSelect?: (target: FabricObject) => void;
202
+ onRemove?: (target: FabricObject) => void;
203
+ onTransaction?: (transaction: TransactionEvent) => void;
204
+ onInteraction?: (interactionMode: InteractionMode) => void;
205
+ onLoad?: (handler: Handler, canvas?: fabric.Canvas) => void;
206
+ imageHandler: ImageHandler;
207
+ chartHandler: ChartHandler;
208
+ elementHandler: ElementHandler;
209
+ cropHandler: CropHandler;
210
+ animationHandler: AnimationHandler;
211
+ contextmenuHandler: ContextmenuHandler;
212
+ tooltipHandler: TooltipHandler;
213
+ zoomHandler: ZoomHandler;
214
+ workareaHandler: WorkareaHandler;
215
+ interactionHandler: InteractionHandler;
216
+ transactionHandler: TransactionHandler;
217
+ gridHandler: GridHandler;
218
+ portHandler: PortHandler;
219
+ linkHandler: LinkHandler;
220
+ nodeHandler: NodeHandler;
221
+ alignmentHandler: AlignmentHandler;
222
+ guidelineHandler: GuidelineHandler;
223
+ eventHandler: EventHandler;
224
+ drawingHandler: DrawingHandler;
225
+ shortcutHandler: ShortcutHandler;
226
+ handlers: {
227
+ [key: string]: CustomHandler;
228
+ };
229
+ objectMap: Record<string, FabricObject>;
230
+ objects: FabricObject[];
231
+ activeLine?: any;
232
+ activeShape?: any;
233
+ zoom: number;
234
+ prevTarget?: FabricObject;
235
+ target?: FabricObject;
236
+ pointArray?: any[];
237
+ lineArray?: any[];
238
+ isCut: boolean;
239
+ private isRequsetAnimFrame;
240
+ private requestFrame;
241
+ /**
242
+ * Copied object
243
+ *
244
+ * @private
245
+ * @type {*}
246
+ */
247
+ private clipboard;
248
+ constructor(options: HandlerOptions);
249
+ /**
250
+ * Initialize handler
251
+ *
252
+ * @author salgum1114
253
+ * @param {HandlerOptions} options
254
+ */
255
+ initialize(options: HandlerOptions): void;
256
+ /**
257
+ * Init class fields
258
+ * @param {HandlerOptions} options
259
+ */
260
+ initOption: (options: HandlerOptions) => void;
261
+ /**
262
+ * Initialize callback
263
+ * @param {HandlerOptions} options
264
+ */
265
+ initCallback: (options: HandlerOptions) => void;
266
+ /**
267
+ * Initialize handlers
268
+ *
269
+ */
270
+ initHandler: () => void;
271
+ /**
272
+ * Get primary object
273
+ * @returns {FabricObject[]}
274
+ */
275
+ getObjects: () => FabricObject[];
276
+ /**
277
+ * Set key pair
278
+ * @param {keyof FabricObject} key
279
+ * @param {*} value
280
+ * @returns
281
+ */
282
+ set: (key: keyof FabricObject, value: any) => void;
283
+ /**
284
+ * Set option
285
+ * @param {Partial<FabricObject>} option
286
+ * @returns
287
+ */
288
+ setObject: (option: Partial<FabricObject>) => void;
289
+ /**
290
+ * Set key pair by object
291
+ * @param {FabricObject} obj
292
+ * @param {string} key
293
+ * @param {*} value
294
+ * @returns
295
+ */
296
+ setByObject: (obj: any, key: string, value: any) => void;
297
+ /**
298
+ * Set key pair by id
299
+ * @param {string} id
300
+ * @param {string} key
301
+ * @param {*} value
302
+ */
303
+ setById: (id: string, key: string, value: any) => void;
304
+ /**
305
+ * Set partial by object
306
+ * @param {FabricObject} obj
307
+ * @param {FabricObjectOption} option
308
+ * @returns
309
+ */
310
+ setByPartial: (obj: FabricObject, option: FabricObjectOption) => void;
311
+ /**
312
+ * Set shadow
313
+ * @param {fabric.Shadow} option
314
+ * @returns
315
+ */
316
+ setShadow: (option: fabric.IShadowOptions) => void;
317
+ /**
318
+ * Set the image
319
+ * @param {FabricImage} obj
320
+ * @param {(File | string)} [source]
321
+ * @returns
322
+ */
323
+ setImage: (obj: FabricImage, source?: File | string) => void;
324
+ /**
325
+ * Set image by id
326
+ * @param {string} id
327
+ * @param {*} source
328
+ */
329
+ setImageById: (id: string, source: any) => void;
330
+ /**
331
+ * Set visible
332
+ * @param {boolean} [visible]
333
+ * @returns
334
+ */
335
+ setVisible: (visible?: boolean) => void;
336
+ /**
337
+ * Set the position on Object
338
+ *
339
+ * @param {FabricObject} obj
340
+ * @param {boolean} [centered]
341
+ */
342
+ centerObject: (obj: FabricObject, centered?: boolean) => void;
343
+ /**
344
+ * Add object
345
+ * @param {FabricObjectOption} obj
346
+ * @param {boolean} [centered=true]
347
+ * @param {boolean} [loaded=false]
348
+ * @returns
349
+ */
350
+ add: (obj: FabricObjectOption, centered?: boolean, loaded?: boolean) => FabricObject<fabric.Object>;
351
+ /**
352
+ * Add group object
353
+ *
354
+ * @param {FabricGroup} obj
355
+ * @param {boolean} [centered=true]
356
+ * @param {boolean} [loaded=false]
357
+ * @returns
358
+ */
359
+ addGroup: (obj: FabricGroup, centered?: boolean, loaded?: boolean) => FabricObject<fabric.Object>[];
360
+ /**
361
+ * Add iamge object
362
+ * @param {FabricImage} obj
363
+ * @returns
364
+ */
365
+ addImage: (obj: FabricImage) => FabricImage;
366
+ /**
367
+ * Remove object
368
+ * @param {FabricObject} target
369
+ * @returns {any}
370
+ */
371
+ remove: (target?: FabricObject) => void;
372
+ /**
373
+ * Remove object by id
374
+ * @param {string} id
375
+ */
376
+ removeById: (id: string) => void;
377
+ /**
378
+ * Delete at origin object list
379
+ * @param {string} id
380
+ */
381
+ removeOriginById: (id: string) => void;
382
+ /**
383
+ * Duplicate object
384
+ * @returns
385
+ */
386
+ duplicate: () => void;
387
+ /**
388
+ * Duplicate object by id
389
+ * @param {string} id
390
+ * @returns
391
+ */
392
+ duplicateById: (id: string) => boolean;
393
+ /**
394
+ * Cut object
395
+ *
396
+ */
397
+ cut: () => void;
398
+ /**
399
+ * Copy to clipboard
400
+ *
401
+ * @param {*} value
402
+ */
403
+ copyToClipboard: (value: any) => void;
404
+ /**
405
+ * Copy object
406
+ *
407
+ * @returns
408
+ */
409
+ copy: () => boolean;
410
+ /**
411
+ * Paste object
412
+ *
413
+ * @returns
414
+ */
415
+ paste: () => boolean;
416
+ /**
417
+ * Load the image
418
+ * @param {FabricImage} obj
419
+ * @param {string} src
420
+ */
421
+ loadImage: (obj: FabricImage, src: string) => void;
422
+ /**
423
+ * Find object by object
424
+ * @param {FabricObject} obj
425
+ */
426
+ find: (obj: FabricObject) => FabricObject<fabric.Object>;
427
+ /**
428
+ * Find object by id
429
+ * @param {string} id
430
+ * @returns {(FabricObject | null)}
431
+ */
432
+ findById: (id: string) => FabricObject | null;
433
+ /**
434
+ * Find object in origin list
435
+ * @param {string} id
436
+ * @returns
437
+ */
438
+ findOriginById: (id: string) => FabricObject<fabric.Object>;
439
+ /**
440
+ * Return origin object list
441
+ * @param {string} id
442
+ * @returns
443
+ */
444
+ findOriginByIdWithIndex: (id: string) => {
445
+ object?: undefined;
446
+ index?: undefined;
447
+ } | {
448
+ object: undefined;
449
+ index: number;
450
+ };
451
+ /**
452
+ * Select object
453
+ * @param {FabricObject} obj
454
+ * @param {boolean} [find]
455
+ */
456
+ select: (obj: FabricObject, find?: boolean) => void;
457
+ /**
458
+ * Select by id
459
+ * @param {string} id
460
+ */
461
+ selectById: (id: string) => void;
462
+ /**
463
+ * Select all
464
+ * @returns
465
+ */
466
+ selectAll: () => void;
467
+ /**
468
+ * Save origin width, height
469
+ * @param {FabricObject} obj
470
+ * @param {number} width
471
+ * @param {number} height
472
+ */
473
+ originScaleToResize: (obj: FabricObject, width: number, height: number) => void;
474
+ /**
475
+ * When set the width, height, Adjust the size
476
+ * @param {number} width
477
+ * @param {number} height
478
+ */
479
+ scaleToResize: (width: number, height: number) => void;
480
+ /**
481
+ * Import json
482
+ * @param {*} json
483
+ * @param {(canvas: FabricCanvas) => void} [callback]
484
+ */
485
+ importJSON: (json: any, callback?: (canvas: FabricCanvas) => void) => Promise<FabricCanvas<fabric.Canvas>>;
486
+ /**
487
+ * Export json
488
+ */
489
+ exportJSON: () => FabricObject<fabric.Object>[];
490
+ /**
491
+ * Active selection to group
492
+ * @returns
493
+ */
494
+ toGroup: (target?: FabricObject) => FabricObject<fabric.Group>;
495
+ /**
496
+ * Group to active selection
497
+ * @returns
498
+ */
499
+ toActiveSelection: (target?: FabricObject) => any;
500
+ /**
501
+ * Bring forward
502
+ */
503
+ bringForward: () => void;
504
+ /**
505
+ * Bring to front
506
+ */
507
+ bringToFront: () => void;
508
+ /**
509
+ * Send backwards
510
+ * @returns
511
+ */
512
+ sendBackwards: () => void;
513
+ /**
514
+ * Send to back
515
+ */
516
+ sendToBack: () => void;
517
+ /**
518
+ * Clear canvas
519
+ * @param {boolean} [includeWorkarea=false]
520
+ */
521
+ clear: (includeWorkarea?: boolean) => void;
522
+ /**
523
+ * Start request animation frame
524
+ */
525
+ startRequestAnimFrame: () => void;
526
+ /**
527
+ * Stop request animation frame
528
+ */
529
+ stopRequestAnimFrame: () => void;
530
+ /**
531
+ * Save target object as image
532
+ * @param {FabricObject} targetObject
533
+ * @param {string} [option={ name: 'New Image', format: 'png', quality: 1 }]
534
+ */
535
+ saveImage: (targetObject: FabricObject, option?: {
536
+ name: string;
537
+ format: string;
538
+ quality: number;
539
+ }) => void;
540
+ /**
541
+ * Save canvas as image
542
+ * @param {string} [option={ name: 'New Image', format: 'png', quality: 1 }]
543
+ */
544
+ saveCanvasImage: (option?: {
545
+ name: string;
546
+ format: string;
547
+ quality: number;
548
+ }) => void;
549
+ /**
550
+ * Sets "angle" of an instance with centered rotation
551
+ *
552
+ * @param {number} angle
553
+ */
554
+ rotate: (angle: number) => void;
555
+ /**
556
+ * Destroy canvas
557
+ *
558
+ */
559
+ destroy: () => void;
560
+ /**
561
+ * Set canvas option
562
+ *
563
+ * @param {CanvasOption} canvasOption
564
+ */
565
+ setCanvasOption: (canvasOption: CanvasOption) => void;
566
+ /**
567
+ * Set keyboard event
568
+ *
569
+ * @param {KeyEvent} keyEvent
570
+ */
571
+ setKeyEvent: (keyEvent: KeyEvent) => void;
572
+ /**
573
+ * Set fabric objects
574
+ *
575
+ * @param {FabricObjects} fabricObjects
576
+ */
577
+ setFabricObjects: (fabricObjects: FabricObjects) => void;
578
+ /**
579
+ * Set workarea option
580
+ *
581
+ * @param {WorkareaOption} workareaOption
582
+ */
583
+ setWorkareaOption: (workareaOption: WorkareaOption) => void;
584
+ /**
585
+ * Set guideline option
586
+ *
587
+ * @param {GuidelineOption} guidelineOption
588
+ */
589
+ setGuidelineOption: (guidelineOption: GuidelineOption) => void;
590
+ /**
591
+ * Set grid option
592
+ *
593
+ * @param {GridOption} gridOption
594
+ */
595
+ setGridOption: (gridOption: GridOption) => void;
596
+ /**
597
+ * Set object option
598
+ *
599
+ * @param {FabricObjectOption} objectOption
600
+ */
601
+ setObjectOption: (objectOption: FabricObjectOption) => void;
602
+ /**
603
+ * Set activeSelection option
604
+ *
605
+ * @param {Partial<FabricObjectOption<fabric.ActiveSelection>>} activeSelectionOption
606
+ */
607
+ setActiveSelectionOption: (activeSelectionOption: Partial<FabricObjectOption<fabric.ActiveSelection>>) => void;
608
+ /**
609
+ * Set propertiesToInclude
610
+ *
611
+ * @param {string[]} propertiesToInclude
612
+ */
613
+ setPropertiesToInclude: (propertiesToInclude: string[]) => void;
614
+ /**
615
+ * Register custom handler
616
+ *
617
+ * @param {string} name
618
+ * @param {typeof CustomHandler} handler
619
+ */
620
+ registerHandler: (name: string, handler: typeof CustomHandler) => CustomHandler;
621
+ }
622
+ export default Handler;