5
5
6
6
declare namespace Resemble {
7
7
interface ResembleStatic {
8
+ /**
9
+ * Retrieve basic analysis for a single image (add compareTo to compare with another).
10
+ */
8
11
( image : string | ImageData ) : ResembleAnalysis ;
12
+
13
+ /**
14
+ * Set the resemblance image output style
15
+ */
9
16
outputSettings ( settings : OutputSettings ) : ResembleStatic ;
10
17
}
11
18
@@ -21,7 +28,14 @@ declare namespace Resemble {
21
28
}
22
29
23
30
interface ResembleAnalysis {
31
+ /**
32
+ * Run the analysis on this image and get the result
33
+ */
24
34
onComplete ( callback : ( result : ResembleAnalysisResult ) => void ) : void ;
35
+
36
+ /**
37
+ * Compare this image to another image, to get resemblance data
38
+ */
25
39
compareTo ( fileData : string | ImageData ) : ResembleComparison ;
26
40
}
27
41
@@ -33,6 +47,9 @@ declare namespace Resemble {
33
47
}
34
48
35
49
interface ResembleComparison {
50
+ /**
51
+ * Run the analysis and get the comparison result
52
+ */
36
53
onComplete ( callback : ( result : ResembleComparisonResult ) => void ) : void ;
37
54
38
55
ignoreNothing ( ) : ResembleComparison ;
@@ -43,15 +60,29 @@ declare namespace Resemble {
43
60
}
44
61
45
62
interface ResembleComparisonResult {
63
+ /**
64
+ * Do the two images have the same dimensions?
65
+ */
46
66
isSameDimensions : boolean ;
67
+
68
+ /**
69
+ * The difference in width and height between the dimensions of the two compared images
70
+ */
47
71
dimensionDifference : {
48
72
width : number ;
49
73
height : number ;
50
74
} ;
51
75
76
+ /**
77
+ * Get a data URL for the comparison image
78
+ */
52
79
getImageDataUrl ( ) : string ;
53
80
81
+ /**
82
+ * The percentage of pixels which do not match between the images
83
+ */
54
84
misMatchPercentage : number ;
85
+
55
86
diffBounds : {
56
87
top : number ;
57
88
left : number ;
0 commit comments