@syncfusion/ej2-image-editor 31.1.17 → 31.1.22

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 (55) hide show
  1. package/dist/ej2-image-editor.umd.min.js +3 -3
  2. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-image-editor.es2015.js +72 -9
  4. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  5. package/dist/es6/ej2-image-editor.es5.js +72 -9
  6. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  7. package/dist/global/ej2-image-editor.min.js +3 -3
  8. package/dist/global/ej2-image-editor.min.js.map +1 -1
  9. package/dist/global/index.d.ts +2 -2
  10. package/package.json +14 -46
  11. package/src/image-editor/action/export.js +6 -2
  12. package/src/image-editor/action/freehand-draw.d.ts +1 -0
  13. package/src/image-editor/action/freehand-draw.js +30 -3
  14. package/src/image-editor/action/selection.js +14 -2
  15. package/src/image-editor/action/undo-redo.js +10 -0
  16. package/src/image-editor/base/image-editor.d.ts +1 -0
  17. package/src/image-editor/base/image-editor.js +9 -2
  18. package/src/image-editor/renderer/toolbar.js +3 -0
  19. package/dist/ts/image-editor/action/crop.d.ts +0 -44
  20. package/dist/ts/image-editor/action/crop.ts +0 -867
  21. package/dist/ts/image-editor/action/draw.d.ts +0 -187
  22. package/dist/ts/image-editor/action/draw.ts +0 -4924
  23. package/dist/ts/image-editor/action/export.d.ts +0 -29
  24. package/dist/ts/image-editor/action/export.ts +0 -509
  25. package/dist/ts/image-editor/action/filter.d.ts +0 -48
  26. package/dist/ts/image-editor/action/filter.ts +0 -872
  27. package/dist/ts/image-editor/action/freehand-draw.d.ts +0 -68
  28. package/dist/ts/image-editor/action/freehand-draw.ts +0 -1135
  29. package/dist/ts/image-editor/action/index.d.ts +0 -9
  30. package/dist/ts/image-editor/action/index.ts +0 -9
  31. package/dist/ts/image-editor/action/selection.d.ts +0 -178
  32. package/dist/ts/image-editor/action/selection.ts +0 -5241
  33. package/dist/ts/image-editor/action/shape.d.ts +0 -130
  34. package/dist/ts/image-editor/action/shape.ts +0 -3917
  35. package/dist/ts/image-editor/action/transform.d.ts +0 -77
  36. package/dist/ts/image-editor/action/transform.ts +0 -2008
  37. package/dist/ts/image-editor/action/undo-redo.d.ts +0 -52
  38. package/dist/ts/image-editor/action/undo-redo.ts +0 -1169
  39. package/dist/ts/image-editor/base/enum.d.ts +0 -277
  40. package/dist/ts/image-editor/base/enum.ts +0 -288
  41. package/dist/ts/image-editor/base/image-editor-model.d.ts +0 -770
  42. package/dist/ts/image-editor/base/image-editor.d.ts +0 -1928
  43. package/dist/ts/image-editor/base/image-editor.ts +0 -5496
  44. package/dist/ts/image-editor/base/index.d.ts +0 -4
  45. package/dist/ts/image-editor/base/index.ts +0 -4
  46. package/dist/ts/image-editor/base/interface.d.ts +0 -1637
  47. package/dist/ts/image-editor/base/interface.ts +0 -1709
  48. package/dist/ts/image-editor/index.d.ts +0 -3
  49. package/dist/ts/image-editor/index.ts +0 -3
  50. package/dist/ts/image-editor/renderer/index.d.ts +0 -1
  51. package/dist/ts/image-editor/renderer/index.ts +0 -1
  52. package/dist/ts/image-editor/renderer/toolbar.d.ts +0 -171
  53. package/dist/ts/image-editor/renderer/toolbar.ts +0 -6356
  54. package/dist/ts/index.d.ts +0 -4
  55. package/dist/ts/index.ts +0 -4
