forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resemblejs.d.ts
66 lines (54 loc) · 1.52 KB
/
resemblejs.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Type definitions for Resemble.js v1.3.0
// Project: http://huddle.github.io/Resemble.js/
// Definitions by: Tim Perry <https://github.com/pimterry>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Resemble {
interface ResembleStatic {
(image: string|ImageData): ResembleAnalysis;
outputSettings(settings: OutputSettings): ResembleStatic;
}
interface OutputSettings {
errorColor: {
red: number;
green: number;
blue: number;
};
errorType: string;
transparency: number;
largeImageThreshold: number;
}
interface ResembleAnalysis {
onComplete(callback: (result: ResembleAnalysisResult) => void): void;
compareTo(fileData: string|ImageData): ResembleComparison;
}
interface ResembleAnalysisResult {
red: number;
green: number;
blue: number;
brightness: number;
}
interface ResembleComparison {
onComplete(callback: (result: ResembleComparisonResult) => void): void;
ignoreNothing(): ResembleComparison;
ignoreAntialiasing(): ResembleComparison;
ignoreColors(): ResembleComparison;
repaint(): ResembleComparison;
}
interface ResembleComparisonResult {
isSameDimensions: boolean;
dimensionDifference: {
width: number;
height: number;
};
getImageDataUrl(): string;
misMatchPercentage: number;
diffBounds: {
top: number;
left: number;
bottom: number;
right: number;
};
analysisTime: number;
}
}
declare var resemble: Resemble.ResembleStatic;