@bensitu/image-editor 1.5.2 → 2.1.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 (166) hide show
  1. package/README.md +460 -509
  2. package/dist/cjs/index.cjs +6892 -0
  3. package/dist/cjs/index.cjs.map +1 -0
  4. package/dist/esm/animation/animation-queue.js +74 -0
  5. package/dist/esm/animation/animation-queue.js.map +1 -0
  6. package/dist/esm/core/callback-reporter.js +23 -0
  7. package/dist/esm/core/callback-reporter.js.map +1 -0
  8. package/dist/esm/core/default-options.js +529 -0
  9. package/dist/esm/core/default-options.js.map +1 -0
  10. package/dist/esm/core/errors.js +156 -0
  11. package/dist/esm/core/errors.js.map +1 -0
  12. package/dist/esm/core/operation-guard.js +157 -0
  13. package/dist/esm/core/operation-guard.js.map +1 -0
  14. package/dist/esm/core/public-types.js +4 -0
  15. package/dist/esm/core/public-types.js.map +1 -0
  16. package/dist/esm/core/state-serializer.js +252 -0
  17. package/dist/esm/core/state-serializer.js.map +1 -0
  18. package/dist/esm/crop/crop-controller.js +405 -0
  19. package/dist/esm/crop/crop-controller.js.map +1 -0
  20. package/dist/esm/export/export-format.js +53 -0
  21. package/dist/esm/export/export-format.js.map +1 -0
  22. package/dist/esm/export/export-service.js +607 -0
  23. package/dist/esm/export/export-service.js.map +1 -0
  24. package/dist/esm/fabric/fabric-adapter.js +37 -0
  25. package/dist/esm/fabric/fabric-adapter.js.map +1 -0
  26. package/dist/esm/fabric/fabric-animation.js +89 -0
  27. package/dist/esm/fabric/fabric-animation.js.map +1 -0
  28. package/dist/esm/history/command.js +2 -0
  29. package/dist/esm/history/command.js.map +1 -0
  30. package/dist/esm/history/history-manager.js +103 -0
  31. package/dist/esm/history/history-manager.js.map +1 -0
  32. package/dist/esm/image/image-loader.js +238 -0
  33. package/dist/esm/image/image-loader.js.map +1 -0
  34. package/dist/esm/image/image-resampler.js +60 -0
  35. package/dist/esm/image/image-resampler.js.map +1 -0
  36. package/dist/esm/image/layout-manager.js +206 -0
  37. package/dist/esm/image/layout-manager.js.map +1 -0
  38. package/dist/esm/image/transform-controller.js +132 -0
  39. package/dist/esm/image/transform-controller.js.map +1 -0
  40. package/dist/esm/image-editor.js +2076 -0
  41. package/dist/esm/image-editor.js.map +1 -0
  42. package/dist/esm/index.js +5 -0
  43. package/dist/esm/index.js.map +1 -0
  44. package/dist/esm/mask/mask-factory.js +356 -0
  45. package/dist/esm/mask/mask-factory.js.map +1 -0
  46. package/dist/esm/mask/mask-label-manager.js +120 -0
  47. package/dist/esm/mask/mask-label-manager.js.map +1 -0
  48. package/dist/esm/mask/mask-list.js +53 -0
  49. package/dist/esm/mask/mask-list.js.map +1 -0
  50. package/dist/esm/mask/mask-style.js +182 -0
  51. package/dist/esm/mask/mask-style.js.map +1 -0
  52. package/dist/esm/mosaic/mosaic-controller.js +670 -0
  53. package/dist/esm/mosaic/mosaic-controller.js.map +1 -0
  54. package/dist/esm/mosaic/mosaic-geometry.js +81 -0
  55. package/dist/esm/mosaic/mosaic-geometry.js.map +1 -0
  56. package/dist/esm/mosaic/mosaic-pixelate.js +71 -0
  57. package/dist/esm/mosaic/mosaic-pixelate.js.map +1 -0
  58. package/dist/esm/ui/dom-bindings.js +67 -0
  59. package/dist/esm/ui/dom-bindings.js.map +1 -0
  60. package/dist/esm/ui/ui-state.js +25 -0
  61. package/dist/esm/ui/ui-state.js.map +1 -0
  62. package/dist/esm/ui/visibility-state.js +11 -0
  63. package/dist/esm/ui/visibility-state.js.map +1 -0
  64. package/dist/esm/utils/canvas-region.js +100 -0
  65. package/dist/esm/utils/canvas-region.js.map +1 -0
  66. package/dist/esm/utils/dom.js +6 -0
  67. package/dist/esm/utils/dom.js.map +1 -0
  68. package/dist/esm/utils/file.js +53 -0
  69. package/dist/esm/utils/file.js.map +1 -0
  70. package/dist/esm/utils/number.js +24 -0
  71. package/dist/esm/utils/number.js.map +1 -0
  72. package/dist/esm/utils/timeout.js +17 -0
  73. package/dist/esm/utils/timeout.js.map +1 -0
  74. package/dist/types/animation/animation-queue.d.ts +111 -0
  75. package/dist/types/animation/animation-queue.d.ts.map +1 -0
  76. package/dist/types/core/callback-reporter.d.ts +125 -0
  77. package/dist/types/core/callback-reporter.d.ts.map +1 -0
  78. package/dist/types/core/default-options.d.ts +84 -0
  79. package/dist/types/core/default-options.d.ts.map +1 -0
  80. package/dist/types/core/errors.d.ts +142 -0
  81. package/dist/types/core/errors.d.ts.map +1 -0
  82. package/dist/types/core/operation-guard.d.ts +194 -0
  83. package/dist/types/core/operation-guard.d.ts.map +1 -0
  84. package/dist/types/core/public-types.d.ts +788 -0
  85. package/dist/types/core/public-types.d.ts.map +1 -0
  86. package/dist/types/core/state-serializer.d.ts +303 -0
  87. package/dist/types/core/state-serializer.d.ts.map +1 -0
  88. package/dist/types/crop/crop-controller.d.ts +407 -0
  89. package/dist/types/crop/crop-controller.d.ts.map +1 -0
  90. package/dist/types/export/export-format.d.ts +136 -0
  91. package/dist/types/export/export-format.d.ts.map +1 -0
  92. package/dist/types/export/export-service.d.ts +333 -0
  93. package/dist/types/export/export-service.d.ts.map +1 -0
  94. package/dist/types/fabric/fabric-adapter.d.ts +74 -0
  95. package/dist/types/fabric/fabric-adapter.d.ts.map +1 -0
  96. package/dist/types/fabric/fabric-animation.d.ts +141 -0
  97. package/dist/types/fabric/fabric-animation.d.ts.map +1 -0
  98. package/dist/types/history/command.d.ts +16 -0
  99. package/dist/types/history/command.d.ts.map +1 -0
  100. package/dist/types/history/history-manager.d.ts +129 -0
  101. package/dist/types/history/history-manager.d.ts.map +1 -0
  102. package/dist/types/image/image-loader.d.ts +263 -0
  103. package/dist/types/image/image-loader.d.ts.map +1 -0
  104. package/dist/types/image/image-resampler.d.ts +139 -0
  105. package/dist/types/image/image-resampler.d.ts.map +1 -0
  106. package/dist/types/image/layout-manager.d.ts +211 -0
  107. package/dist/types/image/layout-manager.d.ts.map +1 -0
  108. package/dist/types/image/transform-controller.d.ts +286 -0
  109. package/dist/types/image/transform-controller.d.ts.map +1 -0
  110. package/dist/types/image-editor.d.ts +661 -0
  111. package/dist/types/image-editor.d.ts.map +1 -0
  112. package/dist/types/index.d.cts +31 -0
  113. package/dist/types/index.d.cts.map +1 -0
  114. package/dist/types/index.d.ts +31 -0
  115. package/dist/types/index.d.ts.map +1 -0
  116. package/dist/types/mask/mask-factory.d.ts +212 -0
  117. package/dist/types/mask/mask-factory.d.ts.map +1 -0
  118. package/dist/types/mask/mask-label-manager.d.ts +171 -0
  119. package/dist/types/mask/mask-label-manager.d.ts.map +1 -0
  120. package/dist/types/mask/mask-list.d.ts +144 -0
  121. package/dist/types/mask/mask-list.d.ts.map +1 -0
  122. package/dist/types/mask/mask-style.d.ts +338 -0
  123. package/dist/types/mask/mask-style.d.ts.map +1 -0
  124. package/dist/types/mosaic/mosaic-controller.d.ts +82 -0
  125. package/dist/types/mosaic/mosaic-controller.d.ts.map +1 -0
  126. package/dist/types/mosaic/mosaic-geometry.d.ts +29 -0
  127. package/dist/types/mosaic/mosaic-geometry.d.ts.map +1 -0
  128. package/dist/types/mosaic/mosaic-pixelate.d.ts +23 -0
  129. package/dist/types/mosaic/mosaic-pixelate.d.ts.map +1 -0
  130. package/dist/types/ui/dom-bindings.d.ts +105 -0
  131. package/dist/types/ui/dom-bindings.d.ts.map +1 -0
  132. package/dist/types/ui/ui-state.d.ts +112 -0
  133. package/dist/types/ui/ui-state.d.ts.map +1 -0
  134. package/dist/types/ui/visibility-state.d.ts +77 -0
  135. package/dist/types/ui/visibility-state.d.ts.map +1 -0
  136. package/dist/types/utils/canvas-region.d.ts +177 -0
  137. package/dist/types/utils/canvas-region.d.ts.map +1 -0
  138. package/dist/types/utils/dom.d.ts +26 -0
  139. package/dist/types/utils/dom.d.ts.map +1 -0
  140. package/dist/types/utils/file.d.ts +80 -0
  141. package/dist/types/utils/file.d.ts.map +1 -0
  142. package/dist/types/utils/number.d.ts +131 -0
  143. package/dist/types/utils/number.d.ts.map +1 -0
  144. package/dist/types/utils/timeout.d.ts +84 -0
  145. package/dist/types/utils/timeout.d.ts.map +1 -0
  146. package/dist/umd/image-editor.umd.js +2 -0
  147. package/dist/umd/image-editor.umd.js.map +1 -0
  148. package/package.json +72 -66
  149. package/dist/image-editor.cjs +0 -4407
  150. package/dist/image-editor.cjs.map +0 -7
  151. package/dist/image-editor.esm.js +0 -4376
  152. package/dist/image-editor.esm.js.map +0 -7
  153. package/dist/image-editor.esm.min.js +0 -9
  154. package/dist/image-editor.esm.min.js.map +0 -7
  155. package/dist/image-editor.esm.min.mjs +0 -9
  156. package/dist/image-editor.esm.min.mjs.map +0 -7
  157. package/dist/image-editor.esm.mjs +0 -4376
  158. package/dist/image-editor.esm.mjs.map +0 -7
  159. package/dist/image-editor.js +0 -4373
  160. package/dist/image-editor.js.map +0 -7
  161. package/dist/image-editor.min.js +0 -9
  162. package/dist/image-editor.min.js.map +0 -7
  163. package/image-editor.d.ts +0 -271
  164. package/src/browser.js +0 -11
  165. package/src/esm.js +0 -9
  166. package/src/image-editor.js +0 -5013
