@syncfusion/ej2-image-editor 20.3.47
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.
- package/.eslintrc.json +244 -0
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +63 -0
- package/.github/PULL_REQUEST_TEMPLATE/feature.md +39 -0
- package/CHANGELOG.md +18 -0
- package/README.md +6 -0
- package/dist/ej2-image-editor.umd.min.js +11 -0
- package/dist/ej2-image-editor.umd.min.js.map +1 -0
- package/dist/es6/ej2-image-editor.es2015.js +7511 -0
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -0
- package/dist/es6/ej2-image-editor.es5.js +7550 -0
- package/dist/es6/ej2-image-editor.es5.js.map +1 -0
- package/dist/global/ej2-image-editor.min.js +11 -0
- package/dist/global/ej2-image-editor.min.js.map +1 -0
- package/dist/global/index.d.ts +14 -0
- package/helpers/e2e/imageEditorHelper.d.ts +37 -0
- package/helpers/e2e/imageEditorHelper.js +53 -0
- package/helpers/e2e/index.d.ts +1 -0
- package/helpers/e2e/index.js +8 -0
- package/helpers/e2e/querybuilderHelper.d.ts +37 -0
- package/image-editor.d.ts +4 -0
- package/image-editor.js +4 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/package.json +74 -0
- package/src/global.js +1 -0
- package/src/image-editor/image-editor-model.d.ts +206 -0
- package/src/image-editor/image-editor.d.ts +961 -0
- package/src/image-editor/image-editor.js +7542 -0
- package/src/image-editor/index.d.ts +5 -0
- package/src/image-editor/index.js +4 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +4 -0
- package/styles/bootstrap-dark.css +283 -0
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap.css +283 -0
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4.css +279 -0
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark.css +301 -0
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +301 -0
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark.css +283 -0
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric.css +283 -0
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark.css +290 -0
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent.css +290 -0
- package/styles/fluent.scss +1 -0
- package/styles/highcontrast-light.css +281 -0
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast.css +281 -0
- package/styles/highcontrast.scss +1 -0
- package/styles/image-editor/_all.scss +2 -0
- package/styles/image-editor/_bootstrap-dark-definition.scss +10 -0
- package/styles/image-editor/_bootstrap-definition.scss +10 -0
- package/styles/image-editor/_bootstrap4-definition.scss +10 -0
- package/styles/image-editor/_bootstrap5-dark-definition.scss +1 -0
- package/styles/image-editor/_bootstrap5-definition.scss +10 -0
- package/styles/image-editor/_fabric-dark-definition.scss +10 -0
- package/styles/image-editor/_fabric-definition.scss +10 -0
- package/styles/image-editor/_fluent-dark-definition.scss +1 -0
- package/styles/image-editor/_fluent-definition.scss +10 -0
- package/styles/image-editor/_fusionnew-definition.scss +10 -0
- package/styles/image-editor/_highcontrast-definition.scss +10 -0
- package/styles/image-editor/_highcontrast-light-definition.scss +10 -0
- package/styles/image-editor/_layout.scss +204 -0
- package/styles/image-editor/_material-dark-definition.scss +10 -0
- package/styles/image-editor/_material-definition.scss +10 -0
- package/styles/image-editor/_material3-definition.scss +10 -0
- package/styles/image-editor/_tailwind-dark-definition.scss +1 -0
- package/styles/image-editor/_tailwind-definition.scss +10 -0
- package/styles/image-editor/_theme.scss +97 -0
- package/styles/image-editor/bootstrap-dark.css +283 -0
- package/styles/image-editor/bootstrap-dark.scss +12 -0
- package/styles/image-editor/bootstrap.css +283 -0
- package/styles/image-editor/bootstrap.scss +12 -0
- package/styles/image-editor/bootstrap4.css +279 -0
- package/styles/image-editor/bootstrap4.scss +12 -0
- package/styles/image-editor/bootstrap5-dark.css +301 -0
- package/styles/image-editor/bootstrap5-dark.scss +12 -0
- package/styles/image-editor/bootstrap5.css +301 -0
- package/styles/image-editor/bootstrap5.scss +12 -0
- package/styles/image-editor/fabric-dark.css +283 -0
- package/styles/image-editor/fabric-dark.scss +12 -0
- package/styles/image-editor/fabric.css +283 -0
- package/styles/image-editor/fabric.scss +12 -0
- package/styles/image-editor/fluent-dark.css +290 -0
- package/styles/image-editor/fluent-dark.scss +12 -0
- package/styles/image-editor/fluent.css +290 -0
- package/styles/image-editor/fluent.scss +12 -0
- package/styles/image-editor/highcontrast-light.css +281 -0
- package/styles/image-editor/highcontrast-light.scss +12 -0
- package/styles/image-editor/highcontrast.css +281 -0
- package/styles/image-editor/highcontrast.scss +12 -0
- package/styles/image-editor/icons/_bootstrap-dark.scss +218 -0
- package/styles/image-editor/icons/_bootstrap.scss +218 -0
- package/styles/image-editor/icons/_bootstrap4.scss +218 -0
- package/styles/image-editor/icons/_bootstrap5-dark.scss +1 -0
- package/styles/image-editor/icons/_bootstrap5.scss +224 -0
- package/styles/image-editor/icons/_fabric-dark.scss +218 -0
- package/styles/image-editor/icons/_fabric.scss +218 -0
- package/styles/image-editor/icons/_fluent-dark.scss +1 -0
- package/styles/image-editor/icons/_fluent.scss +224 -0
- package/styles/image-editor/icons/_fusionnew.scss +224 -0
- package/styles/image-editor/icons/_highcontrast-light.scss +218 -0
- package/styles/image-editor/icons/_highcontrast.scss +218 -0
- package/styles/image-editor/icons/_material-dark.scss +218 -0
- package/styles/image-editor/icons/_material.scss +218 -0
- package/styles/image-editor/icons/_material3.scss +230 -0
- package/styles/image-editor/icons/_tailwind-dark.scss +1 -0
- package/styles/image-editor/icons/_tailwind.scss +218 -0
- package/styles/image-editor/material-dark.css +299 -0
- package/styles/image-editor/material-dark.scss +12 -0
- package/styles/image-editor/material.css +299 -0
- package/styles/image-editor/material.scss +12 -0
- package/styles/image-editor/tailwind-dark.css +288 -0
- package/styles/image-editor/tailwind-dark.scss +12 -0
- package/styles/image-editor/tailwind.css +288 -0
- package/styles/image-editor/tailwind.scss +12 -0
- package/styles/material-dark.css +299 -0
- package/styles/material-dark.scss +1 -0
- package/styles/material.css +299 -0
- package/styles/material.scss +1 -0
- package/styles/tailwind-dark.css +288 -0
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind.css +288 -0
- package/styles/tailwind.scss +1 -0
- package/tslint.json +111 -0
|
@@ -0,0 +1,961 @@
|
|
|
1
|
+
import { INotifyPropertyChanged } from '@syncfusion/ej2-base';
|
|
2
|
+
import { EmitType } from '@syncfusion/ej2-base';
|
|
3
|
+
import { SignatureBase } from '@syncfusion/ej2-inputs';
|
|
4
|
+
import { ItemModel, ClickEventArgs } from '@syncfusion/ej2-navigations';
|
|
5
|
+
import { OpenEventArgs } from '@syncfusion/ej2-popups';
|
|
6
|
+
import { ImageEditorModel } from './image-editor-model';
|
|
7
|
+
/**
|
|
8
|
+
* Image Editor is a graphical user interface that helps to edit an image by performing actions like selection,
|
|
9
|
+
* cropping, rotating, inserting text and shapes (rectangles, ellipses, lines), and drawing free hand on top of an image.
|
|
10
|
+
*
|
|
11
|
+
```html
|
|
12
|
+
* <div id='imageeditor'></div>
|
|
13
|
+
* ```
|
|
14
|
+
* ```typescript
|
|
15
|
+
* <script>
|
|
16
|
+
* var imageObj = new ImageEditor({});
|
|
17
|
+
* imageObj.appendTo("#imageeditor");
|
|
18
|
+
* </script>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class ImageEditor extends SignatureBase implements INotifyPropertyChanged {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* ImageEditor Private Properties
|
|
25
|
+
*/
|
|
26
|
+
private lowerCanvas;
|
|
27
|
+
private lowerContext;
|
|
28
|
+
private upperCanvas;
|
|
29
|
+
private upperContext;
|
|
30
|
+
private inMemoryCanvas;
|
|
31
|
+
private inMemoryContext;
|
|
32
|
+
private baseImg;
|
|
33
|
+
private textBox;
|
|
34
|
+
private degree;
|
|
35
|
+
private isUndoRedo;
|
|
36
|
+
private dragCanvas;
|
|
37
|
+
private dragElement;
|
|
38
|
+
private keyHistory;
|
|
39
|
+
private flipState;
|
|
40
|
+
private mouseDownPoint;
|
|
41
|
+
private previousPoint;
|
|
42
|
+
private dragPoint;
|
|
43
|
+
private diffPoint;
|
|
44
|
+
private oldPoint;
|
|
45
|
+
private zoomedImg;
|
|
46
|
+
private objColl;
|
|
47
|
+
private undoRedoColl;
|
|
48
|
+
private imgDataColl;
|
|
49
|
+
private currImgData;
|
|
50
|
+
private strokeSettings;
|
|
51
|
+
private textSettings;
|
|
52
|
+
private tempStrokeSettings;
|
|
53
|
+
private penStrokeWidth;
|
|
54
|
+
private tempTextSettings;
|
|
55
|
+
private toolbarHeight;
|
|
56
|
+
private pannStart;
|
|
57
|
+
private pannEnd;
|
|
58
|
+
private togglePan;
|
|
59
|
+
private lastX;
|
|
60
|
+
private lastY;
|
|
61
|
+
private dragStart;
|
|
62
|
+
private dragged;
|
|
63
|
+
private factor;
|
|
64
|
+
private currFlipState;
|
|
65
|
+
private touchEndPoint;
|
|
66
|
+
private flipMethod;
|
|
67
|
+
private flipDirection;
|
|
68
|
+
private prevX;
|
|
69
|
+
private currX;
|
|
70
|
+
private prevY;
|
|
71
|
+
private currY;
|
|
72
|
+
private togglePen;
|
|
73
|
+
private rotateMethod;
|
|
74
|
+
private isBoldbtn;
|
|
75
|
+
private isItalicbtn;
|
|
76
|
+
private lastAction;
|
|
77
|
+
private currentToolbar;
|
|
78
|
+
private textStartPoints;
|
|
79
|
+
private fontSizeColl;
|
|
80
|
+
private tempKeyHistory;
|
|
81
|
+
private penDrawColl;
|
|
82
|
+
private allowDrag;
|
|
83
|
+
private textRow;
|
|
84
|
+
private activeObj;
|
|
85
|
+
private currObjType;
|
|
86
|
+
private defToolbarItems;
|
|
87
|
+
private defaultLocale;
|
|
88
|
+
private l10n;
|
|
89
|
+
private themeColl;
|
|
90
|
+
private toolbarFn;
|
|
91
|
+
private baseImgSrc;
|
|
92
|
+
private isTimer;
|
|
93
|
+
private timer;
|
|
94
|
+
private isScreenOriented;
|
|
95
|
+
/**
|
|
96
|
+
* Defines class/multiple classes separated by a space for customizing Image Editor UI.
|
|
97
|
+
* default ''
|
|
98
|
+
```html
|
|
99
|
+
* <div id='imageeditor'></div>
|
|
100
|
+
* ```
|
|
101
|
+
* ```typescript
|
|
102
|
+
* <script>
|
|
103
|
+
* var imageObj = new ImageEditor({cssClass: 'e-custom-img-editor'});
|
|
104
|
+
* imageObj.appendTo("#imageeditor");
|
|
105
|
+
* </script>
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
cssClass: string;
|
|
109
|
+
/**
|
|
110
|
+
* Specifies whether the Image Editor is disabled.
|
|
111
|
+
* default false
|
|
112
|
+
*/
|
|
113
|
+
disabled: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Specifies the height of the Image Editor.
|
|
116
|
+
* default '100%'
|
|
117
|
+
*/
|
|
118
|
+
height: string;
|
|
119
|
+
/**
|
|
120
|
+
* Specifies the theme of the Image Editor. The shape selection appearance will be decided based on this property.
|
|
121
|
+
* The property supports all the built-in themes of Syncfusion.
|
|
122
|
+
* default 'Bootstrap5'
|
|
123
|
+
* @isenumeration true
|
|
124
|
+
* @default Theme.Bootstrap5
|
|
125
|
+
* @asptype Theme
|
|
126
|
+
*
|
|
127
|
+
*/
|
|
128
|
+
theme: string | Theme;
|
|
129
|
+
/**
|
|
130
|
+
* Specifies the toolbar items to perform UI interactions. It accepts both string[] and ItemModel[] to configure its toolbar items.
|
|
131
|
+
* If the property is defined as empty collection, the toolbar will not be rendered.
|
|
132
|
+
* Suppose the property is not defined in control, an image editor’s toolbar will be rendered with preconfigured toolbar commands.
|
|
133
|
+
* The preconfigured toolbar commands are
|
|
134
|
+
* Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
|
|
135
|
+
* Annotate: help to insert a shape on image that supports rectangle, ellipse, line, text and freehand drawing with resize, drag and drop, and customize its appearance.
|
|
136
|
+
* Transform: helps to rotate and flip an image.
|
|
137
|
+
* ZoomIn: performs zoom-in an image.
|
|
138
|
+
* ZoomOut: performs zoom-out an image.
|
|
139
|
+
* Pan: performs panning once zoomed an image.
|
|
140
|
+
* Move: disable the pan action and move to perform other actions such as insert a shape, transform, and more.
|
|
141
|
+
* Save: save the modified image.
|
|
142
|
+
* Open: open an image to perform editing.
|
|
143
|
+
* Reset: reset the modification and restore the original image.
|
|
144
|
+
* default null
|
|
145
|
+
```html
|
|
146
|
+
* <div id='imageeditor'></div>
|
|
147
|
+
* ```
|
|
148
|
+
* ```typescript
|
|
149
|
+
* <script>
|
|
150
|
+
* var imageObj = new ImageEditor({
|
|
151
|
+
* toolbar[Crop, ZoomIn, ZoomOut, Transform, {text: 'Custom'}]
|
|
152
|
+
* });
|
|
153
|
+
* imageObj.appendTo("#imageeditor");
|
|
154
|
+
* </script>
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
toolbar: (string | ImageEditorCommands | ItemModel)[];
|
|
158
|
+
/**
|
|
159
|
+
* Specifies template to the Image Editor Toolbar.
|
|
160
|
+
* If you want to customize the entire toolbar in own way by using this property.
|
|
161
|
+
* The property is depending on ‘toolbar’.
|
|
162
|
+
*
|
|
163
|
+
* @default null
|
|
164
|
+
```html
|
|
165
|
+
* <div id='imageeditor'></div>
|
|
166
|
+
* ```
|
|
167
|
+
* ```typescript
|
|
168
|
+
* <script>
|
|
169
|
+
* var imageObj = new ImageEditor({
|
|
170
|
+
* toolbarTemplate: '#toolbarTemplate'
|
|
171
|
+
* });
|
|
172
|
+
* imageObj.appendTo("#imageeditor");
|
|
173
|
+
* </script>
|
|
174
|
+
* <script id="toolbarTemplate" type="text/x-template">
|
|
175
|
+
* <div class = 'e-toolbar'>
|
|
176
|
+
* <button id= 'dltbtn'></button>
|
|
177
|
+
* </div>
|
|
178
|
+
* </script>
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
toolbarTemplate: string;
|
|
182
|
+
/**
|
|
183
|
+
* Specifies the width of the Image Editor.
|
|
184
|
+
* default 100%
|
|
185
|
+
*/
|
|
186
|
+
width: string;
|
|
187
|
+
/**
|
|
188
|
+
* Triggers before an image is saved.
|
|
189
|
+
*
|
|
190
|
+
* @event beforeSave
|
|
191
|
+
*/
|
|
192
|
+
beforeSave: EmitType<BeforeSaveEventArgs>;
|
|
193
|
+
/**
|
|
194
|
+
* Triggers once the component rendering is completed.
|
|
195
|
+
*
|
|
196
|
+
* @event created
|
|
197
|
+
*/
|
|
198
|
+
created: EmitType<Event>;
|
|
199
|
+
/**
|
|
200
|
+
* Triggers once the component is destroyed with its elements and bound events.
|
|
201
|
+
*
|
|
202
|
+
* @event destroyed
|
|
203
|
+
*/
|
|
204
|
+
destroyed: EmitType<Event>;
|
|
205
|
+
/**
|
|
206
|
+
* Triggers while zooming an image.
|
|
207
|
+
*
|
|
208
|
+
* @event zooming
|
|
209
|
+
*/
|
|
210
|
+
zooming: EmitType<ZoomEventArgs>;
|
|
211
|
+
/**
|
|
212
|
+
* Triggers while panning an image.
|
|
213
|
+
*
|
|
214
|
+
* @event panning
|
|
215
|
+
*/
|
|
216
|
+
panning: EmitType<PanEventArgs>;
|
|
217
|
+
/**
|
|
218
|
+
* Triggers while cropping an image.
|
|
219
|
+
*
|
|
220
|
+
* @event cropping
|
|
221
|
+
*/
|
|
222
|
+
cropping: EmitType<CropEventArgs>;
|
|
223
|
+
/**
|
|
224
|
+
* Triggers while rotating an image.
|
|
225
|
+
*
|
|
226
|
+
* @event rotating
|
|
227
|
+
*/
|
|
228
|
+
rotating: EmitType<RotateEventArgs>;
|
|
229
|
+
/**
|
|
230
|
+
* Triggers while flipping an image.
|
|
231
|
+
*
|
|
232
|
+
* @event flipping
|
|
233
|
+
*/
|
|
234
|
+
flipping: EmitType<FlipEventArgs>;
|
|
235
|
+
/**
|
|
236
|
+
* Triggers while changing shapes in an image.
|
|
237
|
+
*
|
|
238
|
+
* @event shapeChanging
|
|
239
|
+
*/
|
|
240
|
+
shapeChanging: EmitType<ShapeChangeEventArgs>;
|
|
241
|
+
/**
|
|
242
|
+
* Triggers once an image is opened.
|
|
243
|
+
*
|
|
244
|
+
* @event fileOpened
|
|
245
|
+
*/
|
|
246
|
+
fileOpened: EmitType<OpenEventArgs>;
|
|
247
|
+
/**
|
|
248
|
+
* Triggers once an image is saved.
|
|
249
|
+
*
|
|
250
|
+
* @event saved
|
|
251
|
+
*/
|
|
252
|
+
saved: EmitType<SaveEventArgs>;
|
|
253
|
+
/**
|
|
254
|
+
* Triggers once the toolbar is created.
|
|
255
|
+
*
|
|
256
|
+
* @event toolbarCreated
|
|
257
|
+
*/
|
|
258
|
+
toolbarCreated: EmitType<ToolbarEventArgs>;
|
|
259
|
+
/**
|
|
260
|
+
* Triggers while updating/refreshing the toolbar
|
|
261
|
+
*
|
|
262
|
+
* @event toolbarUpdating
|
|
263
|
+
*/
|
|
264
|
+
toolbarUpdating: EmitType<ToolbarEventArgs>;
|
|
265
|
+
/**
|
|
266
|
+
* Triggers once the toolbar item is clicked.
|
|
267
|
+
*
|
|
268
|
+
* @event toolbarItemClicked
|
|
269
|
+
*/
|
|
270
|
+
toolbarItemClicked: EmitType<ClickEventArgs>;
|
|
271
|
+
/**
|
|
272
|
+
*
|
|
273
|
+
* Constructor for creating the widget
|
|
274
|
+
*
|
|
275
|
+
* @param {ImageEditorModel} options - Specifies the image editor model
|
|
276
|
+
* @param {string|HTMLDivElement} element - Specifies the target element
|
|
277
|
+
*/
|
|
278
|
+
constructor(options?: ImageEditorModel, element?: string | HTMLCanvasElement);
|
|
279
|
+
protected preRender(): void;
|
|
280
|
+
/**
|
|
281
|
+
*
|
|
282
|
+
* To Initialize the component rendering
|
|
283
|
+
*
|
|
284
|
+
* @private
|
|
285
|
+
* @returns {void}
|
|
286
|
+
*/
|
|
287
|
+
protected render(): void;
|
|
288
|
+
/**
|
|
289
|
+
* To get component name.
|
|
290
|
+
*
|
|
291
|
+
* @returns {string} - Module Name
|
|
292
|
+
* @private
|
|
293
|
+
*/
|
|
294
|
+
getModuleName(): string;
|
|
295
|
+
/**
|
|
296
|
+
*
|
|
297
|
+
* To get the properties to be maintained in the persisted state.
|
|
298
|
+
*
|
|
299
|
+
* @returns {string} - Persist data
|
|
300
|
+
* @private
|
|
301
|
+
*/
|
|
302
|
+
getPersistData(): string;
|
|
303
|
+
/**
|
|
304
|
+
*
|
|
305
|
+
* Called internally if any of the property value changed.
|
|
306
|
+
*
|
|
307
|
+
* @param {ImageEditorModel} newProperties - Specifies new properties
|
|
308
|
+
* @param {ImageEditorModel} oldProperties - Specifies old properties
|
|
309
|
+
* @returns {void}
|
|
310
|
+
* @private
|
|
311
|
+
*/
|
|
312
|
+
onPropertyChanged(newProperties: ImageEditorModel, oldProperties?: ImageEditorModel): void;
|
|
313
|
+
destroy(): void;
|
|
314
|
+
initialize(): void;
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
* This Method will add events to component (element, event, method, current reference)
|
|
318
|
+
*
|
|
319
|
+
* @returns {void}.
|
|
320
|
+
*/
|
|
321
|
+
private wireEvent;
|
|
322
|
+
/**
|
|
323
|
+
*
|
|
324
|
+
* This Method will remove events from component
|
|
325
|
+
*
|
|
326
|
+
* @returns {void}.
|
|
327
|
+
*/
|
|
328
|
+
private unwireEvent;
|
|
329
|
+
private updateTheme;
|
|
330
|
+
private toPascalCase;
|
|
331
|
+
private createCanvas;
|
|
332
|
+
private createToolbar;
|
|
333
|
+
private createBottomToolbar;
|
|
334
|
+
private initBottomToolbar;
|
|
335
|
+
private toolbarTemplateFn;
|
|
336
|
+
private templateParser;
|
|
337
|
+
private getLeftToolbarItem;
|
|
338
|
+
private getRightToolbarItem;
|
|
339
|
+
private getMainToolbarItem;
|
|
340
|
+
private getZoomToolbarItem;
|
|
341
|
+
private processToolbar;
|
|
342
|
+
private processSubToolbar;
|
|
343
|
+
private isToolbar;
|
|
344
|
+
private initToolbarItem;
|
|
345
|
+
private createLeftToolbarControls;
|
|
346
|
+
private renderAnnotationBtn;
|
|
347
|
+
private renderCropBtn;
|
|
348
|
+
private renderTransformBtn;
|
|
349
|
+
private renderSaveBtn;
|
|
350
|
+
private cropSelect;
|
|
351
|
+
private transformSelect;
|
|
352
|
+
private getShapesToolbarItem;
|
|
353
|
+
private initShapesToolbarItem;
|
|
354
|
+
private createShapeColor;
|
|
355
|
+
private createShapeBtn;
|
|
356
|
+
private getTextToolbarItem;
|
|
357
|
+
private getFontFamilyItems;
|
|
358
|
+
private getFontSizeItems;
|
|
359
|
+
private initTextToolbarItem;
|
|
360
|
+
private createTextColor;
|
|
361
|
+
private createTextBtn;
|
|
362
|
+
private getFontSizes;
|
|
363
|
+
private getTextAreaWidth;
|
|
364
|
+
private applyFontStyle;
|
|
365
|
+
private initZoomToolbarItem;
|
|
366
|
+
private defToolbarClicked;
|
|
367
|
+
private cancelPan;
|
|
368
|
+
private callMainToolbar;
|
|
369
|
+
private cancelItems;
|
|
370
|
+
private gradient;
|
|
371
|
+
private applyPenDraw;
|
|
372
|
+
private refreshToolbar;
|
|
373
|
+
private getPenToolbarItem;
|
|
374
|
+
private initPenToolbarItem;
|
|
375
|
+
private createPenColor;
|
|
376
|
+
private createPenBtn;
|
|
377
|
+
private setPenStroke;
|
|
378
|
+
private updateCanvas;
|
|
379
|
+
private imageOnLoad;
|
|
380
|
+
private refreshActiveObj;
|
|
381
|
+
private redrawText;
|
|
382
|
+
private setTextSelection;
|
|
383
|
+
private updateUndoRedoColl;
|
|
384
|
+
private fileSelect;
|
|
385
|
+
private findTextPoint;
|
|
386
|
+
private getStrokeWidth;
|
|
387
|
+
private updateToolbarItems;
|
|
388
|
+
private setTimer;
|
|
389
|
+
private touchStartHandler;
|
|
390
|
+
private mouseDownEventHandler;
|
|
391
|
+
private mouseMoveEventHandler;
|
|
392
|
+
private mouseUpEventHandler;
|
|
393
|
+
private keyDownEventHandler;
|
|
394
|
+
private keyUpEventHandler;
|
|
395
|
+
private canvasMouseDownHandler;
|
|
396
|
+
private canvasMouseMoveHandler;
|
|
397
|
+
private canvasMouseUpHandler;
|
|
398
|
+
private textKeyDown;
|
|
399
|
+
private adjustToScreen;
|
|
400
|
+
private screenOrientation;
|
|
401
|
+
private windowResizeHandler;
|
|
402
|
+
private redrawImg;
|
|
403
|
+
private updateContext;
|
|
404
|
+
private scaleNonUniform;
|
|
405
|
+
private zoomImg;
|
|
406
|
+
private handleScroll;
|
|
407
|
+
private redraw;
|
|
408
|
+
private applyCurrActObj;
|
|
409
|
+
private updateTextFromTextArea;
|
|
410
|
+
private redrawActObj;
|
|
411
|
+
private setTextBoxPos;
|
|
412
|
+
private setTextBoxPoints;
|
|
413
|
+
private findTextTarget;
|
|
414
|
+
private setTextBoxHeight;
|
|
415
|
+
private setTextBoxWidth;
|
|
416
|
+
private setActivePoint;
|
|
417
|
+
private updateActivePoint;
|
|
418
|
+
private updateNWPoints;
|
|
419
|
+
private updateNPoints;
|
|
420
|
+
private updateNEPoints;
|
|
421
|
+
private updateWPoints;
|
|
422
|
+
private updateEPoints;
|
|
423
|
+
private updateSWPoints;
|
|
424
|
+
private updateSPoints;
|
|
425
|
+
private updateSEPoints;
|
|
426
|
+
private getScaleRatio;
|
|
427
|
+
private getMaxText;
|
|
428
|
+
private setDragLimit;
|
|
429
|
+
private lineDraw;
|
|
430
|
+
private shapeCircle;
|
|
431
|
+
private drawOuterSelection;
|
|
432
|
+
private getZoomShape;
|
|
433
|
+
private drawObject;
|
|
434
|
+
private updateActiveObject;
|
|
435
|
+
private drawShapeObj;
|
|
436
|
+
private shapeLine;
|
|
437
|
+
private shapeText;
|
|
438
|
+
private updateActPoint;
|
|
439
|
+
private drawSquareLines;
|
|
440
|
+
private drawSelection;
|
|
441
|
+
private drawCenterCircles;
|
|
442
|
+
private findTarget;
|
|
443
|
+
private findTargetObj;
|
|
444
|
+
private updateCursorStyles;
|
|
445
|
+
private drawCropRatio;
|
|
446
|
+
private setDragDirection;
|
|
447
|
+
private calcShapeRatio;
|
|
448
|
+
private getScale;
|
|
449
|
+
private calcRatio;
|
|
450
|
+
private calcMaxDimension;
|
|
451
|
+
private setMaximumDimension;
|
|
452
|
+
private setCursor;
|
|
453
|
+
private setCursorFromObj;
|
|
454
|
+
private setCursorForZoomState;
|
|
455
|
+
private downloadImg;
|
|
456
|
+
private toSVGImg;
|
|
457
|
+
private toBlobFn;
|
|
458
|
+
private addLetter;
|
|
459
|
+
private updateFontStyles;
|
|
460
|
+
private updateInMemoryCanvas;
|
|
461
|
+
private drawBaseImg;
|
|
462
|
+
private calcPrevRatio;
|
|
463
|
+
private textFlipDegree;
|
|
464
|
+
private rotateText;
|
|
465
|
+
private redrawSelection;
|
|
466
|
+
private redrawObj;
|
|
467
|
+
private updateCurrentActiveObjPoint;
|
|
468
|
+
private calcCurrPoints;
|
|
469
|
+
private redrawShape;
|
|
470
|
+
private applyActObj;
|
|
471
|
+
private apply;
|
|
472
|
+
private setCenterPoints;
|
|
473
|
+
private drawShape;
|
|
474
|
+
private drawShapeText;
|
|
475
|
+
private drawPen;
|
|
476
|
+
private getObjDetails;
|
|
477
|
+
private isPointsInRange;
|
|
478
|
+
/**
|
|
479
|
+
* Clear a current selection.
|
|
480
|
+
*
|
|
481
|
+
* @returns {void}.
|
|
482
|
+
*/
|
|
483
|
+
clearSelection(): void;
|
|
484
|
+
/**
|
|
485
|
+
* Crops an image based on the selection.
|
|
486
|
+
* The selection can be done through programmatically using the select method or through UI interactions.
|
|
487
|
+
*
|
|
488
|
+
* @returns {boolean}.
|
|
489
|
+
*/
|
|
490
|
+
crop(): boolean;
|
|
491
|
+
private updateInMemoryContext;
|
|
492
|
+
/**
|
|
493
|
+
* Flips an image by horizontally or vertically.
|
|
494
|
+
*
|
|
495
|
+
* @param {Direction } direction - Specifies the direction to flip the image.
|
|
496
|
+
* @returns {void}.
|
|
497
|
+
*/
|
|
498
|
+
flip(direction: Direction): void;
|
|
499
|
+
/**
|
|
500
|
+
* Return an image as ImageData.
|
|
501
|
+
*
|
|
502
|
+
* @returns {ImageData}.
|
|
503
|
+
*/
|
|
504
|
+
getImageData(): ImageData;
|
|
505
|
+
/**
|
|
506
|
+
* Load/opens an image for editing within an image editor.
|
|
507
|
+
*
|
|
508
|
+
* @param {string | ImageData } data - Specifies url of the Image or image data.
|
|
509
|
+
*
|
|
510
|
+
* @returns {void}.
|
|
511
|
+
*/
|
|
512
|
+
open(data: string | ImageData): void;
|
|
513
|
+
/**
|
|
514
|
+
* Reset all the changes and revert to original image.
|
|
515
|
+
*
|
|
516
|
+
* @returns {void}.
|
|
517
|
+
*/
|
|
518
|
+
reset(): void;
|
|
519
|
+
/**
|
|
520
|
+
* Rotate an image to clockwise and anti-clockwise.
|
|
521
|
+
*
|
|
522
|
+
* @param {number} degree - Specifies a degree to rotate an image.
|
|
523
|
+
* positive integer value for clockwise and negative integer value for anti-clockwise rotation.
|
|
524
|
+
*
|
|
525
|
+
* @returns {boolean}.
|
|
526
|
+
*/
|
|
527
|
+
rotate(degree: number): boolean;
|
|
528
|
+
/**
|
|
529
|
+
* Export an image using the specified file name and the extension.
|
|
530
|
+
*
|
|
531
|
+
* @param {string} type - Specifies a format of image to be saved.
|
|
532
|
+
* @param {string} fileName – Specifies a file name to be saved
|
|
533
|
+
*
|
|
534
|
+
* @returns {void}.
|
|
535
|
+
*/
|
|
536
|
+
export(type?: string, fileName?: string): void;
|
|
537
|
+
/**
|
|
538
|
+
* Perform selection in an image editor. The selection helps to crop an image.
|
|
539
|
+
*
|
|
540
|
+
* @param {string} type - Specifies the shape - circle / square / custom selection / pre-defined ratios.
|
|
541
|
+
* @param {number} startX – Specifies the start x-coordinate point of the selection.
|
|
542
|
+
* @param {number} startY – Specifies the start y-coordinate point of the selection.
|
|
543
|
+
* @param {number} width - Specifies the width of the selection area.
|
|
544
|
+
* @param {number} height - Specifies the height of the selection area.
|
|
545
|
+
* @returns {void}.
|
|
546
|
+
* ```html
|
|
547
|
+
* <div id='imageeditor'></div>
|
|
548
|
+
* ```
|
|
549
|
+
* ```typescript
|
|
550
|
+
* <script>
|
|
551
|
+
* var imageObj = new ImageEditor({
|
|
552
|
+
* created : () => {
|
|
553
|
+
* imageObj.select('16:9', 10, 10);
|
|
554
|
+
* }
|
|
555
|
+
* });
|
|
556
|
+
* imageObj.appendTo("#imageeditor");
|
|
557
|
+
* </script>
|
|
558
|
+
* ```
|
|
559
|
+
*/
|
|
560
|
+
select(type: string, startX?: number, startY?: number, width?: number, height?: number): void;
|
|
561
|
+
/**
|
|
562
|
+
* Enable or disable a freehand drawing in an Image Editor.
|
|
563
|
+
*
|
|
564
|
+
* @param {boolean} value - Specifies a value whether enable or disable freehand drawing.
|
|
565
|
+
*
|
|
566
|
+
* @returns {void}.
|
|
567
|
+
*/
|
|
568
|
+
freeHandDraw(value: boolean): void;
|
|
569
|
+
/**
|
|
570
|
+
* Enable or disable a panning on the Image Editor.
|
|
571
|
+
*
|
|
572
|
+
* @param {boolean} value - Specifies a value whether enable or disable panning.
|
|
573
|
+
*
|
|
574
|
+
* @returns {void}.
|
|
575
|
+
*/
|
|
576
|
+
pan(value: boolean): void;
|
|
577
|
+
/**
|
|
578
|
+
* Increase / Decrease the magnification of an image.
|
|
579
|
+
*
|
|
580
|
+
* @param {boolean} value - Specifies a value to be zoomed on the image.
|
|
581
|
+
* @returns {void}.
|
|
582
|
+
*/
|
|
583
|
+
zoom(value: number): void;
|
|
584
|
+
/**
|
|
585
|
+
* Draw ellipse on an image.
|
|
586
|
+
*
|
|
587
|
+
* @param {number} x - Specifies x-coordinate of ellipse.
|
|
588
|
+
* @param {number} y - Specifies y-coordinate of ellipse.
|
|
589
|
+
* @param {number} radiusX - the radius x point for the ellipse.
|
|
590
|
+
* @param {number} radiusY - the radius y point for the ellipse.
|
|
591
|
+
* @param {number} strokeWidth - the stroke width of ellipse.
|
|
592
|
+
* @param {string} strokeColor - the stroke color of ellipse.
|
|
593
|
+
* @param {string} fillColor - the fill color of the ellipse.
|
|
594
|
+
* @returns {boolean}.
|
|
595
|
+
*
|
|
596
|
+
* ```html
|
|
597
|
+
* <div id='imageeditor'></div>
|
|
598
|
+
* ```
|
|
599
|
+
* ```typescript
|
|
600
|
+
* <script>
|
|
601
|
+
* * var imageObj = new ImageEditor({
|
|
602
|
+
* created: () => {
|
|
603
|
+
* imageObj.drawEllipse(10, 10, 40, 60);
|
|
604
|
+
* }
|
|
605
|
+
* });
|
|
606
|
+
* imageObj.appendTo("#imageeditor");
|
|
607
|
+
* </script>
|
|
608
|
+
* ```
|
|
609
|
+
*/
|
|
610
|
+
drawEllipse(x?: number, y?: number, radiusX?: number, radiusY?: number, strokeWidth?: number, strokeColor?: string, fillColor?: string): boolean;
|
|
611
|
+
/**
|
|
612
|
+
* Draw line on an image.
|
|
613
|
+
*
|
|
614
|
+
* @param {number} startX – Specifies start point x-coordinate of line.
|
|
615
|
+
* @param {number} startY – Specifies start point y-coordinate of line.
|
|
616
|
+
* @param {number} endX - Specifies end point x-coordinates of line.
|
|
617
|
+
* @param {number} endY - Specifies end point y-coordinates of the line.
|
|
618
|
+
* @param {number} strokeWidth - Specifies the stroke width of line.
|
|
619
|
+
* @param {string} strokeColor - Specifies the stroke color of line.
|
|
620
|
+
* @returns {boolean}.
|
|
621
|
+
*/
|
|
622
|
+
drawLine(startX?: number, startY?: number, endX?: number, endY?: number, strokeWidth?: number, strokeColor?: string): boolean;
|
|
623
|
+
/**
|
|
624
|
+
* Draw a rectangle on an image.
|
|
625
|
+
*
|
|
626
|
+
* @param {number} x - Specifies x-coordinate of rectangle.
|
|
627
|
+
* @param {number} y - Specifies y-coordinate of rectangle.
|
|
628
|
+
* @param {number} width - Specifies the width of the rectangle.
|
|
629
|
+
* @param {number} height - Specifies the height of the rectangle.
|
|
630
|
+
* @param {number} strokeWidth - Specifies the stroke width of rectangle.
|
|
631
|
+
* @param {string} strokeColor - Specifies the stroke color of rectangle.
|
|
632
|
+
* @param {string} fillColor - the fill color of the rectangle.
|
|
633
|
+
* @returns {boolean}.
|
|
634
|
+
*/
|
|
635
|
+
drawRectangle(x?: number, y?: number, width?: number, height?: number, strokeWidth?: number, strokeColor?: string, fillColor?: string): boolean;
|
|
636
|
+
/**
|
|
637
|
+
* Draw a text on an image.
|
|
638
|
+
*
|
|
639
|
+
* @param {number} x - Specifies x-coordinate of text.
|
|
640
|
+
* @param {number} y - Specifies y-coordinate of text.
|
|
641
|
+
* @param {string} text - Specifies the text to add on an image.
|
|
642
|
+
* @param {string} fontFamily - Specifies the font family of the text.
|
|
643
|
+
* @param {number} fontSize - Specifies the font size of the text.
|
|
644
|
+
* @param {boolean} bold - Specifies whether the text is bold or not.
|
|
645
|
+
* @param {boolean} italic - Specifies whether the text is italic or not.
|
|
646
|
+
* @param {string} color - Specifies font color of the text.
|
|
647
|
+
* @returns {boolean}.
|
|
648
|
+
*
|
|
649
|
+
* ```html
|
|
650
|
+
* <div id='imageeditor'></div>
|
|
651
|
+
* ```
|
|
652
|
+
* ```typescript
|
|
653
|
+
* <script>
|
|
654
|
+
* var imageObj = new ImageEditor({
|
|
655
|
+
* created: () => {
|
|
656
|
+
* imageObj.drawText(10, 10, 'Syncfusion', 'Arial', 12, true, true, '#000');
|
|
657
|
+
* }
|
|
658
|
+
* });
|
|
659
|
+
* imageObj.appendTo("#imageeditor");
|
|
660
|
+
*
|
|
661
|
+
* </script>
|
|
662
|
+
* ```
|
|
663
|
+
*/
|
|
664
|
+
drawText(x?: number, y?: number, text?: string, fontFamily?: string, fontSize?: number, bold?: boolean, italic?: boolean, color?: string): boolean;
|
|
665
|
+
/**
|
|
666
|
+
* Selects a shape based on the given shape id. The id can be got from the public method ‘getShapeSettings’.
|
|
667
|
+
*
|
|
668
|
+
* @param {string} id - Specifies the shape id to select a shape on an image.
|
|
669
|
+
* @returns {boolean}.
|
|
670
|
+
* ```html
|
|
671
|
+
* <div id='imageeditor'></div>
|
|
672
|
+
* ```
|
|
673
|
+
* ```typescript
|
|
674
|
+
* <script>
|
|
675
|
+
* var imageObj = new ImageEditor({
|
|
676
|
+
* created: () => {
|
|
677
|
+
* imageObj.selectShape('shape_1');
|
|
678
|
+
* }
|
|
679
|
+
* });
|
|
680
|
+
* imageObj.appendTo("#imageeditor");
|
|
681
|
+
* </script>
|
|
682
|
+
* ```
|
|
683
|
+
*/
|
|
684
|
+
selectShape(id: string): boolean;
|
|
685
|
+
/**
|
|
686
|
+
* Deletes a shape based on the given shape id. The id can be got from the public method getShapeSettings.
|
|
687
|
+
*
|
|
688
|
+
* @param {string} id - Specifies the shape id to delete the shape on an image.
|
|
689
|
+
* @returns {void}.
|
|
690
|
+
* ```html
|
|
691
|
+
* <div id='imageeditor'></div>
|
|
692
|
+
* ```
|
|
693
|
+
* ```typescript
|
|
694
|
+
* <script>
|
|
695
|
+
* var imageObj = new ImageEditor({
|
|
696
|
+
* created: () => {
|
|
697
|
+
* imageObj.deleteShape('shape_1');
|
|
698
|
+
* }
|
|
699
|
+
* });
|
|
700
|
+
* imageObj.appendTo("#imageeditor");
|
|
701
|
+
* </script>
|
|
702
|
+
* ```
|
|
703
|
+
*/
|
|
704
|
+
deleteShape(id: string): void;
|
|
705
|
+
/**
|
|
706
|
+
* Get particular shapes details based on id of the shape which is drawn on an image editor.
|
|
707
|
+
*
|
|
708
|
+
* @param {string} id - Specifies the shape id on an image.
|
|
709
|
+
* @returns {ShapeSettings}.
|
|
710
|
+
* ```html
|
|
711
|
+
* <div id='imageeditor'></div>
|
|
712
|
+
* ```
|
|
713
|
+
* ```typescript
|
|
714
|
+
* <script>
|
|
715
|
+
* var imageObj = new ImageEditor({
|
|
716
|
+
* created: () => {
|
|
717
|
+
* imageObj.getShapeSetting('shape_1');
|
|
718
|
+
* }
|
|
719
|
+
* });
|
|
720
|
+
* imageObj.appendTo("#imageeditor");
|
|
721
|
+
* </script>
|
|
722
|
+
* ```
|
|
723
|
+
*/
|
|
724
|
+
getShapeSetting(id: string): ShapeSettings;
|
|
725
|
+
/**
|
|
726
|
+
* Get all the shapes details which is drawn on an image editor.
|
|
727
|
+
*
|
|
728
|
+
* @returns {ShapeSettings[]}.
|
|
729
|
+
*/
|
|
730
|
+
getShapeSettings(): ShapeSettings[];
|
|
731
|
+
/**
|
|
732
|
+
* To refresh the Canvas Wrapper.
|
|
733
|
+
*
|
|
734
|
+
* @returns {void}.
|
|
735
|
+
*/
|
|
736
|
+
update(): void;
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Defines the Image Editor file type.
|
|
740
|
+
*/
|
|
741
|
+
export declare type FileType = 'Png' | 'Jpeg' | 'Svg';
|
|
742
|
+
/**
|
|
743
|
+
* Defines the direction to flip the image on Image Editor.
|
|
744
|
+
*/
|
|
745
|
+
export declare type Direction = 'Horizontal' | 'Vertical';
|
|
746
|
+
/**
|
|
747
|
+
* Defines the Image Editor shape type.
|
|
748
|
+
*/
|
|
749
|
+
export declare type ShapeType = 'Rectangle' | 'Ellipse' | 'Line' | 'Text';
|
|
750
|
+
/**
|
|
751
|
+
* Defines the theme for Image Editor.
|
|
752
|
+
*/
|
|
753
|
+
export declare type Theme = 'Bootstrap5' | 'Bootstrap5Dark' | 'Tailwind' | 'TailwindDark' | 'Fluent' | 'FluentDark' | 'Bootstrap4' | 'Bootstrap' | 'BootstrapDark' | 'Material' | 'MaterialDark' | 'Fabric' | 'FabricDark' | 'Highcontrast';
|
|
754
|
+
/**
|
|
755
|
+
* Defines the toolbar items for Image Editor.
|
|
756
|
+
*/
|
|
757
|
+
export declare type ImageEditorCommands = 'Crop' | 'Transform' | 'Annotate' | 'ZoomIn' | 'ZoomOut' | 'Open' | 'Reset' | 'Save' | 'Pan' | 'Move' | 'Pen' | 'Line' | 'Rectangle' | 'Ellipse' | 'Text' | 'CustomSelection' | 'CircleSelection' | 'SquareSelection' | 'RatioSelection' | 'RotateLeft' | 'RotateRight' | 'FlipHorizontal' | 'FlipVertical';
|
|
758
|
+
/**
|
|
759
|
+
* Interface for zoom transition occur in the imageEditor.
|
|
760
|
+
*/
|
|
761
|
+
export interface ZoomEventArgs {
|
|
762
|
+
/**
|
|
763
|
+
* Returns the (x, y) point to be zoomed.
|
|
764
|
+
*/
|
|
765
|
+
zoomPoint: Point;
|
|
766
|
+
/**
|
|
767
|
+
* Specifies the value of zooming. Zoom in or out can be defined based on the value.
|
|
768
|
+
*/
|
|
769
|
+
zoomLevel: number;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Interface for pan transition occur in the imageEditor.
|
|
773
|
+
*/
|
|
774
|
+
export interface PanEventArgs {
|
|
775
|
+
/**
|
|
776
|
+
* Returns the (x, y) point of panning started
|
|
777
|
+
*/
|
|
778
|
+
startPoint: Point;
|
|
779
|
+
/**
|
|
780
|
+
* Returns the (x, y) point to be panning ended.
|
|
781
|
+
*/
|
|
782
|
+
endPoint: Point;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Interface for crop transition occur in the imageEditor.
|
|
786
|
+
*/
|
|
787
|
+
export interface CropEventArgs {
|
|
788
|
+
/**
|
|
789
|
+
* Returns the start point of the crop region.
|
|
790
|
+
*/
|
|
791
|
+
startPoint: Point;
|
|
792
|
+
/**
|
|
793
|
+
* Returns the end point of the crop region.
|
|
794
|
+
*/
|
|
795
|
+
endPoint: Point;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Interface for rotate transition in the imageEditor.
|
|
799
|
+
*/
|
|
800
|
+
export interface RotateEventArgs {
|
|
801
|
+
/**
|
|
802
|
+
* Returns the degree to be rotated.
|
|
803
|
+
*/
|
|
804
|
+
degree: number;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Interface for flip transition in the imageEditor.
|
|
808
|
+
*/
|
|
809
|
+
export interface FlipEventArgs {
|
|
810
|
+
/**
|
|
811
|
+
* Returns the direction(Horizontal and vertical) to be flipped.
|
|
812
|
+
*/
|
|
813
|
+
direction: string;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Interface for shape change in imageEditor.
|
|
817
|
+
*/
|
|
818
|
+
export interface ShapeChangeEventArgs {
|
|
819
|
+
/**
|
|
820
|
+
* Returns the name of the action.
|
|
821
|
+
*/
|
|
822
|
+
action?: string;
|
|
823
|
+
/**
|
|
824
|
+
* Returns the object of shape before moved, resized, or customized the UI.
|
|
825
|
+
*/
|
|
826
|
+
previousShapeSettings?: Object;
|
|
827
|
+
/**
|
|
828
|
+
* Returns `the object of shape which is inserted or moved or deleted or resized or customized the UI.
|
|
829
|
+
*/
|
|
830
|
+
currentShapeSettings?: Object;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Interface for Toolbar events.
|
|
834
|
+
*/
|
|
835
|
+
export interface ToolbarEventArgs {
|
|
836
|
+
/**
|
|
837
|
+
* Defines the cancel option to cancel the toolbar action.
|
|
838
|
+
*/
|
|
839
|
+
cancel?: boolean;
|
|
840
|
+
/**
|
|
841
|
+
* Returns the current toolbar type.
|
|
842
|
+
*/
|
|
843
|
+
toolbarType?: string;
|
|
844
|
+
/**
|
|
845
|
+
* Returns the current toolbar item.
|
|
846
|
+
*/
|
|
847
|
+
item?: ItemModel;
|
|
848
|
+
/**
|
|
849
|
+
* Specifies the toolbar item collection to be rendered as contextual toolbar.
|
|
850
|
+
*/
|
|
851
|
+
toolbarItems?: (string | ItemModel)[];
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Interface for saving the canvas as image.
|
|
855
|
+
*/
|
|
856
|
+
export interface SaveEventArgs {
|
|
857
|
+
/**
|
|
858
|
+
* Specifies the file name for an image.
|
|
859
|
+
*/
|
|
860
|
+
fileName: string;
|
|
861
|
+
/**
|
|
862
|
+
* Returns the file type for an image.
|
|
863
|
+
*/
|
|
864
|
+
fileType: FileType;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Interface for before saving the canvas as image.
|
|
868
|
+
*/
|
|
869
|
+
export interface BeforeSaveEventArgs {
|
|
870
|
+
/**
|
|
871
|
+
* Defines the cancel option to cancel the save action.
|
|
872
|
+
*/
|
|
873
|
+
cancel: boolean;
|
|
874
|
+
/**
|
|
875
|
+
* Specifies the file name for an image.
|
|
876
|
+
*/
|
|
877
|
+
fileName: string;
|
|
878
|
+
/**
|
|
879
|
+
* Returns the file type for an image.
|
|
880
|
+
*/
|
|
881
|
+
fileType: FileType;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Interface for Point Object in the image editor.
|
|
885
|
+
*
|
|
886
|
+
*/
|
|
887
|
+
export interface Point {
|
|
888
|
+
/**
|
|
889
|
+
* Returns the x position in the canvas.
|
|
890
|
+
*/
|
|
891
|
+
x: number;
|
|
892
|
+
/**
|
|
893
|
+
* Returns y position in the canvas.
|
|
894
|
+
*/
|
|
895
|
+
y: number;
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Interface for ShapeSettings in the imageEditor.
|
|
899
|
+
*/
|
|
900
|
+
export interface ShapeSettings {
|
|
901
|
+
/**
|
|
902
|
+
* Returns the id of the shape.
|
|
903
|
+
*/
|
|
904
|
+
id: string;
|
|
905
|
+
/**
|
|
906
|
+
* Returns the type of the shape.
|
|
907
|
+
*/
|
|
908
|
+
type: ShapeType;
|
|
909
|
+
/**
|
|
910
|
+
* Returns the start x position of the shape.
|
|
911
|
+
*/
|
|
912
|
+
startX: number;
|
|
913
|
+
/**
|
|
914
|
+
* Returns the start y position of the shape.
|
|
915
|
+
*/
|
|
916
|
+
startY: number;
|
|
917
|
+
/**
|
|
918
|
+
* Returns the width of the shape.
|
|
919
|
+
*/
|
|
920
|
+
width?: number;
|
|
921
|
+
/**
|
|
922
|
+
* Returns the height of the shape.
|
|
923
|
+
*/
|
|
924
|
+
height?: number;
|
|
925
|
+
/**
|
|
926
|
+
* Returns the stroke color of the shape.
|
|
927
|
+
*/
|
|
928
|
+
strokeColor?: string;
|
|
929
|
+
/**
|
|
930
|
+
* Returns the fill color of the shape.
|
|
931
|
+
*/
|
|
932
|
+
fillColor?: string;
|
|
933
|
+
/**
|
|
934
|
+
* Returns the stroke width of the shape.
|
|
935
|
+
*/
|
|
936
|
+
strokeWidth?: number;
|
|
937
|
+
/**
|
|
938
|
+
* Returns the radius of the ellipse shape.
|
|
939
|
+
*/
|
|
940
|
+
radius?: number;
|
|
941
|
+
/**
|
|
942
|
+
* Returns the length of the line shape.
|
|
943
|
+
*/
|
|
944
|
+
length?: number;
|
|
945
|
+
/**
|
|
946
|
+
* Returns the text content of the text.
|
|
947
|
+
*/
|
|
948
|
+
text?: string;
|
|
949
|
+
/**
|
|
950
|
+
* Returns the font size of the text.
|
|
951
|
+
*/
|
|
952
|
+
fontSize?: number;
|
|
953
|
+
/**
|
|
954
|
+
* Returns the font style of the text.
|
|
955
|
+
*/
|
|
956
|
+
fontStyle?: string[];
|
|
957
|
+
/**
|
|
958
|
+
* Returns the font color of the text.
|
|
959
|
+
*/
|
|
960
|
+
color?: string;
|
|
961
|
+
}
|