mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #32475 from Tom-Dynamsoft/master
<@types/dwt> Updated the structure of the definitions to reflect the changes in the new version. Added definitions for new APIs introduced in the new version mainly from the addons
This commit is contained in:
Vendored
+113
@@ -0,0 +1,113 @@
|
||||
declare namespace Dynamsoft {
|
||||
let Lib: DynamsoftLib;
|
||||
let WebTwainEnv: dwtEnv;
|
||||
namespace WebTwain {
|
||||
namespace Addon {
|
||||
let OCRPro: OCRProAddon;
|
||||
}
|
||||
}
|
||||
namespace DWT {
|
||||
let defaultEnv: dwtEnv;
|
||||
}
|
||||
}
|
||||
|
||||
declare const dwt: WebTwain;
|
||||
|
||||
interface dwtEnv {
|
||||
ActiveXInstallWithCAB: boolean;
|
||||
ActiveXVersion: string;
|
||||
AutoLoad: boolean;
|
||||
CloseDialog(): void;
|
||||
ContainerMap: {};
|
||||
Containers: Container[];
|
||||
CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void;
|
||||
CreateDWTObject(newObjID: string, ip: number | string, port: number | string, portSSL: number | string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void;
|
||||
Debug: boolean;
|
||||
DeleteDWTObject(objID: string): void;
|
||||
DynamicContainers: string[];
|
||||
DynamicDWTMap: {};
|
||||
GetWebTwain(cid: string): WebTwain;
|
||||
IfUpdateService: boolean;
|
||||
IfUseActiveXForIE10Plus: boolean;
|
||||
JSVersion: string;
|
||||
Load(): void;
|
||||
|
||||
/*ignored
|
||||
OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed
|
||||
*/
|
||||
|
||||
OnWebTwainPostExecute(): void;
|
||||
OnWebTwainPreExecute(): void;
|
||||
|
||||
/*ignored
|
||||
OnWebTwainReady
|
||||
*/
|
||||
|
||||
PluginVersion: string;
|
||||
ProductKey: string;
|
||||
RegisterEvent(event: string, fn: (...args: any[]) => void): void;
|
||||
RemoveAllAuthorizations(): void;
|
||||
ResourcesPath: string;
|
||||
ServerVersionInfo: string;
|
||||
ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void;
|
||||
Trial: boolean;
|
||||
Unload(): void;
|
||||
UseDefaultInstallUI: boolean;
|
||||
initQueue: any[];
|
||||
inited: boolean;
|
||||
}
|
||||
|
||||
interface DynamsoftLib {
|
||||
/*ignored
|
||||
Addon_Events Addon_Sendback_Events AttachAndShowImage BIO DOM DynamicLoadAddonFuns DynamicWebTwain EnumMouseButton
|
||||
Errors Events IntToColorStr LS OnGetImageByURL OnGetImageFromServer Path ProgressBar UI Uri
|
||||
addEventListener ajax all appendMessage appendRichMessage aryControlLoadImage attachAddon attachProperty
|
||||
base64 bio cancelFrome clearMessage closeAll closeProgress colorStrToInt config css currentStyle
|
||||
debug*/
|
||||
|
||||
detect: {
|
||||
/*ignored
|
||||
OnCreatWS OnDetectNext OnWebTwainPostExecute OnWebTwainPreExecute StartWSByIPTimeoutId StartWSTimeoutId
|
||||
aryReconnectSTwains arySTwains arySTwainsByIP bFirst bNeedUpgradeEvent bNoControlEvent bOK bPromptJSOrServerOutdated
|
||||
cUrlIndex dcpCallbackType dcpStatus detectType getVersionArray global_dlg hideMask isDWTVersionLatest onNoControl
|
||||
onNotAllowedForChrome ports scriptLoaded showMask starting tryTimes*/
|
||||
ssl: boolean;
|
||||
};
|
||||
|
||||
/*ignored
|
||||
detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite
|
||||
each empty endsWith
|
||||
*/
|
||||
|
||||
env: {
|
||||
WSSession: number, WSVersion: string,
|
||||
bChrome: boolean, bEdge: boolean, bFileSystem: boolean, bFirefox: boolean,
|
||||
bIE: boolean, bLinux: boolean, bMac: boolean, bSafari: boolean, bWin: boolean, bWin64: boolean,
|
||||
basePath: string, iPluginLength: number, isX64: boolean, pathType: number,
|
||||
strChromeVersion: string, strFirefoxVersion: string, strIEVersion: string
|
||||
};
|
||||
|
||||
/*ignored
|
||||
error escapeHtml escapeRegExp extend filter fireEvent fromUnicode get getColor getCss
|
||||
getElDimensions getHex getHexColor getHttpUrl getLogger getOffset getRandom getRealPath getScript
|
||||
getWS getWSUrl getWheelDelta globalEval guid hide html5 imageControlCount indexOf install
|
||||
io isArray isBoolean isDef isFunction isLocalIP isNaN isNull isNumber isObject
|
||||
isPlainObject isString isUndef isUndefined isWindow keys log main makeArray mix
|
||||
needShowTwiceShowDialog nil noop now obj one page param parse parseHTML parser
|
||||
product progressMessage ready removeEventListener replaceAll replaceControl show showProgress startWS
|
||||
startWSByIP startsWith stopPropagation stringify style support switchEvent tmp toggle trim
|
||||
type unEscapeHtml unparam upperCaseFirst urlDecode urlEncode utf8 win
|
||||
...other internal ones
|
||||
*/
|
||||
hideMask(): void;
|
||||
showMask(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* interface for a DWT container which basically defines a DIV on the page
|
||||
*/
|
||||
interface Container {
|
||||
ContainerId: string;
|
||||
Width: string | number;
|
||||
Height: string | number;
|
||||
}
|
||||
Vendored
+192
@@ -0,0 +1,192 @@
|
||||
declare enum EnumDWT_OCRLanguage {
|
||||
OCRL_ENG = "eng",
|
||||
OCRL_ARA = "ara",
|
||||
OCRL_CHI_SIM = "chi_sim",
|
||||
OCRL_CHI_TRA = "chi_tra",
|
||||
OCRL_HIN = "hin",
|
||||
OCRL_URD = "urd",
|
||||
OCRL_SPA = "spa",
|
||||
OCRL_FRA = "fra",
|
||||
OCRL_MSA = "msa",
|
||||
OCRL_IND = "ind",
|
||||
OCRL_RUS = "rus",
|
||||
OCRL_BEN = "ben",
|
||||
OCRL_POR = "por",
|
||||
OCRL_PAN = "pan",
|
||||
OCRL_DEU = "deu",
|
||||
OCRL_JPN = "jpn",
|
||||
OCRL_FAS = "fas",
|
||||
OCRL_SWA = "swa",
|
||||
OCRL_JAV = "jav",
|
||||
OCRL_TEL = "tel",
|
||||
OCRL_TUR = "tur",
|
||||
OCRL_KOR = "kor",
|
||||
OCRL_MAR = "mar",
|
||||
OCRL_TAM = "tam",
|
||||
OCRL_VIE = "vie",
|
||||
OCRL_ITA = "ita",
|
||||
OCRL_THA = "tha"
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCRPageSetMode {
|
||||
OCRPSM_OSD_ONLY = 0,
|
||||
PSM_AUTO_OSD = 1,
|
||||
PSM_AUTO_ONLY = 2,
|
||||
PSM_AUTO = 3,
|
||||
PSM_SINGLE_COLUMN = 4,
|
||||
PSM_SINGLE_BLOCK_VERT_TEXT = 5,
|
||||
PSM_SINGLE_BLOCK = 6,
|
||||
PSM_SINGLE_LINE = 7,
|
||||
PSM_SINGLE_WORD = 8,
|
||||
PSM_CIRCLE_WORD = 9,
|
||||
PSM_SINGLE_CHAR = 10
|
||||
}
|
||||
|
||||
declare enum EnumDWT_OCROutputFormat {
|
||||
OCROF_TEXT = 0,
|
||||
OCROF_PDFPLAINTEXT = 1,
|
||||
OCROF_PDFIMAGEOVERTEXT = 2,
|
||||
OCROF_PDFPLAINTEXT_PDFX = 3,
|
||||
OCROF_PDFIMAGEOVERTEXT_PDFX = 4
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
interface OCR {
|
||||
/**
|
||||
* Downloads and installs the ocr add-on on the local system.
|
||||
* @method Dynamsoft.WebTwain#Download
|
||||
* @param {string} remoteFile specifies the value of which frame to get.
|
||||
* @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 {boolean}
|
||||
*/
|
||||
Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Downloads and deploys the OCR language package on the local system.
|
||||
* @method Dynamsoft.WebTwain#DownloadLangData
|
||||
* @param {string} remoteFile specifies the value of which frame to get.
|
||||
* @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 {boolean}
|
||||
*/
|
||||
DownloadLangData(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on a given image.
|
||||
* @method Dynamsoft.WebTwain#Read
|
||||
* @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 {boolean}
|
||||
*/
|
||||
Recognize(sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Peforms OCR on the given rectangle on a specified image.
|
||||
* @method Dynamsoft.WebTwain#ReadRect
|
||||
* @param {number} sImageIndex Specifies the index of the image.
|
||||
* @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle.
|
||||
* @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle.
|
||||
* @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle.
|
||||
* @param {number} bottom specifies the y-coordinate of the lower-right corner 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 {boolean}
|
||||
*/
|
||||
RecognizeRect(sImageIndex: number, left: number, top: number, right: number, bottom: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on one or multiple specified local file(s) directly.
|
||||
* @method Dynamsoft.WebTwain#Read
|
||||
* @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 {boolean}
|
||||
*/
|
||||
RecognizeFile(fileNames: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Performs OCR on the currently selected images in the buffer.
|
||||
* @method Dynamsoft.WebTwain#Read
|
||||
* @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 {boolean}
|
||||
*/
|
||||
RecognizeSelectedImages(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Specifies a font to be used by OCR when Addon.OCR.SetIfUseDetectedFont is set to false.
|
||||
* @method Dynamsoft.WebTwain#SetUnicodeFontName
|
||||
* @param {string} name Specifies a font to be used by
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetUnicodeFontName(name: string): void;
|
||||
|
||||
/**
|
||||
* Returns the detected OCR font name.
|
||||
* @method Dynamsoft.WebTwain#GetUnicodeFontName
|
||||
* @return {string} Returns the detected OCR font name.
|
||||
*/
|
||||
GetUnicodeFontName(): void;
|
||||
|
||||
/**
|
||||
* Determines whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead.
|
||||
* @method Dynamsoft.WebTwain#SetIfUseDetectedFont
|
||||
* @param {boolean} bValue By default this is true, indicating detected fonts should be used. The detected fonts must exist on the user's system for this to be successful.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetIfUseDetectedFont(bValue: boolean): void;
|
||||
|
||||
/**
|
||||
* Returns whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead.
|
||||
* @method Dynamsoft.WebTwain#GetIfUseDetectedFont
|
||||
* @return {boolean} Returns whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead.
|
||||
*/
|
||||
GetIfUseDetectedFont(): void;
|
||||
|
||||
/**
|
||||
* Applies higher-level accuracy of OCR to the area of the image where the font size is bigger than the value set here.
|
||||
* @method Dynamsoft.WebTwain#SetIfUseDetectedFont
|
||||
* @param {number} nValue Specifies the font size base to apply the higher-level accracy OCR. The default value is 0 which means no regional accurate OCR is performed.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetMinFontSizeforMoreAccurateResult(nValue: number): void;
|
||||
|
||||
/**
|
||||
* Returns the font size base to apply higher-level regional accarate OCR which is set through Addon.OCR.SetMinFontSizeforMoreAccurateResult.
|
||||
* @method Dynamsoft.WebTwain#GetMinFontSizeforMoreAccurateResult
|
||||
* @return {boolean} Returns the font size base to apply higher-level regional accarate OCR. If the return value is 0, it indicates no regional accurate OCR is performed.
|
||||
*/
|
||||
GetMinFontSizeforMoreAccurateResult(): void;
|
||||
|
||||
/**
|
||||
* Sets the target language for OCR operations.
|
||||
* @method Dynamsoft.WebTwain#SetLanguage
|
||||
* @param {string} value Specifies the target language for OCR operation.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetLanguage(value: string): void;
|
||||
|
||||
/**
|
||||
* Sets the mode for OCR page layout analysis. Determines how pages are determined when processing OCR.
|
||||
* @method Dynamsoft.WebTwain#SetPageSetMode
|
||||
* @param {EnumDWT_OCRPageSetMode} value Specifies the OCR Page layout analysis mode.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetPageSetMode(value: EnumDWT_OCRPageSetMode): void;
|
||||
|
||||
/**
|
||||
* Sets the OCR result format. Determines whether the OCR output is in text or PDF format.
|
||||
* @method Dynamsoft.WebTwain#SetOutputFormat
|
||||
* @param {EnumDWT_OCROutputFormat} value Specifies the OCR result format.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetOutputFormat(value: EnumDWT_OCROutputFormat): void;
|
||||
}
|
||||
|
||||
interface WebTwainAddon {
|
||||
OCR: OCR;
|
||||
}
|
||||
Vendored
+164
@@ -0,0 +1,164 @@
|
||||
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;
|
||||
}
|
||||
|
||||
interface OCRProAddon {
|
||||
NewOCRError(): OCRError;
|
||||
NewOCRReadPara(): OCRReadPara;
|
||||
NewOCRZone(): OCRZone;
|
||||
NewSettings(): Settings;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
interface WebTwainAddon {
|
||||
OCRPro: OCRPro;
|
||||
}
|
||||
Vendored
-15
@@ -1,14 +1,3 @@
|
||||
/*!
|
||||
* Dynamsoft WebTwain PDF Addon
|
||||
* Based on Dynamsoft WebTwain JavaScript Intellisense
|
||||
* Product: Dynamsoft Web Twain
|
||||
* Web Site: http://www.dynamsoft.com
|
||||
*
|
||||
* Copyright 2018, Dynamsoft Corporation
|
||||
* Author: Dynamsoft Support Team
|
||||
* Version: 14.2
|
||||
*/
|
||||
|
||||
declare enum EnumDWT_ConvertMode {
|
||||
CM_DEFAULT = 0,
|
||||
CM_RENDERALL = 1
|
||||
@@ -73,7 +62,3 @@ interface PDF {
|
||||
interface WebTwainAddon {
|
||||
PDF: PDF;
|
||||
}
|
||||
|
||||
interface WebTwain {
|
||||
Addon: WebTwainAddon;
|
||||
}
|
||||
|
||||
Vendored
+334
@@ -0,0 +1,334 @@
|
||||
/** -2400 to -2499 is webcam error code */
|
||||
declare enum EnumDWT_ErrorCode {
|
||||
/** All error from directshow sdk */
|
||||
WCERR_SYSTEM = -2400,
|
||||
/** Create ICreateDevEnum interface failed. */
|
||||
WCERR_FAIL_ICREATEDEVENUM = -2401,
|
||||
/** Create IEnumMoniker interface failed. */
|
||||
WCERR_FAIL_IENUMMONIKER = -2402,
|
||||
/** The camera doesn't support IAMVideoProcAmp interface. */
|
||||
WCERR_NOT_IAMVIDEOPROPERTY = -2403,
|
||||
/** The camera doesn't support IAMCameraControl interface. */
|
||||
WCERR_NOT_IAMCAMERACONTROL = -2404,
|
||||
/** The property doesn't support auto capability. */
|
||||
WCERR_NOT_AUTOPROPERTY = -2405,
|
||||
/** No webcam device is found. */
|
||||
WCERR_NO_DEVICE = -2406,
|
||||
/** Could not get video window interface */
|
||||
WCERR_FAIL_VIDEOWINDOW = -2407,
|
||||
/** Could not create filter graph. */
|
||||
WCERR_FAIL_FILTERGRAPH = -2408,
|
||||
/** Could not create SampleGrabber (isqedit.all registered?). */
|
||||
WCERR_FAIL_SAMPLEGRABBER = -2409,
|
||||
/** Unable to make NULL renderer */
|
||||
WCERR_NULLRENDER = -2410,
|
||||
/** Can't add the filter to graph */
|
||||
WCERR_FAIL_ADDFILTER = -2411,
|
||||
/** Can't build the graph */
|
||||
WCERR_FAIL_BUILDGRAPH = -2412,
|
||||
/** Failed to register filter graph with ROT. */
|
||||
WCERR_FAIL_REGFILTERGRAPH = -2413,
|
||||
/** Time out */
|
||||
WCERR_GRAB_TIMEOUT = -2414
|
||||
}
|
||||
|
||||
/** Specifies the video rotate mode on a video capture device. */
|
||||
declare enum EnumDWT_VideoRotateMode {
|
||||
/** Don't rotate */
|
||||
VRM_NONE = 0,
|
||||
/** 90 deg Clockwise */
|
||||
VRM_90_DEGREES_CLOCKWISE = 1,
|
||||
/** 180 deg Clockwise */
|
||||
VRM_180_DEGREES_CLOCKWISE = 2,
|
||||
/** 270 deg Clockwise */
|
||||
VRM_270_DEGREES_CLOCKWISE = 3,
|
||||
/** Flip */
|
||||
VRM_FLIP_VERTICAL = 4,
|
||||
/** Mirror */
|
||||
VRM_FLIP_HORIZONTAL = 5
|
||||
}
|
||||
|
||||
/** Specifies video properties on a video capture device. */
|
||||
declare enum EnumDWT_VideoProperty {
|
||||
/** Specifies the brightness, also called the black level. For NTSC, the value is expressed in IRE units * 100.
|
||||
* For non-NTSC sources, the units are arbitrary, with zero representing blanking and 10,000 representing pure white.
|
||||
* Values range from -10,000 to 10,000.
|
||||
*/
|
||||
VP_BRIGHTNESS = 0,
|
||||
/** Specifies the contrast, expressed as gain factor * 100. Values range from zero to 10,000. */
|
||||
VP_CONTRAST = 1,
|
||||
/** Specifies the hue, in degrees * 100. Values range from -180,000 to 180,000 (-180 to +180 degrees). */
|
||||
VP_HUE = 2,
|
||||
/** Specifies the saturation. Values range from 0 to 10,000. */
|
||||
VP_SATURATION = 3,
|
||||
/** Specifies the sharpness. Values range from 0 to 100. */
|
||||
VP_SHARPNESS = 4,
|
||||
/** Specifies the gamma, as gamma * 100. Values range from 1 to 500. */
|
||||
VP_GAMMA = 5,
|
||||
/** Specifies the color enable setting. The possible values are 0 (off) and 1 (on). */
|
||||
VP_COLORENABLE = 6,
|
||||
/** Specifies the white balance, as a color temperature in degrees Kelvin. The range of values depends on the device. */
|
||||
VP_WHITEBALANCE = 7,
|
||||
/** Specifies the backlight compensation setting. Possible values are 0 (off) and 1 (on). */
|
||||
VP_BACKLIGHTCOMPENSATION = 8,
|
||||
/** Specifies the gain adjustment. Zero is normal. Positive values are brighter and negative values are darker.
|
||||
* The range of values depends on the device.
|
||||
*/
|
||||
VP_GAIN = 9
|
||||
}
|
||||
|
||||
/** Specifies a setting on a camera. */
|
||||
declare enum EnumDWT_CameraControlProperty {
|
||||
/** Specifies the camera's pan setting, in degrees. Values range from -180 to +180, with the default set to zero.
|
||||
* Positive values are clockwise from the origin (the camera rotates clockwise when viewed from above),
|
||||
* and negative values are counterclockwise from the origin.
|
||||
*/
|
||||
CCP_PAN = 0,
|
||||
/** Specifies the camera's tilt setting, in degrees. Values range from -180 to +180, with the default set to zero.
|
||||
* Positive values point the imaging plane up, and negative values point the imaging plane down.
|
||||
*/
|
||||
CCP_TILT = 1,
|
||||
/** Specifies the camera's roll setting, in degrees. Values range from -180 to +180, with the default set to zero.
|
||||
* Positive values cause a clockwise rotation of the camera along the image-viewing axis, and negative values cause a counterclockwise rotation of the camera.
|
||||
*/
|
||||
CCP_ROLL = 2,
|
||||
/** Specifies the camera's zoom setting, in millimeters. Values range from 10 to 600, and the default is specific to the device. */
|
||||
CCP_ZOOM = 3,
|
||||
/** Specifies the exposure setting, in log base 2 seconds. In other words, for values less than zero, the exposure time is 1/2^n seconds,
|
||||
* and for values zero or above, the exposure time is 2^n seconds. For example:
|
||||
* Value Seconds
|
||||
* -3 1/8
|
||||
* -2 1/4
|
||||
* -1 1/2
|
||||
* 0 1
|
||||
* 1 2
|
||||
* 2 4
|
||||
*/
|
||||
CCP_EXPOSURE = 4,
|
||||
/** Specifies the camera's iris setting, in units of fstop* 10. */
|
||||
CCP_IRIS = 5,
|
||||
/** Specifies the camera's focus setting, as the distance to the optimally focused target, in millimeters.
|
||||
* The range and default value are specific to the device.
|
||||
*/
|
||||
CCP_FOCUS = 6
|
||||
}
|
||||
|
||||
interface WebcamMediaType {
|
||||
GetCount(): number;
|
||||
Get(index: number): string;
|
||||
GetCurrent(): string;
|
||||
}
|
||||
|
||||
interface WebcamResolution {
|
||||
GetCount(): number;
|
||||
Get(index: number): string;
|
||||
GetCurrent(): string;
|
||||
}
|
||||
|
||||
interface WebcamFrameRate {
|
||||
GetCount(): number;
|
||||
Get(index: number): string;
|
||||
GetCurrent(): string;
|
||||
}
|
||||
|
||||
interface CameraControlMoreSetting {
|
||||
GetMinValue(): number;
|
||||
GetMaxValue(): number;
|
||||
GetSteppingDelta(): number;
|
||||
GetDefaultValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
interface CameraControlSetting {
|
||||
GetValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
interface VideoPropertyMoreSetting {
|
||||
GetMinValue(): number;
|
||||
GetMaxValue(): number;
|
||||
GetSteppingDelta(): number;
|
||||
GetDefaultValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
interface VideoPropertySetting {
|
||||
GetValue(): number;
|
||||
GetIfAuto(): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
interface Webcam {
|
||||
IsModuleInstalled(): boolean;
|
||||
GetFramePartURL(): string;
|
||||
GetFrameURL(): string;
|
||||
|
||||
/**
|
||||
* Download and install webcam add-on on the local system.
|
||||
* @method Dynamsoft.WebTwain#Download
|
||||
* @param {string} remoteFile:string specifies the value of which frame to get.
|
||||
* @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 {boolean}
|
||||
*/
|
||||
Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void;
|
||||
|
||||
/**
|
||||
* Return supported webcam source names.
|
||||
* @method Dynamsoft.WebTwain#GetSourceList
|
||||
* @return {string array}
|
||||
*/
|
||||
GetSourceList(): string[];
|
||||
|
||||
/**
|
||||
* Select the source with the specified name.
|
||||
* @method Dynamsoft.WebTwain#SelectSource
|
||||
* @param {string} strSourceName The source name.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SelectSource(strSourceName: string): boolean;
|
||||
|
||||
/**
|
||||
* Close the selected source and release the webcam.
|
||||
* @method Dynamsoft.WebTwain#CloseSource
|
||||
* @return {boolean}
|
||||
*/
|
||||
CloseSource(): boolean;
|
||||
|
||||
/**
|
||||
* Show video stream in a specified container
|
||||
* @method Dynamsoft.WebTwain#StopVideo
|
||||
* @param {WebTwain} DWObject Specifies the WebTwain Object.
|
||||
* @param {number} quality Specifies the quality of each frame in the video stream. Only valid for the HTML5 edition.
|
||||
* @param {function} onFrameCaptured callback of the operation to capture
|
||||
* @return {void}
|
||||
*/
|
||||
PlayVideo(DWObject: WebTwain, quality: number, onFrameCaptured: () => void): void;
|
||||
|
||||
/**
|
||||
* Stop the video stream in the specified container
|
||||
* @method Dynamsoft.WebTwain#StopVideo
|
||||
* @return {boolean}
|
||||
*/
|
||||
StopVideo(): boolean;
|
||||
|
||||
/**
|
||||
* Capture image from the specified webcam.
|
||||
* @method Dynamsoft.WebTwain#CaptureImage
|
||||
* @param {function} OnCaptureSuccess he function to call when the capture succeeds. Please refer to the function prototype OnCaptureSuccess.
|
||||
* @param {function} OnCaptureError The function to call when the capture fails. Please refer to the function prototype OnCaptureError.
|
||||
* @return {void}
|
||||
*/
|
||||
CaptureImage(OnCaptureSuccess: () => void, OnCaptureError: () => void): void;
|
||||
|
||||
/**
|
||||
* Returns the media type for a camera.
|
||||
* @method Dynamsoft.WebTwain#GetMediaType
|
||||
* @return {class MediaType}
|
||||
*/
|
||||
GetMediaType(): WebcamMediaType;
|
||||
|
||||
/**
|
||||
* Returns the count in the media type list.
|
||||
* @method Dynamsoft.WebTwain#GetResolution
|
||||
* @return {class Resolution}
|
||||
*/
|
||||
GetResolution(): WebcamResolution;
|
||||
|
||||
/**
|
||||
* Returns the frame rate for a camera.
|
||||
* @method Dynamsoft.WebTwain#GetFrameRate
|
||||
* @return {class FrameRate}
|
||||
*/
|
||||
GetFrameRate(): WebcamFrameRate;
|
||||
|
||||
/**
|
||||
* Set the media type of the current selected source by the value.
|
||||
* @method Dynamsoft.WebTwain#SetMediaType
|
||||
* @param {string} value The new media type value.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetMediaType(value: string): boolean;
|
||||
|
||||
/**
|
||||
* Set the resolution of the current camera source.
|
||||
* @method Dynamsoft.WebTwain#SetResolution
|
||||
* @param {string} value The new resolution value.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetResolution(value: string): boolean;
|
||||
|
||||
/**
|
||||
* Set current frame rate.
|
||||
* @method Dynamsoft.WebTwain#SetFrameRate
|
||||
* @param {number} value The new frame rate value.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetFrameRate(value: number): boolean;
|
||||
|
||||
/**
|
||||
* Gets the current setting of a video property.
|
||||
* @method Dynamsoft.WebTwain#GetVideoPropertySetting
|
||||
* @param {EnumDWT_VideoProperty} property The property.
|
||||
* @return {class VideoPropertySetting}
|
||||
*/
|
||||
GetVideoPropertySetting(property: EnumDWT_VideoProperty): VideoPropertySetting;
|
||||
|
||||
/**
|
||||
* Gets the range and default value of a specified video property.
|
||||
* @method Dynamsoft.WebTwain#GetVideoPropertyMoreSetting
|
||||
* @param {EnumDWT_VideoProperty} property The property.
|
||||
* @return {class VideoPropertyMoreSetting}
|
||||
*/
|
||||
GetVideoPropertyMoreSetting(property: EnumDWT_VideoProperty): VideoPropertyMoreSetting;
|
||||
|
||||
/**
|
||||
* Gets the current setting of a camera property.
|
||||
* @method Dynamsoft.WebTwain#GetCameraControlPropertySetting
|
||||
* @param {EnumDWT_CameraControlProperty} property The property.
|
||||
* @return {class CameraControlPropertySetting}
|
||||
*/
|
||||
GetCameraControlPropertySetting(property: EnumDWT_CameraControlProperty): CameraControlSetting;
|
||||
|
||||
/**
|
||||
* Gets the range and default value of a specified camera property.
|
||||
* @method Dynamsoft.WebTwain#GetVideoPropertyMoreSetting
|
||||
* @param {EnumDWT_CameraControlProperty} property The property.
|
||||
* @return {class CameraControlPropertyMoreSetting}
|
||||
*/
|
||||
GetCameraControlPropertyMoreSetting(property: EnumDWT_CameraControlProperty): CameraControlMoreSetting;
|
||||
|
||||
/**
|
||||
* Sets video quality for a specified property.
|
||||
* @method Dynamsoft.WebTwain#SetVideoPropertySetting
|
||||
* @param {EnumDWT_VideoProperty} property The property.
|
||||
* @param {number} value The new value of the property.
|
||||
* @param {boolean} auto The desired control setting, whether the setting is controlled manually or automatically.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetVideoPropertySetting(property: EnumDWT_VideoProperty, value: number, auto: boolean): boolean;
|
||||
|
||||
/**
|
||||
* Sets video rotate mode.
|
||||
* @method Dynamsoft.WebTwain#SetVideoRotateMode
|
||||
* @param {EnumDWT_VideoRotateMode} enumAngle The rotate angle.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetVideoRotateMode(enumAngle: EnumDWT_VideoRotateMode): boolean;
|
||||
|
||||
/**
|
||||
* Sets a specified property on the camera.
|
||||
* @method Dynamsoft.WebTwain#SetCameraControlPropertySetting
|
||||
* @param {EnumDWT_CameraControlProperty} property The property.
|
||||
* @param {number} value The new value of the property.
|
||||
* @param {boolean} auto The desired control setting, whether the setting is controlled manually or automatically.
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetCameraControlPropertySetting(property: EnumDWT_CameraControlProperty, value: number, auto: boolean): boolean;
|
||||
}
|
||||
|
||||
interface WebTwainAddon {
|
||||
Webcam: Webcam;
|
||||
}
|
||||
Vendored
+192
@@ -0,0 +1,192 @@
|
||||
interface RunTimeSetting {
|
||||
mAntiDamageLevel: number;
|
||||
mBarcodeFormatIds: number;
|
||||
mBarcodeInvertMode: number;
|
||||
mBinarizationBlockSize: number;
|
||||
mColourImageConvertMode: number;
|
||||
mDeblurLevel: number;
|
||||
mEnableFillBinaryVacancy: number;
|
||||
mExpectedBarcodesCount: number;
|
||||
mGrayEqualizationSensitivity: number;
|
||||
mLocalizationAlgorithmPriority: string;
|
||||
mMaxAlgorithmThreadCount: number;
|
||||
mMaxBarcodesCount: number;
|
||||
mMaxDimOfFullImageAsBarcodeZone: number;
|
||||
mPDFRasterDPI: number;
|
||||
mRegionPredetectionMode: number;
|
||||
mReserved: string;
|
||||
mScaleDownThreshold: number;
|
||||
mTextFilterMode: number;
|
||||
mTextureDetectionSensitivity: number;
|
||||
mTimeout: number;
|
||||
}
|
||||
|
||||
interface dbrEnv {
|
||||
bAutoConnectService: boolean;
|
||||
logLevel: number;
|
||||
productKey: string;
|
||||
resourcesPath: string;
|
||||
onAutoConnectServiceSuccess(): void;
|
||||
onAutoConnectServiceError(status: any): void;
|
||||
}
|
||||
|
||||
declare namespace dynamsoft {
|
||||
let TaskQueue: TaskQueue;
|
||||
let dbrEnv: dbrEnv;
|
||||
/**dbrMasterPage20170526 */
|
||||
let dcp: {
|
||||
ifCheck64bitServiceFirst: boolean;
|
||||
};
|
||||
/**dwtDbrDemo20170613 */
|
||||
let initOrder: any;
|
||||
let lib: any;
|
||||
let managerEnv: any;
|
||||
let navInfo: any;
|
||||
namespace BarcodeReader {
|
||||
/** Barcode Formats */
|
||||
enum EnumBarcodeFormat {
|
||||
All = 503317503,
|
||||
OneD = 0x3FF,
|
||||
CODE_39 = 0x1,
|
||||
CODE_128 = 0x2,
|
||||
CODE_93 = 0x4,
|
||||
CODABAR = 0x8,
|
||||
ITF = 0x10,
|
||||
EAN_13 = 0x20,
|
||||
EAN_8 = 0x40,
|
||||
UPC_A = 0x80,
|
||||
UPC_E = 0x100,
|
||||
INDUSTRIAL_25 = 0x200,
|
||||
PDF417 = 0x2000000,
|
||||
QR_CODE = 0x4000000,
|
||||
DATAMATRIX = 0x8000000,
|
||||
AZTEC = 0x10000000
|
||||
}
|
||||
|
||||
enum EnumErrorCode {
|
||||
DBR_SYSTEM_EXCEPTION = 1,
|
||||
DBR_SUCCESS = 0,
|
||||
DBR_UNKNOWN = -10000,
|
||||
DBR_NO_MEMORY = -10001,
|
||||
DBR_NULL_REFERENCE = -10002,
|
||||
DBR_LICENSE_INVALID = -10003,
|
||||
DBR_LICENSE_EXPIRED = -10004,
|
||||
DBR_FILE_NOT_FOUND = -10005,
|
||||
DBR_FILETYPE_NOT_SUPPORTED = -10006,
|
||||
DBR_BPP_NOT_SUPPORTED = -10007,
|
||||
DBR_INDEX_INVALID = -10008,
|
||||
DBR_BARCODE_FORMAT_INVALID = -10009,
|
||||
DBR_CUSTOM_REGION_INVALID = -10010,
|
||||
DBR_MAX_BARCODE_NUMBER_INVALID = -10011,
|
||||
DBR_IMAGE_READ_FAILED = -10012,
|
||||
DBR_TIFF_READ_FAILED = -10013,
|
||||
DBR_QR_LICENSE_INVALID = -10016,
|
||||
DBR_1D_LICENSE_INVALID = -10017,
|
||||
DBR_DIB_BUFFER_INVALID = -10018,
|
||||
DBR_PDF417_LICENSE_INVALID = 10019,
|
||||
DBR_DATAMATRIX_LICENSE_INVALID = -10020,
|
||||
DBR_PDF_READ_FAILED = -10021,
|
||||
DBR_PDF_DLL_MISSING = -10022,
|
||||
DBR_PAGE_NUMBER_INVALID = -10023,
|
||||
DBR_CUSTOM_SIZE_INVALID = -10024,
|
||||
DBR_CUSTOM_MODULESIZE_INVALID = -10025,
|
||||
DBR_RECOGNITION_TIMEOUT = -10026,
|
||||
DBR_JSON_PARSE_FAILED = -10030,
|
||||
DBR_JSON_TYPE_INVALID = -10031,
|
||||
DBR_JSON_KEY_INVALID = -10032,
|
||||
DBR_JSON_VALUE_INVALID = -10033,
|
||||
DBR_JSON_NAME_KEY_MISSING = -10034,
|
||||
DBR_JSON_NAME_VALUE_DUPLICATED = -10035,
|
||||
DBR_TEMPLATE_NAME_INVALID = -10036,
|
||||
DBR_JSON_NAME_REFERENCE_INVALID = -10037,
|
||||
DBR_PARAMETER_VALUE_INVALID = 10038,
|
||||
DBR_DOMAIN_NOT_MATCHED = -10039,
|
||||
DBR_RESERVEDINFO_NOT_MATCHED = -10040,
|
||||
DBR_DBRERR_AZTEC_LICENSE_INVALID = -10041
|
||||
}
|
||||
enum EnumConflictMode {
|
||||
ECM_Ignore = 1,
|
||||
ECM_Overwrite = 2
|
||||
}
|
||||
enum EnumImagePixelFormat {
|
||||
IPF_Binary = 0,
|
||||
IPF_BinaryInverted = 1,
|
||||
IPF_GrayScaled = 2,
|
||||
IPF_NV21 = 3,
|
||||
IPF_RGB_565 = 4,
|
||||
IPF_RGB_555 = 5,
|
||||
IPF_RGB_888 = 6,
|
||||
IPF_ARGB_8888 = 7
|
||||
}
|
||||
enum EnumResultType {
|
||||
EDT_CandidateText = 2,
|
||||
EDT_PartialText = 3,
|
||||
EDT_RawText = 1,
|
||||
EDT_StandardText = 0
|
||||
}
|
||||
enum EnumTerminateStage {
|
||||
ETS_Localized = 1,
|
||||
ETS_Prelocalized = 0,
|
||||
ETS_Recognized = 2
|
||||
}
|
||||
}
|
||||
|
||||
class BarcodeReader {
|
||||
static BarcodeReaderException(): any;
|
||||
static initServiceConnection(): Promise<any>;
|
||||
static name: string;
|
||||
static length: number;
|
||||
static version: string;
|
||||
// appendTplStringToRuntimeSettings(b, d):
|
||||
/**
|
||||
* Read barcode from the source image.
|
||||
* @method BarcodeReader#decode
|
||||
* @param {string} source specifies the image to read on
|
||||
* @return {Promise}
|
||||
* @example
|
||||
```javascript
|
||||
// dwtUrl: HTML5 Edition only
|
||||
reader.decode('dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022').then(
|
||||
results=>{
|
||||
for(var i = 0; i < results.length; ++i){
|
||||
console.log(results[i].BarcodeText);
|
||||
// Confidence >= 30 is reliable
|
||||
console.log(results[i].LocalizationResult.ExtendedResultArray[0].Confidence);
|
||||
}
|
||||
});
|
||||
// dcsUrl
|
||||
reader.decode('dcs://dcs_trial_6110531/img?id=306159652&index=0&t=1502184632022').then(
|
||||
function(results){
|
||||
// ie6-7 does not support console.log
|
||||
var messageArr = [];
|
||||
for(var i = 0; i < results.length; ++i){
|
||||
messageArr.push(results[i].BarcodeText);
|
||||
// Confidence >= 30 is reliable
|
||||
messageArr.push(results[i].LocalizationResult.ExtendedResultArray[0].Confidence);
|
||||
}
|
||||
alert(messageArr.join(''));
|
||||
})['catch'](function(ex){
|
||||
// ie6-9 does not support '.catch(function(ex){...})'
|
||||
if(ex){alert(ex.message||ex);}
|
||||
});
|
||||
```
|
||||
*/
|
||||
decode(source: string): Promise<any>;
|
||||
|
||||
/**
|
||||
* Read barcode from base64 string
|
||||
*/
|
||||
decodeBase64String(base64String: string): Promise<any>;
|
||||
getAllLocalizationResults(): any;
|
||||
getAllParameterTemplateNames(): any;
|
||||
getRuntimeSettings(): RunTimeSetting;
|
||||
initRuntimeSettingsWithString(): any;
|
||||
outputSettingsToString(): any;
|
||||
resetRuntimeSettings(): void;
|
||||
updateRuntimeSettings(setting: RunTimeSetting): void;
|
||||
/**
|
||||
* Constructs a new barcode reader
|
||||
*/
|
||||
constructor(dbrKey?: string);
|
||||
}
|
||||
}
|
||||
Vendored
+3681
File diff suppressed because it is too large
Load Diff
Vendored
+11
-3782
File diff suppressed because it is too large
Load Diff
Vendored
+1047
File diff suppressed because it is too large
Load Diff
+13
-5
@@ -2,11 +2,12 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -17,8 +18,15 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"addon.ocr.d.ts",
|
||||
"addon.ocrp.d.ts",
|
||||
"addon.pdf.d.ts",
|
||||
"dwt-tests.ts"
|
||||
"addon.webcam.d.ts",
|
||||
"dbr.d.ts",
|
||||
"dwt-tests.ts",
|
||||
"dwt.d.ts",
|
||||
"index.d.ts",
|
||||
"Dynamsoft.d.ts",
|
||||
"mbc.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user