@@ -0,0 +1,661 @@
1
+ /**
2
+ * @author Ben Situ
3
+ * @license MIT
4
+ * Lightweight canvas-based image editor built on Fabric.js v7.
5
+ * Provides masking, animated scale/rotate, crop, mosaic, undo/redo, and export.
6
+ *
7
+ * @module
8
+ */
9
+ import { type CanvasJson } from './core/state-serializer.js';
10
+ import type { Base64ExportOptions, ElementIdMap, FabricModule, ImageEditorOptions, ImageFileExportOptions, LayoutMode, LoadImageOptions, MaskConfig, MaskObject, MosaicConfig, RemoveAllMasksOptions, ResolvedMosaicConfig } from './core/public-types.js';
11
+ /**
12
+ * Lightweight Fabric.js v7 image editor with masking, animated transforms,
13
+ * crop, undo/redo, and multi-format export.
14
+ *
15
+ * ## Quick start (ESM)
16
+ * ```ts
17
+ * import * as fabric from 'fabric';
18
+ * import { ImageEditor } from '@bensitu/image-editor';
19
+ *
20
+ * const editor = new ImageEditor(fabric, { canvasWidth: 1024, canvasHeight: 768 });
21
+ * editor.init({ canvas: 'myCanvas' });
22
+ * ```
23
+ *
24
+ * ## Quick start (CDN / `<script>` tag)
25
+ * ```ts
26
+ * // Assumes window.fabric is populated by a Fabric.js CDN script
27
+ * const editor = new ImageEditor({ canvasWidth: 1024 });
28
+ * editor.init();
29
+ * ```
30
+ */
31
+ export declare class ImageEditor {
32
+ private fabricModule;
33
+ private isFabricLoaded;
34
+ private readonly options;
35
+ private currentLayoutMode;
36
+ private readonly defaultMosaicConfig;
37
+ private currentMosaicConfig;
38
+ private canvas;
39
+ private canvasElement;
40
+ private containerElement;
41
+ private placeholderElement;
42
+ private elements;
43
+ private readonly elementOriginalDisabledMap;
44
+ private readonly elementOriginalAriaDisabledMap;
45
+ private readonly elementOriginalPointerEventsMap;
46
+ private originalImage;
47
+ private baseImageScale;
48
+ private currentScale;
49
+ private currentRotation;
50
+ private isImageLoadedToCanvas;
51
+ private currentImageMimeType;
52
+ private maskCounter;
53
+ private lastMask;
54
+ private lastSnapshot;
55
+ private readonly historyManager;
56
+ /**
57
+ * Single source of truth for `isAnimating` and `isDisposed` flags
58
+ * shared between the facade, the transform controller, and the
59
+ * Fabric animation wrapper. The transform controller calls
60
+ * `runAnimation` to bracket each Fabric tween so the flag is
61
+ * cleared inside a `finally`; the facade reads
62
+ * `isAnimating` for the per-method guard rejections; and the
63
+ * dispose path forwards to
64
+ * `markDisposed` so in-flight animation callbacks short-circuit.
65
+ */
66
+ private readonly operationGuard;
67
+ private readonly animQueue;
68
+ /**
69
+ * Owns animated `scaleImage`, `rotateImage`, and
70
+ * `resetImageTransform`. The facade enqueues each public method on
71
+ * {@link animQueue} and the controller drives
72
+ * the per-Fabric-animation `runAnimation` bracket through
73
+ * {@link operationGuard}. The controller is constructed in {@link init}
74
+ * once `canvas` is available so its `TransformContext` can hold a
75
+ * stable Fabric canvas reference.
76
+ */
77
+ private transformController;
78
+ /**
79
+ * Hidden-container viewport cache shared across `loadImage` calls. Owned
80
+ * by the facade so the layout manager can reuse the last visible
81
+ * measurement when the editor is hidden inside a tab, modal, or
82
+ * accordion.
83
+ */
84
+ private readonly viewportCache;
85
+ /**
86
+ * Live crop session pointer owned by the facade. The crop controller
87
+ * (`crop/crop-controller.ts`) reads and writes this slot through the
88
+ * `getCropSession`/`setCropSession` callbacks bundled into the
89
+ * controller's context, so the controller has no class state of its
90
+ * own and multiple editors on the same page do not share crop state.
91
+ */
92
+ private cropSession;
93
+ private mosaicSession;
94
+ /**
95
+ * Managed registry of DOM event listeners owned by this editor.
96
+ *
97
+ * Constructed lazily by {@link init} so the registry can read the
98
+ * editor's `isDisposed` flag through a closure that captures `this`.
99
+ * `dispose` drains the registry via {@link DomBindings.removeAll}
100
+ * and the wrapped handlers exit early while
101
+ * `isDisposed === true`.
102
+ */
103
+ private domBindings;
104
+ private isDisposed;
105
+ /**
106
+ * When `true`, {@link saveState} is a no-op. Used by
107
+ * {@link resetImageTransform} (via the transform controller) to
108
+ * suppress the intermediate history entries from {@link scaleImage}
109
+ * and {@link rotateImage} so the entire reset is a single undoable
110
+ * step.
111
+ */
112
+ private shouldSuppressSaveState;
113
+ private lastEmittedIsBusy;
114
+ private activeStateRestoreOperation;
115
+ private nextSelectionChangeContext;
116
+ /**
117
+ * Creates a new image editor instance.
118
+ *
119
+ * The constructor accepts two argument shapes so the same source ships
120
+ * to both ESM and UMD consumers:
121
+ *
122
+ * - **ESM form** — `new ImageEditor(fabric, options?)`. The first
123
+ * argument is the imported Fabric.js v7 module
124
+ * (`import * as fabric from 'fabric'`).
125
+ * - **UMD / CDN form** — `new ImageEditor(options?)`. The Fabric module
126
+ * is read from `globalThis.fabric` and the first argument is treated
127
+ * as `ImageEditorOptions`.
128
+ *
129
+ * Detection is delegated to `fabric/fabric-adapter.ts`. When neither
130
+ * form yields a usable Fabric module, the adapter logs a single
131
+ * descriptive `console.error` and the constructor returns a degraded
132
+ * instance whose `init` and `loadImage` calls become no-ops
133
+ * resolving to `undefined`.
134
+ *
135
+ * Options are normalized through `core/default-options.ts#resolveOptions`,
136
+ * which deep-merges nested `label`/`crop` configs with the documented
137
+ * defaults, drops unknown keys, and freezes the nested references so
138
+ * post-construction mutation cannot affect the live editor
139
+ * The resolved options object is held on the
140
+ * instance as an internal facade field; nothing on the public surface
141
+ * exposes it directly.
142
+ *
143
+ * @param fabricModuleOrOptions - Fabric.js module (ESM) or options (UMD).
144
+ * @param options - Editor options when the first argument
145
+ * is the Fabric module. Ignored otherwise.
146
+ */
147
+ constructor(fabricModuleOrOptions?: FabricModule | ImageEditorOptions, options?: ImageEditorOptions);
148
+ /**
149
+ * Initializes the editor: connects to DOM elements, wires events,
150
+ * and optionally loads the `initialImageBase64` from options.
151
+ *
152
+ * Must be called once before any other method is used.
153
+ *
154
+ * @param idMap - Optional mapping from logical names to DOM element IDs.
155
+ *
156
+ * @example
157
+ * ```ts
158
+ * editor.init({ canvas: 'myCanvas', downloadImageButton: 'dlBtn'});
159
+ * ```
160
+ */
161
+ init(idMap?: ElementIdMap): void;
162
+ private initCanvas;
163
+ private bindDomEvents;
164
+ private bindElementIfExists;
165
+ /**
166
+ * Read a `File` selected via the upload control as a base64 data URL
167
+ * and route it through the transactional `loadImage` pipeline.
168
+ *
169
+ * Routes through `utils/file.ts` so MIME inference (including the
170
+ * empty-`file.type` extension fallback), `FileReader` plumbing, and
171
+ * input reset live in one place. The input is reset on both success
172
+ * and failure so re-selecting the same file fires a fresh `change`
173
+ * event.
174
+ */
175
+ private loadImageFile;
176
+ /**
177
+ * Loads a Base64-encoded image data URL onto the canvas.
178
+ *
179
+ * The transactional pipeline lives in `image/image-loader.ts`; this
180
+ * facade method delegates to it so all rollback, downsample, layout,
181
+ * and `onImageLoaded` ordering rules are owned in one place.
182
+ *
183
+ * Pipeline contract preserved end-to-end:
184
+ *
185
+ * - Non-`data:image/` strings resolve without mutation.
186
+ * - On a valid data URL, the loader captures a rollback bundle BEFORE
187
+ * the first mutation. Decode, downsample, Fabric, timeout, or layout
188
+ * failures replay the bundle and reject with the original error.
189
+ * - On commit, the loader sets `originalImage`, `currentScale = 1`,
190
+ * `currentRotation = 0`, `baseImageScale`, `maskCounter = 0`,
191
+ * `lastSnapshot`, and `isImageLoadedToCanvas = true`. It also
192
+ * honours `LoadImageOptions.preserveScroll` and invokes
193
+ * `onImageLoaded` exactly once after every scalar is committed.
194
+ *
195
+ * Operation guard: `loadImage` is one of the
196
+ * guarded operations. While `isAnimating === true` the facade rejects
197
+ * the call as a documented no-op so a queued scale/rotate animation
198
+ * cannot be torn down by a concurrent reload.
199
+ *
200
+ * @param base64 - Data URL string starting with `data:image/…`.
201
+ * @param options - Optional {@link LoadImageOptions}; currently only
202
+ * `preserveScroll` is consulted.
203
+ * @returns A promise that resolves once the image is on the canvas, or
204
+ * rejects with the original error after a transactional
205
+ * rollback. Non-data:image inputs and Fabric-unavailable /
206
+ * disposed states resolve without observable mutation.
207
+ */
208
+ loadImage(base64: string, options?: LoadImageOptions): Promise<void>;
209
+ private loadImageInternal;
210
+ private getInternalOperationToken;
211
+ private canRunDuringAnimationQueue;
212
+ private withInternalOperationOptions;
213
+ private withAnimationQueueBypass;
214
+ private assertIdleForOperation;
215
+ private canRunIdleOperation;
216
+ private isExpectedIdleGuardError;
217
+ private assertCanQueueAnimation;
218
+ /**
219
+ * Returns `true` if a valid image is currently loaded on the canvas.
220
+ */
221
+ isImageLoaded(): boolean;
222
+ /**
223
+ * Returns `true` while the editor is loading, animating, or in crop mode.
224
+ */
225
+ isBusy(): boolean;
226
+ /**
227
+ * Selects the layout strategy used by subsequent image loads.
228
+ *
229
+ * The current canvas is not re-laid out immediately; call this before
230
+ * `loadImage()` to choose how the next image is placed.
231
+ *
232
+ * @param mode - Layout mode to use for future image loads.
233
+ */
234
+ setLayoutMode(mode: LayoutMode): void;
235
+ private getRuntimeOptions;
236
+ private buildCallbackContext;
237
+ private getOperationContext;
238
+ private emitOptionCallback;
239
+ private getImageInfo;
240
+ private getMasks;
241
+ private getMaskCollectionSignature;
242
+ private getEditorState;
243
+ private emitImageChanged;
244
+ private emitMasksChanged;
245
+ private emitBusyChangeIfChanged;
246
+ private buildSelection;
247
+ private withSelectionChangeContext;
248
+ private isSupportedImageMimeType;
249
+ private inferCurrentImageMimeType;
250
+ /**
251
+ * Atomically resize the Fabric canvas. Routes through
252
+ * {@link applyCanvasDimensions} so the canvas's lower (render) and
253
+ * upper (event) layers stay in sync and the surrounding container is
254
+ * reflowed before the next paint — matching the contract enforced
255
+ * across the rest of the layout pipeline (see
256
+ * `image/layout-manager.ts`).
257
+ */
258
+ private setCanvasSizePx;
259
+ /**
260
+ * Re-align an object so its bounding-box top-left maps to the
261
+ * object's `(left, top)` reference. Used by the transform pipeline's
262
+ * `afterTransformSnap` hook to absorb floating-point drift on the
263
+ * final animation tick.
264
+ */
265
+ private alignObjectBoundingBoxToCanvasTopLeft;
266
+ private measureLayoutViewport;
267
+ /**
268
+ * Resize the canvas to fit the transformed image bounds. Used by the
269
+ * transform pipeline's `afterTransformSnap` hook so a post-rotation/scale
270
+ * image that exceeds the viewport gets a real scroll range.
271
+ */
272
+ private updateCanvasSizeToImageBounds;
273
+ private shouldNormalizeCanvasSizeAfterStateRestore;
274
+ private settleFitCoverScrollbarsAfterStateRestore;
275
+ private captureImageDisplayGeometry;
276
+ private restoreMergedImageDisplayGeometry;
277
+ /**
278
+ * Build the {@link TransformContext} the controller reads/writes
279
+ * through. The facade is the single owner of `currentScale`,
280
+ * `currentRotation`, `baseImageScale`, `shouldSuppressSaveState`, and
281
+ * the {@link OperationGuard}, so the context's accessors all bind
282
+ * back to `this` rather than duplicating state.
283
+ *
284
+ * The `saveCanvasState` callback delegates to {@link saveState},
285
+ * which already honors `shouldSuppressSaveState`. That lets
286
+ * {@link resetImageTransform} reuse the public scale and rotate paths
287
+ * while suppressing intermediate saves and emitting one final history
288
+ * entry.
289
+ *
290
+ * The `afterTransformSnap` hook re-runs the post-animation UI helpers:
291
+ * expand-to-image canvas sizing, bounding-box re-alignment, and mask
292
+ * label sync.
293
+ *
294
+ */
295
+ private buildTransformContext;
296
+ /**
297
+ * Animates the image to the given scale factor.
298
+ * The factor is clamped to `[options.minScale, options.maxScale]`.
299
+ *
300
+ * Routed through the {@link animQueue} so concurrent calls are
301
+ * serialized. The actual animation lives
302
+ * in {@link TransformController.scaleImage}, which brackets the
303
+ * Fabric tween in {@link OperationGuard.runAnimation} so
304
+ * `isAnimating` is `false` before this Promise settles
305
+ * and calls {@link saveState} on success.
306
+ *
307
+ * @returns A promise that resolves when the animation finishes.
308
+ */
309
+ scaleImage(factor: number): Promise<void>;
310
+ /**
311
+ * Animates the image to the given rotation angle.
312
+ *
313
+ * Routed through the {@link animQueue}.
314
+ * Non-finite input is a documented no-op; the controller
315
+ * short-circuits without modifying canvas state.
316
+ *
317
+ * @param degrees - Target rotation angle in degrees.
318
+ * @returns A promise that resolves when the animation finishes.
319
+ */
320
+ rotateImage(degrees: number): Promise<void>;
321
+ /**
322
+ * Resets the image to scale `1` and rotation `0` (animated) and
323
+ * records exactly one history entry covering the entire reset.
324
+ *
325
+ * Routed through the {@link animQueue} so the chained
326
+ * `scaleImage(1)` and `rotateImage(0)` sub-animations are serialized
327
+ * with any other queued transform. The
328
+ * controller toggles `shouldSuppressSaveState` around the chain so the
329
+ * inner per-operation `saveState` calls collapse into a single
330
+ * post-reset save.
331
+ *
332
+ * @returns A promise that resolves when both sub-animations have
333
+ * settled and the single history entry has been recorded.
334
+ */
335
+ resetImageTransform(): Promise<void>;
336
+ private refreshUiAfterQueuedAnimation;
337
+ /**
338
+ * Restores a previously serialized canvas state.
339
+ *
340
+ * Delegates the snapshot-format-aware steps (parse, canvas resize,
341
+ * `loadFromJSON`, position-based mask metadata restore) to
342
+ * {@link loadFromStateImpl} in `core/state-serializer.ts` so the
343
+ * facade and the merge/crop pipelines share one production path.
344
+ *
345
+ * Errors are routed through the documented `onError` callback. The
346
+ * promise rejects with the original error so the history manager
347
+ * leaves `currentIndex` untouched on a failed undo/redo restore.
348
+ *
349
+ * @param jsonString - JSON string returned by `saveState` (or parsed object).
350
+ */
351
+ loadFromState(jsonString: string | CanvasJson): Promise<void>;
352
+ private loadFromStateInternal;
353
+ /**
354
+ * Captures the current canvas state into the undo/redo history.
355
+ * Called automatically after transforms, mask operations, and crop.
356
+ */
357
+ saveState(): void;
358
+ private saveStateInternal;
359
+ private restoreActiveMaskAfterSnapshot;
360
+ /**
361
+ * Undoes the last recorded action.
362
+ *
363
+ * Routed through {@link animQueue} so that undo is serialized with any
364
+ * in-progress animation and rapid clicks cannot interleave canvas restores.
365
+ * The {@link HistoryManager.isProcessing} lock provides a second line of
366
+ * defence inside the history layer itself.
367
+ *
368
+ * After {@link dispose} the call resolves without touching the canvas.
369
+ * The early return covers the case where dispose has already happened;
370
+ * the inner check covers the case where dispose happens while waiting
371
+ * in the animation queue.
372
+ */
373
+ undo(): Promise<void>;
374
+ /**
375
+ * Redoes the next recorded action.
376
+ *
377
+ * Same serialization and dispose guarantees as {@link undo}.
378
+ */
379
+ redo(): Promise<void>;
380
+ /**
381
+ * Creates and adds a mask shape to the canvas.
382
+ *
383
+ * Delegates to {@link createMask} in `mask/mask-factory.ts`, which
384
+ * owns the resolved-config build, polygon bounding-box realignment,
385
+ * falsy-style preservation, monotonic `maskCounter` bookkeeping,
386
+ * and the post-create ordering contract: add to canvas → update
387
+ * list DOM → `setActiveObject` (when `selectable !== false`) →
388
+ * `saveState` → `config.onCreate(mask, canvas)`.
389
+ *
390
+ * @param config - Shape type, dimensions, position, style, and callbacks.
391
+ * @returns The created mask object, or `null` if the canvas is unavailable.
392
+ *
393
+ * @example
394
+ * ```ts
395
+ * // Simple rect mask
396
+ * editor.createMask;
397
+ *
398
+ * // Circle with custom size
399
+ * editor.createMask({ shape: 'circle', radius: 60, color: 'rgba(255,0,0,0.4)'});
400
+ *
401
+ * // Positioned at 20% from the left
402
+ * editor.createMask({ left: '20%', top: 40});
403
+ * ```
404
+ */
405
+ createMask(config?: MaskConfig): MaskObject | null;
406
+ /**
407
+ * Removes the currently selected mask (and its label).
408
+ *
409
+ * Delegates to {@link removeSelectedMask} in `mask/mask-factory.ts`,
410
+ * which removes the active mask, clears the canvas selection,
411
+ * re-renders the mask list DOM, and pushes a single history entry.
412
+ */
413
+ removeSelectedMask(): void;
414
+ /**
415
+ * Removes all masks and their labels.
416
+ *
417
+ * Delegates to {@link removeAllMasks} in `mask/mask-factory.ts`,
418
+ * which removes every mask and label in canvas order, clears the
419
+ * `lastMask` reference, re-renders the mask list
420
+ * DOM, and pushes a single history entry by default. Callers can
421
+ * pass `{ saveHistory: false}` to skip the history push — used by
422
+ * the merge and crop pipelines, which already record their own
423
+ * enclosing history entry.
424
+ *
425
+ * Operation guard: while `isAnimating === true`
426
+ * the call is a documented no-op so an in-flight scale/rotate
427
+ * animation cannot have its mask layer torn out from under it. The
428
+ * guard mirrors the loadImage pattern (silent no-op, no throw, no
429
+ * DOM mutation) so the canvas, history stack, and mask list are
430
+ * left untouched.
431
+ */
432
+ removeAllMasks(options?: RemoveAllMasksOptions): void;
433
+ /**
434
+ * Build the {@link CreateMaskContext} the mask factory reads/writes
435
+ * through. The facade is the single owner of `maskCounter`,
436
+ * `lastMask`, the canvas, and `saveState`, so the context's
437
+ * accessors all bind back to `this` rather than duplicating state.
438
+ */
439
+ private buildCreateMaskContext;
440
+ /**
441
+ * Build the {@link RemoveMaskContext} the mask factory reads/writes
442
+ * through for `removeSelectedMask` / `removeAllMasks`. The facade
443
+ * is the single owner of the canvas, mask label DOM, mask list
444
+ * DOM, history, and `lastMask`, so the context's accessors bind
445
+ * back to `this`.
446
+ */
447
+ private buildRemoveMaskContext;
448
+ private buildMaskLabelContext;
449
+ private removeLabelForMask;
450
+ private createLabelForMask;
451
+ private hideAllMaskLabels;
452
+ private syncMaskLabel;
453
+ private showLabelForMask;
454
+ private handleSelectionChanged;
455
+ private buildMaskListContext;
456
+ private updateMaskList;
457
+ private updateMaskListSelection;
458
+ /**
459
+ * Bakes all current masks into the image:
460
+ * exports the masked image, removes the masks, and re-imports the result
461
+ * as the new base image.
462
+ *
463
+ * Operation guard: while `isAnimating === true`
464
+ * the call resolves without mutation so a queued scale/rotate
465
+ * animation cannot have the original image swapped out mid-flight.
466
+ *
467
+ * Delegates the merge pipeline to {@link mergeMasks} in
468
+ * `export/export-service.ts`, which captures the pre-merge snapshot,
469
+ * renders the merged bitmap via the export bake-in bracket, removes
470
+ * masks without history, reloads the merged image transactionally,
471
+ * preserves container scroll, and pushes exactly one history entry.
472
+ * On any failure it restores the pre-merge snapshot and rejects with
473
+ * `MergeMasksError`.
474
+ *
475
+ * @returns A promise that resolves when the merge is complete.
476
+ */
477
+ mergeMasks(): Promise<void>;
478
+ /**
479
+ * Triggers a browser download of the current canvas.
480
+ *
481
+ * Operation guard: while `isAnimating === true`
482
+ * the call is a no-op (no DOM action, no download triggered).
483
+ *
484
+ * Delegates to {@link downloadImage} in `export/export-service.ts`,
485
+ * which builds the data URL through the same pipeline used by
486
+ * {@link exportImageBase64} and triggers the anchor-driven download.
487
+ *
488
+ * @param fileName - Filename for the downloaded file.
489
+ * @default `options.defaultDownloadFileName`
490
+ */
491
+ downloadImage(fileName?: string): void;
492
+ /**
493
+ * Exports the canvas as a Base64-encoded data URL.
494
+ *
495
+ * Delegates to {@link exportImageBase64} in `export/export-service.ts`,
496
+ * which discards any active selection, runs the bake-in/restore
497
+ * bracket for image-area exports, and emits a single
498
+ * `canvas.toDataURL` call with the floored image-bounding-box region
499
+ * after temporarily baking masks into the export when requested.
500
+ *
501
+ * Operation guard: while `isAnimating === true`
502
+ * the call resolves to an empty string so an in-flight scale/rotate
503
+ * animation does not see a mid-frame export of the canvas.
504
+ *
505
+ * @param options - Export options.
506
+ * @returns A promise resolving to a data URL on success, or `''` when
507
+ * no image is loaded.
508
+ */
509
+ exportImageBase64(options?: Base64ExportOptions): Promise<string>;
510
+ /**
511
+ * Exports the canvas as a browser `File` object.
512
+ *
513
+ * Delegates to {@link exportImageFile} in `export/export-service.ts`,
514
+ * which reuses the base64 pipeline, repaints through an offscreen
515
+ * canvas only when the resulting MIME type does not match the
516
+ * requested `fileType`, and resolves with a `File` whose `type`
517
+ * matches the requested format.
518
+ *
519
+ * Operation guard: while `isAnimating === true`
520
+ * the call rejects via `OperationGuard.assertNotAnimating` because
521
+ * `Promise<File>` has no natural no-op shape. The thrown error
522
+ * embeds the operation label so callers can distinguish the guard
523
+ * rejection from an underlying export failure.
524
+ *
525
+ * @param options - Export and file options.
526
+ * @returns A promise resolving to a `File`.
527
+ * @throws `ExportNotReadyError` when no image is loaded.
528
+ *
529
+ * @example
530
+ * ```ts
531
+ * const file = await editor.exportImageFile({ fileType: 'png', mergeMask: false});
532
+ * const formData = new FormData;
533
+ * formData.append('image', file);
534
+ * ```
535
+ */
536
+ exportImageFile(options?: ImageFileExportOptions): Promise<File>;
537
+ /**
538
+ * Build the {@link ExportServiceContext} the export service reads
539
+ * through. The facade is the single owner of the canvas, options,
540
+ * and the `originalImage` reference.
541
+ */
542
+ private buildExportServiceContext;
543
+ /**
544
+ * Build the {@link MergeMasksContext} the merge pipeline reads
545
+ * through. Extends the export-service context with the history
546
+ * manager, container element, transactional `loadImage`, and the
547
+ * `saveState`/`loadFromState`/`removeAllMasksNoHistory` callbacks
548
+ * the merge needs.
549
+ */
550
+ private buildMergeMasksContext;
551
+ /**
552
+ * Capture a snapshot string suitable for `loadFromState` without
553
+ * pushing it onto the history stack. Used by the merge and crop
554
+ * pipelines, which manage their own enclosing history entries and
555
+ * need the same wire format `saveState` writes to history.
556
+ *
557
+ * Routes through `core/state-serializer.ts` so the snapshot wire
558
+ * format has one production path. Does NOT push a history entry
559
+ * and does NOT update `lastSnapshot`.
560
+ */
561
+ private captureSnapshotInternal;
562
+ private getActiveMaskForSnapshot;
563
+ enterMosaicMode(): void;
564
+ exitMosaicMode(): void;
565
+ isMosaicMode(): boolean;
566
+ getMosaicConfig(): Readonly<ResolvedMosaicConfig>;
567
+ setMosaicConfig(config: MosaicConfig): void;
568
+ resetMosaicConfig(): void;
569
+ setMosaicBrushSize(size: number): void;
570
+ setMosaicBlockSize(size: number): void;
571
+ private applyMosaicConfigPatch;
572
+ private buildMosaicControllerContext;
573
+ /**
574
+ * Enters crop mode: adds a resizable selection rect to the canvas.
575
+ * All other controls are disabled until {@link applyCrop} or
576
+ * {@link cancelCrop} is called.
577
+ *
578
+ * Operation guard: while `isAnimating === true`
579
+ * the call is a silent no-op; opening a crop session in the middle
580
+ * of a queued scale/rotate animation would otherwise allow the
581
+ * animation to mutate `originalImage` while a crop rect is bound to
582
+ * the prior coordinate system.
583
+ *
584
+ * Delegates to {@link enterCropMode} in `crop/crop-controller.ts`,
585
+ * which captures the pre-crop canvas snapshot, freezes every other
586
+ * canvas object's `evented`/`selectable`, captures per-mask style
587
+ * backups when `crop.hideMasksDuringCrop` is `true`, and adds the
588
+ * interactive crop rectangle.
589
+ */
590
+ enterCropMode(): void;
591
+ /**
592
+ * Cancels crop mode and removes the crop rectangle without applying
593
+ * it.
594
+ *
595
+ * Delegates to {@link cancelCrop} in `crop/crop-controller.ts`,
596
+ * which restores the per-object `evented`/`selectable`, restores
597
+ * per-mask style backups, removes the crop rectangle, detaches
598
+ * every crop-bound Fabric handler, and drops the session WITHOUT
599
+ * pushing a history entry.
600
+ */
601
+ cancelCrop(): void;
602
+ /**
603
+ * Applies the current crop rectangle: crops the image and reloads
604
+ * it. Pushes the operation onto the undo/redo history.
605
+ *
606
+ * Operation guard: while `isAnimating === true`
607
+ * the call resolves without mutation. The crop session is left
608
+ * intact so the user can retry once the queued animation settles.
609
+ *
610
+ * Delegates to {@link applyCrop} in `crop/crop-controller.ts`,
611
+ * which reads the crop region, optionally captures intersecting
612
+ * masks for `crop.preserveMasksAfterCrop`, exports the cropped
613
+ * region, reloads it through the transactional loader, and pushes
614
+ * exactly one history entry. On any failure it restores the
615
+ * pre-crop snapshot and rejects with `CropApplyError`.
616
+ *
617
+ * @returns A promise that resolves when the cropped image is loaded.
618
+ */
619
+ applyCrop(): Promise<void>;
620
+ /**
621
+ * Build the {@link CropControllerContext} the crop controller reads
622
+ * through. The facade is the single owner of the live crop session
623
+ * pointer (`cropSession`), the canvas, the resolved options, the
624
+ * history manager, and the transactional loader, so the context's
625
+ * accessors all bind back to `this`.
626
+ */
627
+ private buildCropControllerContext;
628
+ private updateInputs;
629
+ private updateUi;
630
+ private setControlEnabled;
631
+ private recordElementOriginalState;
632
+ private restoreElementOriginalStates;
633
+ private updatePlaceholderStatus;
634
+ /**
635
+ * Cleans up all DOM event listeners and disposes the Fabric.js Canvas.
636
+ * Call this when the editor is no longer needed to prevent memory leaks.
637
+ *
638
+ * Teardown sequence:
639
+ *
640
+ * 1. Short-circuit on a second call so `dispose` is idempotent. This
641
+ * also guards against re-running
642
+ * the teardown path after the canvas reference has already been
643
+ * nulled.
644
+ * 2. Set `isDisposed = true` so in-flight animation `onChange`/
645
+ * `onComplete` callbacks bail before touching the canvas
646
+ * and so disposed-aware DOM handlers
647
+ * exit early.
648
+ * 3. Drain the {@link AnimationQueue} so callers awaiting an enqueued
649
+ * slot do not hang after teardown.
650
+ * The currently-executing entry, if any, is not interrupted but
651
+ * settles promptly because its disposed-aware callbacks see the
652
+ * flag and exit.
653
+ * 4. Detach every DOM listener via the bindings registry's
654
+ * `removeAll`, wrapped in try/catch
655
+ * inside the registry so already-detached listeners do not throw.
656
+ * 5. Drop the crop rectangle if a crop session was open and dispose
657
+ * the underlying Fabric canvas, matching teardown order.
658
+ */
659
+ dispose(): void;
660
+ }
661
+ //# sourceMappingURL=image-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-editor.d.ts","sourceRoot":"","sources":["../../src/image-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH,OAAO,EAGH,KAAK,UAAU,EAClB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACR,mBAAmB,EACnB,YAAY,EACZ,YAAY,EAKZ,kBAAkB,EAClB,sBAAsB,EAGtB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,qBAAqB,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