DefinitelyTyped/types/dwt/addon.ocrp.d.ts
lincoln 7c60c01ab5 v14.3.1 (#35615)
* fix bugs with types

* fixed type errors

* more type errors fixed

* fixed errors and added missing type definitions

* fix all typos and added all missing ones

* change inappropriate names

* Updated names to be more accurate.

* adds EnumDWT_ConvertMode to make compatible with the old enum

* update to 14.2

* add v13

* delete v13 for test not pass

* remove base64

* fixed conflict

* add back GetLicenseInfo

* change header version to 14.2

* Added definitions for new APIs as well as APIs whose definitions were missing before. Also adding APIs for addons

* remove unused file

* adding types for barcode reader and changing the copyright year

* comment change, TS to 3.2.2

* adds more definitions to dwt barcode reader

* rollback

* update

* update index.d.ts

* Update Dynamsoft.d.ts

It's ok

* Update index.d.ts

1. update 2017 -> 2019
2. update parameters

* Update index.d.ts

rollback

* Update index.d.ts

rollback

* Update addon.pdf.ts

rollback

* Update index.d.ts

rollback

* Update index.d.ts

rollback

* Update index.d.ts

rollback

* Update index.d.ts

rollback

* Update index.d.ts

no changes but whites

* Update index.d.ts

TypeScript Version can be 3.2
2017 => 2019

* Update index.d.ts

rollback

* update

* Update index.d.ts

start new request

* Update index.d.ts

delete this file

* Update

delete this file

* a

a

* rollback

* update

* remove package.json

* add current version to v13

* 1) update to version 14.3.1
2) change index.d.ts declare Dynamsoft

* update comments

* remove WebTWAIN.d.ts

* change v13 tsconfig.json

* change to v14.3.1

* change to v14.3.1

* change to version 14.3

* change to version 14.3

* update

* update

* Update index.d.ts

* Update index.d.ts

* Update tsconfig.json

* Update tsconfig.json

* update

* update

* aa

* a

* a

* update

* remove dwt.d.ts

* remove v12

* update1

* update

* update

* a

* a

* a

* a

* a

* a

* a

* a

* d

* a

* a

* b

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d

* d
2019-05-22 10:57:27 -07:00

175 lines
5.7 KiB
TypeScript

// tslint:disable:jsdoc-format
// tslint:disable:max-line-length
// tslint:disable:no-irregular-whitespace
/*!
* Product: Dynamsoft Web Twain
* Web Site: http://www.dynamsoft.com
*
* Copyright 2019, Dynamsoft Corporation
* Author: Dynamsoft Support Team
*/
interface Redaction {
FindText: string;
FindTextFlags: EnumDWT_OCRFindTextFlags.OCRFT_WHOLEWORD;
FindTextAction: EnumDWT_OCRFindTextAction.OCRFT_MARKFORREDACT;
}
interface OCRZone {
left: number;
top: number;
right: number;
bottom: number;
}
interface OCRReadPara {
STWAIN: WebTwain;
AjaxFunctionUrl: string;
FunctionName: string;
ImageIndex: number;
FileNames: string;
Type: string;
AryZone: number[];
JsonString: string;
OnSuccess(): void;
OnFailure(): void;
}
interface OCRError {
responseText: string;
errorString: string;
}
interface Settings {
RecognitionModule: string;
Languages: string;
OutputFormat: EnumDWT_OCRProOutputFormat;
PDFVersion: EnumDWT_OCRProPDFVersion;
PDFAVersion: EnumDWT_OCRProPDFAVersion;
LicenseChecker: string;
Redaction: Redaction;
}
interface DynamsoftLib {
NewRedaction(): Redaction;
NewOCRReadPara(): OCRReadPara;
NewOCRZone(): OCRZone;
}
declare enum EnumDWT_OCRFindTextFlags {
OCRFT_WHOLEWORD = 1,
OCRFT_MATCHCASE = 2,
OCRFT_FUZZYMATCH = 4
}
declare enum EnumDWT_OCRFindTextAction {
OCRFT_HIGHLIGHT = 0,
OCRFT_STRIKEOUT = 1,
OCRFT_MARKFORREDACT = 2
}
declare enum EnumDWT_OCRProOutputFormat {
OCRPFT_IOTPDF = "IOTPDF",
OCRPFT_IOTPDF_MRC = "IOTPDF_MRC",
OCRPFT_TXTCSV = "TXTCSV",
OCRPFT_TXTF = "TXTF",
OCRPFT_TXTS = "TXTS",
OCRPFT_XML = "XML"
}
declare enum EnumDWT_OCRProPDFAVersion {
OCRPPDFAV_1A = "pdf/a-1a",
OCRPPDFAV_1B = "pdf/a-1b",
OCRPPDFAV_2A = "pdf/a-2a",
OCRPPDFAV_2B = "pdf/a-2b",
OCRPPDFAV_2U = "pdf/a-2u",
OCRPPDFAV_3A = "pdf/a-3a",
OCRPPDFAV_3B = "pdf/a-3b",
OCRPPDFAV_3U = "pdf/a-3u"
}
declare enum EnumDWT_OCRProPDFVersion {
OCRPPDFV_0 = "1.0",
OCRPPDFV_1 = "1.1",
OCRPPDFV_2 = "1.2",
OCRPPDFV_3 = "1.3",
OCRPPDFV_4 = "1.4",
OCRPPDFV_5 = "1.5",
OCRPPDFV_6 = "1.6",
OCRPPDFV_7 = "1.7"
}
declare enum EnumDWT_OCRProRecognitionModule {
OCRPM_AUTO = "AUTO",
OCRPM_MOSTACCURATE = "MOSTACCURATE",
OCRPM_BALANCED = "BALANCED",
OCRPM_FASTEST = "FASTEST"
}
declare enum EnumDWT_OCRProType {
OCRDT_File = 0,
OCRDT_Index = 1
}
interface OCRPro {
/**
* Returns whether OCR Pro addon is installed
* @return {boolean}
*/
IsModuleInstalled(): boolean;
/**
* Downloads and installs the ocr add-on on the local system.
* @param {string} remoteFile specifies the URL to download a ZIP which contains the OCR Pro addon
* @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess.
* @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure.
* @return {void}
*/
Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
/**
* Performs OCR on a given image.
* @param {number} sImageIndex Specifies the index of the image.
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
* @return {void}
*/
Recognize(sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
/**
* Performs OCR on one or multiple specified local file(s) directly.
* @param {string} fileNames Specifies the local paths of the target files. If multiple files are given, they should be separated by the '|' character.
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
* @return {void}
*/
RecognizeFile(fileNames: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
/**
* Peforms OCR on the given rectangle on a specified image.
* @param {number} sImageIndex Specifies the index of the image.
* @param {number[]} aryZone specifies the coordinates of the rectangle.
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
* @return {void}
*/
RecognizeRect(sImageIndex: number, aryZone: number[], optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
/**
* Performs OCR on the currently selected images in the buffer.
* @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess.
* @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure.
* @return {void}
*/
RecognizeSelectedImages(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
NewOCRError(): OCRError;
NewOCRReadPara(): OCRReadPara;
NewOCRZone(): OCRZone;
NewSettings(): Settings;
}
interface DynamsoftWebTwainAddon {
OCRPro: OCRPro;
}