dwt 16.2.4 → 16.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +16 -12
  2. package/dist/addon/dbrjs/dbr-7.6.0.full.wasm.js +4016 -4016
  3. package/dist/addon/dbrjs/dbr-7.6.0.worker.js +107 -107
  4. package/dist/addon/dbrjs/dbr.js +10 -10
  5. package/dist/dist/DynamsoftServiceSetup.deb +0 -0
  6. package/dist/dist/DynamsoftServiceSetup.msi +0 -0
  7. package/dist/dist/DynamsoftServiceSetup.pkg +0 -0
  8. package/dist/dist/DynamsoftServiceSetup.rpm +0 -0
  9. package/dist/dist/LICENSE +95 -95
  10. package/dist/dynamsoft.webtwain.min.js +209 -209
  11. package/dist/dynamsoft.webtwain.min.mjs +208 -208
  12. package/dist/src/dynamsoft.imageio_wasm-1.6.2.js +93 -93
  13. package/dist/src/dynamsoft.webtwain.css +1045 -1045
  14. package/dist/types/Addon.BarcodeReader.d.ts +168 -168
  15. package/dist/types/Addon.Camera.d.ts +125 -125
  16. package/dist/types/Addon.OCR.d.ts +264 -264
  17. package/dist/types/Addon.OCRPro.d.ts +251 -251
  18. package/dist/types/Addon.PDF.d.ts +110 -110
  19. package/dist/types/Addon.Webcam.d.ts +257 -257
  20. package/dist/types/Dynamsoft.Enum.d.ts +1850 -1849
  21. package/dist/types/Dynamsoft.FileUploader.d.ts +130 -130
  22. package/dist/types/Dynamsoft.d.ts +495 -495
  23. package/dist/types/WebTwain.Acquire.d.ts +1059 -1059
  24. package/dist/types/WebTwain.Buffer.d.ts +259 -259
  25. package/dist/types/WebTwain.Edit.d.ts +434 -434
  26. package/dist/types/WebTwain.IO.d.ts +951 -951
  27. package/dist/types/WebTwain.Util.d.ts +102 -102
  28. package/dist/types/WebTwain.Viewer.d.ts +795 -795
  29. package/dist/types/WebTwain.d.ts +51 -51
  30. package/dist/types/index.d.ts +20 -20
  31. package/package.json +2 -2
  32. package/samples/1.AcquireImage.html +0 -69
  33. package/samples/2.CustomScan.html +0 -98
  34. package/samples/3.PDFRasterizer.html +0 -73
  35. package/samples/4.OCRADocument.html +0 -156
  36. package/samples/5.ReadBarcode.html +0 -231
  37. package/samples/6.ScanOrCapture.html +0 -189
