Fixed a few incorrect definitions and added a few missing ones (#39166)

* 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

* change to v15

* add enums

* remove enums

* Updating to v15.0.2

* roll back to 1 previous version

* add back v15 APIs

* fix errors

* fix errors attempt 2

* update to 15.1

* upgrade to v15.2
add tag image

* fixed a few bugs

* fix grammar errors
This commit is contained in:
Tom Kent 2019-10-18 05:24:04 +08:00 committed by Andrew Branch
parent e7f4d0d913
commit b082e088a2
2 changed files with 49 additions and 39 deletions

View File

@ -11,7 +11,7 @@
*/
interface DynamsoftStatic<TElement extends Node = HTMLElement> {
Lib: DynamsoftLib;
Lib: DynamsoftLib;
WebTwainEnv: dwtEnv;
}
@ -50,7 +50,7 @@ interface dwtEnv {
JSVersion: string;
PluginVersion: string;
ServerVersionInfo: string;
RemoveAllAuthorizations(): void;
ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void;
CloseDialog(): void;
@ -107,6 +107,7 @@ interface DynamsoftLib {
*/
hideMask(): void;
showMask(): void;
getScript(url: string, bAsync: boolean, callback: () => void): void;
}
/**
@ -3785,7 +3786,7 @@ interface WebTwain {
/*ingored
SourceNameItems
*/
/**
* Shows the GUI of Image Editor.
* @method WebTwain#startScan
@ -3812,14 +3813,14 @@ interface WebTwain {
*/
UnregisterEvent(name: string, evt: object): boolean;
TagImages(aryImageIndices: number[], tagName: string): boolean;
TagImages(aryImageIndices: number[], tagName: string): boolean;
SetDefaultTag(tagName: string): boolean;
ClearImageTags(sImageIndex: number): boolean;
FilterImagesByTag(tagName: string): boolean;
/*ignored
checkErrorString
first
@ -3832,5 +3833,5 @@ interface WebTwain {
...other internal ones
*/
Addon: DynamsoftWebTwainAddon;
Addon: DynamsoftWebTwainAddon;
}

69
types/dwt/dbr.d.ts vendored
View File

@ -10,27 +10,27 @@
* Author: Dynamsoft Support Team
*/
interface Region {
left: number;
top: number;
right: number;
bottom: number;
measuredByPercentage: number;
}
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;
barcodeFormatIds: number;
binarizationModes: number[];
deblurLevel: number;
expectedBarcodesCount: number;
localizationModes: number[];
minBarcodeTextLength: number;
minResultConfidence: number;
region: Region;
resultCoordinateType: number;
scaleDownThreshold: number;
textResultOrderModes: number[];
timeout: number;
}
interface dbrEnv {
@ -38,12 +38,14 @@ interface dbrEnv {
logLevel: number;
productKey: string;
resourcesPath: string;
hideDWASInstallDialog: boolean;
disableAutoDownloadModule: boolean;
onAutoConnectServiceSuccess(): void;
onAutoConnectServiceError(status: any): void;
}
interface TaskQueue {
push(task: (bLoadingWhenPush: boolean) => void, context?: any, args?: []): void;
push(task: (bLoadingWhenPush: boolean) => void, context?: any, args?: []): void;
unshift(task: (bLoadingWhenPush: boolean) => void, context?: any, args?: []): void;
next(): void;
}
@ -111,12 +113,12 @@ declare namespace dynamsoft {
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,
@ -127,21 +129,21 @@ declare namespace dynamsoft {
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 {
/**
* Constructs a new KPainter
@ -153,8 +155,15 @@ declare namespace dynamsoft {
static name: string;
static length: number;
static version: string;
// appendTplStringToRuntimeSettings(b, d):
/**
* Append a new template string to current runtime settings.
* @method BarcodeReader#decode
* @param {string} content A JSON string that represents the content of the settings.
* @param {number} emSettingPriority The parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
* @return {void}
*/
appendTplStringToRuntimeSettings(content: string, emSettingPriority: number): void;
/**
* Read barcode from the source image.
* @method BarcodeReader#decode
@ -203,7 +212,7 @@ declare namespace dynamsoft {
resetRuntimeSettings(): void;
updateRuntimeSettings(setting: RunTimeSetting): void;
}
let TaskQueue: TaskQueue;
let dbrEnv: dbrEnv;
/**dbrMasterPage20170526 */