-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
48 lines (44 loc) · 1.49 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
declare module "ocr-space-api-wrapper" {
type OcrSpaceLanguages = 'ara' | 'bul' | 'chs' | 'cht' | 'hrv' | 'cze' | 'dan' | 'dut' |
'eng' | 'fin' | 'fre' | 'ger' | 'gre' | 'hun' | 'kor' | 'ita' | 'jpn' | 'pol' |
'por' | 'rus' | 'slv' | 'spa' | 'swe' | 'tur' |
// The following are only supported by OCREngine = '3'
'hin' | 'kan' | 'per' | 'tel' | 'tam' | 'tai' | 'vie';
type OcrSpaceFileTypes = string | 'PDF' | 'GIF' | 'PNG' | 'JPG' | 'TIF' | 'BMP';
export type OcrSpaceOptions = {
apiKey?: string;
ocrUrl?: string;
language?: OcrSpaceLanguages;
isOverlayRequired?: boolean;
filetype?: OcrSpaceFileTypes;
detectOrientation?: boolean;
isCreateSearchablePdf?: boolean;
isSearchablePdfHideTextLayer?: boolean;
scale?: boolean;
isTable?: boolean;
OCREngine?: '1' | '2' | '3';
};
export type OcrSpaceParsedResult = {
ErrorMessage: string;
ErrorDetails: string;
FileParseExitCode: 0 | 1 | -10 | -20 | -30 | -99;
HasOverlay: boolean;
Message: string;
ParsedText: string;
TextOverlay: {
Lines: any[];
HasOverlay: boolean;
Message: string;
};
}
export type OcrSpaceResponse = {
ErrorMessage: string;
ErrorDetails: string;
IsErroredOnProcessing: boolean;
OCRExitCode: number;
ParsedResults: OcrSpaceParsedResult[];
ProcessingTimeInMilliseconds: number
SearchablePDFURL: string;
};
export function ocrSpace(input: string, options?: OcrSpaceOptions): Promise<OcrSpaceResponse>;
}