@leapfrog/interactive-canvas 2.0.18 → 2.0.20-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.
@@ -0,0 +1,3 @@
1
+ interface ErrorOptions {
2
+ cause?: unknown;
3
+ }
@@ -20,12 +20,12 @@ import { ICanvasObject } from "./object/canvas-object.interface";
20
20
  import { ISelectionData } from "./types/selection-data.interface";
21
21
  import { ICanvasState } from "./types/canvas-state.interface";
22
22
  import { ITextSelection } from "./mutator/mutable-text-style.interface";
23
- import { fabric } from "fabric";
23
+ import { TEvent, FabricObject, Canvas } from "fabric";
24
24
  import { IRichText } from "./object/impl/rich-text";
25
25
  import { IBackgroundImage } from "./object/impl/background-image";
26
26
  export declare abstract class AbstractInteractiveCanvas implements IInteractiveCanvas {
27
27
  fabric: any;
28
- protected readonly fabricCanvas: fabric.Canvas;
28
+ protected readonly fabricCanvas: Canvas;
29
29
  protected devicePixelRatio: number;
30
30
  protected readonly IMAGE_CAPTURE_COEFFICIENT: number;
31
31
  abstract readonly headless: boolean;
@@ -40,7 +40,7 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
40
40
  protected readonly objects$: BehaviorSubject<Array<AbstractCanvasObject<any>>>;
41
41
  protected readonly selection$: BehaviorSubject<SelectionData>;
42
42
  protected baseDimensions: ICanvasDimensions;
43
- protected constructor(fabric: any, fabricCanvas: fabric.Canvas, devicePixelRatio: number);
43
+ protected constructor(fabric: any, fabricCanvas: Canvas, devicePixelRatio: number);
44
44
  /**
45
45
  * @override
46
46
  * @inheritDoc
@@ -181,6 +181,26 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
181
181
  * @inheritDoc
182
182
  */
183
183
  removeObject(target: ICanvasObject): void;
184
+ /**
185
+ * @override
186
+ * @inheritDoc
187
+ */
188
+ bringObjectToFront(target: FabricObject): void;
189
+ /**
190
+ * @override
191
+ * @inheritDoc
192
+ */
193
+ bringObjectForward(target: FabricObject): void;
194
+ /**
195
+ * @override
196
+ * @inheritDoc
197
+ */
198
+ sendObjectBackwards(target: FabricObject): void;
199
+ /**
200
+ * @override
201
+ * @inheritDoc
202
+ */
203
+ sendObjectToBack(target: FabricObject): void;
184
204
  /**
185
205
  * @override
186
206
  * @inheritDoc
@@ -335,7 +355,7 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
335
355
  */
336
356
  notifyMarginChanged(): void;
337
357
  removeFabricObject(obj: any): void;
338
- protected selectFabricObject(object: fabric.Object): void;
358
+ protected selectFabricObject(object: FabricObject): void;
339
359
  protected onTextChange(): void;
340
360
  protected onObjectListChange(): void;
341
361
  protected onDimensionsChange(): void;
@@ -368,5 +388,7 @@ export declare class SelectionData implements ISelectionData {
368
388
  readonly objects: Array<AbstractCanvasObject<any>>;
369
389
  readonly isText: boolean;
370
390
  readonly textSelection: ITextSelection | null;
391
+ event: TEvent<MouseEvent>;
371
392
  constructor(objects: Array<AbstractCanvasObject<any>>);
393
+ setEvent(event: TEvent<MouseEvent>): void;
372
394
  }
@@ -1,10 +1,10 @@
1
- import { fabric } from "fabric";
2
1
  import { AbstractInteractiveCanvas } from "./abstract-interactive-canvas";
2
+ import { FabricObject } from "fabric";
3
3
  export declare class HeadlessInteractiveCanvas extends AbstractInteractiveCanvas {
4
4
  readonly headless: boolean;
5
5
  constructor();
6
6
  /**
7
7
  * @override
8
8
  */
9
- protected selectFabricObject(object: fabric.Object): void;
9
+ protected selectFabricObject(object: FabricObject): void;
10
10
  }
@@ -3,7 +3,7 @@ export declare class InteractiveCanvas extends AbstractInteractiveCanvas {
3
3
  protected devicePixelRatio: number;
4
4
  readonly headless: boolean;
5
5
  private readonly undoStack;
6
- constructor(canvas: HTMLCanvasElement | string | null, devicePixelRatio: number);
6
+ constructor(canvas: HTMLCanvasElement | string | undefined, devicePixelRatio: number);
7
7
  /**
8
8
  * @override
9
9
  * @inheritDoc