@blazediff/bin 3.1.0 → 3.1.1
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/package.json +8 -7
- package/dist/index.d.mts +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blazediff/bin",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Native Rust binaries for blazediff - the fastest image diff in the world",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@blazediff/bin-darwin-arm64": "3.1.
|
|
24
|
-
"@blazediff/bin-darwin-x64": "3.1.
|
|
25
|
-
"@blazediff/bin-linux-arm64": "3.1.
|
|
26
|
-
"@blazediff/bin-linux-x64": "3.1.
|
|
27
|
-
"@blazediff/bin-win32-arm64": "3.1.
|
|
28
|
-
"@blazediff/bin-win32-x64": "3.1.
|
|
23
|
+
"@blazediff/bin-darwin-arm64": "3.1.1",
|
|
24
|
+
"@blazediff/bin-darwin-x64": "3.1.1",
|
|
25
|
+
"@blazediff/bin-linux-arm64": "3.1.1",
|
|
26
|
+
"@blazediff/bin-linux-x64": "3.1.1",
|
|
27
|
+
"@blazediff/bin-win32-arm64": "3.1.1",
|
|
28
|
+
"@blazediff/bin-win32-x64": "3.1.1"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|
|
31
31
|
"image",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"typescript": "5.9.2"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
53
54
|
"build": "tsup",
|
|
54
55
|
"clean": "rm -rf dist"
|
|
55
56
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
interface BlazeDiffOptions {
|
|
2
|
-
/** Color difference threshold (0.0-1.0). Lower = more strict. Default: 0.1 */
|
|
3
|
-
threshold?: number;
|
|
4
|
-
/** Enable anti-aliasing detection to exclude AA pixels from diff count */
|
|
5
|
-
antialiasing?: boolean;
|
|
6
|
-
/** Output only differences with transparent background */
|
|
7
|
-
diffMask?: boolean;
|
|
8
|
-
/** Fail immediately if images have different dimensions */
|
|
9
|
-
failOnLayoutDiff?: boolean;
|
|
10
|
-
/** PNG compression level (0-9, 0=fastest/largest, 9=slowest/smallest) */
|
|
11
|
-
compression?: number;
|
|
12
|
-
/** JPEG quality (1-100). Default: 90 */
|
|
13
|
-
quality?: number;
|
|
14
|
-
}
|
|
15
|
-
type BlazeDiffResult = {
|
|
16
|
-
match: true;
|
|
17
|
-
} | {
|
|
18
|
-
match: false;
|
|
19
|
-
reason: "layout-diff";
|
|
20
|
-
} | {
|
|
21
|
-
match: false;
|
|
22
|
-
reason: "pixel-diff";
|
|
23
|
-
diffCount: number;
|
|
24
|
-
diffPercentage: number;
|
|
25
|
-
} | {
|
|
26
|
-
match: false;
|
|
27
|
-
reason: "file-not-exists";
|
|
28
|
-
file: string;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Compare two images (PNG or JPEG) and optionally generate a diff image.
|
|
32
|
-
*
|
|
33
|
-
* Uses native N-API bindings when available for ~10-100x better performance
|
|
34
|
-
* on small images (no process spawn overhead). Falls back to execFile if
|
|
35
|
-
* native bindings are unavailable.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* // With diff output
|
|
40
|
-
* const result = await compare('expected.png', 'actual.png', 'diff.png');
|
|
41
|
-
*
|
|
42
|
-
* // Without diff output (faster, just returns comparison result)
|
|
43
|
-
* const result = await compare('expected.png', 'actual.png');
|
|
44
|
-
*
|
|
45
|
-
* if (result.match) {
|
|
46
|
-
* console.log('Images identical');
|
|
47
|
-
* } else if (result.reason === 'pixel-diff') {
|
|
48
|
-
* console.log(`${result.diffCount} pixels differ`);
|
|
49
|
-
* }
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
declare function compare(basePath: string, comparePath: string, diffOutput?: string, options?: BlazeDiffOptions): Promise<BlazeDiffResult>;
|
|
53
|
-
/** Get the path to the blazediff binary for direct CLI usage. */
|
|
54
|
-
declare function getBinaryPath(): string;
|
|
55
|
-
/**
|
|
56
|
-
* Check if native N-API bindings are available.
|
|
57
|
-
* Returns true if the native module loaded successfully.
|
|
58
|
-
*/
|
|
59
|
-
declare function hasNativeBinding(): boolean;
|
|
60
|
-
|
|
61
|
-
export { type BlazeDiffOptions, type BlazeDiffResult, compare, getBinaryPath, hasNativeBinding };
|