diff --git a/types/looks-same/index.d.ts b/types/looks-same/index.d.ts index 53c2afe504..6423e5fe4c 100644 --- a/types/looks-same/index.d.ts +++ b/types/looks-same/index.d.ts @@ -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. diff --git a/types/looks-same/looks-same-tests.ts b/types/looks-same/looks-same-tests.ts index cf7d8815d6..f788d2119e 100644 --- a/types/looks-same/looks-same-tests.ts +++ b/types/looks-same/looks-same-tests.ts @@ -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