Skip to content

Commit 8efbe33

Browse files
committed
Add more detail to the ResembleJS docs
1 parent e7a15cc commit 8efbe33

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

resemblejs/resemblejs.d.ts

+17-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
declare namespace Resemble {
77
interface ResembleStatic {
88
/**
9-
* Retrieve basic analysis on one image (add compareTo to compare with another).
9+
* Retrieve basic analysis for a single image (add compareTo to compare with another).
1010
*/
1111
(image: string|ImageData): ResembleAnalysis;
1212

@@ -29,13 +29,13 @@ declare namespace Resemble {
2929

3030
interface ResembleAnalysis {
3131
/**
32-
* Run the analysis and get the result
32+
* Run the analysis on this image and get the result
3333
*/
3434
onComplete(callback: (result: ResembleAnalysisResult) => void): void;
3535

3636
/**
3737
* Compare this image to another image, to get resemblance data
38-
*/
38+
*/
3939
compareTo(fileData: string|ImageData): ResembleComparison;
4040
}
4141

@@ -60,15 +60,29 @@ declare namespace Resemble {
6060
}
6161

6262
interface ResembleComparisonResult {
63+
/**
64+
* Do the two images have the same dimensions?
65+
*/
6366
isSameDimensions: boolean;
67+
68+
/**
69+
* The difference in width and height between the dimensions of the two compared images
70+
*/
6471
dimensionDifference: {
6572
width: number;
6673
height: number;
6774
};
6875

76+
/**
77+
* Get a data URL for the comparison image
78+
*/
6979
getImageDataUrl(): string;
7080

81+
/**
82+
* The percentage of pixels which do not match between the images
83+
*/
7184
misMatchPercentage: number;
85+
7286
diffBounds: {
7387
top: number;
7488
left: number;

0 commit comments

Comments
 (0)