File tree Expand file tree Collapse file tree 3 files changed +67
-28
lines changed Expand file tree Collapse file tree 3 files changed +67
-28
lines changed Original file line number Diff line number Diff line change 1
1
declare module "ocr-space-api-wrapper" {
2
- export function ocrSpace ( input : string , options ?: any ) : any ;
2
+ type OcrSpaceLanguages = 'ara' | 'bul' | 'chs' | 'cht' | 'hrv' | 'cze' | 'dan' | 'dut' |
3
+ 'eng' | 'fin' | 'fre' | 'ger' | 'gre' | 'hun' | 'kor' | 'ita' | 'jpn' | 'pol' |
4
+ 'por' | 'rus' | 'slv' | 'spa' | 'swe' | 'tur' |
5
+ // The following are only supported by OCREngine = '3'
6
+ 'hin' | 'kan' | 'per' | 'tel' | 'tam' | 'tai' | 'vie' ;
7
+ type OcrSpaceFileTypes = string | 'PDF' | 'GIF' | 'PNG' | 'JPG' | 'TIF' | 'BMP' ;
8
+
9
+ export type OcrSpaceOptions = {
10
+ apiKey ?: string ;
11
+ ocrUrl ?: string ;
12
+ language ?: OcrSpaceLanguages ;
13
+ isOverlayRequired ?: boolean ;
14
+ filetype ?: OcrSpaceFileTypes ;
15
+ detectOrientation ?: boolean ;
16
+ isCreateSearchablePdf ?: boolean ;
17
+ isSearchablePdfHideTextLayer ?: boolean ;
18
+ scale ?: boolean ;
19
+ isTable ?: boolean ;
20
+ OCREngine ?: '1' | '2' | '3' ;
21
+ } ;
22
+
23
+ type OcrSpaceResponse = {
24
+ ErrorMessage : string ;
25
+ ErrorDetails : string ;
26
+ IsErroredOnProcessing : boolean ;
27
+ OCRExitCode : number ;
28
+ ParsedResults : {
29
+ ErrorMessage : string ;
30
+ ErrorDetails : string ;
31
+ FileParseExitCode : 0 | 1 | - 10 | - 20 | - 30 | - 99 ;
32
+ HasOverlay : boolean ,
33
+ Message : string ;
34
+ ParsedText : string ;
35
+ TextOverlay : any ;
36
+ } [ ] ;
37
+ ProcessingTimeInMilliseconds : number
38
+ SearchablePDFURL : string ;
39
+ } ;
40
+
41
+ export function ocrSpace ( input : string , options ?: OcrSpaceOptions ) : OcrSpaceResponse ;
3
42
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ocr-space-api-wrapper" ,
3
- "version" : " 2.2 .0" ,
3
+ "version" : " 2.3 .0" ,
4
4
"description" : " Node.js wrapper for ocr.space APIs." ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
35
35
"form-data" : " ^4.0.0"
36
36
},
37
37
"devDependencies" : {
38
- "eslint" : " ^8.33 .0" ,
38
+ "eslint" : " ^8.42 .0" ,
39
39
"eslint-config-google" : " ^0.14.0" ,
40
40
"mocha" : " ^10.2.0" ,
41
41
"nyc" : " ^15.1.0"
You can’t perform that action at this time.
0 commit comments