@leapfrog/interactive-canvas 0.1.0 → 1.0.0

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 (61) hide show
  1. package/dist/{interactive-canvas.impl.d.ts → abstract-interactive-canvas.d.ts} +340 -305
  2. package/dist/dimensions/pixel-canvas-dimensions.d.ts +13 -13
  3. package/dist/dimensions/print-6-col-canvas-dimensions.d.ts +18 -18
  4. package/dist/dimensions/print-8-col-canvas-dimensions.d.ts +18 -18
  5. package/dist/font/font-library.d.ts +27 -22
  6. package/dist/font/font-library.interface.d.ts +24 -20
  7. package/dist/font/font.interface.d.ts +20 -20
  8. package/dist/font/unknown-font.d.ts +6 -6
  9. package/dist/headless-interactive-canvas.d.ts +9 -0
  10. package/dist/index.d.ts +49 -47
  11. package/dist/interactive-canvas.d.ts +8 -0
  12. package/dist/interactive-canvas.es.js +3193 -0
  13. package/dist/interactive-canvas.interface.d.ts +267 -221
  14. package/dist/interactive-canvas.js +3222 -34
  15. package/dist/layout/abstract-layout-manager.d.ts +17 -18
  16. package/dist/layout/advanced-layout-manager.d.ts +15 -15
  17. package/dist/layout/function/pin-to-bottom.layout-function.d.ts +4 -4
  18. package/dist/layout/function/redraw-all.layout-function.d.ts +4 -4
  19. package/dist/layout/function/reposition-borders.layout-function.d.ts +4 -4
  20. package/dist/layout/function/reposition-cutoffs.layout-function.d.ts +4 -4
  21. package/dist/layout/function/resize-canvas.layout-function.d.ts +4 -4
  22. package/dist/layout/function/stack-objects.layout-function.d.ts +11 -11
  23. package/dist/layout/function/update-object-dimensions.layout-function.d.ts +4 -4
  24. package/dist/layout/layout-manager.enum.d.ts +5 -5
  25. package/dist/layout/layout-manager.interface.d.ts +13 -13
  26. package/dist/layout/standard-layout-manager.d.ts +35 -36
  27. package/dist/mutator/mutable-background-color.interface.d.ts +15 -15
  28. package/dist/mutator/mutable-color.interface.d.ts +6 -6
  29. package/dist/mutator/mutable-image.interface.d.ts +28 -28
  30. package/dist/mutator/mutable-position.interface.d.ts +33 -33
  31. package/dist/mutator/mutable-text-style.interface.d.ts +163 -149
  32. package/dist/mutator/mutable-text.interface.d.ts +40 -40
  33. package/dist/object/abstract-canvas-object.d.ts +155 -155
  34. package/dist/object/canvas-object-data.d.ts +23 -23
  35. package/dist/object/canvas-object.interface.d.ts +96 -96
  36. package/dist/object/impl/border.d.ts +59 -60
  37. package/dist/object/impl/cutoff.d.ts +59 -60
  38. package/dist/object/impl/horizontal-rule.d.ts +88 -89
  39. package/dist/object/impl/image.d.ts +81 -82
  40. package/dist/object/impl/rectangle.d.ts +58 -59
  41. package/dist/object/impl/text.d.ts +264 -255
  42. package/dist/object/impl/vertical-rule.d.ts +88 -89
  43. package/dist/profile/canvas-profile.interface.d.ts +22 -22
  44. package/dist/profile/default-canvas-profile.d.ts +23 -23
  45. package/dist/types/canvas-dimension-restrictions.interface.d.ts +14 -14
  46. package/dist/types/canvas-dimensions.interface.d.ts +21 -21
  47. package/dist/types/canvas-state.interface.d.ts +11 -11
  48. package/dist/types/dimension-restrictions.interface.d.ts +6 -6
  49. package/dist/types/image-type.enum.d.ts +6 -6
  50. package/dist/types/margin.interface.d.ts +6 -6
  51. package/dist/types/object-dimensions.interface.d.ts +23 -23
  52. package/dist/types/object-type.enum.d.ts +10 -10
  53. package/dist/types/overflow.interface.d.ts +4 -4
  54. package/dist/types/position.interface.d.ts +6 -6
  55. package/dist/types/rect.interface.d.ts +6 -6
  56. package/dist/types/selection-data.interface.d.ts +19 -19
  57. package/dist/types/text-alignment.interface.d.ts +1 -1
  58. package/package.json +7 -9
  59. package/readme.md +12 -1
  60. package/dist/interactive-canvas.js.map +0 -1
  61. package/dist/interactive-canvas.nomin.js +0 -57456
