Skip to content

Commit b36815c

Browse files
Update ts
1 parent 054be0e commit b36815c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ odiff --help
7979
NodeJS Api is pretty tiny as well. Here is a typescript interface we have:
8080

8181
```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. */
8486
outputDiffMask: boolean;
8587
/** Do not compare images and produce output if images layout is different. */
8688
failOnLayoutDiff: boolean;
@@ -94,7 +96,16 @@ declare function compare(
9496
diffPath: string,
9597
options?: ODiffOptions
9698
): 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+
}
98109
>;
99110
```
100111

0 commit comments

Comments
 (0)