@leapfrog/interactive-canvas 2.0.16 → 2.0.17-beta-1

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