@@ -1,305 +1,340 @@
1
- import { Observable } from "rxjs";
2
- import { ICutoff } from "./object/impl/cutoff";
3
- import { IRectangle } from "./object/impl/rectangle";
4
- import { IBorder } from "./object/impl/border";
5
- import { IImage } from "./object/impl/image";
6
- import { IText } from "./object/impl/text";
7
- import { ILayoutManager } from "./layout/layout-manager.interface";
8
- import { LayoutManager } from "./layout/layout-manager.enum";
9
- import { IVerticalRule } from "./object/impl/vertical-rule";
10
- import { IHorizontalRule } from "./object/impl/horizontal-rule";
11
- import { IInteractiveCanvas } from "./interactive-canvas.interface";
12
- import { ICanvasProfile } from "./profile/canvas-profile.interface";
13
- import { IFontLibrary } from "./font/font-library.interface";
14
- import { ICanvasDimensions } from "./types/canvas-dimensions.interface";
15
- import { ICanvasDimensionRestrictions } from "./types/canvas-dimension-restrictions.interface";
16
- import { AbstractCanvasObject } from "./object/abstract-canvas-object";
17
- import { IRect } from "./types/rect.interface";
18
- import { ObjectType } from "./types/object-type.enum";
19
- import { ICanvasObject } from "./object/canvas-object.interface";
20
- import { ISelectionData } from "./types/selection-data.interface";
21
- import { ICanvasState } from "./types/canvas-state.interface";
22
- export declare class InteractiveCanvas implements IInteractiveCanvas {
23
- protected devicePixelRatio: number;
24
- private readonly IMAGE_CAPTURE_COEFFICIENT;
25
- private readonly fontLibrary;
26
- private readonly profile$;
27
- private readonly layoutManager$;
28
- private readonly backgroundColor$;
29
- private readonly dimensions$;
30
- private readonly dimensionRestrictions$;
31
- private readonly dimensionChangeRejections$;
32
- private readonly zoom$;
33
- private readonly objects$;
34
- private readonly selection$;
35
- private readonly fabricCanvas;
36
- private baseDimensions;
37
- constructor(elementId: string, devicePixelRatio: number);
38
- /**
39
- * @override
40
- * @inheritDoc
41
- */
42
- getFontLibrary(): IFontLibrary;
43
- /**
44
- * @override
45
- * @inheritDoc
46
- */
47
- getProfile(): ICanvasProfile;
48
- /**
49
- * @override
50
- * @inheritDoc
51
- */
52
- getProfile$(): Observable<ICanvasProfile>;
53
- /**
54
- * @override
55
- * @inheritDoc
56
- */
57
- setProfile(profile: ICanvasProfile): void;
58
- /**
59
- * @override
60
- * @inheritDoc
61
- */
62
- getLayoutManager(): ILayoutManager;
63
- /**
64
- * @override
65
- * @inheritDoc
66
- */
67
- getLayoutManager$(): Observable<ILayoutManager>;
68
- /**
69
- * @override
70
- * @inheritDoc
71
- */
72
- setLayoutManager(layoutManager: LayoutManager): void;
73
- /**
74
- * @override
75
- * @inheritDoc
76
- */
77
- getBackgroundColor(): string;
78
- /**
79
- * @override
80
- * @inheritDoc
81
- */
82
- getBackgroundColor$(): Observable<string>;
83
- /**
84
- * @override
85
- * @inheritDoc
86
- */
87
- setBackgroundColor(color?: string): void;
88
- /**
89
- * @override
90
- * @inheritDoc
91
- */
92
- getDimensions(): ICanvasDimensions;
93
- /**
94
- * @override
95
- * @inheritDoc
96
- */
97
- getBaseDimensions(): ICanvasDimensions;
98
- /**
99
- * @override
100
- * @inheritDoc
101
- */
102
- getDimensions$(): Observable<ICanvasDimensions>;
103
- /**
104
- * @override
105
- * @inheritDoc
106
- */
107
- setDimensions(dimensions: ICanvasDimensions): void;
108
- /**
109
- * @override
110
- * @inheritDoc
111
- */
112
- setBaseDimensions(dimensions: ICanvasDimensions): void;
113
- /**
114
- * @override
115
- * @inheritDoc
116
- */
117
- getDimensionChangeRejections$(): Observable<ICanvasDimensions>;
118
- /**
119
- * @override
120
- * @inheritDoc
121
- */
122
- getDimensionsRestrictions(): ICanvasDimensionRestrictions;
123
- /**
124
- * @override
125
- * @inheritDoc
126
- */
127
- getDimensionsRestrictions$(): Observable<ICanvasDimensionRestrictions>;
128
- /**
129
- * @override
130
- * @inheritDoc
131
- */
132
- setDimensionRestrictions(restrictions: ICanvasDimensionRestrictions): void;
133
- getMargin(): IRect;
134
- /**
135
- * @override
136
- * @inheritDoc
137
- */
138
- getZoom(): number;
139
- /**
140
- * @override
141
- * @inheritDoc
142
- */
143
- getZoom$(): Observable<number>;
144
- /**
145
- * @override
146
- * @inheritDoc
147
- */
148
- setZoom(zoom: number): void;
149
- /**
150
- * @override
151
- * @inheritDoc
152
- */
153
- getObjects(): ICanvasObject[];
154
- /**
155
- * Get the list of objects directly.
156
- */
157
- getObjectsInternal(): Array<AbstractCanvasObject<any>>;
158
- getObjectsByTypeInternal<T extends AbstractCanvasObject<any>>(type: ObjectType): T[];
159
- getObjectsByTypesInternal(...types: ObjectType[]): Array<AbstractCanvasObject<any>>;
160
- /**
161
- * @override
162
- * @inheritDoc
163
- */
164
- getObjects$(): Observable<ICanvasObject[]>;
165
- /**
166
- * @override
167
- * @inheritDoc
168
- */
169
- removeObject(target: ICanvasObject): void;
170
- /**
171
- * @override
172
- * @inheritDoc
173
- */
174
- addImageObject(imageUrl: string): Observable<IImage>;
175
- /**
176
- * @override
177
- * @inheritDoc
178
- */
179
- addTextObject(): Observable<IText>;
180
- /**
181
- * @override
182
- * @inheritDoc
183
- */
184
- addRectangleObject(): Observable<IRectangle>;
185
- /**
186
- * @override
187
- * @inheritDoc
188
- */
189
- addCutoffObject(): Observable<ICutoff>;
190
- /**
191
- * @override
192
- * @inheritDoc
193
- */
194
- addBorderObject(): Observable<IBorder>;
195
- /**
196
- * @override
197
- * @inheritDoc
198
- */
199
- addVerticalRuleObject(): Observable<IVerticalRule>;
200
- /**
201
- * @override
202
- * @inheritDoc
203
- */
204
- addHorizontalRuleObject(): Observable<IHorizontalRule>;
205
- /**
206
- * @override
207
- * @inheritDoc
208
- */
209
- setPrefillData(data: {
210
- [id: string]: string;
211
- }): void;
212
- /**
213
- * @override
214
- * @inheritDoc
215
- */
216
- distributeObjectsVertically(): void;
217
- /**
218
- * @override
219
- * @inheritDoc
220
- */
221
- getSelection(): ISelectionData;
222
- /**
223
- * @override
224
- * @inheritDoc
225
- */
226
- getSelection$(): Observable<ISelectionData>;
227
- /**
228
- * @override
229
- * @inheritDoc
230
- */
231
- select(object: ICanvasObject): void;
232
- /**
233
- * @override
234
- * @inheritDoc
235
- */
236
- clearSelection(): void;
237
- setMultiSelect(value: boolean): void;
238
- /**
239
- * @override
240
- * @inheritDoc
241
- */
242
- clear(): void;
243
- /**
244
- * @override
245
- * @inheritDoc
246
- */
247
- save(): ICanvasState;
248
- /**
249
- * @override
250
- * @inheritDoc
251
- */
252
- load(canvasState: ICanvasState): Promise<void>;
253
- /**
254
- * Another hack for bullet points... because they use canvas objects to render the bullets, they get saved when the canvas is persisted... and then loaded into a new canvas, but there's
255
- * nothing linking them to the field that needs bullets, so they end up duplicating every time the canvas is saved/loaded. Since we don't use circles for anything else, this just
256
- * deletes all circles on canvas load.
257
- */
258
- private removePersistedBullets;
259
- /**
260
- * @override
261
- * @inheritDoc
262
- */
263
- toSvg(): string;
264
- /**
265
- * @override
266
- * @inheritDoc
267
- */
268
- toImage(): string;
269
- /**
270
- * Redraw the canvas.
271
- */
272
- redraw(): void;
273
- syncObjectList(): void;
274
- onTextChange(): void;
275
- onObjectListChange(): void;
276
- onDimensionsChange(): void;
277
- onMarginChange(): void;
278
- notifyObjectListChanged(): void;
279
- removeFabricObject(obj: any): void;
280
- private bindFields;
281
- private bindField;
282
- private findFabricObject;
283
- private findObject;
284
- /**
285
- * Reset zoom and canvas dimensions to 1:1 scale, execute a function, then return the canvas to
286
- * the previous values.
287
- * @param func Function to execute.
288
- */
289
- private executeWithNormalizedCanvas;
290
- /**
291
- * Update the actual dimensions of the canvas by multiplying the requested dimensions by the current zoom factor.
292
- */
293
- private updateCanvasDimensions;
294
- private calculateImageCaptureCoefficient;
295
- private onProfileChanged;
296
- private onFabricSelectionChanged;
297
- private onTextEditing;
298
- private getFieldByCanvasObject;
299
- private getFieldsByCanvasObject;
300
- private randomId;
301
- private getLowestTextPoint;
302
- private trackNewObject;
303
- private enterTextSelectionModeIfRequired;
304
- private dimensionsExceedRestrictions;
305
- }
1
+ import { BehaviorSubject, Observable, Subject } from "rxjs";
2
+ import { ICutoff } from "./object/impl/cutoff";
3
+ import { IRectangle } from "./object/impl/rectangle";
4
+ import { IBorder } from "./object/impl/border";
5
+ import { IImage } from "./object/impl/image";
6
+ import { IText } from "./object/impl/text";
7
+ import { ILayoutManager } from "./layout/layout-manager.interface";
8
+ import { LayoutManager } from "./layout/layout-manager.enum";
9
+ import { IVerticalRule } from "./object/impl/vertical-rule";
10
+ import { IHorizontalRule } from "./object/impl/horizontal-rule";
11
+ import { IInteractiveCanvas } from "./interactive-canvas.interface";
12
+ import { ICanvasProfile } from "./profile/canvas-profile.interface";
13
+ import { IFontLibrary } from "./font/font-library.interface";
14
+ import { ICanvasDimensions } from "./types/canvas-dimensions.interface";
15
+ import { ICanvasDimensionRestrictions } from "./types/canvas-dimension-restrictions.interface";
16
+ import { AbstractCanvasObject } from "./object/abstract-canvas-object";
17
+ import { IRect } from "./types/rect.interface";
18
+ import { ObjectType } from "./types/object-type.enum";
19
+ import { ICanvasObject } from "./object/canvas-object.interface";
20
+ import { ISelectionData } from "./types/selection-data.interface";
21
+ import { ICanvasState } from "./types/canvas-state.interface";
22
+ import { ITextSelection } from "./mutator/mutable-text-style.interface";
23
+ import { fabric } from "fabric";
24
+ export declare abstract class AbstractInteractiveCanvas implements IInteractiveCanvas {
25
+ protected fabric: any;
26
+ protected readonly fabricCanvas: fabric.Canvas;
27
+ protected devicePixelRatio: number;
28
+ protected readonly IMAGE_CAPTURE_COEFFICIENT: number;
29
+ protected readonly fontLibrary: IFontLibrary;
30
+ protected readonly profile$: BehaviorSubject<ICanvasProfile>;
31
+ protected readonly layoutManager$: BehaviorSubject<ILayoutManager>;
32
+ protected readonly backgroundColor$: BehaviorSubject<string>;
33
+ protected readonly dimensions$: BehaviorSubject<ICanvasDimensions>;
34
+ protected readonly dimensionRestrictions$: BehaviorSubject<ICanvasDimensionRestrictions>;
35
+ protected readonly dimensionChangeRejections$: Subject<ICanvasDimensions>;
36
+ protected readonly zoom$: BehaviorSubject<number>;
37
+ protected readonly objects$: BehaviorSubject<Array<AbstractCanvasObject<any>>>;
38
+ protected readonly selection$: BehaviorSubject<SelectionData>;
39
+ protected baseDimensions: ICanvasDimensions;
40
+ protected constructor(fabric: any, fabricCanvas: fabric.Canvas, devicePixelRatio: number);
41
+ /**
42
+ * @override
43
+ * @inheritDoc
44
+ */
45
+ getFontLibrary(): IFontLibrary;
46
+ /**
47
+ * @override
48
+ * @inheritDoc
49
+ */
50
+ getProfile(): ICanvasProfile;
51
+ /**
52
+ * @override
53
+ * @inheritDoc
54
+ */
55
+ getProfile$(): Observable<ICanvasProfile>;
56
+ /**
57
+ * @override
58
+ * @inheritDoc
59
+ */
60
+ setProfile(profile: ICanvasProfile): void;
61
+ /**
62
+ * @override
63
+ * @inheritDoc
64
+ */
65
+ getLayoutManager(): ILayoutManager;
66
+ /**
67
+ * @override
68
+ * @inheritDoc
69
+ */
70
+ getLayoutManager$(): Observable<ILayoutManager>;
71
+ /**
72
+ * @override
73
+ * @inheritDoc
74
+ */
75
+ setLayoutManager(layoutManager: LayoutManager): void;
76
+ /**
77
+ * @override
78
+ * @inheritDoc
79
+ */
80
+ getBackgroundColor(): string;
81
+ /**
82
+ * @override
83
+ * @inheritDoc
84
+ */
85
+ getBackgroundColor$(): Observable<string>;
86
+ /**
87
+ * @override
88
+ * @inheritDoc
89
+ */
90
+ setBackgroundColor(color?: string): void;
91
+ /**
92
+ * @override
93
+ * @inheritDoc
94
+ */
95
+ getDimensions(): ICanvasDimensions;
96
+ /**
97
+ * @override
98
+ * @inheritDoc
99
+ */
100
+ getBaseDimensions(): ICanvasDimensions;
101
+ /**
102
+ * @override
103
+ * @inheritDoc
104
+ */
105
+ getDimensions$(): Observable<ICanvasDimensions>;
106
+ /**
107
+ * @override
108
+ * @inheritDoc
109
+ */
110
+ setDimensions(dimensions: ICanvasDimensions): void;
111
+ /**
112
+ * @override
113
+ * @inheritDoc
114
+ */
115
+ setBaseDimensions(dimensions: ICanvasDimensions): void;
116
+ /**
117
+ * @override
118
+ * @inheritDoc
119
+ */
120
+ getDimensionChangeRejections$(): Observable<ICanvasDimensions>;
121
+ /**
122
+ * @override
123
+ * @inheritDoc
124
+ */
125
+ getDimensionsRestrictions(): ICanvasDimensionRestrictions;
126
+ /**
127
+ * @override
128
+ * @inheritDoc
129
+ */
130
+ getDimensionsRestrictions$(): Observable<ICanvasDimensionRestrictions>;
131
+ /**
132
+ * @override
133
+ * @inheritDoc
134
+ */
135
+ setDimensionRestrictions(restrictions: ICanvasDimensionRestrictions): void;
136
+ getMargin(): IRect;
137
+ /**
138
+ * @override
139
+ * @inheritDoc
140
+ */
141
+ getZoom(): number;
142
+ /**
143
+ * @override
144
+ * @inheritDoc
145
+ */
146
+ getZoom$(): Observable<number>;
147
+ /**
148
+ * @override
149
+ * @inheritDoc
150
+ */
151
+ setZoom(zoom: number): void;
152
+ /**
153
+ * @override
154
+ * @inheritDoc
155
+ */
156
+ getObjects(): ICanvasObject[];
157
+ /**
158
+ * Get the list of objects directly.
159
+ */
160
+ getObjectsInternal(): Array<AbstractCanvasObject<any>>;
161
+ /**
162
+ * @override
163
+ * @inheritDoc
164
+ */
165
+ getObjectsByTypeInternal<T extends AbstractCanvasObject<any>>(type: ObjectType): T[];
166
+ /**
167
+ * @override
168
+ * @inheritDoc
169
+ */
170
+ getObjectsByTypesInternal(...types: ObjectType[]): Array<AbstractCanvasObject<any>>;
171
+ /**
172
+ * @override
173
+ * @inheritDoc
174
+ */
175
+ getObjects$(): Observable<ICanvasObject[]>;
176
+ /**
177
+ * @override
178
+ * @inheritDoc
179
+ */
180
+ removeObject(target: ICanvasObject): void;
181
+ /**
182
+ * @override
183
+ * @inheritDoc
184
+ */
185
+ addImageObject(imageUrl: string): Promise<IImage>;
186
+ /**
187
+ * @override
188
+ * @inheritDoc
189
+ */
190
+ addTextObject(): Promise<IText>;
191
+ /**
192
+ * @override
193
+ * @inheritDoc
194
+ */
195
+ addRectangleObject(): Promise<IRectangle>;
196
+ /**
197
+ * @override
198
+ * @inheritDoc
199
+ */
200
+ addCutoffObject(): Promise<ICutoff>;
201
+ /**
202
+ * @override
203
+ * @inheritDoc
204
+ */
205
+ addBorderObject(): Promise<IBorder>;
206
+ /**
207
+ * @override
208
+ * @inheritDoc
209
+ */
210
+ addVerticalRuleObject(): Promise<IVerticalRule>;
211
+ /**
212
+ * @override
213
+ * @inheritDoc
214
+ */
215
+ addHorizontalRuleObject(): Promise<IHorizontalRule>;
216
+ /**
217
+ * @override
218
+ * @inheritDoc
219
+ */
220
+ setPrefillData(data: {
221
+ [id: string]: string;
222
+ }): void;
223
+ /**
224
+ * @override
225
+ * @inheritDoc
226
+ */
227
+ distributeObjectsVertically(): void;
228
+ /**
229
+ * @override
230
+ * @inheritDoc
231
+ */
232
+ getSelection(): ISelectionData;
233
+ /**
234
+ * @override
235
+ * @inheritDoc
236
+ */
237
+ getSelection$(): Observable<ISelectionData>;
238
+ /**
239
+ * @override
240
+ * @inheritDoc
241
+ */
242
+ select(object: ICanvasObject): void;
243
+ /**
244
+ * @override
245
+ * @inheritDoc
246
+ */
247
+ clearSelection(): void;
248
+ setMultiSelect(value: boolean): void;
249
+ /**
250
+ * @override
251
+ * @inheritDoc
252
+ */
253
+ clear(): void;
254
+ /**
255
+ * @override
256
+ * @inheritDoc
257
+ */
258
+ save(): ICanvasState;
259
+ /**
260
+ * @override
261
+ * @inheritDoc
262
+ */
263
+ load(canvasState: ICanvasState): Promise<void>;
264
+ /**
265
+ * Another hack for bullet points... because they use canvas objects to render the bullets, they get saved when the canvas is persisted... and then loaded into a new canvas, but there's
266
+ * nothing linking them to the field that needs bullets, so they end up duplicating every time the canvas is saved/loaded. Since we don't use circles for anything else, this just
267
+ * deletes all circles on canvas load.
268
+ */
269
+ private removePersistedBullets;
270
+ /**
271
+ * @override
272
+ * @inheritDoc
273
+ */
274
+ toSvg(): string;
275
+ /**
276
+ * @override
277
+ * @inheritDoc
278
+ */
279
+ toImage(): string;
280
+ /**
281
+ * @override
282
+ * @inheritDoc
283
+ */
284
+ createPNGStream(): any;
285
+ /**
286
+ * Redraw the canvas.
287
+ */
288
+ redraw(): void;
289
+ syncObjectList(): void;
290
+ /**
291
+ * @override
292
+ * @inheritDoc
293
+ */
294
+ notifyObjectListChanged(): void;
295
+ /**
296
+ * @override
297
+ * @inheritDoc
298
+ */
299
+ notifyTextChanged(): void;
300
+ /**
301
+ * @override
302
+ * @inheritDoc
303
+ */
304
+ notifyMarginChanged(): void;
305
+ removeFabricObject(obj: any): void;
306
+ protected selectFabricObject(object: fabric.Object): void;
307
+ protected onTextChange(): void;
308
+ protected onObjectListChange(): void;
309
+ protected onDimensionsChange(): void;
310
+ protected onMarginChange(): void;
311
+ private bindFields;
312
+ private bindField;
313
+ private findFabricObject;
314
+ private findObject;
315
+ /**
316
+ * Reset zoom and canvas dimensions to 1:1 scale, execute a function, then return the canvas to
317
+ * the previous values.
318
+ * @param func Function to execute.
319
+ */
320
+ private executeWithNormalizedCanvas;
321
+ /**
322
+ * Update the actual dimensions of the canvas by multiplying the requested dimensions by the current zoom factor.
323
+ */
324
+ private updateCanvasDimensions;
325
+ protected onProfileChanged(profile: ICanvasProfile): void;
326
+ protected getFieldByCanvasObject?(object: any): AbstractCanvasObject<any> | null;
327
+ protected getFieldsByCanvasObject(objects: any[]): Array<AbstractCanvasObject<any>>;
328
+ private calculateImageCaptureCoefficient;
329
+ private randomId;
330
+ private getLowestTextPoint;
331
+ private trackNewObject;
332
+ private dimensionsExceedRestrictions;
333
+ }
334
+ export declare class SelectionData implements ISelectionData {
335
+ readonly empty: boolean;
336
+ readonly objects: Array<AbstractCanvasObject<any>>;
337
+ readonly isText: boolean;
338
+ readonly textSelection: ITextSelection | null;
339
+ constructor(objects: Array<AbstractCanvasObject<any>>);
340
+ }