/// import { PNGDiffer, DiffResult } from '../interfaces/png-differ'; export interface Color { r: number; g: number; b: number; } export interface PixelDifferOptions { /** * The color used to mark different pixels. */ diffColor?: Color; /** * A number between `0` and `1` representing the max difference in % * between 2 pixels to be considered identical. * * @example * `0` means the pixel need to be identical. * * @example * `1` means two completely different images will be identical. If the * images have different dimension then the comparison will fail. * * @example * `0.1` means black (`#000`) and 90% gray (`#0a0a0a`) will be identical. */ threshold?: number; } /** * Compare screenshots pixel by pixel using * [pixelmatch](https://github.com/mapbox/pixelmatch). * * Images with different dimensions will always fail comparison and a diff * indicating the extra region will be returned. The images will be overlaid * starting from the top left corner and then compared. All of the pixels that * are outside of the intersection will be considered different, no matter the * {@link PixelDifferOptions.threshold | threshold}. * * ![pixel-differ-explanation](media://pixel-differ-explanation.png) * * See the examples below to understand how images with different sizes will be * compared. * * ![pixel-differ-examples](media://pixel-differ-examples.png) */ export declare class PixelDiffer implements PNGDiffer { private readonly diffColor; private readonly threshold; /** * @param __namedParameters {@link PixelDifferOptions} */ constructor({ diffColor, threshold, }?: PixelDifferOptions); compare: (expected: Buffer, actual: Buffer) => Promise; }