File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,10 @@ odiff --help
79
79
NodeJS Api is pretty tiny as well. Here is a typescript interface we have:
80
80
81
81
``` ts
82
- type ODiffOptions = {
83
- /** Output only changed pixels over transparent background. */
82
+ export type ODiffOptions = {
83
+ /** Color used to highlight different pixels in the output (in hex format e.g. #cd2cc9). */
84
+ diffColor: string ;
85
+ /** Output full diff image. */
84
86
outputDiffMask: boolean ;
85
87
/** Do not compare images and produce output if images layout is different. */
86
88
failOnLayoutDiff: boolean ;
@@ -94,7 +96,16 @@ declare function compare(
94
96
diffPath : string ,
95
97
options ? : ODiffOptions
96
98
): Promise <
97
- { match: true } | { match: false ; reason: " layout-diff" | " pixel-diff" }
99
+ | { match: true }
100
+ | { match: false ; reason: " layout-diff" }
101
+ | {
102
+ match: false ;
103
+ reason: " pixel-diff" ;
104
+ /** Amount of different pixels */
105
+ diffCount: number ;
106
+ /** Percentage of different pixels in the whole image */
107
+ diffPercentage: number ;
108
+ }
98
109
>;
99
110
```
100
111
You can’t perform that action at this time.
0 commit comments