-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54217d5
commit b094042
Showing
1 changed file
with
36 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,38 @@ | ||
type Languages = '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 FileTypes = string | 'PDF' | 'GIF' | 'PNG' | 'JPG' | 'TIF' | 'BMP'; | ||
|
||
type ParsedResult = { | ||
ErrorMessage: string; | ||
ErrorDetails: string; | ||
FileParseExitCode: 0 | 1 | -10 | -20 | -30 | -99; | ||
HasOverlay: boolean, | ||
Message: string; | ||
ParsedText: string; | ||
TextOverlay: any; | ||
} | ||
|
||
type OcrSpaceResponse = { | ||
ErrorMessage: string; | ||
ErrorDetails: string; | ||
IsErroredOnProcessing: boolean; | ||
OCRExitCode: number; | ||
ParsedResults: ParsedResult[]; | ||
ProcessingTimeInMilliseconds: number | ||
SearchablePDFURL: string; | ||
} | ||
|
||
type OcrSpaceOptions = { | ||
apiKey?: string; | ||
ocrUrl?: string; | ||
language?: Languages; | ||
isOverlayRequired?: boolean; | ||
filetype?: FileTypes; | ||
detectOrientation?: boolean; | ||
isCreateSearchablePdf?: boolean; | ||
isSearchablePdfHideTextLayer?: boolean; | ||
scale?: boolean; | ||
isTable?: boolean; | ||
OCREngine?: '1' | '2' | '3'; | ||
} | ||
|
||
declare module "ocr-space-api-wrapper" { | ||
export type OcrSpaceLanguages = Languages; | ||
export type OcrSpaceFileTypes = FileTypes; | ||
export function ocrSpace(input: string, options?: OcrSpaceOptions): OcrSpaceResponse; | ||
export function ocrSpace( | ||
input: string, | ||
options?: { | ||
apiKey?: string; | ||
ocrUrl?: string; | ||
language?: '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'; | ||
isOverlayRequired?: boolean; | ||
filetype?: string | 'PDF' | 'GIF' | 'PNG' | 'JPG' | 'TIF' | 'BMP'; | ||
detectOrientation?: boolean; | ||
isCreateSearchablePdf?: boolean; | ||
isSearchablePdfHideTextLayer?: boolean; | ||
scale?: boolean; | ||
isTable?: boolean; | ||
OCREngine?: '1' | '2' | '3'; | ||
} | ||
): { | ||
ErrorMessage: string; | ||
ErrorDetails: string; | ||
IsErroredOnProcessing: boolean; | ||
OCRExitCode: number; | ||
ParsedResults: { | ||
ErrorMessage: string; | ||
ErrorDetails: string; | ||
FileParseExitCode: 0 | 1 | -10 | -20 | -30 | -99; | ||
HasOverlay: boolean, | ||
Message: string; | ||
ParsedText: string; | ||
TextOverlay: any; | ||
}[]; | ||
ProcessingTimeInMilliseconds: number | ||
SearchablePDFURL: string; | ||
}; | ||
} |