mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Update looks-same import syntax
This commit is contained in:
parent
6623749f9d
commit
b9311a23e3
3
types/looks-same/index.d.ts
vendored
3
types/looks-same/index.d.ts
vendored
@ -116,10 +116,12 @@ declare function looksSame(image1: string, image2: string, options: LooksSameOpt
|
||||
* @param callback Call when finish compare
|
||||
*/
|
||||
declare function looksSame(image1: string, image2: string, callback: LooksSameCallback): void;
|
||||
|
||||
// https://stackoverflow.com/questions/44058101/typescript-declare-third-party-modules
|
||||
declare namespace looksSame {
|
||||
function createDiff(options: CreateDiffOptions, callback: (error: Error | null) => any): void;
|
||||
function createDiff(options: CreateDiffAsBufferOptions, callback: (error: Error | null, buffer: Buffer) => any): void;
|
||||
|
||||
/**
|
||||
* Compare two colors
|
||||
* @param color1 The first color
|
||||
@ -128,6 +130,7 @@ declare namespace looksSame {
|
||||
*/
|
||||
function colors(color1: LooksSameColor, color2: LooksSameColor, options: { tolerance: number }): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Node.js library for comparing PNG-images, taking into account human color perception.
|
||||
* It is created specially for the needs of visual regression testing for gemini utility, but can be used for other purposes.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as looksSame from 'looks-same';
|
||||
import looksSame = require('looks-same');
|
||||
|
||||
looksSame('image1.png', 'image2.png', (error, equal) => {
|
||||
// equal will be true, if images looks the same
|
||||
|
||||
Loading…
Reference in New Issue
Block a user