UNPKG

dotting

Version:

Dotting is a pixel art editor component library for react

20 lines (19 loc) 792 B
import { ColorChangeItem } from "../components/Canvas/types"; /** * This class is used to record the changes of pixels. * It will record the changes of pixels and record the changes in two arrays: rawChanges and effectiveChanges. * * `getRawChanges()`returns an array that recorded all the changes of pixels whether or not the pixel has been already changed. * * `getEffectiveChanges()` returns an array of changes that will later be applied to the canvas. */ export declare class PixelChangeRecords { private rawChanges; private effectiveChangesMap; constructor(); record(pixel: ColorChangeItem): void; reset(): void; getIsChanged(): boolean; getRawChanges(): Array<ColorChangeItem>; getEffectiveChanges(): Array<ColorChangeItem>; }