@@ -1,495 +1,495 @@
1
- import { DynamsoftEnums } from "./Dynamsoft.Enum";
2
- import { WebTwain } from "./WebTwain";
3
- import { Settings } from "./Addon.OCRPro";
4
- import { FileUploader } from "./Dynamsoft.FileUploader";
5
-
6
- export namespace DynamsoftStatic {
7
- let Lib: DynamsoftLib;
8
- let MSG: Messages;
9
- let WebTwainEnv: WebTwainEnv;
10
- let managerEnv: ManagerEnv;
11
- let FileUploader: FileUploader;
12
- namespace WebTwain {
13
- namespace Addon {
14
- namespace OCRPro {
15
- function NewSettings(): Settings;
16
- }
17
- }
18
- }
19
- }
20
- export interface DWTInitialConfig {
21
- WebTwainId: string;
22
- Host?: string;
23
- Port?: string;
24
- SSLPort?: string;
25
- }
26
- export interface DynamsoftLib {
27
- /**
28
- * A built-in method to set up a listener for the specified event type on the target element.
29
- * @param target Specify the HTML element.
30
- * @param type Specify the event
31
- * @param listener Specify the callback
32
- */
33
- addEventListener(target: HTMLElement, type: string, listener: EventListenerOrEventListenerObject): void;
34
- /**
35
- * Whether to enable debugging. Once enabled, debugging inforamtion is printed out in the browser console.
36
- */
37
- debug: boolean;
38
- detect: DSLibDetect;
39
- env: DSLibEnv;
40
- /**
41
- * Hide the built-in page mask
42
- */
43
- hideMask(): void;
44
- /**
45
- * Show the built-in page mask
46
- */
47
- showMask(): void;
48
- /**
49
- * Load the specified script.
50
- * @param url Specify the URL of the script.
51
- * @param bAsync Whether to load the script asynchronously.
52
- * @param callback Callback function triggered when the script is loaded.
53
- */
54
- getScript(url: string, bAsync: boolean, callback: () => void): void;
55
- /**
56
- * Load the specified scripts.
57
- * @param urls Specify the URLs of the scripts.
58
- * @param bAsync Whether to load the script asynchronously.
59
- * @param callback Callback function triggered when the scripts are all loaded.
60
- */
61
- getScripts(urls: string[], bAsync: boolean, callback: () => void): void;
62
-
63
- dlgLoadingShowStatus: boolean;
64
- product: Product;
65
- /**
66
- * The following Functions & Options are internal & ignored
67
- *
68
- * Addon_Events, Addon_Sendback_Events, Attributes, BGR2RGB, BIO, DOM,
69
- * DynamicLoadAddonFuns, DynamicWebTwain, EnumMouseButton, Errors,
70
- * Events, File, Index, IntToColorStr, LS, License, MobileFuns, Path,
71
- * ProgressBar, RGB2BGR, ShowLicenseDialog, UI, Uri
72
- * ajax, all, appendMessage, appendRichMessage, asyncQueue, atob,
73
- * attachAddon, attachProperty, attachPropertyUI, base64, bio, btoa,
74
- * cancelFrome, checkDomReady, checkNavInfoReady, clearMessage, clone,
75
- * closeAll, closeLoadingMsg, closeProgress, colorStrToInt, config,css,
76
- * currentStyle, detectButton, dialog, dialogShowStatus, dlgLoading,
77
- * dlgLoadingShowStatus, dlgProgress, dlgRef, doc, domReady,
78
- * each, empty, endsWith, error, escapeHtml, escapeRegExp, extend,
79
- * filter, fireEvent, fromUnicode, get, getAllCss, getColor, getCss,
80
- * getElDimensions, getHex, getHttpUrl, getLogger, getNavInfo,
81
- * getNavInfoByUAData, getNavInfoByUserAgent, getNavInfoSync, getRandom,
82
- * getRealPath, getWS, getWSUrl, getWheelDelta, globalEval, guid, hide,
83
- * html5, indexOf, initProgress, install,io, isArray, isBoolean, isDef,
84
- * isFunction, isLocalIP, isNaN, isNodeList, isNull, isNumber, isObject,
85
- * isPlainObject, isString, isUndef, isUndefined, isWindow, keys, makeArray,
86
- * mask, mix, needShowTwiceShowDialog, nil, noop, now, obj, one, openLoadingMsg,
87
- * page, param, parse, parseHTML, progressMessage, ready,
88
- * removeEventListener, replaceAll, replaceControl, setBtnCancelVisibleForProgress,
89
- * show, showLoadingMsg, showProgress, showProgressMsg, sizzle, sprintf, startWS,
90
- * startWSByIP, startsWith, stopPropagation, stringify, style, support, switchEvent,
91
- * tmp, toggle, trim, type, unEscapeHtml, uniq, unparam, upperCaseFirst, uriQuery,
92
- * urlDecode, urlEncode, utf8, vsprintf, win
93
- */
94
- }
95
- export interface DSLibDetect {
96
- /**
97
- * Whether or not the site is secure (Https://).
98
- */
99
- readonly ssl: boolean;
100
- readonly scriptLoaded: boolean;
101
- /**
102
- * The following Functions & Options are internal & ignored
103
- * OnCreatWS, OnDetectNext, StartWSByIPTimeoutId, StartWSTimeoutId,
104
- * aryReconnectSTwains, arySTwains, arySTwainsByIP, bFirst,
105
- * bNeedUpgradeEvent, bNoControlEvent, bOK, bPromptJSOrServerOutdated,
106
- * cUrlIndex, cssLoaded, dcpCallbackType, dcpStatus, detectType, getVersionArray,
107
- * isDWTVersionLatest, needUpgrade, onNoControl, onNotAllowedForChrome, ports,
108
- * starting, tryTimes, urls, viewerScriptLoaded, wasmScriptLoaded,
109
- * OnWebTwainPostExecute, OnWebTwainPreExecute, hideMask, showMask,
110
- * win64Ports, __WebTwainMain, __dialog
111
- */
112
- }
113
- export interface DSLibEnv {
114
- /**
115
- * Whether the browser is Chrome.
116
- */
117
- readonly bChrome: boolean;
118
- /**
119
- * Whether the browser is Edge.
120
- */
121
- readonly bEdge: boolean;
122
- /**
123
- * Whether the page is opening from the disk.
124
- */
125
- readonly bFileSystem: boolean;
126
- /**
127
- * Whether the browser is Firefox.
128
- */
129
- readonly bFirefox: boolean;
130
- /**
131
- * Whether the browser is IE.
132
- */
133
- readonly bIE: boolean;
134
- /**
135
- * Whether the browser is Safari.
136
- */
137
- readonly bSafari: boolean;
138
- /**
139
- * Whether the operating system is Linux.
140
- */
141
- readonly bLinux: boolean;
142
- /**
143
- * Whether the operating system is macOS.
144
- */
145
- readonly bMac: boolean;
146
- /**
147
- * Whether the operating system is mobile (Android & iOS & iPadOS).
148
- */
149
- readonly bMobile: boolean;
150
- /**
151
- * Whether the operating system is Windows.
152
- */
153
- readonly bWin: boolean;
154
- /**
155
- * Whether the operating system is 64bit Windows.
156
- */
157
- readonly bWin64: boolean;
158
- /**
159
- * The base path.
160
- */
161
- readonly basePath: string;
162
- /**
163
- * The WebSocket session id.
164
- */
165
- readonly WSSession: number;
166
- /**
167
- * The WebSocket version.
168
- */
169
- readonly WSVersion: string;
170
- /**
171
- * The plugin lenghth.
172
- */
173
- readonly iPluginLength: number;
174
- /**
175
- * Whether it is a desktop viewer.
176
- */
177
- isDesktopViewer(): boolean;
178
- /**
179
- * Whether it is a mobile viewer.
180
- */
181
- isMobileViewer(): boolean;
182
- /**
183
- * Whether it is a pad viewer.
184
- */
185
- isPadViewer(): boolean;
186
- /**
187
- * Whether the platform is 64bit.
188
- */
189
- readonly isX64: boolean;
190
- /**
191
- * Information about macOSX.
192
- */
193
- readonly macOSX: string;
194
- /**
195
- * OS version.
196
- */
197
- readonly osVersion: string;
198
- /**
199
- * The path type used to calculate the real path.
200
- */
201
- readonly pathType: number;
202
- /**
203
- * The version of Chrome.
204
- */
205
- readonly strChromeVersion: number | string;
206
- /**
207
- * The version of Firefox.
208
- */
209
- readonly strFirefoxVersion: number | string;
210
- /**
211
- * The version of IE.
212
- */
213
- readonly strIEVersion: number | string;
214
- }
215
- export interface WebTwainEnv {
216
- /**
217
- * Whether to install the ActiveX with CAB.
218
- */
219
- ActiveXInstallWithCAB: boolean;
220
- /**
221
- * The version of the ActiveX;
222
- */
223
- readonly ActiveXVersion: string;
224
- /**
225
- * Whether to create a WebTwain instance automatically upon page load.
226
- */
227
- AutoLoad: boolean;
228
- /**
229
- * Close a dialog opened by the method ShowDialog.
230
- */
231
- CloseDialog(): void;
232
- /**
233
- * A map of all WebTwain instances.
234
- */
235
- ContainerMap: any;
236
- /**
237
- * Define the Id and UI of the WebTwain instances.
238
- */
239
- Containers: Container[];
240
- /**
241
- * Create a WebTwain instance with UI.
242
- * @param ContainerId Specify the HTML element (typically of the type HTMLDivElement) to hold the UI.
243
- * @param host Specify the host.
244
- * @param port Specify the port.
245
- * @param portSSL Specify the SSL port.
246
- * @param successCallback A callback function that is executed if the request succeeds.
247
- * @param failureCallback A callback function that is executed if the request fails.
248
- */
249
- CreateDWTObject(
250
- ContainerId: string,
251
- host: string,
252
- port: string | number,
253
- portSSL: string | number,
254
- successCallBack: (DWObject: WebTwain) => void,
255
- failureCallBack: (errorString: string) => void): void;
256
- /**
257
- * Create a WebTwain instance with UI.
258
- * @param ContainerId Specify the HTML element (typically of the type HTMLDivElement) to hold the UI.
259
- * @param host Specify the host.
260
- * @param port Specify the port.
261
- * @param portSSL Specify the SSL port.
262
- * @param successCallback A callback function that is executed if the request succeeds.
263
- * @param failureCallback A callback function that is executed if the request fails.
264
- */
265
- CreateDWTObject(ContainerId: string, successCallBack: (DWObject: WebTwain) => void, failureCallBack: (errorString: string) => void): void;
266
- /**
267
- * Create a WebTwain instance without UI.
268
- * @param WebTwainId Specify the Id of the instance.
269
- * @param successCallback A callback function that is executed if the request succeeds.
270
- * @param failureCallback A callback function that is executed if the request fails.
271
- */
272
- CreateDWTObjectEx(dwtInitialConfig: DWTInitialConfig, successCallBack: (DWObject: WebTwain) => void, failureCallBack: (errorString: string) => void): void;
273
- /**
274
- * Define the display info.
275
- */
276
- CustomizableDisplayInfo: DisplayInfo;
277
- /**
278
- * Remove and destroy a WebTwain instance.
279
- * @param Id Specify the instance with its ContainerId or WebTwainId.
280
- */
281
- DeleteDWTObject(Id: string): boolean;
282
- /**
283
- * Return the WebTwain instance specified by its ContainerId. If no parameter is provided, the first valid WebTwain instance is returnd.
284
- * @param ContainerId The ContainerId.
285
- */
286
- GetWebTwain(ContainerId?: string): WebTwain;
287
- /**
288
- * Return the WebTwain instance specified by its WebTwainId. If no parameter is provided, the first valid WebTwain instance is returnd.
289
- * @param WebTwainId The WebTwainId.
290
- */
291
- GetWebTwainEx(WebTwainId?: string): WebTwain;
292
- /**
293
- * Whether or not an md5 header `dwt-md5` should be included in HTTP upload requests.
294
- */
295
- IfAddMD5InUploadHeader: boolean;
296
- /**
297
- * Whether to confine the mask within the viewer element.
298
- */
299
- IfConfineMaskWithinTheViewer: boolean;
300
- /**
301
- * Whether to use ActiveX for IE 10 & 11.
302
- */
303
- IfUseActiveXForIE10Plus: boolean;
304
- /**
305
- * The version of the JavaScript script.
306
- */
307
- readonly JSVersion: string;
308
- /**
309
- * Create a WebTwain instance(s).
310
- */
311
- Load(): void;
312
- /**
313
- * A callback function that is executed when the WebTwain related files are not found.
314
- */
315
- OnWebTwainNotFound: () => {};
316
- /**
317
- * A callback function that is executed after a time-consuming operation.
318
- */
319
- OnWebTwainPostExecute: () => {};
320
- /**
321
- * A callback function that is executed before a time-consuming operation.
322
- */
323
- OnWebTwainPreExecute: () => {};
324
- /**
325
- * A callback function that is executed when a WebTwain instance is created.
326
- */
327
- OnWebTwainReady: () => {};
328
- /**
329
- * A callback function that is executed right before the creation of a WebTwain instance.
330
- */
331
- OnWebTwainWillInit: () => {};
332
- /**
333
- * The version of the PDF module (not the rasterizer).
334
- */
335
- PdfVersion: string;
336
- /**
337
- * The version of the plug-in edition.
338
- */
339
- PluginVersion: string;
340
- /**
341
- * Set or return the product key for the library. A product key is required to enables certain modules of the library.
342
- */
343
- ProductKey: string;
344
- /**
345
- * The product name.
346
- */
347
- readonly ProductName: string;
348
- /**
349
- * Attach the callback function to the specified event.
350
- * @param event Specify the event.
351
- * @param callback Specify the callback.
352
- */
353
- RegisterEvent(event: string, callback: (...args: any[]) => void): void;
354
- /**
355
- * Remove all authorizations for accessing local resources.
356
- */
357
- RemoveAllAuthorizations(): void;
358
- /**
359
- * Set or return where the library looks for resources files including service installers, CSS, etc.
360
- */
361
- ResourcesPath: string;
362
- /**
363
- * The version of the Linux edition (the service, not wasm).
364
- */
365
- ServerLinuxVersionInfo: string;
366
- /**
367
- * The version of the macOS edition (the service, not wasm).
368
- */
369
- ServerMacVersionInfo: string;
370
- /**
371
- * The version of the Windows edition (the service, not wasm).
372
- */
373
- ServerVersionInfo: string;
374
- /**
375
- * Built-in method to show a modal dialog.
376
- * @param width Width of the dialog.
377
- * @param height Height of the dialog.
378
- * @param content Content of the dialog.
379
- * @param simple Whether to show a simple dialog with no header.
380
- * @param hideCloseButton Whether to hide the close button.
381
- */
382
- ShowDialog(width: number, height: number, content: string, simple: boolean, hideCloseButton: boolean): void;
383
- /**
384
- * Remove and destroy all WebTwain instances.
385
- */
386
- Unload(): void;
387
- /**
388
- * Whether to download the wasm for Camera Addon to use on initialization.
389
- */
390
- UseCameraAddonWasm: boolean;
391
- /**
392
- * Whether to use the library in Local-Service mode or WASM mode.
393
- */
394
- UseLocalService: boolean;
395
- /**
396
- * Whether to load UI related js files.
397
- */
398
- UseDefaultViewer: boolean;
399
- /**
400
- * Control whether the scanner related UI & load/save UI are always display in the front window.
401
- */
402
- IfAlwaysFocusOnPopupWindow: boolean;
403
- ConnectToTheService: () => void;
404
- initQueue: any[];
405
- /**
406
- * The following Functions & Options are internal & ignored
407
- * ActiveXIntegerited, CheckConnectToTheService,
408
- * ContainerMap, Debug, DynamicContainers,
409
- * DynamicDWTMap, GetLocalServiceStatus,IfCheck64bitServiceFirst,
410
- * IfCheckDCP, IfCheckDWT,
411
- * IfDisableDefaultSettings, IfDownload64bitService,
412
- * IfInstallDWTModuleWithZIP, IfUpdateService,
413
- * IfUseEmbeddedDownloadNoticeForActiveX, IfUseViewer,
414
- * OnWebTwainInitMessage, OnWebTwainNeedUpgrade,
415
- * OnWebTwainNeedUpgradeWebJavascript, OnWebTwainInitMessage
416
- * OnWebTwainOldPluginNotAllowed, OnWebTwainOldPluginNotAllowed
417
- * Trial, UseDefaultInstallUI, ViewerJSIntegerited,
418
- * inited, _srcUseLocalService
419
- */
420
- }
421
- export interface DisplayInfo {
422
- buttons: any;
423
- customProgressText: any;
424
- dialogText: any;
425
- errorMessages: any;
426
- generalMessages: any;
427
- }
428
- /**
429
- * Define default messages.
430
- */
431
- export interface Messages {
432
- ConvertingToBase64: string;
433
- ConvertingToBlob: string;
434
- Downloading: string;
435
- Encoding: string;
436
- Err_BrowserNotSupportWasm: string;
437
- Init_AllJsLoaded: string;
438
- Init_CheckDWT: string;
439
- Init_CheckDWTVersion: string;
440
- Init_CheckingLicense: string;
441
- Init_CompilingWasm: string;
442
- Init_ConfiguringDWT: string;
443
- Init_CreatingDWT: string;
444
- Init_DownloadingWasm: string;
445
- Init_FireBeforeInitEvt: string;
446
- Init_GetLicenseInfoForDWT: string;
447
- Init_InitActiveX: string;
448
- Init_InitDynamsoftService: string;
449
- Init_InitH5: string;
450
- Init_InitWasm: string;
451
- Init_LoadingViewerJs: string;
452
- Init_LookingLicense: string;
453
- Init_SetLicenseForDWT: string;
454
- Loading: string;
455
- LoadingPdf: string;
456
- LoadingTiff: string;
457
- SavingPdf: string;
458
- SavingTiff: string;
459
- Uploading: string;
460
- }
461
- export interface ManagerEnv {
462
- IfUpdateService: boolean;
463
- resourcesPath: string;
464
- }
465
- /**
466
- * Interface for a WebTwain profile.
467
- */
468
- export interface Container {
469
- WebTwainId: string;
470
- ContainerId?: string;
471
- Width?: string | number;
472
- Height?: string | number;
473
- bNoUI?: boolean;
474
- bLocalService?: boolean;
475
- }
476
- export interface Product {
477
- bActiveXEdition: boolean;
478
- bChromeEdition: boolean;
479
- bHTML5Edition: boolean;
480
- bPluginEdition: boolean;
481
- host: string;
482
- name: string;
483
- }
484
- export interface WasmConfig {
485
- /**
486
- * Maximum heap size
487
- */
488
- maxHeapSize: number;
489
- /**
490
- * fetch API Options
491
- */
492
- fetchOptions: any;
493
- }
494
- declare const Dynamsoft: (typeof DynamsoftEnums & typeof DynamsoftStatic);
495
- export default Dynamsoft;
1
+ import { DynamsoftEnums } from "./Dynamsoft.Enum";
2
+ import { WebTwain } from "./WebTwain";
3
+ import { Settings } from "./Addon.OCRPro";
4
+ import { FileUploader } from "./Dynamsoft.FileUploader";
5
+
6
+ export namespace DynamsoftStatic {
7
+ let Lib: DynamsoftLib;
8
+ let MSG: Messages;
9
+ let WebTwainEnv: WebTwainEnv;
10
+ let managerEnv: ManagerEnv;
11
+ let FileUploader: FileUploader;
12
+ namespace WebTwain {
13
+ namespace Addon {
14
+ namespace OCRPro {
15
+ function NewSettings(): Settings;
16
+ }
17
+ }
18
+ }
19
+ }
20
+ export interface DWTInitialConfig {
21
+ WebTwainId: string;
22
+ Host?: string;
23
+ Port?: string;
24
+ SSLPort?: string;
25
+ }
26
+ export interface DynamsoftLib {
27
+ /**
28
+ * A built-in method to set up a listener for the specified event type on the target element.
29
+ * @param target Specify the HTML element.
30
+ * @param type Specify the event
31
+ * @param listener Specify the callback
32
+ */
33
+ addEventListener(target: HTMLElement, type: string, listener: EventListenerOrEventListenerObject): void;
34
+ /**
35
+ * Whether to enable debugging. Once enabled, debugging inforamtion is printed out in the browser console.
36
+ */
37
+ debug: boolean;
38
+ detect: DSLibDetect;
39
+ env: DSLibEnv;
40
+ /**
41
+ * Hide the built-in page mask
42
+ */
43
+ hideMask(): void;
44
+ /**
45
+ * Show the built-in page mask
46
+ */
47
+ showMask(): void;
48
+ /**
49
+ * Load the specified script.
50
+ * @param url Specify the URL of the script.
51
+ * @param bAsync Whether to load the script asynchronously.
52
+ * @param callback Callback function triggered when the script is loaded.
53
+ */
54
+ getScript(url: string, bAsync: boolean, callback: () => void): void;
55
+ /**
56
+ * Load the specified scripts.
57
+ * @param urls Specify the URLs of the scripts.
58
+ * @param bAsync Whether to load the script asynchronously.
59
+ * @param callback Callback function triggered when the scripts are all loaded.
60
+ */
61
+ getScripts(urls: string[], bAsync: boolean, callback: () => void): void;
62
+
63
+ dlgLoadingShowStatus: boolean;
64
+ product: Product;
65
+ /**
66
+ * The following Functions & Options are internal & ignored
67
+ *
68
+ * Addon_Events, Addon_Sendback_Events, Attributes, BGR2RGB, BIO, DOM,
69
+ * DynamicLoadAddonFuns, DynamicWebTwain, EnumMouseButton, Errors,
70
+ * Events, File, Index, IntToColorStr, LS, License, MobileFuns, Path,
71
+ * ProgressBar, RGB2BGR, ShowLicenseDialog, UI, Uri
72
+ * ajax, all, appendMessage, appendRichMessage, asyncQueue, atob,
73
+ * attachAddon, attachProperty, attachPropertyUI, base64, bio, btoa,
74
+ * cancelFrome, checkDomReady, checkNavInfoReady, clearMessage, clone,
75
+ * closeAll, closeLoadingMsg, closeProgress, colorStrToInt, config,css,
76
+ * currentStyle, detectButton, dialog, dialogShowStatus, dlgLoading,
77
+ * dlgLoadingShowStatus, dlgProgress, dlgRef, doc, domReady,
78
+ * each, empty, endsWith, error, escapeHtml, escapeRegExp, extend,
79
+ * filter, fireEvent, fromUnicode, get, getAllCss, getColor, getCss,
80
+ * getElDimensions, getHex, getHttpUrl, getLogger, getNavInfo,
81
+ * getNavInfoByUAData, getNavInfoByUserAgent, getNavInfoSync, getRandom,
82
+ * getRealPath, getWS, getWSUrl, getWheelDelta, globalEval, guid, hide,
83
+ * html5, indexOf, initProgress, install,io, isArray, isBoolean, isDef,
84
+ * isFunction, isLocalIP, isNaN, isNodeList, isNull, isNumber, isObject,
85
+ * isPlainObject, isString, isUndef, isUndefined, isWindow, keys, makeArray,
86
+ * mask, mix, needShowTwiceShowDialog, nil, noop, now, obj, one, openLoadingMsg,
87
+ * page, param, parse, parseHTML, progressMessage, ready,
88
+ * removeEventListener, replaceAll, replaceControl, setBtnCancelVisibleForProgress,
89
+ * show, showLoadingMsg, showProgress, showProgressMsg, sizzle, sprintf, startWS,
90
+ * startWSByIP, startsWith, stopPropagation, stringify, style, support, switchEvent,
91
+ * tmp, toggle, trim, type, unEscapeHtml, uniq, unparam, upperCaseFirst, uriQuery,
92
+ * urlDecode, urlEncode, utf8, vsprintf, win
93
+ */
94
+ }
95
+ export interface DSLibDetect {
96
+ /**
97
+ * Whether or not the site is secure (Https://).
98
+ */
99
+ readonly ssl: boolean;
100
+ readonly scriptLoaded: boolean;
101
+ /**
102
+ * The following Functions & Options are internal & ignored
103
+ * OnCreatWS, OnDetectNext, StartWSByIPTimeoutId, StartWSTimeoutId,
104
+ * aryReconnectSTwains, arySTwains, arySTwainsByIP, bFirst,
105
+ * bNeedUpgradeEvent, bNoControlEvent, bOK, bPromptJSOrServerOutdated,
106
+ * cUrlIndex, cssLoaded, dcpCallbackType, dcpStatus, detectType, getVersionArray,
107
+ * isDWTVersionLatest, needUpgrade, onNoControl, onNotAllowedForChrome, ports,
108
+ * starting, tryTimes, urls, viewerScriptLoaded, wasmScriptLoaded,
109
+ * OnWebTwainPostExecute, OnWebTwainPreExecute, hideMask, showMask,
110
+ * win64Ports, __WebTwainMain, __dialog
111
+ */
112
+ }
113
+ export interface DSLibEnv {
114
+ /**
115
+ * Whether the browser is Chrome.
116
+ */
117
+ readonly bChrome: boolean;
118
+ /**
119
+ * Whether the browser is Edge.
120
+ */
121
+ readonly bEdge: boolean;
122
+ /**
123
+ * Whether the page is opening from the disk.
124
+ */
125
+ readonly bFileSystem: boolean;
126
+ /**
127
+ * Whether the browser is Firefox.
128
+ */
129
+ readonly bFirefox: boolean;
130
+ /**
131
+ * Whether the browser is IE.
132
+ */
133
+ readonly bIE: boolean;
134
+ /**
135
+ * Whether the browser is Safari.
136
+ */
137
+ readonly bSafari: boolean;
138
+ /**
139
+ * Whether the operating system is Linux.
140
+ */
141
+ readonly bLinux: boolean;
142
+ /**
143
+ * Whether the operating system is macOS.
144
+ */
145
+ readonly bMac: boolean;
146
+ /**
147
+ * Whether the operating system is mobile (Android & iOS & iPadOS).
148
+ */
149
+ readonly bMobile: boolean;
150
+ /**
151
+ * Whether the operating system is Windows.
152
+ */
153
+ readonly bWin: boolean;
154
+ /**
155
+ * Whether the operating system is 64bit Windows.
156
+ */
157
+ readonly bWin64: boolean;
158
+ /**
159
+ * The base path.
160
+ */
161
+ readonly basePath: string;
162
+ /**
163
+ * The WebSocket session id.
164
+ */
165
+ readonly WSSession: number;
166
+ /**
167
+ * The WebSocket version.
168
+ */
169
+ readonly WSVersion: string;
170
+ /**
171
+ * The plugin lenghth.
172
+ */
173
+ readonly iPluginLength: number;
174
+ /**
175
+ * Whether it is a desktop viewer.
176
+ */
177
+ isDesktopViewer(): boolean;
178
+ /**
179
+ * Whether it is a mobile viewer.
180
+ */
181
+ isMobileViewer(): boolean;
182
+ /**
183
+ * Whether it is a pad viewer.
184
+ */
185
+ isPadViewer(): boolean;
186
+ /**
187
+ * Whether the platform is 64bit.
188
+ */
189
+ readonly isX64: boolean;
190
+ /**
191
+ * Information about macOSX.
192
+ */
193
+ readonly macOSX: string;
194
+ /**
195
+ * OS version.
196
+ */
197
+ readonly osVersion: string;
198
+ /**
199
+ * The path type used to calculate the real path.
200
+ */
201
+ readonly pathType: number;
202
+ /**
203
+ * The version of Chrome.
204
+ */
205
+ readonly strChromeVersion: number | string;
206
+ /**
207
+ * The version of Firefox.
208
+ */
209
+ readonly strFirefoxVersion: number | string;
210
+ /**
211
+ * The version of IE.
212
+ */
213
+ readonly strIEVersion: number | string;
214
+ }
215
+ export interface WebTwainEnv {
216
+ /**
217
+ * Whether to install the ActiveX with CAB.
218
+ */
219
+ ActiveXInstallWithCAB: boolean;
220
+ /**
221
+ * The version of the ActiveX;
222
+ */
223
+ readonly ActiveXVersion: string;
224
+ /**
225
+ * Whether to create a WebTwain instance automatically upon page load.
226
+ */
227
+ AutoLoad: boolean;
228
+ /**
229
+ * Close a dialog opened by the method ShowDialog.
230
+ */
231
+ CloseDialog(): void;
232
+ /**
233
+ * A map of all WebTwain instances.
234
+ */
235
+ ContainerMap: any;
236
+ /**
237
+ * Define the Id and UI of the WebTwain instances.
238
+ */
239
+ Containers: Container[];
240
+ /**
241
+ * Create a WebTwain instance with UI.
242
+ * @param ContainerId Specify the HTML element (typically of the type HTMLDivElement) to hold the UI.
243
+ * @param host Specify the host.
244
+ * @param port Specify the port.
245
+ * @param portSSL Specify the SSL port.
246
+ * @param successCallback A callback function that is executed if the request succeeds.
247
+ * @param failureCallback A callback function that is executed if the request fails.
248
+ */
249
+ CreateDWTObject(
250
+ ContainerId: string,
251
+ host: string,
252
+ port: string | number,
253
+ portSSL: string | number,
254
+ successCallBack: (DWObject: WebTwain) => void,
255
+ failureCallBack: (errorString: string) => void): void;
256
+ /**
257
+ * Create a WebTwain instance with UI.
258
+ * @param ContainerId Specify the HTML element (typically of the type HTMLDivElement) to hold the UI.
259
+ * @param host Specify the host.
260
+ * @param port Specify the port.
261
+ * @param portSSL Specify the SSL port.
262
+ * @param successCallback A callback function that is executed if the request succeeds.
263
+ * @param failureCallback A callback function that is executed if the request fails.
264
+ */
265
+ CreateDWTObject(ContainerId: string, successCallBack: (DWObject: WebTwain) => void, failureCallBack: (errorString: string) => void): void;
266
+ /**
267
+ * Create a WebTwain instance without UI.
268
+ * @param WebTwainId Specify the Id of the instance.
269
+ * @param successCallback A callback function that is executed if the request succeeds.
270
+ * @param failureCallback A callback function that is executed if the request fails.
271
+ */
272
+ CreateDWTObjectEx(dwtInitialConfig: DWTInitialConfig, successCallBack: (DWObject: WebTwain) => void, failureCallBack: (errorString: string) => void): void;
273
+ /**
274
+ * Define the display info.
275
+ */
276
+ CustomizableDisplayInfo: DisplayInfo;
277
+ /**
278
+ * Remove and destroy a WebTwain instance.
279
+ * @param Id Specify the instance with its ContainerId or WebTwainId.
280
+ */
281
+ DeleteDWTObject(Id: string): boolean;
282
+ /**
283
+ * Return the WebTwain instance specified by its ContainerId. If no parameter is provided, the first valid WebTwain instance is returnd.
284
+ * @param ContainerId The ContainerId.
285
+ */
286
+ GetWebTwain(ContainerId?: string): WebTwain;
287
+ /**
288
+ * Return the WebTwain instance specified by its WebTwainId. If no parameter is provided, the first valid WebTwain instance is returnd.
289
+ * @param WebTwainId The WebTwainId.
290
+ */
291
+ GetWebTwainEx(WebTwainId?: string): WebTwain;
292
+ /**
293
+ * Whether or not an md5 header `dwt-md5` should be included in HTTP upload requests.
294
+ */
295
+ IfAddMD5InUploadHeader: boolean;
296
+ /**
297
+ * Whether to confine the mask within the viewer element.
298
+ */
299
+ IfConfineMaskWithinTheViewer: boolean;
300
+ /**
301
+ * Whether to use ActiveX for IE 10 & 11.
302
+ */
303
+ IfUseActiveXForIE10Plus: boolean;
304
+ /**
305
+ * The version of the JavaScript script.
306
+ */
307
+ readonly JSVersion: string;
308
+ /**
309
+ * Create a WebTwain instance(s).
310
+ */
311
+ Load(): void;
312
+ /**
313
+ * A callback function that is executed when the WebTwain related files are not found.
314
+ */
315
+ OnWebTwainNotFound: () => {};
316
+ /**
317
+ * A callback function that is executed after a time-consuming operation.
318
+ */
319
+ OnWebTwainPostExecute: () => {};
320
+ /**
321
+ * A callback function that is executed before a time-consuming operation.
322
+ */
323
+ OnWebTwainPreExecute: () => {};
324
+ /**
325
+ * A callback function that is executed when a WebTwain instance is created.
326
+ */
327
+ OnWebTwainReady: () => {};
328
+ /**
329
+ * A callback function that is executed right before the creation of a WebTwain instance.
330
+ */
331
+ OnWebTwainWillInit: () => {};
332
+ /**
333
+ * The version of the PDF module (not the rasterizer).
334
+ */
335
+ PdfVersion: string;
336
+ /**
337
+ * The version of the plug-in edition.
338
+ */
339
+ PluginVersion: string;
340
+ /**
341
+ * Set or return the product key for the library. A product key is required to enables certain modules of the library.
342
+ */
343
+ ProductKey: string;
344
+ /**
345
+ * The product name.
346
+ */
347
+ readonly ProductName: string;
348
+ /**
349
+ * Attach the callback function to the specified event.
350
+ * @param event Specify the event.
351
+ * @param callback Specify the callback.
352
+ */
353
+ RegisterEvent(event: string, callback: (...args: any[]) => void): void;
354
+ /**
355
+ * Remove all authorizations for accessing local resources.
356
+ */
357
+ RemoveAllAuthorizations(): void;
358
+ /**
359
+ * Set or return where the library looks for resources files including service installers, CSS, etc.
360
+ */
361
+ ResourcesPath: string;
362
+ /**
363
+ * The version of the Linux edition (the service, not wasm).
364
+ */
365
+ ServerLinuxVersionInfo: string;
366
+ /**
367
+ * The version of the macOS edition (the service, not wasm).
368
+ */
369
+ ServerMacVersionInfo: string;
370
+ /**
371
+ * The version of the Windows edition (the service, not wasm).
372
+ */
373
+ ServerVersionInfo: string;
374
+ /**
375
+ * Built-in method to show a modal dialog.
376
+ * @param width Width of the dialog.
377
+ * @param height Height of the dialog.
378
+ * @param content Content of the dialog.
379
+ * @param simple Whether to show a simple dialog with no header.
380
+ * @param hideCloseButton Whether to hide the close button.
381
+ */
382
+ ShowDialog(width: number, height: number, content: string, simple: boolean, hideCloseButton: boolean): void;
383
+ /**
384
+ * Remove and destroy all WebTwain instances.
385
+ */
386
+ Unload(): void;
387
+ /**
388
+ * Whether to download the wasm for Camera Addon to use on initialization.
389
+ */
390
+ UseCameraAddonWasm: boolean;
391
+ /**
392
+ * Whether to use the library in Local-Service mode or WASM mode.
393
+ */
394
+ UseLocalService: boolean;
395
+ /**
396
+ * Whether to load UI related js files.
397
+ */
398
+ UseDefaultViewer: boolean;
399
+ /**
400
+ * Control whether the scanner related UI & load/save UI are always display in the front window.
401
+ */
402
+ IfAlwaysFocusOnPopupWindow: boolean;
403
+ ConnectToTheService: () => void;
404
+ initQueue: any[];
405
+ /**
406
+ * The following Functions & Options are internal & ignored
407
+ * ActiveXIntegerited, CheckConnectToTheService,
408
+ * ContainerMap, Debug, DynamicContainers,
409
+ * DynamicDWTMap, GetLocalServiceStatus,IfCheck64bitServiceFirst,
410
+ * IfCheckDCP, IfCheckDWT,
411
+ * IfDisableDefaultSettings, IfDownload64bitService,
412
+ * IfInstallDWTModuleWithZIP, IfUpdateService,
413
+ * IfUseEmbeddedDownloadNoticeForActiveX, IfUseViewer,
414
+ * OnWebTwainInitMessage, OnWebTwainNeedUpgrade,
415
+ * OnWebTwainNeedUpgradeWebJavascript, OnWebTwainInitMessage
416
+ * OnWebTwainOldPluginNotAllowed, OnWebTwainOldPluginNotAllowed
417
+ * Trial, UseDefaultInstallUI, ViewerJSIntegerited,
418
+ * inited, _srcUseLocalService
419
+ */
420
+ }
421
+ export interface DisplayInfo {
422
+ buttons: any;
423
+ customProgressText: any;
424
+ dialogText: any;
425
+ errorMessages: any;
426
+ generalMessages: any;
427
+ }
428
+ /**
429
+ * Define default messages.
430
+ */
431
+ export interface Messages {
432
+ ConvertingToBase64: string;
433
+ ConvertingToBlob: string;
434
+ Downloading: string;
435
+ Encoding: string;
436
+ Err_BrowserNotSupportWasm: string;
437
+ Init_AllJsLoaded: string;
438
+ Init_CheckDWT: string;
439
+ Init_CheckDWTVersion: string;
440
+ Init_CheckingLicense: string;
441
+ Init_CompilingWasm: string;
442
+ Init_ConfiguringDWT: string;
443
+ Init_CreatingDWT: string;
444
+ Init_DownloadingWasm: string;
445
+ Init_FireBeforeInitEvt: string;
446
+ Init_GetLicenseInfoForDWT: string;
447
+ Init_InitActiveX: string;
448
+ Init_InitDynamsoftService: string;
449
+ Init_InitH5: string;
450
+ Init_InitWasm: string;
451
+ Init_LoadingViewerJs: string;
452
+ Init_LookingLicense: string;
453
+ Init_SetLicenseForDWT: string;
454
+ Loading: string;
455
+ LoadingPdf: string;
456
+ LoadingTiff: string;
457
+ SavingPdf: string;
458
+ SavingTiff: string;
459
+ Uploading: string;
460
+ }
461
+ export interface ManagerEnv {
462
+ IfUpdateService: boolean;
463
+ resourcesPath: string;
464
+ }
465
+ /**
466
+ * Interface for a WebTwain profile.
467
+ */
468
+ export interface Container {
469
+ WebTwainId: string;
470
+ ContainerId?: string;
471
+ Width?: string | number;
472
+ Height?: string | number;
473
+ bNoUI?: boolean;
474
+ bLocalService?: boolean;
475
+ }
476
+ export interface Product {
477
+ bActiveXEdition: boolean;
478
+ bChromeEdition: boolean;
479
+ bHTML5Edition: boolean;
480
+ bPluginEdition: boolean;
481
+ host: string;
482
+ name: string;
483
+ }
484
+ export interface WasmConfig {
485
+ /**
486
+ * Maximum heap size
487
+ */
488
+ maxHeapSize: number;
489
+ /**
490
+ * fetch API Options
491
+ */
492
+ fetchOptions: any;
493
+ }
494
+ declare const Dynamsoft: (typeof DynamsoftEnums & typeof DynamsoftStatic);
495
+ export default Dynamsoft;