ocr-space-api-wrapper 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +40 -1
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,3 +1,42 @@
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
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,7 +35,7 @@
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"