@blazediff/bin 2.0.1 → 2.1.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.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -26,12 +26,16 @@ type BlazeDiffResult = {
|
|
|
26
26
|
file: string;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* Compare two PNG images and generate a diff image.
|
|
29
|
+
* Compare two PNG images and optionally generate a diff image.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* ```ts
|
|
33
|
+
* // With diff output
|
|
33
34
|
* const result = await compare('expected.png', 'actual.png', 'diff.png');
|
|
34
35
|
*
|
|
36
|
+
* // Without diff output (faster, just returns comparison result)
|
|
37
|
+
* const result = await compare('expected.png', 'actual.png');
|
|
38
|
+
*
|
|
35
39
|
* if (result.match) {
|
|
36
40
|
* console.log('Images identical');
|
|
37
41
|
* } else if (result.reason === 'pixel-diff') {
|
|
@@ -39,7 +43,7 @@ type BlazeDiffResult = {
|
|
|
39
43
|
* }
|
|
40
44
|
* ```
|
|
41
45
|
*/
|
|
42
|
-
declare function compare(basePath: string, comparePath: string, diffOutput
|
|
46
|
+
declare function compare(basePath: string, comparePath: string, diffOutput?: string, options?: BlazeDiffOptions): Promise<BlazeDiffResult>;
|
|
43
47
|
/** Get the path to the blazediff binary for direct CLI usage. */
|
|
44
48
|
declare function getBinaryPath(): string;
|
|
45
49
|
|
package/dist/index.d.ts
CHANGED
|
@@ -26,12 +26,16 @@ type BlazeDiffResult = {
|
|
|
26
26
|
file: string;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* Compare two PNG images and generate a diff image.
|
|
29
|
+
* Compare two PNG images and optionally generate a diff image.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* ```ts
|
|
33
|
+
* // With diff output
|
|
33
34
|
* const result = await compare('expected.png', 'actual.png', 'diff.png');
|
|
34
35
|
*
|
|
36
|
+
* // Without diff output (faster, just returns comparison result)
|
|
37
|
+
* const result = await compare('expected.png', 'actual.png');
|
|
38
|
+
*
|
|
35
39
|
* if (result.match) {
|
|
36
40
|
* console.log('Images identical');
|
|
37
41
|
* } else if (result.reason === 'pixel-diff') {
|
|
@@ -39,7 +43,7 @@ type BlazeDiffResult = {
|
|
|
39
43
|
* }
|
|
40
44
|
* ```
|
|
41
45
|
*/
|
|
42
|
-
declare function compare(basePath: string, comparePath: string, diffOutput
|
|
46
|
+
declare function compare(basePath: string, comparePath: string, diffOutput?: string, options?: BlazeDiffOptions): Promise<BlazeDiffResult>;
|
|
43
47
|
/** Get the path to the blazediff binary for direct CLI usage. */
|
|
44
48
|
declare function getBinaryPath(): string;
|
|
45
49
|
|
package/dist/index.js
CHANGED
|
@@ -40,7 +40,9 @@ var import_node_util = require("util");
|
|
|
40
40
|
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
41
41
|
var BINARY_PATH = import_node_path.default.join(__dirname, "..", "bin", "blazediff.exe");
|
|
42
42
|
function buildArgs(diffOutput, options) {
|
|
43
|
-
const args = [
|
|
43
|
+
const args = [];
|
|
44
|
+
if (diffOutput) args.push(diffOutput);
|
|
45
|
+
args.push("--output-format=json");
|
|
44
46
|
if (!options) return args;
|
|
45
47
|
if (options.threshold !== void 0) args.push(`--threshold=${options.threshold}`);
|
|
46
48
|
if (options.antialiasing) args.push("--antialiasing");
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,9 @@ import { promisify } from "util";
|
|
|
12
12
|
var execFileAsync = promisify(execFile);
|
|
13
13
|
var BINARY_PATH = path2.join(__dirname, "..", "bin", "blazediff.exe");
|
|
14
14
|
function buildArgs(diffOutput, options) {
|
|
15
|
-
const args = [
|
|
15
|
+
const args = [];
|
|
16
|
+
if (diffOutput) args.push(diffOutput);
|
|
17
|
+
args.push("--output-format=json");
|
|
16
18
|
if (!options) return args;
|
|
17
19
|
if (options.threshold !== void 0) args.push(`--threshold=${options.threshold}`);
|
|
18
20
|
if (options.antialiasing) args.push("--antialiasing");
|