@@ -1,1928 +0,0 @@
1
- import { Component, INotifyPropertyChanged, ModuleDeclaration } from '@syncfusion/ej2-base';
2
- import { EmitType } from '@syncfusion/ej2-base';
3
- import { ItemModel, ClickEventArgs } from '@syncfusion/ej2-navigations';
4
- import { ChildProperty } from '@syncfusion/ej2-base';
5
- import { ImageEditorModel, FinetuneSettingsModel, ZoomSettingsModel, SelectionSettingsModel, FontFamilyModel, UploadSettingsModel } from './image-editor-model';
6
- import { SelectionChangeEventArgs, Transition, ArrowheadType, ResizeEventArgs, FrameType, FrameLineStyle, FrameChangeEventArgs, ShapeType, ImageSettings, RedactType, TransformationCollection } from './../index';
7
- import { ZoomEventArgs, PanEventArgs, CropEventArgs, RotateEventArgs, FlipEventArgs, ShapeChangeEventArgs } from './../index';
8
- import { ToolbarEventArgs, OpenEventArgs, SaveEventArgs, BeforeSaveEventArgs, Point, ShapeSettings, ImageFilterEventArgs, RedactSettings } from './../index';
9
- import { FinetuneEventArgs, QuickAccessToolbarEventArgs, CurrentObject, ImageDimension, TransformValue, PanPoint } from './../index';
10
- import { Interaction, SelectionPoint, ImageFinetuneValue, Dimension, ActivePoint, ImageEditorClickEventArgs, FrameValue } from './../index';
11
- import { Direction, ZoomTrigger, Theme, ImageEditorCommand, ImageFilterOption, ImageFinetuneOption, EditCompleteEventArgs } from './../index';
12
- import { ItemModel as DropDownButtonItemModel } from '@syncfusion/ej2-splitbuttons';
13
- /**
14
- * Defines the settings for restricting uploaded images.
15
- */
16
- export declare class UploadSettings extends ChildProperty<UploadSettings> {
17
- /**
18
- * Specifies the allowed file extensions for uploaded images.
19
- *
20
- * @type {string}
21
- * @default null
22
- * @remarks
23
- * Example: '.jpg, .png, .gif'
24
- * This property restricts the types of image files that can be uploaded based on their file extensions. Only files with the specified extensions will be allowed.
25
- */
26
- allowedExtensions: string;
27
- /**
28
- * Specifies the minimum size (in bytes) for the uploaded image.
29
- *
30
- * @type {number}
31
- * @default null
32
- * @remarks
33
- * The value represents the file size in bytes. Any file smaller than this size will be rejected during the upload process. Use this property to ensure that images meet a certain quality or resolution standard.
34
- */
35
- minFileSize: number;
36
- /**
37
- * Specifies the maximum size (in bytes) for the uploaded image.
38
- *
39
- * @type {number}
40
- * @default null
41
- * @remarks
42
- * The value represents the file size in bytes. Any file larger than this size will be rejected during the upload process. This property helps prevent the upload of excessively large files that may impact performance.
43
- */
44
- maxFileSize: number;
45
- }
46
- /**
47
- * This interface is used to specify settings for finetuning operations on images, including brightness, contrast, hue, saturation, exposure, opacity, and blur. It includes properties for setting minimum and maximum values for each of these options, as well as a default value.
48
- */
49
- export declare class FinetuneSettings extends ChildProperty<FinetuneSettings> {
50
- /**
51
- * Represents a finetune setting for adjusting the brightness of an image.
52
- *
53
- * @type {ImageFinetuneValue}
54
- *
55
- * @property {number} value - The brightness level of the image, from -100 to 100.
56
- * @property {number} min - The minimum brightness value allowed, typically -100.
57
- * @property {number} max - The maximum brightness value allowed, typically 100.
58
- * @default null
59
- */
60
- brightness: ImageFinetuneValue;
61
- /**
62
- * Represents a finetune setting for adjusting the contrast of an image.
63
- *
64
- * @type {ImageFinetuneValue}
65
- *
66
- * @property {number} value - The contrast level of the image, from -100 to 100.
67
- * @property {number} min - The minimum contrast value allowed, typically -100.
68
- * @property {number} max - The maximum contrast value allowed, typically 100.
69
- * @default null
70
- */
71
- contrast: ImageFinetuneValue;
72
- /**
73
- * Represents a finetune setting for adjusting the hue of an image.
74
- *
75
- * @type {ImageFinetuneValue}
76
- *
77
- * @property {number} value - The hue level of the image, from 0 to 100.
78
- * @property {number} min - The minimum hue value allowed, typically 0.
79
- * @property {number} max - The maximum hue value allowed, typically 100.
80
- * @default null
81
- */
82
- hue: ImageFinetuneValue;
83
- /**
84
- * Represents a finetune setting for adjusting the saturation of an image.
85
- *
86
- * @type {ImageFinetuneValue}
87
- *
88
- * @property {number} value - The saturation level of the image, from -100 to 100.
89
- * @property {number} min - The minimum saturation value allowed, typically -100.
90
- * @property {number} max - The maximum saturation value allowed, typically 100.
91
- * @default null
92
- */
93
- saturation: ImageFinetuneValue;
94
- /**
95
- * Represents a finetune setting for adjusting the exposure of an image.
96
- *
97
- * @type {ImageFinetuneValue}
98
- *
99
- * @property {number} value - The exposure level of the image, from -100 to 100.
100
- * @property {number} min - The minimum exposure value allowed, typically -100.
101
- * @property {number} max - The maximum exposure value allowed, typically 100.
102
- * @default null
103
- */
104
- exposure: ImageFinetuneValue;
105
- /**
106
- * Represents a finetune setting for adjusting the opacity of an image.
107
- *
108
- * @type {ImageFinetuneValue}
109
- *
110
- * @property {number} value - The opacity level of the image, from 0 to 100.
111
- * @property {number} min - The minimum opacity value allowed, typically 0.
112
- * @property {number} max - The maximum opacity value allowed, typically 100.
113
- * @default null
114
- */
115
- opacity: ImageFinetuneValue;
116
- /**
117
- * Represents a finetune setting for adjusting the blur of an image.
118
- *
119
- * @type {ImageFinetuneValue}
120
- *
121
- * @property {number} value - The blur level of the image, from 0 to 100.
122
- * @property {number} min - The minimum blur value allowed, typically 0.
123
- * @property {number} max - The maximum blur value allowed, typically 100.
124
- * @default null
125
- */
126
- blur: ImageFinetuneValue;
127
- }
128
- /**
129
- * An interface used to define the settings such as minimum, maximum, and default zoom factors, and the type of zooming which are available in the image editor control.
130
- */
131
- export declare class ZoomSettings extends ChildProperty<ZoomSettings> {
132
- /**
133
- * Specifies the available options for zooming in an image editor control.
134
- *
135
- * @remarks
136
- * Use this property to enable or disable specific types of zooming in the image editor. The following zooming options are available:
137
- * MouseWheel: Zooming is performed by scrolling the mouse wheel up and down.
138
- * Pinch: Zooming is performed using pinch gestures on touch-enabled devices.
139
- * Commands: Zooming is performed by clicking the CTRL key and either the plus (+) or minus (-) buttons on the keyboard.
140
- * Toolbar: Zooming is performed using toolbar buttons.
141
- *
142
- * By default, this property is set to `null`, which enables all types of zooming.
143
- *
144
- * @default null
145
- * @aspNumberEnum
146
- */
147
- zoomTrigger: ZoomTrigger;
148
- /**
149
- * Specifies the minimum zooming level to limit the zooming.
150
- * An integer value that specifies the minimum zooming level. And the default value is 1 (100%).
151
- *
152
- * @remarks
153
- * The given value is considered as percentage.
154
- *
155
- */
156
- minZoomFactor: number;
157
- /**
158
- * Specifies the maximum zooming level to limit the zooming.
159
- * An integer value that specifies the maximum zooming level. And the default value is 10 (1000 percent).
160
- *
161
- * @remarks
162
- * The given value is considered as percentage.
163
- *
164
- */
165
- maxZoomFactor: number;
166
- /**
167
- * Specifies the default zoom factor to be applied on initial loading of image.
168
- * An integer value that specifies the current zooming level. And the default value is 1 (100 percent).
169
- *
170
- * @remarks
171
- * The given value is considered as percentage.
172
- *
173
- */
174
- zoomFactor: number;
175
- /**
176
- * Specifies the point in which the zooming has been performed in the image editor.
177
- * A point value that specifies the current zooming point.
178
- * And the default value is null, and it can be considered as center point of the image editor.
179
- *
180
- * @remarks
181
- * The given value is a point object which has x and y coordinates.
182
- *
183
- */
184
- zoomPoint: Point;
185
- }
186
- /**
187
- * This interface is used to specify settings for selection operations on images, including visibility, stroke color and fill color.
188
- */
189
- export declare class SelectionSettings extends ChildProperty<SelectionSettings> {
190
- /**
191
- * Specifies a boolean value whether to show circle on selection in the image editor.
192
- *
193
- * @type {boolean}
194
- *
195
- * @default true
196
- */
197
- showCircle: boolean;
198
- /**
199
- * Represents stroke color of circle selection in the image editor.
200
- *
201
- * @type {string}
202
- *
203
- * @default null
204
- */
205
- strokeColor: string;
206
- /**
207
- * Represents fill color of circle selection in the image editor.
208
- *
209
- * @type {string}
210
- *
211
- * @default null
212
- */
213
- fillColor: string;
214
- }
215
- /**
216
- * Predefine the font families that populate in font family dropdown list from the toolbar.
217
- */
218
- export declare class FontFamily extends ChildProperty<FontFamily> {
219
- /**
220
- * Specifies default font family selection
221
- *
222
- * @default 'Arial'
223
- */
224
- default: string;
225
- /**
226
- * Specifies default font family items
227
- *
228
- * @default null
229
- */
230
- items: DropDownButtonItemModel[];
231
- }
232
- /**
233
- * The Image Editor is a graphical user interface for editing images.
234
- *
235
- * {% codeBlock src='image-editor/default/index.md' %}{% endcodeBlock %}
236
- *
237
- * @remarks
238
- * The Image Editor component provides various image editing features such as zooming, cropping, rotating, inserting text and shapes (rectangles, ellipses, and lines), drawing freehand on top of an image, undo/redo, and more.
239
- *
240
- */
241
- export declare class ImageEditor extends Component<HTMLDivElement> implements INotifyPropertyChanged {
242
- /**
243
- *
244
- * Image Editor Private Properties
245
- */
246
- /** @hidden */
247
- isImageLoaded: boolean;
248
- /** @hidden */
249
- baseImg: HTMLImageElement;
250
- /** @hidden */
251
- baseImgCanvas: HTMLCanvasElement;
252
- /** @hidden */
253
- lowerCanvas: HTMLCanvasElement;
254
- /** @hidden */
255
- upperCanvas: HTMLCanvasElement;
256
- /** @hidden */
257
- maskCanvas: HTMLCanvasElement;
258
- /** @hidden */
259
- inMemoryCanvas: HTMLCanvasElement;
260
- /** @hidden */
261
- textArea: HTMLInputElement;
262
- /** @hidden */
263
- activeObj: SelectionPoint;
264
- /** @hidden */
265
- currObjType: Interaction;
266
- /** @hidden */
267
- objColl: SelectionPoint[];
268
- /** @hidden */
269
- pointColl: any;
270
- /** @hidden */
271
- freehandCounter: number;
272
- /** @hidden */
273
- points: Point[];
274
- /** @hidden */
275
- togglePen: boolean;
276
- /** @hidden */
277
- togglePan: boolean;
278
- /** @hidden */
279
- img: ImageDimension;
280
- /** @hidden */
281
- themeColl: Object;
282
- /** @hidden */
283
- rotateFlipColl: any;
284
- /** @hidden */
285
- cropObj: CurrentObject;
286
- /** @hidden */
287
- afterCropActions: string[];
288
- /** @hidden */
289
- currSelectionPoint: SelectionPoint;
290
- /** @hidden */
291
- transform: TransformValue;
292
- /** @hidden */
293
- panPoint: PanPoint;
294
- /** @hidden */
295
- isUndoRedo: boolean;
296
- /** @hidden */
297
- isCropTab: boolean;
298
- /** @hidden */
299
- isCircleCrop: boolean;
300
- /** @hidden */
301
- fontSizeColl: DropDownButtonItemModel[];
302
- /** @hidden */
303
- initialAdjustmentValue: string;
304
- /** @hidden */
305
- currentFilter: string;
306
- /** @hidden */
307
- canvasFilter: string;
308
- /** @hidden */
309
- toolbarHeight: number;
310
- /** @hidden */
311
- events: any;
312
- /** @hidden */
313
- isPublicMethod: boolean;
314
- /** @hidden */
315
- cancelCropSelection: Transition;
316
- /** @hidden */
317
- isCropToolbar: boolean;
318
- /** @hidden */
319
- prevCurrSelectionPoint: SelectionPoint;
320
- /** @hidden */
321
- cursor: string;
322
- /** @hidden */
323
- eventType: string;
324
- /** @hidden */
325
- panEventArgs: PanEventArgs;
326
- /** @hidden */
327
- resizeSrc: ActivePoint;
328
- /** @hidden */
329
- isResize: boolean;
330
- /** @hidden */
331
- aspectHeight: number;
332
- /** @hidden */
333
- aspectWidth: number;
334
- /** @hidden */
335
- isAspectRatio: boolean;
336
- /** @hidden */
337
- prevCropObj: CurrentObject;
338
- /** @hidden */
339
- prevObj: CurrentObject;
340
- /** @hidden */
341
- frameObj: FrameValue;
342
- /** @hidden */
343
- tempFrameObj: FrameValue;
344
- /** @hidden */
345
- allowDownScale: boolean;
346
- /** @hidden */
347
- frameType: FrameType;
348
- /** @hidden */
349
- gradientColor: string;
350
- /** @hidden */
351
- size: number;
352
- /** @hidden */
353
- inset: number;
354
- /** @hidden */
355
- offset: number;
356
- /** @hidden */
357
- borderRadius: number;
358
- /** @hidden */
359
- lineCount: number;
360
- /** @hidden */
361
- tempFrameZoomLevel: number;
362
- /** @hidden */
363
- frameDestPoints: ImageDimension;
364
- /** @hidden */
365
- cxtTbarHeight: number;
366
- /** @hidden */
367
- straightenPoint: Point;
368
- /** @hidden */
369
- prevStraightenedDegree: number;
370
- /** @hidden */
371
- tempStraighten: number;
372
- /** @hidden */
373
- isStraightening: boolean;
374
- /** @hidden */
375
- prevEventSelectionPoint: SelectionPoint;
376
- /** @hidden */
377
- prevEventObjPoint: CurrentObject;
378
- /** @hidden */
379
- isCroppedEvent: boolean;
380
- /** @hidden */
381
- isResizeOkBtn: boolean;
382
- /** @hidden */
383
- isFinetuning: boolean;
384
- /** @hidden */
385
- isZoomBtnClick: boolean;
386
- /** @hidden */
387
- isFinetuneBtnClick: boolean;
388
- /** @hidden */
389
- isFilterCanvasClick: boolean;
390
- /** @hidden */
391
- isFrameBtnClick: boolean;
392
- /** @hidden */
393
- curFilterObjEvent: object;
394
- /** @hidden */
395
- curFinetuneObjEvent: object;
396
- /** @hidden */
397
- curFrameObjEvent: object;
398
- /** @hidden */
399
- isChangesSaved: boolean;
400
- /** @hidden */
401
- drawingShape: string;
402
- /** @hidden */
403
- isShapeDrawing: boolean;
404
- /** @hidden */
405
- noPushUndo: boolean;
406
- /** @hidden */
407
- isUndoRedoStack: boolean;
408
- /** @hidden */
409
- shapeColl: any;
410
- /** @hidden */
411
- imgSrc: string;
412
- /** @hidden */
413
- isKBDNavigation: boolean;
414
- /** @hidden */
415
- isMaskImage: boolean;
416
- /** @hidden */
417
- tempObjColl: SelectionPoint[];
418
- /** @hidden */
419
- tempPointColl: Point[];
420
- /** @hidden */
421
- tempShapeColl: any;
422
- /** @hidden */
423
- isImageUpdated: boolean;
424
- /** @hidden */
425
- noRedact: boolean;
426
- /** @hidden */
427
- tempRedactBlur: number;
428
- /** @hidden */
429
- tempRedactPixel: number;
430
- /** @hidden */
431
- isSafari: boolean;
432
- /** @hidden */
433
- editCompleteArgs: object | RotateEventArgs | FlipEventArgs | CropEventArgs | FinetuneEventArgs | FrameChangeEventArgs | ImageFilterEventArgs | PanEventArgs | ResizeEventArgs | ShapeChangeEventArgs | ZoomEventArgs;
434
- /** @hidden */
435
- imageSettings: Dimension;
436
- /** @hidden */
437
- aspectRatioBaseDimension: boolean;
438
- /** @hidden */
439
- imageLoaded: boolean;
440
- private lowerContext;
441
- private upperContext;
442
- private inMemoryContext;
443
- private toolbarFn;
444
- private qatFn;
445
- private tempToolbarHeight;
446
- private tempToolbar;
447
- /**
448
- * Defines one or more CSS classes that can be used to customize the appearance of an Image Editor component.
449
- *
450
- * @remarks
451
- * One or more CSS classes to customize the appearance of the Image Editor component, such as by changing its toolbar appearance, borders, sizes, or other visual aspects.
452
- *
453
- * @default ''
454
- *
455
- */
456
- cssClass: string;
457
- /**
458
- * Defines whether an Image Editor component is enabled or disabled.
459
- *
460
- * @remarks
461
- * A disabled Image Editor component may have a different visual appearance than an enabled one. When set to “true”, the Image Editor component will be disabled, and the user will not be able to interact with it.
462
- *
463
- * @default false
464
- */
465
- disabled: boolean;
466
- /**
467
- * Specifies the height of the Image Editor.
468
- *
469
- * @remarks
470
- * The value of height is specified either as a percentage (e.g. '100%') or as a fixed pixel value (e.g. '100px').
471
- *
472
- * @default '100%'
473
- */
474
- height: string;
475
- /**
476
- * Specifies the theme of the Image Editor. The appearance of the shape selection in Image Editor is determined by this property.
477
- *
478
- * @remarks
479
- * The `theme` property supports all the built-in themes of Syncfusion, including:
480
- * - `Bootstrap5`
481
- * - `Fluent`
482
- * - `Tailwind`
483
- * - `Bootstrap4`
484
- * - `Material`
485
- * - `Fabric`
486
- * - `HighContrast`
487
- * - `Bootstrap5Dark`
488
- * - `Bootstrap4Dark`
489
- * - `MaterialDark`
490
- * - `FabricDark`
491
- * - `HighContrastDark`
492
- * - `Fluent2`
493
- *
494
- * The default value is set to `Theme.Bootstrap5`.
495
- *
496
- * @isenumeration true
497
- * @default Theme.Bootstrap5
498
- * @asptype Theme
499
- *
500
- */
501
- theme: string | Theme;
502
- /**
503
- * Specifies the toolbar items to perform UI interactions.
504
- * It accepts both string[] and ItemModel[] to configure its toolbar items. The default value is null.
505
- * If the property is not defined in the control, the default toolbar will be rendered with preconfigured toolbar commands.
506
- * If the property is defined as empty collection, the toolbar will not be rendered.
507
- * The preconfigured toolbar commands are
508
- * - Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
509
- * - Straightening: helps to rotate an image by a specified angle.
510
- * - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, path, text, image and freehand drawing with resize, drag and drop, and customize its appearance.
511
- * - Transform: helps to rotate and flip an image.
512
- * - Finetunes: helps to perform adjustments on an image.
513
- * - Filters: helps to perform predefined color filters.
514
- * - Frame: helps to add decorative borders or frames around images.
515
- * - Resize: helps to modify the dimensions of an image.
516
- * - ZoomIn: performs zoom-in an image.
517
- * - ZoomOut: performs zoom-out an image.
518
- * - Save: save the modified image.
519
- * - Open: open an image to perform editing.
520
- * - Undo: helps to revert the last action.
521
- * - Redo: helps to redo the last action.
522
- * - Reset: reset the modification and restore the original image.
523
- *
524
- * {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
525
- *
526
- * @remarks
527
- * If the toolbarTemplate property is defined in the control, the toolbar will be rendered based on the toolbarTemplate property.
528
- * @default null
529
- *
530
- */
531
- toolbar: (string | ImageEditorCommand | ItemModel)[];
532
- /**
533
- * Specifies a custom template for the toolbar of an image editor control.
534
- * A string that specifies a custom template for the toolbar of the image editor. If this property is defined, the 'toolbar' property will not have any effect.
535
- *
536
- * {% codeBlock src='image-editor/toolbarTemplate/index.md' %}{% endcodeBlock %}
537
- *
538
- * @remarks
539
- * Use this property if you want to customize the entire toolbar in your own way. The template should be a string that contains the HTML markup for the custom toolbar.
540
- *
541
- * @default null
542
- * @aspType string
543
- *
544
- *
545
- */
546
- toolbarTemplate: string | Function;
547
- /**
548
- * Specifies the width of an Image Editor.
549
- *
550
- * @remarks
551
- * The value of width is specified either as a percentage (e.g. '100%') or as a fixed pixel value (e.g. '100px').
552
- *
553
- * @default '100%'
554
- */
555
- width: string;
556
- /**
557
- * Specifies a boolean value whether enable undo/redo operations in the image editor.
558
- *
559
- * @remarks
560
- * If this property is true, the undo redo options will be enabled in toolbar and can also be accessed via keyboard shortcuts.
561
- * If set to false, both options will be disabled.
562
- * The undo redo history is limited to 16. Once the maximum limit is reached, the oldest history item will be removed to make space for the new item.
563
- *
564
- * @default true
565
- *
566
- */
567
- allowUndoRedo: boolean;
568
- /**
569
- * Specifies whether to show/hide the quick access toolbar.
570
- *
571
- * @default true
572
- *
573
- * @remarks
574
- * Set this property to true to show the quick access toolbar, and false to hide it.
575
- * ```html
576
- * <div id='imageeditor'></div>
577
- * ```
578
- * ```typescript
579
- * <script>
580
- * var imageObj = new ImageEditor({
581
- * showQuickAccessToolbar : true
582
- * });
583
- * imageObj.appendTo("#imageeditor");
584
- * </script>
585
- * ```
586
- */
587
- showQuickAccessToolbar: boolean;
588
- /**
589
- * Specifies a template for the quick access toolbar.
590
- * Use this property to customize the quick access toolbar.
591
- *
592
- * @default null
593
- * @aspType string
594
- *
595
- * @remarks
596
- * This property only works if the "showQuickToolbar" property is set to true.
597
- * ```html
598
- * <div id='imageeditor'></div>
599
- * ```
600
- * ```typescript
601
- * <script>
602
- * var imageObj = new ImageEditor({
603
- * showQuickAccessToolbar : true,
604
- * quickAccessToolbarTemplate: '#toolbarTemplate'
605
- * });
606
- * imageObj.appendTo("#imageeditor");
607
- * </script>
608
- * <script id="toolbarTemplate" type="text/x-template">
609
- * <div class = 'e-toolbar'>
610
- * <button id= 'dltbtn'></button>
611
- * </div>
612
- * </script>
613
- * ```
614
- */
615
- quickAccessToolbarTemplate: string | Function;
616
- /**
617
- * Determines whether high-quality images should be smoothed when rendered.
618
- *
619
- * @default false
620
- *
621
- * @remarks
622
- *
623
- * When enabled (`true`), the image will be smoothed, reducing pixelation at the cost of sharpness.
624
- *
625
- * When disabled (`false`), the image will be rendered with crisp, unaltered pixels.
626
- *
627
- * ```html
628
- * <div id='imageeditor'></div>
629
- * ```
630
- * ```typescript
631
- * <script>
632
- * var imageObj = new ImageEditor({
633
- * imageSmoothingEnabled: true
634
- * });
635
- * imageObj.appendTo("#imageeditor");
636
- * </script>
637
- * ```
638
- */
639
- imageSmoothingEnabled: boolean;
640
- /**
641
- * Specifies whether to prevent user interaction with the image editor control.
642
- * A boolean that specifies whether to prevent the interaction in image editor control. The default value is false.
643
- *
644
- * @remarks
645
- * If the property is true, the image editor control becomes read-only, and the user interaction will be prevented.
646
- *
647
- * @default false
648
- * @private
649
- */
650
- isReadOnly: boolean;
651
- /**
652
- * Specifies whether to enable RTL mode in image editor control that displays the content in the right-to-left direction.
653
- * A boolean that specifies whether to enable RTL mode in image editor control. The default value is false.
654
- *
655
- * @default false
656
- * @private
657
- */
658
- enableRtl: boolean;
659
- /**
660
- * Specifies a bool value whether enable or disable persist component's state between page reloads. The default value is false.
661
- *
662
- * @remarks
663
- * If this property is true, the controls's state persistence will be enabled.
664
- * Control's property will be stored in browser local storage to persist control's state when page reloads.
665
- *
666
- * @default false
667
- * @private
668
- */
669
- enablePersistence: boolean;
670
- /**
671
- * Specifies the finetune settings option which can be used to perform color adjustments in the image editor control.
672
- *
673
- * {% codeBlock src='image-editor/finetuneSettings/index.md' %}{% endcodeBlock %}
674
- *
675
- * @remarks
676
- * A 'FinetuneSettingsModel' value that specifies the the finetune options which are enabled in image editor control.
677
- * If the property is not specified, then the default values will be applied for minimum, maximum, and value properties for all finetune options.
678
- *
679
- * The possible values are:
680
- * - Brightness: The intensity of the primary colors grows with increased brightness, but the color itself does not change. It can be done by changing brightness and opacity property.
681
- * - Contrast: The contrast of an image refers to the difference between the light pixels and dark pixels. Low contrast images contain either a narrow range of colors while high contrast images have bright highlights and dark shadows. It can be done by changing contrast property.
682
- * - Hue: Hue distinguishes one color from another and is described using common color names such as green, blue, red, yellow, etc. Value refers to the lightness or darkness of a color. It can be controlled by hue-rotate property.
683
- * - Saturation: If saturation increases, colors appear sharper or purer. As saturation decreases, colors appear more washed-out or faded. It can be controlled by saturation and brightness property.
684
- * - Exposure: If exposure increases, intensity of light appears brighter. As exposure decreases, intensity of light decreases. Exposure can be controlled by brightness property.
685
- * - Opacity: The state or quality of being opaque or transparent, not allowing light to pass through the image. Opacity can be controlled by opacity property.
686
- * - Blur : Adjusting the blur can make an image unfocused or unclear. Blur can be controlled by blur property.
687
- *
688
- */
689
- finetuneSettings: FinetuneSettingsModel;
690
- /**
691
- * Specifies the zoom settings to perform zooming action.
692
- * A 'ZoomSettingsModel' value that specifies the the zoom related options which are enabled in image editor control. The default value is null.
693
- *
694
- * {% codeBlock src='image-editor/zoomSettings/index.md' %}{% endcodeBlock %}
695
- *
696
- * @remarks
697
- * If the property is not specified, then the default settings will be applied for all the properties available in zoom settings.
698
- *
699
- * The following options are available in `zoomSettings`.
700
- * - minZoomFactor: Specifies the minimum zoom factor level to control the zoom.
701
- * - maxZoomFactor: Specifies the maximum zoom factor level to control the zoom.
702
- * - zoomFactor: Specifies the zoom factor to be applied to the image.
703
- * - zoomTrigger: Specifies the types of zooming to be supported in the image editor.
704
- * - zoomPoint: Specifies the x and y coordinates in which the zooming performed on initial load.
705
- *
706
- */
707
- zoomSettings: ZoomSettingsModel;
708
- /**
709
- * Specifies the selection settings to customize selection.
710
- * A 'SelectionSettingsModel' value that specifies the the customization related options which are enabled in image editor control. The default value is null.
711
- *
712
- * @remarks
713
- * If the property is not specified, then the default settings will be applied for all the properties available in selection settings.
714
- *
715
- * The following options are available in `selectionSettings`.
716
- * - showCircle: Specifies whether to show / hide circles on selection.
717
- * - strokeColor: Specifies the stroke color of circle selection.
718
- * - fillColor: Specifies the fill color of circle selection.
719
- *
720
- */
721
- selectionSettings: SelectionSettingsModel;
722
- /**
723
- * Predefine the font families that populate in font family dropdown list from the toolbar.
724
- */
725
- fontFamily: FontFamilyModel;
726
- /**
727
- * Represents the settings for configuring image uploads.
728
- *
729
- * This object allows you to specify restrictions on the types and sizes of images that can be uploaded, ensuring that only valid files are accepted according to the defined criteria.
730
- *
731
- * The following options are available in `uploadSettings`.
732
- * - allowedExtensions: Specifies the allowed file extensions for uploaded images. The default value is null.
733
- * - minFileSize: Specifies the minimum size (in bytes) for the uploaded image. The default value is null.
734
- * - maxFileSize: Specifies the maximum size (in bytes) for the uploaded image. The default value is null.
735
- *
736
- */
737
- uploadSettings: UploadSettingsModel;
738
- /**
739
- * Event callback that is raised before an image is saved.
740
- *
741
- * @event beforeSave
742
- */
743
- beforeSave: EmitType<BeforeSaveEventArgs>;
744
- /**
745
- * Event callback that is raised after rendering the Image Editor component.
746
- *
747
- * @event created
748
- */
749
- created: EmitType<Event>;
750
- /**
751
- * Event callback that is raised once the component is destroyed with its elements and bound events.
752
- *
753
- * @event destroyed
754
- */
755
- destroyed: EmitType<Event>;
756
- /**
757
- * Event callback that is raised while zooming an image.
758
- *
759
- * @event zooming
760
- */
761
- zooming: EmitType<ZoomEventArgs>;
762
- /**
763
- * Event callback that is raised while panning an image.
764
- *
765
- * @event panning
766
- */
767
- panning: EmitType<PanEventArgs>;
768
- /**
769
- * Event callback that is raised while cropping an image.
770
- *
771
- * @event cropping
772
- */
773
- cropping: EmitType<CropEventArgs>;
774
- /**
775
- * Event callback that is raised while rotating an image.
776
- *
777
- * @event rotating
778
- */
779
- rotating: EmitType<RotateEventArgs>;
780
- /**
781
- * Event callback that is raised while flipping an image.
782
- *
783
- * @event flipping
784
- */
785
- flipping: EmitType<FlipEventArgs>;
786
- /**
787
- * Event callback that is raised while changing shapes in an Image Editor.
788
- *
789
- * @event shapeChanging
790
- */
791
- shapeChanging: EmitType<ShapeChangeEventArgs>;
792
- /**
793
- * Event callback that is raised while changing selection in an Image Editor.
794
- *
795
- * @event selectionChanging
796
- */
797
- selectionChanging: EmitType<SelectionChangeEventArgs>;
798
- /**
799
- * Event callback that is raised once an image is opened in an Image Editor.
800
- *
801
- * @event fileOpened
802
- */
803
- fileOpened: EmitType<OpenEventArgs>;
804
- /**
805
- * Event callback that is raised once an image is saved.
806
- *
807
- * @event saved
808
- */
809
- saved: EmitType<SaveEventArgs>;
810
- /**
811
- * Event callback that is raised once the toolbar is created.
812
- *
813
- * @event toolbarCreated
814
- */
815
- toolbarCreated: EmitType<ToolbarEventArgs>;
816
- /**
817
- * Event callback that is raised while updating/refreshing the toolbar
818
- *
819
- * {% codeBlock src='image-editor/toolbarUpdating/index.md' %}{% endcodeBlock %}
820
- *
821
- * @event toolbarUpdating
822
- *
823
- */
824
- toolbarUpdating: EmitType<ToolbarEventArgs>;
825
- /**
826
- * Event callback that is raised once the toolbar item is clicked.
827
- *
828
- * @event toolbarItemClicked
829
- */
830
- toolbarItemClicked: EmitType<ClickEventArgs>;
831
- /**
832
- * Event callback that is raised when applying filter to an image.
833
- *
834
- * @event imageFiltering
835
- */
836
- imageFiltering: EmitType<ImageFilterEventArgs>;
837
- /**
838
- * Event callback that is raised when applying fine tune to an image.
839
- *
840
- * @event finetuneValueChanging
841
- */
842
- finetuneValueChanging: EmitType<FinetuneEventArgs>;
843
- /**
844
- * Event callback that is raised while clicking on an image in the Image Editor.
845
- *
846
- * @event click
847
- */
848
- click: EmitType<ImageEditorClickEventArgs>;
849
- /**
850
- * Event callback that is raised after shape changing action is performed in an image editor.
851
- *
852
- * @remarks
853
- * This event is triggered after changing stroke color, fill Color, and stroke width property for the shapes and after the shape is applied to the canvas while clicking the OK button in toolbar.
854
- *
855
- * @event shapeChange
856
- */
857
- shapeChange: EmitType<ShapeChangeEventArgs>;
858
- /**
859
- * Event callback that is raised when opening the quick access toolbar.
860
- *
861
- * @event quickAccessToolbarOpen
862
- *
863
- * @remarks
864
- * Use this event to customize the toolbar items that appear in the quick access toolbar.
865
- * To customize the toolbar items, modify the "toolbarItems" collection property of the event arguments.
866
- * The "toolbarItems" collection contains string and ItemModel values.
867
- * The string values representing the names of the built-in toolbar items to display.
868
- * The ItemModel values representing the ItemModel of custom toolbar items to display.
869
- *
870
- * ```html
871
- * <div id='imageeditor'></div>
872
- * ```
873
- * ```typescript
874
- * <script>
875
- * var imageObj = new ImageEditor({
876
- * showQuickAccessToolbar : true,
877
- * quickAccessToolbarOpen: (args: QuickAccessToolbarEventArgs)=> {
878
- * args.toolbarItems = [“Delete”, {text: “custom”}];
879
- * }
880
- *
881
- * });
882
- * imageObj.appendTo("#imageeditor");
883
- * </script>
884
- */
885
- quickAccessToolbarOpen: EmitType<QuickAccessToolbarEventArgs>;
886
- /**
887
- * Event callback that is raised while resizing an image.
888
- *
889
- * @event resizing
890
- */
891
- resizing: EmitType<ResizeEventArgs>;
892
- /**
893
- * Event callback that is raised once the quick access toolbar item is clicked.
894
- *
895
- * @event quickAccessToolbarItemClick
896
- *
897
- */
898
- quickAccessToolbarItemClick: EmitType<ClickEventArgs>;
899
- /**
900
- * Event callback that is raised while applying frames on an image.
901
- *
902
- * @event frameChange
903
- */
904
- frameChange: EmitType<FrameChangeEventArgs>;
905
- /**
906
- * Event callback that is triggered after the completion of an editing action in the image editor.
907
- *
908
- * This event occurs after the image editor canvas has been updated through following actions such as cropping, drawing annotations, applying filters, fine-tuning, or other customizations.
909
- *
910
- * It provides an opportunity to perform additional tasks, such as comparing the current image data with previous states or triggering further processing based on the changes.
911
- *
912
- * @event editComplete
913
- *
914
- */
915
- editComplete: EmitType<EditCompleteEventArgs>;
916
- /**
917
- *
918
- * Constructor for creating the widget
919
- *
920
- * @param {ImageEditorModel} options - Specifies the image editor model
921
- * @param {string|HTMLDivElement} element - Specifies the target element
922
- */
923
- constructor(options?: ImageEditorModel, element?: string | HTMLDivElement);
924
- /**
925
- * To provide the array of modules needed for component rendering.
926
- *
927
- * @returns {ModuleDeclaration[]} - To provide the array of modules needed for component rendering.
928
- * @hidden
929
- */
930
- requiredModules(): ModuleDeclaration[];
931
- protected preRender(): void;
932
- /**
933
- *
934
- * To Initialize the component rendering
935
- *
936
- * @private
937
- * @returns {void}
938
- */
939
- protected render(): void;
940
- /**
941
- * To get component name.
942
- *
943
- * @returns {string} - Module Name
944
- * @private
945
- */
946
- getModuleName(): string;
947
- /**
948
- *
949
- * To get the properties to be maintained in the persisted state.
950
- *
951
- * @returns {string} - Persist data
952
- * @private
953
- */
954
- getPersistData(): string;
955
- /**
956
- *
957
- * Called internally if any of the property value changed.
958
- *
959
- * @param {ImageEditorModel} newProperties - Specifies new properties
960
- * @param {ImageEditorModel} oldProperties - Specifies old properties
961
- * @returns {void}
962
- * @private
963
- */
964
- onPropertyChanged(newProperties: ImageEditorModel, oldProperties?: ImageEditorModel): void;
965
- destroy(): void;
966
- initialize(): void;
967
- private createDropUploader;
968
- private dlgCloseBtnClick;
969
- /**
970
- * Show dialog popup for unsupported files.
971
- *
972
- * @param { string } type - Specifies the type of error.
973
- * @param { boolean } fileTypeError - Specifies the error is due to file type.
974
- * @hidden
975
- * @returns {void}.
976
- */
977
- showDialogPopup(type?: string, fileTypeError?: boolean): void;
978
- /**
979
- * Returns bytes in string format.
980
- *
981
- * @param { number } bytes - Specifies the bytes.
982
- *
983
- * @hidden
984
- * @returns {string}.
985
- */
986
- formatSizeUnits(bytes: number): string;
987
- /**
988
- * Returns allowed file type extensions in string[].
989
- *
990
- * @hidden
991
- * @returns {string[]}.
992
- */
993
- getExtensionArray(): string[];
994
- /**
995
- * Returns allowed file type extensions in string.
996
- *
997
- * @hidden
998
- * @returns {string}.
999
- */
1000
- getExtensionString(): string;
1001
- /**
1002
- *
1003
- * This Method will add events to component (element, event, method, current reference)
1004
- *
1005
- * @returns {void}.
1006
- */
1007
- private wireEvent;
1008
- /**
1009
- *
1010
- * This Method will remove events from component
1011
- *
1012
- * @returns {void}.
1013
- */
1014
- private unwireEvent;
1015
- private createCanvas;
1016
- private touchStartHandler;
1017
- private mouseDownEventHandler;
1018
- private mouseMoveEventHandler;
1019
- private mouseUpEventHandler;
1020
- private keyDownEventHandler;
1021
- private keyUpEventHandler;
1022
- private canvasMouseDownHandler;
1023
- private canvasMouseMoveHandler;
1024
- private canvasMouseUpHandler;
1025
- private handleScroll;
1026
- private adjustToScreen;
1027
- private screenOrientation;
1028
- private windowResizeHandler;
1029
- private notifyResetForAllModules;
1030
- private allowShape;
1031
- private manageActiveAction;
1032
- /**
1033
- * Clears the current selection performed in the image editor.
1034
- *
1035
- * @param { boolean } resetCrop - Specifies to reset last cropped image.
1036
- *
1037
- * @returns {void}.
1038
- */
1039
- clearSelection(resetCrop?: boolean): void;
1040
- /**
1041
- * Crops an image based on the selection done in the image editor.
1042
- *
1043
- * {% codeBlock src='image-editor/crop/index.md' %}{% endcodeBlock %}
1044
- *
1045
- * @remarks
1046
- * The selection can be done through programmatically using the 'select' method or through UI interactions.
1047
- *
1048
- * @returns {boolean}.
1049
- *
1050
- */
1051
- crop(): boolean;
1052
- /**
1053
- * Flips an image by horizontally or vertically in the image editor.
1054
- *
1055
- * {% codeBlock src='image-editor/zoom/index.md' %}{% endcodeBlock %}
1056
- *
1057
- * @param { Direction } direction - Specifies the direction to flip the image.
1058
- * A horizontal direction for horizontal flipping and vertical direction for vertical flipping.
1059
- *
1060
- * @remarks
1061
- * It flips the shapes including rectangle, circle, line, text, image, and freehand drawings.
1062
- *
1063
- * @returns {void}.
1064
- *
1065
- */
1066
- flip(direction: Direction): void;
1067
- /**
1068
- * Returns an image as ImageData to load it in to a canvas.
1069
- *
1070
- * @param {boolean} [includeAnnotations=true] - Optional. Specifies whether the returned image data should include annotations. The default value is true, meaning annotations are included.
1071
- *
1072
- * @remarks
1073
- * The data returned from this method is directly drawn in a canvas using 'putImageData' method.
1074
- * And then the user can get the base64 string from the canvas using toDataURL method.
1075
- *
1076
- * @returns {ImageData}.
1077
- */
1078
- getImageData(includeAnnotations?: boolean): ImageData;
1079
- /**
1080
- * Opens an image as URL or ImageData for editing in an image editor.
1081
- *
1082
- * @param {string | ImageData } data - Specifies url of the image or image data.
1083
- * @param {boolean} [resetChanges=true] - Optional. Determines whether to reset existing changes when opening the image. The default value is true, which resets all existing changes.
1084
- * @param {ImageSettings} imageSettings - Optional. Specifies image settings to apply when loading an image.
1085
- *
1086
- * @remarks
1087
- * The supported file types are JPG, JPEG, PNG, and SVG.
1088
- *
1089
- * @returns {void}.
1090
- */
1091
- open(data: string | ImageData, resetChanges?: boolean, imageSettings?: ImageSettings): void;
1092
- /**
1093
- * Reset all the changes done in an image editor and revert to original image.
1094
- *
1095
- * @remarks
1096
- * The undo redo collection also cleared while resetting the image editor.
1097
- *
1098
- * @returns {void}.
1099
- */
1100
- reset(): void;
1101
- /**
1102
- * Rotate an image to clockwise and anti-clockwise.
1103
- *
1104
- * {% codeBlock src='image-editor/rotate/index.md' %}{% endcodeBlock %}
1105
- *
1106
- * @param {number} degree - Specifies a degree to rotate an image.
1107
- * A positive integer value for clockwise and negative integer value for anti-clockwise rotation.
1108
- *
1109
- * @remarks
1110
- * It rotated the shapes including rectangle, circle, line, text, image, and freehand drawings.
1111
- *
1112
- * @returns {boolean}.
1113
- *
1114
- */
1115
- rotate(degree: number): boolean;
1116
- /**
1117
- * Export an image using the specified file name and the extension.
1118
- *
1119
- * @param {string} type - Specifies a format of image to be saved.
1120
- * @param {string} fileName – Specifies a file name to be saved
1121
- * @param {number} imageQuality – Specifies the quality of an image to be saved. The default value is “1” which represents the original size of the image if not specified.
1122
- *
1123
- * @remarks
1124
- * The supported file types are JPG, JPEG, PNG, and SVG.
1125
- *
1126
- * @returns {void}.
1127
- */
1128
- export(type?: string, fileName?: string, imageQuality?: number): void;
1129
- /**
1130
- * Perform selection in an image editor. The selection helps to crop an image.
1131
- *
1132
- * {% codeBlock src='image-editor/select/index.md' %}{% endcodeBlock %}
1133
- *
1134
- * @param {string} type - Specifies the shape - circle / square / custom selection / pre-defined ratios.
1135
- * @param {number} startX – Specifies the start x-coordinate point of the selection.
1136
- * @param {number} startY – Specifies the start y-coordinate point of the selection.
1137
- * @param {number} width - Specifies the width of the selection area.
1138
- * @param {number} height - Specifies the height of the selection area.
1139
- *
1140
- * @remarks
1141
- * The selection UI is based on the 'theme' property.
1142
- *
1143
- * @returns {void}.
1144
- *
1145
- */
1146
- select(type: string, startX?: number, startY?: number, width?: number, height?: number): void;
1147
- /**
1148
- * Enable or disable a freehand drawing option in an Image Editor.
1149
- *
1150
- * @param {boolean} value - Specifies a value whether to enable or disable freehand drawing.
1151
- *
1152
- * @returns {void}.
1153
- * @private
1154
- */
1155
- freeHandDraw(value: boolean): void;
1156
- /**
1157
- * Enable or disable a freehand drawing in an Image Editor.
1158
- *
1159
- * @param {boolean} value - Specifies a value whether to enable or disable freehand drawing.
1160
- *
1161
- * @remarks
1162
- * User can directly drawing on a canvas after enabling this option.
1163
- *
1164
- * @returns {void}.
1165
- */
1166
- freehandDraw(value: boolean): void;
1167
- /**
1168
- * Enable or disable a panning on the Image Editor.
1169
- *
1170
- * @param {boolean} value - Specifies a value whether enable or disable panning.
1171
- * @param {number} x - Optional, Specifies a value to pan the image horizontally.
1172
- * @param {number} y - Optional, Specifies a value to pan the image vertically.
1173
- *
1174
- * @remarks
1175
- * This option will take into effect once the image's visibility is hidden when zooming an image or selection has been performed.
1176
- *
1177
- * @returns {void}.
1178
- */
1179
- pan(value: boolean, x?: number, y?: number): void;
1180
- /**
1181
- * Zoom in or out on a point in the image editor.
1182
- *
1183
- * @param {number} zoomFactor - The percentage-based zoom factor to use (e.g. 20 for 2x zoom).
1184
- * @param {Point} zoomPoint - The point in the image editor to zoom in/out on.
1185
- *
1186
- * @remarks
1187
- * Zooming directly enables the panning option when the image's visibility is hidden.
1188
- * User can disable it by using 'Pan' method.
1189
- * @returns {void}
1190
- *
1191
- */
1192
- zoom(zoomFactor: number, zoomPoint?: Point): void;
1193
- /**
1194
- * Draw ellipse on an image.
1195
- *
1196
- * {% codeBlock src='image-editor/ellipse/index.md' %}{% endcodeBlock %}
1197
- *
1198
- * @param {number} x - Specifies x-coordinate of ellipse.
1199
- * @param {number} y - Specifies y-coordinate of ellipse.
1200
- * @param {number} radiusX - Specifies the radius x point for the ellipse.
1201
- * @param {number} radiusY - Specifies the radius y point for the ellipse.
1202
- * @param {number} strokeWidth - Specifies the stroke width of ellipse.
1203
- * @param {string} strokeColor - Specifies the stroke color of ellipse.
1204
- * @param {string} fillColor - Specifies the fill color of the ellipse.
1205
- * @param {number} degree - Specifies the degree to rotate the ellipse.
1206
- * @param {boolean} isSelected - Specifies to show the ellipse in the selected state.
1207
- * @returns {boolean}.
1208
- *
1209
- */
1210
- drawEllipse(x?: number, y?: number, radiusX?: number, radiusY?: number, strokeWidth?: number, strokeColor?: string, fillColor?: string, degree?: number, isSelected?: boolean): boolean;
1211
- /**
1212
- * Draw line on an image.
1213
- *
1214
- * @param {number} startX – Specifies start point x-coordinate of line.
1215
- * @param {number} startY – Specifies start point y-coordinate of line.
1216
- * @param {number} endX - Specifies end point x-coordinates of line.
1217
- * @param {number} endY - Specifies end point y-coordinates of the line.
1218
- * @param {number} strokeWidth - Specifies the stroke width of line.
1219
- * @param {string} strokeColor - Specifies the stroke color of line.
1220
- * @param {boolean} isSelected - Specifies to show the line in the selected state.
1221
- * @returns {boolean}.
1222
- */
1223
- drawLine(startX?: number, startY?: number, endX?: number, endY?: number, strokeWidth?: number, strokeColor?: string, isSelected?: boolean): boolean;
1224
- /**
1225
- * Draw arrow on an image.
1226
- *
1227
- * @param {number} startX – Specifies start point x-coordinate of arrow.
1228
- * @param {number} startY – Specifies start point y-coordinate of arrow.
1229
- * @param {number} endX - Specifies end point x-coordinates of arrow.
1230
- * @param {number} endY - Specifies end point y-coordinates of the arrow.
1231
- * @param {number} strokeWidth - Specifies the stroke width of arrow.
1232
- * @param {string} strokeColor - Specifies the stroke color of arrow.
1233
- * @param {ArrowheadType} arrowStart – Specifies the type of arrowhead for start position. The default value is ‘None’.
1234
- * @param {ArrowheadType} arrowEnd – Specifies the type of arrowhead for end position. The default value is ‘SolidArrow’.
1235
- * @param {boolean} isSelected - Specifies to show the arrow in the selected state.
1236
- * @returns {boolean}.
1237
- */
1238
- drawArrow(startX?: number, startY?: number, endX?: number, endY?: number, strokeWidth?: number, strokeColor?: string, arrowStart?: ArrowheadType, arrowEnd?: ArrowheadType, isSelected?: boolean): boolean;
1239
- /**
1240
- * Draw path on an image.
1241
- *
1242
- * @param {Point[]} pointColl – Specifies collection of start and end x, y-coordinates of path.
1243
- * @param {number} strokeWidth - Specifies the stroke width of path.
1244
- * @param {string} strokeColor - Specifies the stroke color of path.
1245
- * @param {boolean} isSelected - Specifies to show the path in the selected state.
1246
- * @returns {boolean}.
1247
- */
1248
- drawPath(pointColl: Point[], strokeWidth?: number, strokeColor?: string, isSelected?: boolean): boolean;
1249
- /**
1250
- * Draw a rectangle on an image.
1251
- *
1252
- * @param {number} x - Specifies x-coordinate of rectangle.
1253
- * @param {number} y - Specifies y-coordinate of rectangle.
1254
- * @param {number} width - Specifies the width of the rectangle.
1255
- * @param {number} height - Specifies the height of the rectangle.
1256
- * @param {number} strokeWidth - Specifies the stroke width of rectangle.
1257
- * @param {string} strokeColor - Specifies the stroke color of rectangle.
1258
- * @param {string} fillColor - Specifies the fill color of the rectangle.
1259
- * @param {number} degree - Specifies the degree to rotate the rectangle.
1260
- * @param {boolean} isSelected - Specifies to show the rectangle in the selected state.
1261
- * @param {number} borderRadius - Specifies the radius to apply border radius to rectangle.
1262
- * @returns {boolean}.
1263
- */
1264
- drawRectangle(x?: number, y?: number, width?: number, height?: number, strokeWidth?: number, strokeColor?: string, fillColor?: string, degree?: number, isSelected?: boolean, borderRadius?: number): boolean;
1265
- /**
1266
- * Draw a text on an image.
1267
- *
1268
- * {% codeBlock src='image-editor/text/index.md' %}{% endcodeBlock %}
1269
- *
1270
- * @param {number} x - Specifies x-coordinate of text.
1271
- * @param {number} y - Specifies y-coordinate of text.
1272
- * @param {string} text - Specifies the text to add on an image.
1273
- * @param {string} fontFamily - Specifies the font family of the text.
1274
- * @param {number} fontSize - Specifies the font size of the text.
1275
- * @param {boolean} bold - Specifies whether the text is bold or not.
1276
- * @param {boolean} italic - Specifies whether the text is italic or not.
1277
- * @param {string} color - Specifies font color of the text.
1278
- * @param {boolean} isSelected - Specifies to show the text in the selected state.
1279
- * @param {number} degree - Specifies the degree to rotate the text.
1280
- * @param {fillColor} fillColor - Specifies the background Color of the text.
1281
- * @param {string} strokeColor - Specifies the outline color of the text annotation.
1282
- * @param {number} strokeWidth - Specifies the outline stroke width of the text annotation.
1283
- * @param {TransformationCollection[]} transformCollection - Specifies the transform collection of the text annotation.
1284
- * @param {boolean} underline - Specifies whether the text should be underlined.
1285
- * @param {boolean} strikethrough - Specifies whether the text should have a strikethrough.
1286
- * @returns {boolean}.
1287
- *
1288
- */
1289
- drawText(x?: number, y?: number, text?: string, fontFamily?: string, fontSize?: number, bold?: boolean, italic?: boolean, color?: string, isSelected?: boolean, degree?: number, fillColor?: string, strokeColor?: string, strokeWidth?: number, transformCollection?: TransformationCollection[], underline?: boolean, strikethrough?: boolean): boolean;
1290
- /**
1291
- * Draw an image as annotation on an image.
1292
- *
1293
- *
1294
- * @param {string | ImageData} data - Specifies url of the image or image data.
1295
- * @param {number} x - Specifies x-coordinate of a starting point for an image.
1296
- * @param {number} y - Specifies y-coordinate of a starting point for an image.
1297
- * @param {number} width - Specifies the width of the image.
1298
- * @param {number} height - Specifies the height of the image.
1299
- * @param {boolean} isAspectRatio - Specifies whether to maintain aspect ratio or not.
1300
- * @param {number} degree - Specifies the degree to rotate the image.
1301
- * @param {number} opacity - Specifies the value for the image.
1302
- * @param {boolean} isSelected - Specifies to show the image in the selected state.
1303
- * @returns {boolean}.
1304
- *
1305
- */
1306
- drawImage(data: string | ImageData, x?: number, y?: number, width?: number, height?: number, isAspectRatio?: boolean, degree?: number, opacity?: number, isSelected?: boolean): boolean;
1307
- /**
1308
- * This method is used to update the existing shapes by changing its height, width, color, and font styles in the component.
1309
- * Use 'getShapeSettings' method to get the shape which is then passed to change the options of a shape.
1310
- * {% codeBlock src='image-editor/updateShape/index.md' %}{% endcodeBlock %}
1311
- *
1312
- * @param {ShapeSettings} setting - Specifies the shape settings to be updated for the shape on an image.
1313
- * @param {boolean} isSelected - Specifies to show the shape in the selected state.
1314
- * @returns {boolean}.
1315
- *
1316
- */
1317
- updateShape(setting: ShapeSettings, isSelected?: boolean): boolean;
1318
- /**
1319
- * Select a shape based on the given shape id.
1320
- * Use 'getShapeSettings' method to get the shape id which is then passed to perform selection.
1321
- *
1322
- * {% codeBlock src='image-editor/selectShape/index.md' %}{% endcodeBlock %}
1323
- *
1324
- * @param {string} id - Specifies the shape id to select a shape on an image.
1325
- * @returns {boolean}.
1326
- *
1327
- */
1328
- selectShape(id: string): boolean;
1329
- /**
1330
- * Deletes a shape based on the given shape id.
1331
- * Use 'getShapeSettings' method to get the shape id which is then passed to perform selection.
1332
- *
1333
- * {% codeBlock src='image-editor/deleteShape/index.md' %}{% endcodeBlock %}
1334
- *
1335
- * @param {string} id - Specifies the shape id to delete the shape on an image.
1336
- * @returns {void}.
1337
- *
1338
- */
1339
- deleteShape(id: string): void;
1340
- /**
1341
- * Get particular shapes details based on id of the shape which is drawn on an image editor.
1342
- *
1343
- * {% codeBlock src='image-editor/getShapeSetting/index.md' %}{% endcodeBlock %}
1344
- *
1345
- * @param {string} id - Specifies the shape id on an image.
1346
- * @returns {ShapeSettings}.
1347
- *
1348
- */
1349
- getShapeSetting(id: string): ShapeSettings;
1350
- /**
1351
- * Get all the shapes details which is drawn on an image editor.
1352
- *
1353
- * @returns {ShapeSettings[]}.
1354
- */
1355
- getShapeSettings(): ShapeSettings[];
1356
- /**
1357
- * Get all the shapes details which is drawn on an image editor.
1358
- *
1359
- * @returns {RedactSettings[]}.
1360
- */
1361
- getRedacts(): RedactSettings[];
1362
- /**
1363
- * Select a redaction based on the given redaction id.
1364
- * Use 'getRedacts' method to get the shape id which is then passed to perform selection.
1365
- *
1366
- *
1367
- * @param {string} id - Specifies the shape id to select a redact on an image.
1368
- * @returns {boolean}.
1369
- *
1370
- */
1371
- selectRedact(id: string): boolean;
1372
- /**
1373
- * Deletes a redaction based on the given shape id.
1374
- * Use 'getRedacts' method to get the redaaction id which is then passed to perform deletion.
1375
- *
1376
- *
1377
- * @param {string} id - Specifies the redaction id to delete the redaction on an image.
1378
- * @returns {void}.
1379
- *
1380
- */
1381
- deleteRedact(id: string): void;
1382
- /**
1383
- * This method is used to update the existing redacts by changing its height, width, blur, and pixel size in the component.
1384
- * Use 'getRedacts' method to get the redacts which is then passed to change the options of a redacts.
1385
- *
1386
- * @param {RedactSettings} setting - Specifies the redact settings to be updated for the shape on an image.
1387
- * @param {boolean} isSelected - Specifies to show the redacts in the selected state.
1388
- * @returns {boolean}.
1389
- *
1390
- */
1391
- updateRedact(setting: RedactSettings, isSelected?: boolean): boolean;
1392
- /**
1393
- * To refresh the Canvas Wrapper.
1394
- *
1395
- * @returns {void}.
1396
- */
1397
- update(): void;
1398
- /**
1399
- * Finetuning an image with the given type of finetune and its value in the image editor.
1400
- *
1401
- * @param {ImageFinetuneOption } finetuneOption - Specifies the finetune options to be performed in the image.
1402
- * @param {number } value - Specifies the value for finetuning the image.
1403
- *
1404
- * @remarks
1405
- * The finetuning will not affect the shapes background and border color.
1406
- *
1407
- * @returns {void}.
1408
- *
1409
- */
1410
- finetuneImage(finetuneOption: ImageFinetuneOption, value: number): void;
1411
- /**
1412
- * Filtering an image with the given type of filters.
1413
- *
1414
- * @param {ImageFilterOption } filterOption - Specifies the filter options to the image.
1415
- *
1416
- * @remarks
1417
- * The filtering will not affect the shape's background and border color.
1418
- * @returns {void}.
1419
- */
1420
- applyImageFilter(filterOption: ImageFilterOption): void;
1421
- /**
1422
- * Reverse the last action which performed by the user in the Image Editor.
1423
- *
1424
- * @remarks
1425
- * This method will take into effect once the 'allowUndoRedo' property is enabled.
1426
- *
1427
- * @returns {void}.
1428
- */
1429
- undo(): void;
1430
- /**
1431
- * Redo the last user action that was undone by the user or `undo` method.
1432
- *
1433
- * @remarks
1434
- * This method will take into effect once the 'allowUndoRedo' property is enabled.
1435
- * @returns {void}.
1436
- */
1437
- redo(): void;
1438
- /**
1439
- * Get the dimension of an image in the image editor such as x, y, width, and height.
1440
- * The method helps to get dimension after cropped an image.
1441
- *
1442
- * @returns {Dimension}.
1443
- * A Dimension object containing the x, y, width, and height of an image.
1444
- */
1445
- getImageDimension(): Dimension;
1446
- /**
1447
- * Resize an image by changing its width and height.
1448
- *
1449
- * @param {number} width - Specifies the width of an image.
1450
- * @param {number} height - Specifies the height of an image.
1451
- * @param {boolean} isAspectRatio - Specifies whether the scaling option is enabled or not.
1452
- *
1453
- * @returns {boolean} - A boolean value indicating the success of the resizing operation.
1454
- */
1455
- resize(width: number, height: number, isAspectRatio?: boolean): boolean;
1456
- /**
1457
- * Draw a frame on an image.
1458
- *
1459
- * @param { FrameType} frameType - Specifies the frame option to be drawn on an image.
1460
- * @param {string} color - Specifies the color of a frame on an image. The default value is ‘#fff’.
1461
- * @param {string} gradientColor - Specifies the gradient color of a frame on an image. The default value is ‘’.
1462
- * @param {number} size - Specifies the size of the frame as a percentage. It can be provided as an integer percentage (e.g., 10). Defaults to 20 if not specified.
1463
- * @param {number} inset - Specifies the inset value for line, hook, and inset type frames, as a percentage. It can be provided as an integer percentage (e.g., 10). Defaults to 0 if not specified.
1464
- * @param {number} offset - Specifies the offset value for line and inset type frames, as a percentage. It can be provided as an integer percentage (e.g., 10). Defaults to 0 if not specified.
1465
- * @param {number} borderRadius - Specifies the border radius for line-type frames, as a percentage. It can be provided as an integer percentage (e.g., 10). Defaults to 0 if not specified.
1466
- * @param {FrameLineStyle} frameLineStyle - Specifies the type of line to be drawn for line-type frames. Default to Solid if not specified.
1467
- * @param {number} lineCount - Specifies the number of lines for line-type frames. Defaults to 0 if not specified.
1468
- *
1469
- * @returns {boolean}.
1470
- */
1471
- drawFrame(frameType: FrameType, color?: string, gradientColor?: string, size?: number, inset?: number, offset?: number, borderRadius?: number, frameLineStyle?: FrameLineStyle, lineCount?: number): boolean;
1472
- /**
1473
- * Straightens an image by rotating it clockwise or counterclockwise.
1474
- *
1475
- * @param {number} degree - The degree value specifying the amount of rotation for straightening the image.
1476
- * Positive values indicate clockwise rotation, while negative values indicate counterclockwise rotation.
1477
- *
1478
- * @remarks
1479
- * The degree value should be within the range of -45 to +45 degrees for accurate straightening.
1480
- *
1481
- * @returns {boolean} - A boolean value indicating the success of the straightening operation.
1482
- */
1483
- straightenImage(degree: number): boolean;
1484
- /**
1485
- * Duplicates a shape based on the given shape ID in the ImageEditor.
1486
- * Use 'getShapeSettings' method to get the shape and then pass a shapeId from the returned shape to clone a shape.
1487
- *
1488
- * @param {string} shapeId - Specifies the shape id to clone a shape on an image.
1489
- * @returns {boolean}.
1490
- *
1491
- */
1492
- cloneShape(shapeId: string): boolean;
1493
- /**
1494
- * Update filter to the canvas in the ImageEditor.
1495
- *
1496
- * @param {ImageFilterOption } filterOption - Specifies the filter options to the image.
1497
- *
1498
- * @returns {string}.
1499
- *
1500
- */
1501
- getImageFilter(filterOption: ImageFilterOption): string;
1502
- /**
1503
- * Enable text area editing in the ImageEditor.
1504
- *
1505
- * @returns {void}.
1506
- *
1507
- */
1508
- enableTextEditing(): void;
1509
- /**
1510
- * Specifies if it's possible to undo the last recent action made in an Image Editor.
1511
- *
1512
- * @returns {boolean}.
1513
- *
1514
- */
1515
- canUndo(): boolean;
1516
- /**
1517
- * Specifies if it's possible to redo the last recent action made in an Image Editor.
1518
- *
1519
- * @returns {boolean}.
1520
- *
1521
- */
1522
- canRedo(): boolean;
1523
- /**
1524
- * Applies the operations performed in the Image Editor, such as annotation drawings.
1525
- *
1526
- * @returns{void}
1527
- * @remarks
1528
- * This method applies the actions performed after enabling annotation drawings, ensuring that the drawn annotations are applied to the image.
1529
- */
1530
- apply(): void;
1531
- /**
1532
- * Discards the operations performed in the Image Editor, such as annotation drawings.
1533
- *
1534
- * @returns{void}
1535
- * @remarks
1536
- * This method discards the actions performed after enabling annotation drawings, ensuring that the drawn annotations are not applied to the image.
1537
- */
1538
- discard(): void;
1539
- /**
1540
- * Enable or disable a shape drawing option in an Image Editor.
1541
- *
1542
- * @param {ShapeType} shapeType - Specifies the type of shape to be enabled or disabled for drawing.
1543
- * @param {boolean} isEnabled - Optional. Specifies a value to indicate whether to enable or disable shape drawing. The default value is true.
1544
- *
1545
- * @remarks This function allows the user to toggle the shape drawing feature in the Image Editor. When enabled, users can draw shapes on the image. When disabled, the shape drawing functionality is not available.
1546
- *
1547
- * @returns {void}.
1548
- */
1549
- enableShapeDrawing(shapeType: ShapeType, isEnabled: boolean): void;
1550
- /**
1551
- * Moves a shape to the front of all other shapes based on the given shape id.
1552
- * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1553
- *
1554
- * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1555
- * @returns {void}.
1556
- *
1557
- */
1558
- bringToFront(shapeId: string): void;
1559
- /**
1560
- * Moves a shape to ahead of one shape based on the given shape id.
1561
- * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1562
- *
1563
- * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1564
- * @returns {void}.
1565
- *
1566
- */
1567
- bringForward(shapeId: string): void;
1568
- /**
1569
- * Moves a shape to behind all other shapes based on the given shape id.
1570
- * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1571
- *
1572
- * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1573
- * @returns {void}.
1574
- *
1575
- */
1576
- sendToBack(shapeId: string): void;
1577
- /**
1578
- * Moves a shape to behind one shape based on the given shape id.
1579
- * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1580
- *
1581
- * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1582
- * @returns {void}.
1583
- *
1584
- */
1585
- sendBackward(shapeId: string): void;
1586
- /**
1587
- * Clears the loaded image in the Image Editor.
1588
- *
1589
- * @returns{void}
1590
- * @remarks
1591
- * This method clears the loaded image and updates the component's user interface to its initial state (the initial user interface without a loaded image).
1592
- */
1593
- clearImage(): void;
1594
- /**
1595
- * Enables overlay drawing to erase objects in an image editor. The eraser tool assists in selecting the mask image.
1596
- *
1597
- * @remarks
1598
- * The selection UI is based on the 'theme' property.
1599
- *
1600
- * @param {number} strokeWidth - Specifies the stroke width of the drawing.
1601
- * @param {string} color - Specifies the color of the drawing.
1602
- * @hidden
1603
- * @returns {void}.
1604
- *
1605
- */
1606
- selectMaskImage(strokeWidth?: number, color?: string): void;
1607
- private enableDisableToolbar;
1608
- private updateImage;
1609
- private editCompleted;
1610
- private updateColl;
1611
- private scaleToFit;
1612
- private setInitialZoomLevel;
1613
- private resetToolbar;
1614
- private setRotateZoom;
1615
- private getData;
1616
- private applyShapes;
1617
- private closeOverlayTbar;
1618
- private toolbarTemplateFn;
1619
- private quickAccessToolbarTemplateFn;
1620
- private templateParser;
1621
- private getTextFromId;
1622
- private getFinetuneOption;
1623
- private setPenStroke;
1624
- private updateFreehandDrawColorChange;
1625
- private getUndoRedoColl;
1626
- private updateImageTransformColl;
1627
- private setInitialZoomState;
1628
- /**
1629
- * Set the old item Transform item state.
1630
- *
1631
- * @hidden
1632
- * @returns {void}.
1633
- */
1634
- updateCropTransformItems(): void;
1635
- /**
1636
- * Get the pascal case.
1637
- *
1638
- * @param { string } str - Specifies the string to convert to pascal case.
1639
- * @param { Object } obj - Specifies the string to convert to pascal case.
1640
- * @hidden
1641
- * @returns {string}.
1642
- * A pascal case string.
1643
- */
1644
- toPascalCase(str: string, obj?: Object): string;
1645
- /**
1646
- * Get the font sizes.
1647
- *
1648
- * @hidden
1649
- * @returns {DropDownButtonItemModel[]}.
1650
- * A font size collections.
1651
- */
1652
- getFontSizes(): DropDownButtonItemModel[];
1653
- /**
1654
- * Updates drop area content dynamically.
1655
- *
1656
- * @param { HTMLElement } dropInfoElement - Specifies the drop area element.
1657
- * @hidden
1658
- * @returns {void}.
1659
- */
1660
- updateDropInfoContent(dropInfoElement: HTMLElement): void;
1661
- /**
1662
- * Handles the OK button operation
1663
- *
1664
- * @param { boolean } isMouseDown - Specifies whether it is a mouse down.
1665
- * @param { boolean } isFinalApply - Specifies whether it is a final apply.
1666
- * @param { boolean } isResize - Specifies whether it is called from resize public method.
1667
- * @hidden
1668
- * @returns {void}.
1669
- */
1670
- okBtn(isMouseDown?: boolean, isFinalApply?: boolean, isResize?: boolean): void;
1671
- triggerEditCompleteEvent(args: EditCompleteEventArgs): void;
1672
- /**
1673
- * Handles the OK button operation
1674
- *
1675
- * @param { string } id - Specifies shape id to return.
1676
- * @hidden
1677
- * @returns {SelectionPoint | Object}.
1678
- */
1679
- getObjFromId(id: string): SelectionPoint | Object;
1680
- /**
1681
- * Set the temporary filter properties.
1682
- *
1683
- * @hidden
1684
- * @returns {void}.
1685
- */
1686
- setTempFilterProperties(): void;
1687
- /**
1688
- * To crop the selection.
1689
- *
1690
- * @hidden
1691
- * @returns {void}.
1692
- */
1693
- cropSelectedState(): void;
1694
- /**
1695
- * Get the current canvas data.
1696
- *
1697
- * @hidden
1698
- * @returns {ImageData}.
1699
- * An ImageData returns the current canvas image data object.
1700
- */
1701
- getCurrentCanvasData(): ImageData;
1702
- /**
1703
- * To set current adjustment value
1704
- *
1705
- * @param { string } type - Specifies the type of adjustment.
1706
- * @param { number } value - Specifies the value to adjust.
1707
- * @hidden
1708
- * @returns {void}.
1709
- */
1710
- setCurrAdjustmentValue(type: string, value: number): void;
1711
- /**
1712
- * Get the square point for path.
1713
- *
1714
- * @param { SelectionPoint } obj - Specifies the points of path.
1715
- * @hidden
1716
- * @returns {ActivePoint}.
1717
- * An ActivePoint object which returns the square point.
1718
- */
1719
- getSquarePointForPath(obj: SelectionPoint): ActivePoint;
1720
- /**
1721
- * Get the SelectionType.
1722
- *
1723
- * @param { string } type - Specifies the SelectionType.
1724
- * @hidden
1725
- * @returns {string}.
1726
- * An string which returns the SelectionType.
1727
- */
1728
- getSelectionType(type: string): string;
1729
- /** Clears the context.
1730
- *
1731
- * @param { CanvasRenderingContext2D } ctx - Specifies the canvas context.
1732
- * @hidden
1733
- * @returns {void}.
1734
- */
1735
- clearContext(ctx: CanvasRenderingContext2D): void;
1736
- /**
1737
- * Apply Arrow for start and end.
1738
- *
1739
- * @param { string } type - Specifies the start arrow or end arrow.
1740
- * @param { string } id - Specifies the start arrow or end arrow item id.
1741
- * @hidden
1742
- * @returns {void}.
1743
- */
1744
- updateArrow(type: string, id: string): void;
1745
- /**
1746
- * Apply Font style for text.
1747
- *
1748
- * @param { string } id - Specifies the selected item id.
1749
- * @hidden
1750
- * @returns {void}.
1751
- */
1752
- updateFontFamily(id: string): void;
1753
- /**
1754
- * Apply Font size for text.
1755
- *
1756
- * @param { string } text - Specifies the selected item text.
1757
- * @hidden
1758
- * @returns {void}.
1759
- */
1760
- updateFontSize(text: string): void;
1761
- /**
1762
- * Apply Font color for text.
1763
- *
1764
- * @param { string } value - Specifies the selected color item value.
1765
- * @param { string } color - Specifies the selected color type value.
1766
- * @hidden
1767
- * @returns {void}.
1768
- */
1769
- updateFontColor(value: string, color: string): void;
1770
- /**
1771
- * Apply Font color for text.
1772
- *
1773
- * @param { string } value - Specifies the selected color item value.
1774
- * @hidden
1775
- * @returns {void}.
1776
- */
1777
- updateStrokeTextColor(value: string): void;
1778
- /**
1779
- * Apply Pen stroke width.
1780
- *
1781
- * @param { string } id - Specifies the selected item id.
1782
- * @hidden
1783
- * @returns {void}.
1784
- */
1785
- updatePenStrokeWidth(id: string): void;
1786
- /**
1787
- * Apply Pen stroke color.
1788
- *
1789
- * @param { string } value - Specifies the selected color item value.
1790
- * @hidden
1791
- * @returns {void}.
1792
- */
1793
- updatePenStrokeColor(value: string): void;
1794
- /**
1795
- * Apply Shape stroke width.
1796
- *
1797
- * @param { string } id - Specifies the selected item id.
1798
- * @param { string } type - Specifies the type of selected item.
1799
- * @param { string } shapeType - Specifies the shape type of selected item.
1800
- * @hidden
1801
- * @returns {void}.
1802
- */
1803
- updateStrokeWidth(id: string, type: string, shapeType?: string): void;
1804
- /**
1805
- * Apply Shape stroke color.
1806
- *
1807
- * @param { string } value - Specifies the selected color item value.
1808
- * @hidden
1809
- * @returns {void}.
1810
- */
1811
- updateStrokeColor(value: string): void;
1812
- /**
1813
- * Apply Shape fill color.
1814
- *
1815
- * @param { string } value - Specifies the selected color item value.
1816
- * @hidden
1817
- * @returns {void}.
1818
- */
1819
- updateFillColor(value: string): void;
1820
- /**
1821
- * Apply horizontal flip.
1822
- *
1823
- * @param { CanvasRenderingContext2D } ctx - Specifies the canvas context 2D.
1824
- * @param { boolean } isPreventURC - Specifies to update undo redo collection.
1825
- * @hidden
1826
- * @returns {void}.
1827
- */
1828
- horizontalFlip(ctx: CanvasRenderingContext2D, isPreventURC?: boolean): void;
1829
- /**
1830
- * Apply vertical flip.
1831
- *
1832
- * @param { CanvasRenderingContext2D } ctx - Specifies the canvas context 2D.
1833
- * @param { boolean } isPreventURC - Specifies to update undo redo collection.
1834
- * @hidden
1835
- * @returns {void}.
1836
- */
1837
- verticalFlip(ctx: CanvasRenderingContext2D, isPreventURC?: boolean): void;
1838
- /**
1839
- * Apply rotate image.
1840
- *
1841
- * @param { string } rotate - Specifies the direction of rotation.
1842
- * @hidden
1843
- * @returns {void}.
1844
- */
1845
- rotateImage(rotate: string): void;
1846
- /**
1847
- * Get pascalToSplitWords from string.
1848
- *
1849
- * @param { string } str - Specifies the word.
1850
- * @hidden
1851
- * @returns {string}.
1852
- */
1853
- pascalToSplitWords(str: string): string;
1854
- /**
1855
- * Get Slider Value.
1856
- *
1857
- * @param { string } type - Finetune type.
1858
- * @hidden
1859
- * @returns {number}.
1860
- */
1861
- getCurrAdjustmentValue(type: string): number;
1862
- /**
1863
- * Apply transformSelect.
1864
- *
1865
- * @param { string } type - Specifies the selected item text.
1866
- * @hidden
1867
- * @returns {void}.
1868
- */
1869
- transformSelect(type: string): void;
1870
- /**
1871
- * Returns default filter.
1872
- *
1873
- * @hidden
1874
- * @returns {string}.
1875
- */
1876
- getDefaultFilter(): string;
1877
- /**
1878
- * Performs Straightening action.
1879
- *
1880
- * @param { number } value - Specifies the degree of straightening.
1881
- * @hidden
1882
- * @returns {void} .
1883
- */
1884
- setStraighten(value: number): void;
1885
- private duplicateImage;
1886
- private performStraighten;
1887
- /**
1888
- * Straightens base image.
1889
- *
1890
- * @hidden
1891
- * @returns {void}.
1892
- */
1893
- straightenBaseImageCanvas(): void;
1894
- /**
1895
- * Returns rotated canvas dimension.
1896
- *
1897
- * @param { number } width - Specifies the width of the canvas.
1898
- * @param { number } height - Specifies the height of the canvas.
1899
- * @param { number } angle - Specifies the angle of rotation in degrees.
1900
- * @hidden
1901
- * @returns {void} .
1902
- */
1903
- getRotatedCanvasDim(width: number, height: number, angle: number): Dimension;
1904
- /**
1905
- * Apply Shape order.
1906
- *
1907
- * @param { string } id - Specifies the id of the shape to change the order.
1908
- * @param { string } value - Specifies the order of the shapes.
1909
- * @hidden
1910
- * @returns {void}.
1911
- */
1912
- updateShapeOrder(id: string, value: string): void;
1913
- private getStraightenFlipState;
1914
- private initializeZoomSettings;
1915
- private initializeThemeColl;
1916
- /**
1917
- * Draw a redaction on an image.
1918
- *
1919
- * @param {RedactType} type – Optional. Specifies the type of redaction to be drawn on the image such as blur or pixelate. If not specified, the redaction drawing is initiated with the default blur value.
1920
- * @param {number} x – Optional. Specifies x-coordinate of redaction. If not specified, the redaction drawing is initiated with the first parameter.
1921
- * @param {number} y – Optional. Specifies y-coordinate of redaction. If not specified it draws redaction from the center point of the image.
1922
- * @param {number} width – Optional. Specifies the width of the redaction. The default value is 100.
1923
- * @param {number} height – Optional. Specifies the height of the redaction. The default value is 50.
1924
- * @param {number} value – Optional. Specifies the blur value for blur-type redaction or the pixel size for pixelate-type redaction. Defaults to 20 since the default redaction is blur.
1925
- * @returns {boolean}.
1926
- */
1927
- drawRedact(type?: RedactType, x?: number, y?: number, width?: number, height?: number, value?: number): boolean;
1928
- }