pixel-data-js 0.30.0 → 0.31.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.
@@ -680,6 +680,65 @@ declare function color32ToHex(color: Color32): string;
680
680
  */
681
681
  declare function color32ToCssRGBA(color: Color32): string;
682
682
 
683
+ type BatchedQueueFn = (fn: () => void) => void;
684
+ type BatchedQueue = ReturnType<typeof makeBatchedQueue>;
685
+ /**
686
+ * Creates a high-performance, zero-allocation batching queue.
687
+ * This utility collects items marked as "dirty" and flushes them in a single batch.
688
+ * * **⚠️ CRITICAL: Synchronous Processing Required**
689
+ * Because the internal sets are reused, the `Set` passed to the `processor` is instantly
690
+ * cleared the moment the processor function returns. If you need to process the items
691
+ * asynchronously, you **must** manually clone the set inside your processor.
692
+ * @template T - The type of items being batched.
693
+ * @param processor - The callback executed when the batch flushes. Receives a `Set` of all batched items.
694
+ * @param queue - The scheduling function used to defer the flush. Defaults to `queueMicrotask`.
695
+ * @returns An object containing methods to mark items as dirty.
696
+ * @example
697
+ * * @example
698
+ * ```ts
699
+ * import { nextTick } from 'vue'
700
+ * let bq = makeBatchedQueue<string>(
701
+ * (items) => drawSomething(items),
702
+ * nextTick,
703
+ * )
704
+ * ```
705
+ */
706
+ declare function makeBatchedQueue<T>(processor: (items: Set<T>) => void, queue: BatchedQueueFn): {
707
+ markDirty: (item: T) => void;
708
+ markMultipleDirty: (items: T[]) => void;
709
+ };
710
+
711
+ /**
712
+ * Creates a debounced render queue using `requestAnimationFrame`.
713
+ * This utility ensures that a callback is executed exactly once right before
714
+ * the next visual frame, regardless of how many times the trigger is called
715
+ * synchronously. It safely prevents layout thrashing and redundant computations.
716
+ * @param cb - The function to execute on the next animation frame.
717
+ * @returns A trigger function that schedules the callback. It includes a `.cancel()` method to abort the pending frame.
718
+ * * @example
719
+ * ```ts
720
+ * let renderQueue = makeRenderQueue(() => {
721
+ * console.log('DOM updated!')
722
+ * })
723
+ * * // Calling this multiple times synchronously...
724
+ * renderQueue()
725
+ * renderQueue()
726
+ * renderQueue()
727
+ * * // ...will only result in one 'DOM updated!' log on the next frame.
728
+ * ```
729
+ * * @example
730
+ * ```ts
731
+ * // Canceling a scheduled render (e.g., when a component unmounts)
732
+ * let trigger = makeRenderQueue(updateLayout)
733
+ * trigger()
734
+ * trigger.cancel() // The callback will not execute
735
+ * ```
736
+ */
737
+ declare function makeRenderQueue(cb: () => void): {
738
+ (): void;
739
+ cancel(): void;
740
+ };
741
+
683
742
  declare const enum TileType {
684
743
  PIXEL = 0,
685
744
  MASK = 1
@@ -857,12 +916,11 @@ declare class PixelWriter<M> {
857
916
  * throw immediately to prevent silent data loss from a nested extractPatch.
858
917
  *
859
918
  * @param transaction Callback to be executed inside the transaction.
860
- * @param after Called after both undo and redo — use for generic change notifications.
861
- * @param afterUndo Called after undo only — use for dimension or state changes specific to undo.
919
+ * @param afterUndo Called after undo only.
862
920
  * @param afterRedo Called after redo only.
863
921
  */
864
- withHistory(transaction: (mutator: M) => void, after?: () => void, afterUndo?: () => void, afterRedo?: () => void): void;
865
- resize(newWidth: number, newHeight: number, offsetX?: number, offsetY?: number, after?: (target: ImageData) => void, afterUndo?: (target: ImageData) => void, afterRedo?: (target: ImageData) => void, resizeImageDataFn?: typeof resizeImageData): void;
922
+ withHistory(transaction: (mutator: M) => void, afterUndo?: (patch: PixelPatchTiles) => void, afterRedo?: (patch: PixelPatchTiles) => void): void;
923
+ resize(newWidth: number, newHeight: number, offsetX?: number, offsetY?: number, afterUndo?: (target: ImageData) => void, afterRedo?: (target: ImageData) => void, resizeImageDataFn?: typeof resizeImageData): void;
866
924
  }
867
925
  type HistoryMutator<T extends {}, D extends {}> = (writer: PixelWriter<any>, deps?: Partial<D>) => T;
868
926
 
@@ -1889,4 +1947,4 @@ declare const makeBinaryMaskTile: TileFactory<BinaryMaskTile>;
1889
1947
 
1890
1948
  declare function makePixelTile(id: number, tx: number, ty: number, tileSize: number, tileArea: number): PixelTile;
1891
1949
 
1892
- export { type AlphaMask, AlphaMaskPaintBuffer, type AlphaMaskPaintBufferCanvasRenderer, type AlphaMaskPaintBufferManager, type AlphaMaskRect, type AlphaMaskTile, type ApplyMaskToPixelDataOptions, BASE_FAST_BLEND_MODE_FUNCTIONS, BASE_PERFECT_BLEND_MODE_FUNCTIONS, type Base64EncodedUInt8Array, BaseBlendMode, type BaseBlendModes, type BaseMask, type BasePixelBlendOptions, type BinaryMask, BinaryMaskPaintBuffer, type BinaryMaskPaintBufferCanvasRenderer, type BinaryMaskPaintBufferManager, type BinaryMaskRect, type BinaryMaskTile, type BlendColor32, type BlendModeRegistry, CANVAS_COMPOSITE_MAP, type CanvasBlendModeIndex, type CanvasCompositeOperation, type CanvasContext, type CanvasFrameRenderer, type CanvasObjectFactory, type CanvasPixelDataRenderer, type ClippedBlit, type ClippedRect, type Color32, type ColorBlendMaskOptions, type ColorBlendOptions, ColorPaintBuffer, type ColorPaintBufferCanvasRenderer, type ColorPaintBufferManager, type DidChangeFn, type DrawPixelLayer, type DrawScreenLayer, _errors as ERRORS, type FloodFillResult, type HistoryAction, type HistoryActionFactory, HistoryManager, type HistoryMutator, type ImageDataLike, type IndexedImage, type InvertMask, type Mask, type MaskOffset, type MaskRect, MaskType, type MergeAlphaMasksOptions, type MutableAlphaMask, type MutableBinaryMask, type MutableMask, type MutablePixelData32, type NullableBinaryMaskRect, type NullableMaskRect, type PaintAlphaMask, type PaintBinaryMask, type PaintCursorRenderer, type PaintMask, PaintMaskOutline, PixelAccumulator, type PixelBlendMaskOptions, type PixelBlendOptions, type PixelCanvas, type PixelData, type PixelData32, PixelEngineConfig, type PixelMutateOptions, type PixelPatchTiles, type PixelRect, type PixelTile, PixelWriter, type PixelWriterOptions, type RGBA, type Rect, type RequiredBlendModes, type ReusableCanvas, type ReusableCanvasFactory, type ReusableImageData, type ReusablePixelData, type SerializedImageData, type Tile, type TileFactory, TilePool, TileType, UnsupportedFormatError, _macro_imageDataToUint32Array, applyAlphaMaskToPixelData, applyBinaryMaskToAlphaMask, applyBinaryMaskToPixelData, applyMaskToPixelData, applyPatchTiles, base64DecodeArrayBuffer, base64EncodeArrayBuffer, blendColorPixelData, blendColorPixelDataAlphaMask, blendColorPixelDataBinaryMask, blendColorPixelDataMask, blendColorPixelDataPaintAlphaMask, blendColorPixelDataPaintBinaryMask, blendColorPixelDataPaintMask, blendPixel, blendPixelData, blendPixelDataAlphaMask, blendPixelDataBinaryMask, blendPixelDataMask, blendPixelDataPaintBuffer, clearPixelDataFast, color32ToCssRGBA, color32ToHex, colorBurnFast, colorBurnPerfect, colorDistance, colorDodgeFast, colorDodgePerfect, commitColorPaintBuffer, commitMaskPaintBuffer, copyImageData, copyImageDataLike, copyMask, copyPixelData, darkenFast, darkenPerfect, darkerFast, darkerPerfect, deserializeImageData, deserializeNullableImageData, deserializeRawImageData, destinationAtopFast, destinationAtopPerfect, destinationInFast, destinationInPerfect, destinationOutFast, destinationOutPerfect, destinationOverFast, destinationOverPerfect, differenceFast, differencePerfect, divideFast, dividePerfect, eachTileInBounds, exclusionFast, exclusionPerfect, extractImageDataBuffer, extractMask, extractMaskBuffer, extractPixelData, extractPixelDataBuffer, fileInputChangeToImageData, fileToImageData, fillPixelData, fillPixelDataBinaryMask, fillPixelDataFast, floodFillSelection, forEachLinePoint, getImageDataFromClipboard, getIndexedImageColor, getIndexedImageColorCounts, getRectsBounds, getSupportedPixelFormats, hardLightFast, hardLightPerfect, hardMixFast, hardMixPerfect, imageDataToAlphaMaskBuffer, imageDataToDataUrl, imageDataToImgBlob, imageDataToUint32Array, imgBlobToImageData, indexedImageToAverageColor, indexedImageToImageData, invertAlphaMask, invertBinaryMask, invertImageData, invertPixelData, lerpColor32, lerpColor32Fast, lightenFast, lightenPerfect, lighterFast, lighterPerfect, linearBurnFast, linearBurnPerfect, linearDodgeFast, linearDodgePerfect, linearLightFast, linearLightPerfect, makeAlphaMask, makeAlphaMaskPaintBufferCanvasRenderer, makeAlphaMaskPaintBufferCommitter, makeAlphaMaskPaintBufferManager, makeAlphaMaskTile, makeBinaryMask, makeBinaryMaskFromAlphaMask, makeBinaryMaskOutline, makeBinaryMaskPaintBufferCanvasRenderer, makeBinaryMaskPaintBufferCommitter, makeBinaryMaskPaintBufferManager, makeBinaryMaskTile, makeBlendModeRegistry, makeCanvasFrameRenderer, makeCanvasPixelDataRenderer, makeCircleBinaryMaskOutline, makeCirclePaintAlphaMask, makeCirclePaintBinaryMask, makeClippedBlit, makeClippedRect, makeColorPaintBufferCanvasRenderer, makeColorPaintBufferCommitter, makeColorPaintBufferManager, makeFastBlendModeRegistry, makeFullPixelMutator, makeHistoryAction, makeImageDataLike, makeIndexedImage, makeIndexedImageFromImageData, makeIndexedImageFromImageDataRaw, makePaintAlphaMask, makePaintBinaryMask, makePaintCursorRenderer, makePerfectBlendModeRegistry, makePixelCanvas, makePixelData, makePixelTile, makeRectBinaryMaskOutline, makeRectFalloffPaintAlphaMask, makeReusableCanvas, makeReusableImageData, makeReusableOffscreenCanvas, makeReusablePixelData, merge2BinaryMaskRects, mergeAlphaMasks, mergeBinaryMaskRects, mergeBinaryMasks, multiplyFast, multiplyPerfect, mutatorApplyAlphaMask, mutatorApplyBinaryMask, mutatorApplyMask, mutatorBlendAlphaMask, mutatorBlendBinaryMask, mutatorBlendColor, mutatorBlendColorPaintAlphaMask, mutatorBlendColorPaintBinaryMask, mutatorBlendColorPaintMask, mutatorBlendColorPaintRect, mutatorBlendMask, mutatorBlendPixel, mutatorBlendPixelData, mutatorClear, mutatorFill, mutatorFillBinaryMask, mutatorFillRect, mutatorInvert, overlayFast, overlayPerfect, overwriteBase, overwriteFast, overwritePerfect, packColor, packRGBA, pinLightFast, pinLightPerfect, pixelDataToAlphaMask, reflectPixelDataHorizontal, reflectPixelDataVertical, resampleImageData, resampleIndexedImage, resamplePixelData, resamplePixelDataInPlace, resampleUint32Array, resizeImageData, resolveBlitClipping, resolveRectClipping, rotatePixelData, screenFast, screenPerfect, serializeImageData, serializeNullableImageData, setMaskData, setPixelData, softLightFast, softLightPerfect, sourceAtopFast, sourceAtopPerfect, sourceInFast, sourceInPerfect, sourceOutFast, sourceOutPerfect, sourceOverFast, sourceOverPerfect, subtractBinaryMaskRects, subtractFast, subtractPerfect, toBlendModeIndexAndName, trimMaskRectBounds, trimRectBounds, uInt32ArrayToImageData, uInt32ArrayToImageDataLike, uInt32ArrayToPixelData, unpackAlpha, unpackBlue, unpackColor, unpackColorTo, unpackGreen, unpackRed, vividLightFast, vividLightPerfect, writeImageData, writeImageDataBuffer, writeImageDataToClipboard, writeImgBlobToClipboard, writePaintBufferToPixelData, writePixelDataBuffer, xorFast, xorPerfect };
1950
+ export { type AlphaMask, AlphaMaskPaintBuffer, type AlphaMaskPaintBufferCanvasRenderer, type AlphaMaskPaintBufferManager, type AlphaMaskRect, type AlphaMaskTile, type ApplyMaskToPixelDataOptions, BASE_FAST_BLEND_MODE_FUNCTIONS, BASE_PERFECT_BLEND_MODE_FUNCTIONS, type Base64EncodedUInt8Array, BaseBlendMode, type BaseBlendModes, type BaseMask, type BasePixelBlendOptions, type BatchedQueue, type BatchedQueueFn, type BinaryMask, BinaryMaskPaintBuffer, type BinaryMaskPaintBufferCanvasRenderer, type BinaryMaskPaintBufferManager, type BinaryMaskRect, type BinaryMaskTile, type BlendColor32, type BlendModeRegistry, CANVAS_COMPOSITE_MAP, type CanvasBlendModeIndex, type CanvasCompositeOperation, type CanvasContext, type CanvasFrameRenderer, type CanvasObjectFactory, type CanvasPixelDataRenderer, type ClippedBlit, type ClippedRect, type Color32, type ColorBlendMaskOptions, type ColorBlendOptions, ColorPaintBuffer, type ColorPaintBufferCanvasRenderer, type ColorPaintBufferManager, type DidChangeFn, type DrawPixelLayer, type DrawScreenLayer, _errors as ERRORS, type FloodFillResult, type HistoryAction, type HistoryActionFactory, HistoryManager, type HistoryMutator, type ImageDataLike, type IndexedImage, type InvertMask, type Mask, type MaskOffset, type MaskRect, MaskType, type MergeAlphaMasksOptions, type MutableAlphaMask, type MutableBinaryMask, type MutableMask, type MutablePixelData32, type NullableBinaryMaskRect, type NullableMaskRect, type PaintAlphaMask, type PaintBinaryMask, type PaintCursorRenderer, type PaintMask, PaintMaskOutline, PixelAccumulator, type PixelBlendMaskOptions, type PixelBlendOptions, type PixelCanvas, type PixelData, type PixelData32, PixelEngineConfig, type PixelMutateOptions, type PixelPatchTiles, type PixelRect, type PixelTile, PixelWriter, type PixelWriterOptions, type RGBA, type Rect, type RequiredBlendModes, type ReusableCanvas, type ReusableCanvasFactory, type ReusableImageData, type ReusablePixelData, type SerializedImageData, type Tile, type TileFactory, TilePool, TileType, UnsupportedFormatError, _macro_imageDataToUint32Array, applyAlphaMaskToPixelData, applyBinaryMaskToAlphaMask, applyBinaryMaskToPixelData, applyMaskToPixelData, applyPatchTiles, base64DecodeArrayBuffer, base64EncodeArrayBuffer, blendColorPixelData, blendColorPixelDataAlphaMask, blendColorPixelDataBinaryMask, blendColorPixelDataMask, blendColorPixelDataPaintAlphaMask, blendColorPixelDataPaintBinaryMask, blendColorPixelDataPaintMask, blendPixel, blendPixelData, blendPixelDataAlphaMask, blendPixelDataBinaryMask, blendPixelDataMask, blendPixelDataPaintBuffer, clearPixelDataFast, color32ToCssRGBA, color32ToHex, colorBurnFast, colorBurnPerfect, colorDistance, colorDodgeFast, colorDodgePerfect, commitColorPaintBuffer, commitMaskPaintBuffer, copyImageData, copyImageDataLike, copyMask, copyPixelData, darkenFast, darkenPerfect, darkerFast, darkerPerfect, deserializeImageData, deserializeNullableImageData, deserializeRawImageData, destinationAtopFast, destinationAtopPerfect, destinationInFast, destinationInPerfect, destinationOutFast, destinationOutPerfect, destinationOverFast, destinationOverPerfect, differenceFast, differencePerfect, divideFast, dividePerfect, eachTileInBounds, exclusionFast, exclusionPerfect, extractImageDataBuffer, extractMask, extractMaskBuffer, extractPixelData, extractPixelDataBuffer, fileInputChangeToImageData, fileToImageData, fillPixelData, fillPixelDataBinaryMask, fillPixelDataFast, floodFillSelection, forEachLinePoint, getImageDataFromClipboard, getIndexedImageColor, getIndexedImageColorCounts, getRectsBounds, getSupportedPixelFormats, hardLightFast, hardLightPerfect, hardMixFast, hardMixPerfect, imageDataToAlphaMaskBuffer, imageDataToDataUrl, imageDataToImgBlob, imageDataToUint32Array, imgBlobToImageData, indexedImageToAverageColor, indexedImageToImageData, invertAlphaMask, invertBinaryMask, invertImageData, invertPixelData, lerpColor32, lerpColor32Fast, lightenFast, lightenPerfect, lighterFast, lighterPerfect, linearBurnFast, linearBurnPerfect, linearDodgeFast, linearDodgePerfect, linearLightFast, linearLightPerfect, makeAlphaMask, makeAlphaMaskPaintBufferCanvasRenderer, makeAlphaMaskPaintBufferCommitter, makeAlphaMaskPaintBufferManager, makeAlphaMaskTile, makeBatchedQueue, makeBinaryMask, makeBinaryMaskFromAlphaMask, makeBinaryMaskOutline, makeBinaryMaskPaintBufferCanvasRenderer, makeBinaryMaskPaintBufferCommitter, makeBinaryMaskPaintBufferManager, makeBinaryMaskTile, makeBlendModeRegistry, makeCanvasFrameRenderer, makeCanvasPixelDataRenderer, makeCircleBinaryMaskOutline, makeCirclePaintAlphaMask, makeCirclePaintBinaryMask, makeClippedBlit, makeClippedRect, makeColorPaintBufferCanvasRenderer, makeColorPaintBufferCommitter, makeColorPaintBufferManager, makeFastBlendModeRegistry, makeFullPixelMutator, makeHistoryAction, makeImageDataLike, makeIndexedImage, makeIndexedImageFromImageData, makeIndexedImageFromImageDataRaw, makePaintAlphaMask, makePaintBinaryMask, makePaintCursorRenderer, makePerfectBlendModeRegistry, makePixelCanvas, makePixelData, makePixelTile, makeRectBinaryMaskOutline, makeRectFalloffPaintAlphaMask, makeRenderQueue, makeReusableCanvas, makeReusableImageData, makeReusableOffscreenCanvas, makeReusablePixelData, merge2BinaryMaskRects, mergeAlphaMasks, mergeBinaryMaskRects, mergeBinaryMasks, multiplyFast, multiplyPerfect, mutatorApplyAlphaMask, mutatorApplyBinaryMask, mutatorApplyMask, mutatorBlendAlphaMask, mutatorBlendBinaryMask, mutatorBlendColor, mutatorBlendColorPaintAlphaMask, mutatorBlendColorPaintBinaryMask, mutatorBlendColorPaintMask, mutatorBlendColorPaintRect, mutatorBlendMask, mutatorBlendPixel, mutatorBlendPixelData, mutatorClear, mutatorFill, mutatorFillBinaryMask, mutatorFillRect, mutatorInvert, overlayFast, overlayPerfect, overwriteBase, overwriteFast, overwritePerfect, packColor, packRGBA, pinLightFast, pinLightPerfect, pixelDataToAlphaMask, reflectPixelDataHorizontal, reflectPixelDataVertical, resampleImageData, resampleIndexedImage, resamplePixelData, resamplePixelDataInPlace, resampleUint32Array, resizeImageData, resolveBlitClipping, resolveRectClipping, rotatePixelData, screenFast, screenPerfect, serializeImageData, serializeNullableImageData, setMaskData, setPixelData, softLightFast, softLightPerfect, sourceAtopFast, sourceAtopPerfect, sourceInFast, sourceInPerfect, sourceOutFast, sourceOutPerfect, sourceOverFast, sourceOverPerfect, subtractBinaryMaskRects, subtractFast, subtractPerfect, toBlendModeIndexAndName, trimMaskRectBounds, trimRectBounds, uInt32ArrayToImageData, uInt32ArrayToImageDataLike, uInt32ArrayToPixelData, unpackAlpha, unpackBlue, unpackColor, unpackColorTo, unpackGreen, unpackRed, vividLightFast, vividLightPerfect, writeImageData, writeImageDataBuffer, writeImageDataToClipboard, writeImgBlobToClipboard, writePaintBufferToPixelData, writePixelDataBuffer, xorFast, xorPerfect };
@@ -2025,6 +2025,67 @@ async function writeImageDataToClipboard(imageData) {
2025
2025
  return writeImgBlobToClipboard(blob);
2026
2026
  }
2027
2027
 
2028
+ // src/Control/BatchedQueue.ts
2029
+ function makeBatchedQueue(processor, queue) {
2030
+ let activeSet = /* @__PURE__ */ new Set();
2031
+ let processingSet = /* @__PURE__ */ new Set();
2032
+ let scheduled = false;
2033
+ const flush = () => {
2034
+ const current = activeSet;
2035
+ activeSet = processingSet;
2036
+ processingSet = current;
2037
+ scheduled = false;
2038
+ try {
2039
+ processor(processingSet);
2040
+ } finally {
2041
+ processingSet.clear();
2042
+ }
2043
+ };
2044
+ function markDirty(item) {
2045
+ activeSet.add(item);
2046
+ if (!scheduled) {
2047
+ scheduled = true;
2048
+ queue(flush);
2049
+ }
2050
+ }
2051
+ function markMultipleDirty(items) {
2052
+ let len = items.length;
2053
+ if (len === 0) return;
2054
+ for (let i = 0; i < len; i++) {
2055
+ activeSet.add(items[i]);
2056
+ }
2057
+ if (!scheduled) {
2058
+ scheduled = true;
2059
+ queue(flush);
2060
+ }
2061
+ }
2062
+ return {
2063
+ markDirty,
2064
+ markMultipleDirty
2065
+ };
2066
+ }
2067
+
2068
+ // src/Control/RenderQueue.ts
2069
+ function makeRenderQueue(cb) {
2070
+ let needsRender = false;
2071
+ let frameId = 0;
2072
+ const trigger = () => {
2073
+ if (needsRender) return;
2074
+ needsRender = true;
2075
+ frameId = requestAnimationFrame(() => {
2076
+ needsRender = false;
2077
+ cb();
2078
+ });
2079
+ };
2080
+ trigger.cancel = () => {
2081
+ if (needsRender) {
2082
+ cancelAnimationFrame(frameId);
2083
+ needsRender = false;
2084
+ }
2085
+ };
2086
+ return trigger;
2087
+ }
2088
+
2028
2089
  // src/History/PixelPatchTiles.ts
2029
2090
  function applyPatchTiles(target, tiles, tileSize) {
2030
2091
  for (let i = 0; i < tiles.length; i++) {
@@ -2587,11 +2648,10 @@ var PixelWriter = class {
2587
2648
  * throw immediately to prevent silent data loss from a nested extractPatch.
2588
2649
  *
2589
2650
  * @param transaction Callback to be executed inside the transaction.
2590
- * @param after Called after both undo and redo — use for generic change notifications.
2591
- * @param afterUndo Called after undo only — use for dimension or state changes specific to undo.
2651
+ * @param afterUndo Called after undo only.
2592
2652
  * @param afterRedo Called after redo only.
2593
2653
  */
2594
- withHistory(transaction, after, afterUndo, afterRedo) {
2654
+ withHistory(transaction, afterUndo, afterRedo) {
2595
2655
  if (this._inProgress) {
2596
2656
  throw new Error("withHistory is not re-entrant \u2014 commit or rollback the current operation first");
2597
2657
  }
@@ -2606,10 +2666,10 @@ var PixelWriter = class {
2606
2666
  }
2607
2667
  if (this.accumulator.beforeTiles.length === 0) return;
2608
2668
  const patch = this.accumulator.extractPatch();
2609
- const action = this.historyActionFactory(this.config, this.accumulator, patch, after, afterUndo, afterRedo);
2669
+ const action = this.historyActionFactory(this.config, this.accumulator, patch, afterUndo, afterRedo);
2610
2670
  this.historyManager.commit(action);
2611
2671
  }
2612
- resize(newWidth, newHeight, offsetX = 0, offsetY = 0, after, afterUndo, afterRedo, resizeImageDataFn = resizeImageData) {
2672
+ resize(newWidth, newHeight, offsetX = 0, offsetY = 0, afterUndo, afterRedo, resizeImageDataFn = resizeImageData) {
2613
2673
  if (this._inProgress) {
2614
2674
  throw new Error("Cannot resize inside a withHistory callback");
2615
2675
  }
@@ -2625,12 +2685,10 @@ var PixelWriter = class {
2625
2685
  undo: () => {
2626
2686
  setPixelData(target, beforeImageData);
2627
2687
  afterUndo?.(beforeImageData);
2628
- after?.(beforeImageData);
2629
2688
  },
2630
2689
  redo: () => {
2631
2690
  setPixelData(target, afterImageData);
2632
2691
  afterRedo?.(afterImageData);
2633
- after?.(afterImageData);
2634
2692
  }
2635
2693
  });
2636
2694
  }
@@ -6424,6 +6482,7 @@ export {
6424
6482
  makeAlphaMaskPaintBufferCommitter,
6425
6483
  makeAlphaMaskPaintBufferManager,
6426
6484
  makeAlphaMaskTile,
6485
+ makeBatchedQueue,
6427
6486
  makeBinaryMask,
6428
6487
  makeBinaryMaskFromAlphaMask,
6429
6488
  makeBinaryMaskOutline,
@@ -6458,6 +6517,7 @@ export {
6458
6517
  makePixelTile,
6459
6518
  makeRectBinaryMaskOutline,
6460
6519
  makeRectFalloffPaintAlphaMask,
6520
+ makeRenderQueue,
6461
6521
  makeReusableCanvas,
6462
6522
  makeReusableImageData,
6463
6523
  makeReusableOffscreenCanvas,