mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* 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
228 lines
7.2 KiB
TypeScript
228 lines
7.2 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 Region {
|
|
left: number;
|
|
top: number;
|
|
right: number;
|
|
bottom: number;
|
|
measuredByPercentage: number;
|
|
}
|
|
|
|
interface RunTimeSetting {
|
|
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 {
|
|
bAutoConnectService: boolean;
|
|
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;
|
|
unshift(task: (bLoadingWhenPush: boolean) => void, context?: any, args?: []): void;
|
|
next(): void;
|
|
}
|
|
|
|
declare namespace dynamsoft {
|
|
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 {
|
|
/**
|
|
* Constructs a new KPainter
|
|
*/
|
|
constructor(dbrKey?: string);
|
|
|
|
static BarcodeReaderException(): any;
|
|
static initServiceConnection(): Promise<any>;
|
|
static name: string;
|
|
static length: number;
|
|
static version: string;
|
|
|
|
/**
|
|
* 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
|
|
* @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;
|
|
}
|
|
|
|
let TaskQueue: TaskQueue;
|
|
let dbrEnv: dbrEnv;
|
|
/**dbrMasterPage20170526 */
|
|
let dcp: {
|
|
ifCheck64bitServiceFirst: boolean;
|
|
};
|
|
/**dwtDbrDemo20170613 */
|
|
let initOrder: any;
|
|
let lib: any;
|
|
let managerEnv: any;
|
|
let navInfo: any;
|
|
}
|