pixel-data-js 0.29.0 → 0.30.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.
package/dist/index.prod.d.ts
CHANGED
|
@@ -759,7 +759,7 @@ interface HistoryAction {
|
|
|
759
759
|
dispose?: () => void;
|
|
760
760
|
}
|
|
761
761
|
type HistoryActionFactory = typeof makeHistoryAction;
|
|
762
|
-
declare function makeHistoryAction(config: PixelEngineConfig, accumulator: PixelAccumulator, patch: PixelPatchTiles,
|
|
762
|
+
declare function makeHistoryAction(config: PixelEngineConfig, accumulator: PixelAccumulator, patch: PixelPatchTiles, afterUndo?: (patch: PixelPatchTiles) => void, afterRedo?: (patch: PixelPatchTiles) => void, applyPatchTilesFn?: typeof applyPatchTiles): HistoryAction;
|
|
763
763
|
|
|
764
764
|
declare class HistoryManager {
|
|
765
765
|
maxSteps: number;
|
package/dist/index.prod.js
CHANGED
|
@@ -2050,19 +2050,17 @@ function applyPatchTiles(target, tiles, tileSize) {
|
|
|
2050
2050
|
}
|
|
2051
2051
|
|
|
2052
2052
|
// src/History/HistoryAction.ts
|
|
2053
|
-
function makeHistoryAction(config, accumulator, patch,
|
|
2053
|
+
function makeHistoryAction(config, accumulator, patch, afterUndo, afterRedo, applyPatchTilesFn = applyPatchTiles) {
|
|
2054
2054
|
const target = config.target;
|
|
2055
2055
|
const tileSize = config.tileSize;
|
|
2056
2056
|
return {
|
|
2057
2057
|
undo: () => {
|
|
2058
2058
|
applyPatchTilesFn(target, patch.beforeTiles, tileSize);
|
|
2059
|
-
afterUndo?.();
|
|
2060
|
-
after?.();
|
|
2059
|
+
afterUndo?.(patch);
|
|
2061
2060
|
},
|
|
2062
2061
|
redo: () => {
|
|
2063
2062
|
applyPatchTilesFn(target, patch.afterTiles, tileSize);
|
|
2064
|
-
afterRedo?.();
|
|
2065
|
-
after?.();
|
|
2063
|
+
afterRedo?.(patch);
|
|
2066
2064
|
},
|
|
2067
2065
|
dispose: () => accumulator.recyclePatch(patch)
|
|
2068
2066
|
};
|