@leapfrog/interactive-canvas 2.0.19 → 2.0.20-beta-2

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,13 +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
- import { IEvent } from "fabric/fabric-impl";
27
26
  export declare abstract class AbstractInteractiveCanvas implements IInteractiveCanvas {
28
27
  fabric: any;
29
- protected readonly fabricCanvas: fabric.Canvas;
28
+ protected readonly fabricCanvas: Canvas;
30
29
  protected devicePixelRatio: number;
31
30
  protected readonly IMAGE_CAPTURE_COEFFICIENT: number;
32
31
  abstract readonly headless: boolean;
@@ -41,7 +40,7 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
41
40
  protected readonly objects$: BehaviorSubject<Array<AbstractCanvasObject<any>>>;
42
41
  protected readonly selection$: BehaviorSubject<SelectionData>;
43
42
  protected baseDimensions: ICanvasDimensions;
44
- protected constructor(fabric: any, fabricCanvas: fabric.Canvas, devicePixelRatio: number);
43
+ protected constructor(fabric: any, fabricCanvas: Canvas, devicePixelRatio: number);
45
44
  /**
46
45
  * @override
47
46
  * @inheritDoc
@@ -182,6 +181,26 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
182
181
  * @inheritDoc
183
182
  */
184
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;
185
204
  /**
186
205
  * @override
187
206
  * @inheritDoc
@@ -336,7 +355,7 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
336
355
  */
337
356
  notifyMarginChanged(): void;
338
357
  removeFabricObject(obj: any): void;
339
- protected selectFabricObject(object: fabric.Object): void;
358
+ protected selectFabricObject(object: FabricObject): void;
340
359
  protected onTextChange(): void;
341
360
  protected onObjectListChange(): void;
342
361
  protected onDimensionsChange(): void;
@@ -369,7 +388,7 @@ export declare class SelectionData implements ISelectionData {
369
388
  readonly objects: Array<AbstractCanvasObject<any>>;
370
389
  readonly isText: boolean;
371
390
  readonly textSelection: ITextSelection | null;
372
- event: IEvent<MouseEvent>;
391
+ event: TEvent<MouseEvent>;
373
392
  constructor(objects: Array<AbstractCanvasObject<any>>);
374
- setEvent(event: IEvent<MouseEvent>): void;
393
+ setEvent(event: TEvent<MouseEvent>): void;
375
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