-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
56 lines (56 loc) · 1.46 KB
/
index.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
export declare type Point = {
x: number;
y: number;
};
/**
* The four corner points of the text block / line / element in
* clockwise order starting with the top left
* point relative to the image in the default
* coordinate space.
**/
export declare type CornerPoints = Array<Point | null>;
/**
* The rectangle that contains the text block / line / element
* relative to the image in the default coordinate space.
*/
export declare type Bounding = {
left: number;
top: number;
height: number;
width: number;
};
/**
* A text element recognized in an image.
* A text element is roughly equivalent to
* a space-separated word in most Latin-script languages.
*/
export declare type MLKTextElement = {
text: string;
cornerPoints: CornerPoints;
bounding: Bounding;
};
/**
* A text line recognized in an image that consists of an array of elements.
* */
export declare type MLKTextLine = {
text: string;
elements: Array<MLKTextElement>;
cornerPoints: CornerPoints;
bounding: Bounding;
};
/**
* A text block recognized in an image that consists of an array of text lines.
*/
export declare type MKLBlock = {
text: string;
lines: MLKTextLine[];
cornerPoints: CornerPoints;
bounding: Bounding;
};
export declare type MlkitOcrResult = MKLBlock[];
declare type MlkitOcrModule = {
detectFromUri(uri: string): Promise<MlkitOcrResult>;
detectFromFile(path: string): Promise<MlkitOcrResult>;
};
declare const MLKit: MlkitOcrModule;
export default MLKit;