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,1059 +1,1059 @@
1
- import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
2
- import { WebTwainEdit } from "./WebTwain.Edit";
3
-
4
- export interface WebTwainAcquire extends WebTwainEdit {
5
- /**
6
- * Start image acquisition.
7
- * @param deviceConfiguration Configuration for the acquisition.
8
- * @param successCallback A callback function that is executed if the request succeeds.
9
- * @param failureCallback A callback function that is executed if the request fails.
10
- * @argument errorCode The error code.
11
- * @argument errorString The error string.
12
- */
13
- AcquireImage(
14
- successCallBack?: () => void,
15
- failureCallBack?: (
16
- errorCode: number,
17
- errorString: string) => void
18
- ): void;
19
- AcquireImage(
20
- deviceConfiguration?: DeviceConfiguration,
21
- successCallBack?: () => void,
22
- failureCallBack?: (
23
- deviceConfiguration: DeviceConfiguration,
24
- errorCode: number,
25
- errorString: string) => void
26
- ): void;
27
- /**
28
- * Close the data source (a TWAIN/ICA/SANE device which in most cases is a scanner) to free it to be used by other applications.
29
- */
30
- CloseSource(): boolean;
31
- /**
32
- * Close the data source (a TWAIN/ICA/SANE device which in most cases is a scanner) to free it to be used by other applications.
33
- */
34
- CloseSourceAsync(): Promise<boolean>;
35
- /**
36
- * Disable the data source (a TWAIN/ICA/SANE device which in most cases is a scanner) to stop the acquiring process. If the data source's user interface is displayed, it will be closed.
37
- */
38
- DisableSource(): boolean;
39
- /**
40
- * Enable the data source to start the acquiring process.
41
- */
42
- EnableSource(): boolean;
43
- /**
44
- * Display the TWAIN source's built-in user interface.
45
- * @param successCallback A callback function that is executed if the request succeeds.
46
- * @param failureCallback A callback function that is executed if the request fails.
47
- * @argument errorCode The error code.
48
- * @argument errorString The error string.
49
- */
50
- EnableSourceUI(
51
- successCallBack: () => void,
52
- failureCallBack: (
53
- errorCode: number,
54
- errorString: string) => void
55
- ): void;
56
- /**
57
- * Load a data source to get it ready to acquire images.
58
- */
59
- OpenSource(): boolean;
60
- /**
61
- * Return all available data sources (scanners, etc.) and optionally all detailed information about them.
62
- * @param bIncludeDetails Whether to return more details about the data sources or just their names.
63
- */
64
- /**
65
- * Load a data source to get it ready to acquire images.
66
- */
67
- OpenSourceAsync(): Promise<boolean>;
68
- GetSourceNames(bIncludeDetails?: boolean): string[] | SourceDetails[];
69
- /**
70
- * Return all available data sources (scanners, etc.) and optionally all detailed information about them.
71
- * @param bIncludeDetails Whether to return more details about the data sources or just their names.
72
- */
73
- GetSourceNamesAsync(bIncludeDetails: boolean): Promise<string[] | SourceDetails[]>;
74
- /**
75
- * Bring up the Source Selection User Interface (UI) for the user to choose a data source.
76
- * @param successCallback A callback function that is executed if the request succeeds.
77
- * @param failureCallback A callback function that is executed if the request fails.
78
- * @argument errorCode The error code.
79
- * @argument errorString The error string.
80
- */
81
- SelectSource(
82
- successCallBack?: () => void,
83
- failureCallBack?: (errorCode: number, errorString: string) => void
84
- ): boolean | void;
85
- /**
86
- * Bring up the Source Selection User Interface (UI) for the user to choose a data source.
87
- * @param successCallback A callback function that is executed if the request succeeds.
88
- * @param failureCallback A callback function that is executed if the request fails.
89
- * @argument errorCode The error code.
90
- * @argument errorString The error string.
91
- */
92
- SelectSourceAsync(
93
- successCallBack?: () => void,
94
- failureCallBack?: (errorCode: number, errorString: string) => void
95
- ): Promise<boolean>;
96
- /**
97
- * Select a data source by its index.
98
- * @param index The index of the data source.
99
- */
100
- SelectSourceByIndex(index: number): boolean;
101
- /**
102
- * Select a data source by its index.
103
- * @param index The index of the data source.
104
- */
105
- SelectSourceByIndexAsync(index: number): Promise<boolean>;
106
- /**
107
- * Sets a timer which stops the data source opening process once it expires.
108
- * @param duration Define the duration of the timer (in milliseconds).
109
- */
110
- SetOpenSourceTimeout(duration: number): boolean;
111
- /**
112
- * Start the acquisition by passing all settings at once.
113
- * @param scanSetup Configuration for the acquisition.
114
- */
115
- startScan(scanSetup: ScanSetup): Promise<ScanSetup>;
116
- /**
117
- * Cancels all pending transfers.
118
- */
119
- CancelAllPendingTransfers(): boolean;
120
- /**
121
- * Closes and unloads Data Source Manager.
122
- */
123
- CloseSourceManager(): boolean;
124
- /**
125
- * Closes and unloads Data Source Manager.
126
- */
127
- CloseSourceManagerAsync(): Promise<boolean>;
128
- /**
129
- * Closes the scanning process to release resources on the machine.
130
- */
131
- CloseWorkingProcess(): boolean;
132
- /**
133
- * Ejects the current page and begins scanning the next page in the document feeder.
134
- */
135
- FeedPage(): boolean;
136
- /**
137
- * Get the custom data source data and saves the data in a specified file.
138
- * @param fileName The path of the file to save the data source data to.
139
- */
140
- GetCustomDSData(fileName: string): boolean;
141
- /**
142
- * Gets custom DS data and returns it in a base64 string.
143
- */
144
- GetCustomDSDataEx(): string;
145
- /**
146
- * Inspect the current data source and return whether it is a scanner, a webcam, etc.
147
- */
148
- GetDeviceType(): number;
149
- /**
150
- * Get the name of a data source by its index in data source manager source list.
151
- * @param index The index of the data source.
152
- */
153
- GetSourceNameItems(index: number): string;
154
- /**
155
- * Load and open data source manager.
156
- */
157
- OpenSourceManager(): boolean;
158
- /**
159
- * Load and open data source manager.
160
- */
161
- OpenSourceManagerAsync(): Promise<boolean>;
162
- /**
163
- * Reset the image layout in the data source.
164
- */
165
- ResetImageLayout(): boolean;
166
- /**
167
- * If called while {IfFeederEnabled} property is true, the data source will return the current page to the input area and return the last page from the output area into the acquisition area.
168
- */
169
- RewindPage(): boolean;
170
- /**
171
- * Sets custom data source data to be used for scanning, the data is stored in a file which can be regarded as a scanning profile.
172
- * @param fileName The path of the file.
173
- */
174
- SetCustomDSData(fileName: string): boolean;
175
- /**
176
- * Set custom data source data to be used for scanning, the input is a base64 string.
177
- * @param dsDataString The string that contains custom data source data.
178
- */
179
- SetCustomDSDataEx(dsDataString: string): boolean;
180
- /**
181
- * Set the file transfer information to be used in File Transfer mode.
182
- * @param fileName The path to transfer the file to.
183
- * @param fileFormat The format of the file.
184
- */
185
- SetFileXferInfo(
186
- fileName: string,
187
- fileFormat: Dynamsoft.EnumDWT_FileFormat | number
188
- ): boolean;
189
- /**
190
- * Set the left, top, right, and bottom sides of the image layout
191
- * rectangle for the current data source. The image layout rectangle
192
- * defines a frame of the data source's scanning area to be acquired.
193
- * @param left Specify the rectangle (leftmost coordinate).
194
- * @param top Specify the rectangle (topmost coordinate).
195
- * @param right Specify the rectangle (rightmost coordinate).
196
- * @param bottom Specify the rectangle (bottommost coordinate).
197
- */
198
- SetImageLayout(
199
- left: number,
200
- top: number,
201
- right: number,
202
- bottom: number
203
- ): boolean;
204
- /**
205
- * Return or set the pixel bit depth for the current value of `PixelType`.
206
- */
207
- BitDepth: number;
208
- /**
209
- * Return or set whether newly acquired images are inserted or appended.
210
- */
211
- IfAppendImage: boolean;
212
- /**
213
- * Return or set whether to close the user interface after all images have been acquired.
214
- */
215
- IfDisableSourceAfterAcquire: boolean;
216
- /**
217
- * Return or set whether to enable duplex scanning (in other words, whether to scan both sides of the paper).
218
- */
219
- IfDuplexEnabled: boolean;
220
- /**
221
- * Return or set whether a data source's Automatic Document Feeder (ADF) is enabled for scanning.
222
- */
223
- IfFeederEnabled: boolean;
224
- /**
225
- * Return or set whether the data source displays the user interface when scanning.
226
- */
227
- IfShowUI: boolean;
228
- /**
229
- * Return or set whether to use TWAIN or ICA protocol on macOS.
230
- */
231
- ImageCaptureDriverType: Dynamsoft.EnumDWT_Driver | number;
232
- /**
233
- * Return or set the page size the data source uses to acquire images.
234
- */
235
- PageSize: Dynamsoft.EnumDWT_CapSupportedSizes | number;
236
- /**
237
- * Return or set the pixel type used when acquiring images.
238
- */
239
- PixelType: Dynamsoft.EnumDWT_PixelType | number;
240
- /**
241
- * Return or set the resolution used when acquiring images.
242
- */
243
- Resolution: number;
244
- /**
245
- * Returns how many data sources are available on the local system.
246
- */
247
- readonly SourceCount: number;
248
- /**
249
- * Return or set the brightness to be used for scanning by the data source.
250
- */
251
- Brightness: number;
252
- /**
253
- * Return or set Contrast to be used for scanning by the data source.
254
- */
255
- Contrast: number;
256
- /**
257
- * Return the device name of current source.
258
- */
259
- readonly CurrentSourceName: string;
260
- /**
261
- * Return a value that indicates the data source status.
262
- */
263
- DataSourceStatus: number;
264
- /**
265
- * Return the name of the default source.
266
- */
267
- DefaultSourceName: string;
268
- /**
269
- * Return whether the source supports duplex. If yes, it further returns the level of duplex the data source supports.
270
- */
271
- readonly Duplex: Dynamsoft.EnumDWT_DUPLEX | number;
272
- /**
273
- * Return or set whether to enable the data source's auto-brightness feature.
274
- */
275
- IfAutoBright: boolean;
276
- /**
277
- * Return or set whether the data source (the scanner) discards blank images during scanning automatically.
278
- */
279
- IfAutoDiscardBlankpages: boolean;
280
- /**
281
- * Return or set whether to enable the data source's automatic document feeding process.
282
- */
283
- IfAutoFeed: boolean;
284
- /**
285
- * Return or set whether to enable the data source's automatic border detection feature.
286
- */
287
- IfAutomaticBorderDetection: boolean;
288
- /**
289
- * Return or set whether to enable the data source's automatic skew correction feature.
290
- */
291
- IfAutomaticDeskew: boolean;
292
- /**
293
- * Return or set whether to enable the data source's automatic document scanning process.
294
- */
295
- IfAutoScan: boolean;
296
- /**
297
- * Return whether or not there are documents loaded in the data source's feeder.
298
- */
299
- readonly IfFeederLoaded: boolean;
300
- /**
301
- * Return whether the Source has a paper sensor that can detect pages on the ADF or Flatbed.
302
- */
303
- readonly IfPaperDetectable: boolean;
304
- /**
305
- * Return or set whether the data source displays a progress indicator during acquisition and transfer.
306
- */
307
- IfShowIndicator: boolean;
308
- /**
309
- * Return whether the data source supports acquisitions with the UI (User Interface) disabled.
310
- */
311
- readonly IfUIControllable: boolean;
312
- /**
313
- * Return or set whether the new TWAIN DSM (data source Manager) is used for acquisitions. The new TWAIN DSM is a DLL called 'TWAINDSM.dll' while the default | old DSM is called 'twain_32.dll'.
314
- */
315
- IfUseTwainDSM: boolean;
316
- /**
317
- * Return the value of the bottom edge of the current image frame (in Unit).
318
- */
319
- readonly ImageLayoutFrameBottom: number;
320
- /**
321
- * Return the value of the left edge of the current image frame (in Unit).
322
- */
323
- readonly ImageLayoutFrameLeft: number;
324
- /**
325
- * Return the value of the right edge of the current image frame (in Unit).
326
- */
327
- readonly ImageLayoutFrameRight: number;
328
- /**
329
- * Return the value of the top edge of the current image frame (in Unit).
330
- */
331
- readonly ImageLayoutFrameTop: number;
332
- /**
333
- * Return the document number of the current image.
334
- */
335
- readonly ImageLayoutDocumentNumber: number;
336
- /**
337
- * Return the page number of the current image.
338
- */
339
- readonly ImageLayoutPageNumber: number;
340
- /**
341
- * Return the bit depth of the current image.
342
- */
343
- readonly ImageBitsPerPixel: number;
344
- /**
345
- * Return the pixel type of the current image.
346
- */
347
- readonly ImagePixelType: Dynamsoft.EnumDWT_PixelType | number;
348
- /**
349
- * Return the length of the current image.
350
- */
351
- readonly ImageLength: number;
352
- /**
353
- * Return the width of the current image.
354
- */
355
- readonly ImageWidth: number;
356
- /**
357
- * Return the horizontal resolution of the current image.
358
- */
359
- readonly ImageXResolution: number;
360
- /**
361
- * Return the vertical resolution of the current image.
362
- */
363
- readonly ImageYResolution: number;
364
- /**
365
- * Return the data of the magnetic data if the data source supports magnetic data recognition.
366
- */
367
- readonly MagData: string;
368
- /**
369
- * Return the type of the magnetic data if the data source supports magnetic data recognition.
370
- */
371
- readonly MagType: Dynamsoft.EnumDWT_MagType | number;
372
- /**
373
- * Return the number of transfers the data source is ready to supply upon demand.
374
- */
375
- readonly PendingXfers: number;
376
- /**
377
- * Return or set the pixel flavor to be used for acquiring images.
378
- */
379
- PixelFlavor: number;
380
- /**
381
- * Return or set the data source's transfer mode.
382
- */
383
- TransferMode: Dynamsoft.EnumDWT_TransferMode | number;
384
- /**
385
- * Return or set the unit of measure for all quantities.
386
- */
387
- Unit: Dynamsoft.EnumDWT_UnitType | number;
388
- /**
389
- * Return and set the number of images your application is willing to accept for each scan job.
390
- */
391
- XferCount: number;
392
- /**
393
- * Gets detailed information about all capabilities of the current data source.
394
- * @param successCallback A callback function that is executed if the request succeeds.
395
- * @param failureCallback A callback function that is executed if the request fails.
396
- * @argument capabilityDetails Detailed information about the specified capabilities.
397
- * @argument errorCode The error code.
398
- * @argument errorString The error string.
399
- */
400
- getCapabilities(
401
- succssCallback: (capabilityDetails: CapabilityDetails[]) => void,
402
- failureCallback: (
403
- errorCode: number,
404
- errorString: string
405
- ) => void
406
- ): void;
407
- /**
408
- * Sets up one or multiple capabilities in one call.
409
- * @param capabilities A object that describes how to set capabilities.
410
- * @param successCallback A callback function that is executed if the request succeeds.
411
- * @param failureCallback A callback function that is executed if the request fails.
412
- * @argument capabilities The capabilities to set.
413
- */
414
- setCapabilities(
415
- capabilities: Capabilities,
416
- succssCallback: (capabilities: Capabilities) => void,
417
- failureCallback: (capabilities: Capabilities) => void
418
- ): void;
419
- /**
420
- * [Deprecation] Specifies the capabiltiy to be negotiated. This is a runtime property.
421
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
422
- */
423
- Capability: Dynamsoft.EnumDWT_Cap;
424
- /**
425
- * [Deprecation] Return or set the index (0-based) of
426
- * a list to indicate the Current Value when the value of
427
- * the CapType property is TWON_ENUMERATION. If the data type
428
- * of the capability is String, the list is in CapItemsString property.
429
- * For other data types, the list is in CapItems property. This is a runtime property.
430
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
431
- */
432
- CapCurrentIndex: number;
433
- /**
434
- * [Deprecation] Return or set the current value in a range when the
435
- * value of the CapType property is TWON_RANGE. This is a runtime property.
436
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
437
- */
438
- CapCurrentValue: number;
439
- /**
440
- * [Deprecation] Return the index (0-based) of a list to indicate the
441
- * Default Value when the value of the CapType property is TWON_ENUMERATION.
442
- * If the data type of the capability is String, the list is in CapItemsString property.
443
- * For other data types, the list is in CapItems property. This is a runtime, read-only property.
444
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
445
- */
446
- readonly CapDefaultIndex: number;
447
- /**
448
- * [Deprecation] Return the default value in a range when the value of the
449
- * CapType property is TWON_RANGE. This is a runtime, read-only property.
450
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
451
- */
452
- CapDefaultValue: number;
453
- /**
454
- * [Deprecation] Retruns the description for a capability
455
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
456
- */
457
- CapDescription: string;
458
- /**
459
- * [Deprecation] Return or set the maximum value in a range when the
460
- * value of the CapType property is TWON_RANGE. This is a runtime property.
461
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
462
- */
463
- CapMaxValue: number;
464
- /**
465
- * [Deprecation] Return or set the minimum value in a range when the
466
- * value of the CapType property is TWON_RANGE. This is a runtime property.
467
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
468
- */
469
- CapMinValue: number;
470
- /**
471
- * [Deprecation] Return or set how many items are in the list when the
472
- * value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
473
- * For String data type, the list is in CapItemsString property.
474
- * For other data types, the list is in CapItems property.
475
- * This is a runtime property.
476
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
477
- */
478
- CapNumItems: number;
479
- /**
480
- * [Deprecation] Return or set the step size in a range when the value
481
- * of the CapType property is TWON_RANGE. This is a runtime property.
482
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
483
- */
484
- CapStepSize: number;
485
- /**
486
- * [Deprecation] Return or set the type of capability container used
487
- * to exchange capability information between application and source.
488
- * This is a runtime property.
489
- */
490
- CapType: Dynamsoft.EnumDWT_CapType;
491
- /**
492
- * [Deprecation] Return or set the value of the capability specified by
493
- * Capability property when the value of the CapType property is TWON_ONEVALUE.
494
- * This is a runtime property.
495
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
496
- */
497
- CapValue: number;
498
- /**
499
- * [Deprecation] Return or set the string value for a capability when the
500
- * value of the CapType property is TWON_ONEVALUE. This is a runtime property.
501
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
502
- */
503
- CapValueString: string;
504
- /**
505
- * [Deprecation] Return or set the value type for reading the value of a capability.
506
- * This is a runtime property.
507
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
508
- */
509
- CapValueType: number;
510
- /**
511
- * [Deprecation] Gets information of the capability specified by the Capability property.
512
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
513
- */
514
- CapGet(): boolean;
515
- /**
516
- * [Deprecation] Return the Source's current Value for the specified capability.
517
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
518
- */
519
- CapGetCurrent(): boolean;
520
- /**
521
- * [Deprecation] Return the Source's Default Value for the specified capability.
522
- * This is the Source's preferred default value.
523
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
524
- */
525
- CapGetDefault(): boolean;
526
- /**
527
- * [Deprecation] Return the value of the bottom-most edge of the specified frame.
528
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
529
- * @param index specifies the value of which frame to get. The index is 0-based.
530
- */
531
- CapGetFrameBottom(index: number): number;
532
- /**
533
- * [Deprecation] Return the value (in Unit) of the left-most edge of the specified frame.
534
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
535
- * @param index specifies the value of which frame to get. The index is 0-based.
536
- */
537
- CapGetFrameLeft(index: number): number;
538
- /**
539
- * [Deprecation] Return the value (in Unit) of the left-most edge of the specified frame.
540
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
541
- * @param index specifies the value of which frame to get. The index is 0-based.
542
- */
543
- CapGetFrameRight(index: number): number;
544
- /**
545
- * [Deprecation] Return the value (in Unit) of the top-most edge of the specified frame.
546
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
547
- * @param index specifies the value of which frame to get. The index is 0-based.
548
- */
549
- CapGetFrameTop(index: number): number;
550
- /**
551
- * [Deprecation] Use getCapabilities() and setCapabilities() instead.
552
- */
553
- CapGetHelp(index: number): number;
554
- /**
555
- * [Deprecation] Use getCapabilities() and setCapabilities() instead.
556
- */
557
- CapGetLabel(index: number): number;
558
- /**
559
- * [Deprecation] Use getCapabilities() and setCapabilities() instead.
560
- */
561
- CapGetLabels(index: number): number;
562
- /**
563
- * [Deprecation] Queries whether the Source supports a particular operation on the capability.
564
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
565
- * @param {Dynamsoft.EnumDWT_MessageType} messageType specifies the type of capability operation.
566
- */
567
- CapIfSupported(messageType: Dynamsoft.EnumDWT_MessageType): boolean;
568
- /**
569
- * [Deprecation] Changes the Current Value of the capability specified by
570
- * Capability property back to its power-on value.
571
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
572
- */
573
- CapReset(): boolean;
574
- /**
575
- * [Deprecation] Sets the current capability using the container type specified by
576
- * CapType property. The current capability is specified by Capability property.
577
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
578
- */
579
- CapSet(): boolean;
580
- /**
581
- * [Deprecation] Sets the values of the specified frame.
582
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
583
- * @param index specifies the values of which frame to set. The index is 0-based.
584
- * @param left the value (in Unit) of the left-most edge of the specified frame.
585
- * @param top the value (in Unit) of the top-most edge of the specified frame.
586
- * @param right the value (in Unit) of the right-most edge of the specified frame.
587
- * @param bottom the value (in Unit) of the bottom-most edge of the specified frame.
588
- */
589
- CapSetFrame(index: number, left: number, top: number, right: number, bottom: number): boolean;
590
- /**
591
- * Get the cap item value of the capability specified by Capability property,
592
- * when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
593
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
594
- * @param index Index is 0-based. It is the index of the cap item.
595
- */
596
- GetCapItems(index: number): number;
597
- /**
598
- * Returns the cap item value of the capability specified by Capability property,
599
- * when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
600
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
601
- * @param index Index is 0-based. It is the index of the cap item.
602
- */
603
- GetCapItemsString(index: number): string;
604
- /**
605
- * [Deprecation] Set the value of the specified cap item.
606
- * @param index Index is 0-based. It is the index of the cap item.
607
- * @param newVal For string type, please use CapItemsstring property.
608
- */
609
- SetCapItems(index: number, newVal: number): void;
610
- /**
611
- * [Deprecation] Set the cap item value of the capability specified by Capability property,
612
- * when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
613
- * [Alternative] Use getCapabilities() and setCapabilities() instead.
614
- * @param index Index is 0-based. It is the index of the cap item.
615
- * @param newVal The new value to be set.
616
- */
617
- SetCapItemsString(index: number, newVal: string): void;
618
- }
619
- export interface DeviceConfiguration {
620
- /**
621
- * Whether to show the built-in User Interface from the device vendor
622
- */
623
- IfShowUI?: boolean;
624
- /**
625
- * How a pixel is represented. Basically it means whether to scan in color, grey or black & white
626
- */
627
- PixelType?: Dynamsoft.EnumDWT_PixelType | number | string;
628
- /**
629
- * How detailed is the acquisition. Measured by dots per pixel (DPI)
630
- */
631
- Resolution?: number;
632
- /**
633
- * Whether to use the document feeder or the flatbed of the device.
634
- */
635
- IfFeederEnabled?: boolean;
636
- /**
637
- * Whether to scan one side or both sides of each paper.
638
- */
639
- IfDuplexEnabled?: boolean;
640
- /**
641
- * Whether to close the built-in User Interface after aquisition. Only valid when {IfShowUI} is true.
642
- */
643
- IfDisableSourceAfterAcquire?: boolean;
644
- /**
645
- * Whether to retrieve information about the image after it's transferred.
646
- */
647
- IfGetImageInfo?: boolean;
648
- /**
649
- * Whether to retrieve extended information about the image after it's transferred.
650
- */
651
- IfGetExtImageInfo?: boolean;
652
- /**
653
- * How much extended information is retrieved. Only valid when {IfGetExtImageInfo} is true.
654
- */
655
- extendedImageInfoQueryLevel?: number;
656
- }
657
- export interface SourceDetails {
658
- /**
659
- * The driver type which can be "TWAIN" | "ICA" | "SANE"
660
- */
661
- DriverType?: string;
662
- /**
663
- * Information about the driver if it's DriverType is "ICA"
664
- */
665
- DeviceInfo?: any;
666
- /**
667
- * The name of the data source. E.g. "TWAIN2 FreeImage Software Scanner".
668
- */
669
- ProductName?: string;
670
- /**
671
- * Whether it is the default source.
672
- */
673
- IsDefaultSource?: boolean;
674
- /**
675
- * Whether it is the current source.
676
- */
677
- IsCurrentSource?: boolean;
678
- /**
679
- * The family name of the data source. E.g. "Software Scan".
680
- */
681
- ProductFamily?: string;
682
- /**
683
- * The manufacturer of the data source. E.g. "TWAIN Working Group".
684
- */
685
- Manufacturer?: string;
686
- /**
687
- * Supported Groups
688
- */
689
- SupportedGroups?: number;
690
- /**
691
- * The version of the protocol based on which the data source is developed.
692
- */
693
- ProtocolMajor?: number;
694
- ProtocolMinor?: number;
695
- /**
696
- * Detailed version of the data source.
697
- */
698
- Version?: Version;
699
- }
700
- export interface Version {
701
- MajorNum?: number;
702
- MinorNum?: number;
703
- Language?: number;
704
- Country?: number;
705
- Info?: string;
706
- }
707
- export interface ScanSetup {
708
- /**
709
- * An id that specifies this specific setup.
710
- */
711
- setupId?: string;
712
- /**
713
- * Whether to ignore or fail the acquistion when an exception is raised. Set "ignore" or "fail".
714
- */
715
- exception?: string;
716
- /**
717
- * The name of the data source (the scanner). If not set, the default data source is used.
718
- */
719
- scanner?: string;
720
- ui?: {
721
- /**
722
- * Whether to show the UI of the device.
723
- */
724
- bShowUI?: boolean,
725
- /**
726
- * Whether to show the indicator of the device.
727
- */
728
- bShowIndicator?: boolean,
729
- };
730
- /**
731
- * The TWAIN transfer mode.
732
- */
733
- transferMode?: Dynamsoft.EnumDWT_TransferMode | number;
734
- /**
735
- * Set how the transfer is done.
736
- */
737
- fileXfer?: {
738
- /**
739
- * Specify the file name (or pattern) for file transfer.
740
- * Example: "C:\\WebTWAIN<%06d>.bmp"
741
- */
742
- fileName?: string,
743
- /**
744
- * Specify the file format.
745
- */
746
- fileFormat?: Dynamsoft.EnumDWT_FileFormat | number,
747
- /**
748
- * Specify the quality of JPEG files.
749
- */
750
- jpegQuality?: number,
751
- /**
752
- * Specify the compression type of the file.
753
- */
754
- compressionType?: Dynamsoft.EnumDWT_CompressionType | number
755
- };
756
- /**
757
- * Set where the scanned images are inserted.
758
- */
759
- insertingIndex?: number;
760
- /**
761
- * The profile is a base64 string, if present, it overrides settings and more settings.
762
- */
763
- profile?: string;
764
- /**
765
- * Basic settings.
766
- */
767
- settings?: {
768
- /**
769
- * "ignore" (default) or "fail".
770
- */
771
- exception?: string,
772
- /**
773
- * Specify the pixel type.
774
- */
775
- pixelType?: Dynamsoft.EnumDWT_PixelType | number,
776
- /**
777
- * Specify the resolution.
778
- */
779
- resolution?: number,
780
- /**
781
- * Whether to enable document feader.
782
- */
783
- bFeeder?: boolean,
784
- /**
785
- * Whether to enable duplex scan.
786
- */
787
- bDuplex?: boolean
788
- };
789
- moreSettings?: {
790
- /**
791
- * "ignore" (default) or "fail".
792
- */
793
- exception?: string,
794
- /**
795
- * Specify the bit depth.
796
- */
797
- bitDepth?: number,
798
- /**
799
- * Specify the page size.
800
- */
801
- pageSize?: Dynamsoft.EnumDWT_CapSupportedSizes | number,
802
- /**
803
- * Specify the unit.
804
- */
805
- unit?: Dynamsoft.EnumDWT_UnitType | number,
806
- /**
807
- * Specify a layout to scan, if present, it'll override pageSize.
808
- */
809
- layout?: {
810
- left?: number,
811
- top?: number,
812
- right?: number,
813
- bottom?: number
814
- },
815
- /**
816
- * Specify the pixel flavor.
817
- */
818
- pixelFlavor?: Dynamsoft.EnumDWT_CapPixelFlavor | number,
819
- /**
820
- * Specify Brightness.
821
- */
822
- brightness?: number,
823
- /**
824
- * Specify contrast.
825
- */
826
- contrast?: number,
827
- /**
828
- * Specify how many images are transferred per session.
829
- */
830
- nXferCount?: number,
831
- /**
832
- * Whether to enable automatic blank image detection and removal.
833
- */
834
- autoDiscardBlankPages?: boolean,
835
- /**
836
- * Whether to enable automatic border detection.
837
- */
838
- autoBorderDetection?: boolean,
839
- /**
840
- * Whether to enable automatic skew correction.
841
- */
842
- autoDeskew?: boolean,
843
- /**
844
- * Whether to enable automatic brightness adjustment.
845
- */
846
- autoBright?: boolean
847
- };
848
- /**
849
- * A callback triggered before the scan, after the scan and after each page has been transferred.
850
- */
851
- funcScanStatus?: (status: Status) => void;
852
- /**
853
- * Set up how the scanned images are outputted.
854
- */
855
- outputSetup?: {
856
- /**
857
- * Output type. "http" is the only supported type for now.
858
- */
859
- type?: string,
860
- /**
861
- * Set the output format.
862
- */
863
- format?: Dynamsoft.EnumDWT_ImageType | number,
864
- /**
865
- * Specify how many times the library will try the output.
866
- */
867
- reTries?: number,
868
- /**
869
- * Whether to use the FileUploader.
870
- */
871
- useUploader?: false,
872
- /**
873
- * Whether to upload all images in one HTTP post.
874
- */
875
- singlePost?: boolean,
876
- /**
877
- * Whether to show a progress bar when outputting.
878
- */
879
- showProgressBar?: boolean,
880
- /**
881
- * Whether to remove the images after outputting.
882
- */
883
- removeAfterOutput?: boolean,
884
- /**
885
- * A callback triggered during the outputting.
886
- * @argument fileInfo A JSON object that contains the fileName, percentage, statusCode, responseString, etc.
887
- */
888
- funcHttpUploadStatus?: (fileInfo: any) => void,
889
- /**
890
- * Setup for PDF output.
891
- */
892
- pdfSetup?: {
893
- author?: string,
894
- compression?: Dynamsoft.EnumDWT_PDFCompressionType | number,
895
- creator?: string,
896
- /**
897
- * Example: 'D:20181231'
898
- */
899
- creationDate?: string,
900
- keyWords?: string,
901
- /**
902
- * Example: 'D:20181231'
903
- */
904
- modifiedDate?: string,
905
- producer?: string,
906
- subject?: string,
907
- title?: string,
908
- version?: number,
909
- quality?: number
910
- },
911
- /**
912
- * Setup for TIFF output.
913
- */
914
- tiffSetup?: {
915
- quality?: number,
916
- compression?: Dynamsoft.EnumDWT_TIFFCompressionType | number,
917
- /**
918
- * Specify Tiff custom tags.
919
- */
920
- tiffTags?: TiffTag[]
921
- },
922
- /**
923
- * Setup for HTTP upload via Post.
924
- */
925
- httpParams?: {
926
- /**
927
- * Target of the request.
928
- * Example: "http://dynamsoft.com/receivepost.aspx"
929
- */
930
- url?: string,
931
- /**
932
- * Custom headers in the form.
933
- * Example: {md5: ""}
934
- */
935
- headers?: any,
936
- /**
937
- * Custom form fields.
938
- * Example: {"UploadedBy": "Dynamsoft"}
939
- */
940
- formFields?: any,
941
- /**
942
- * The maximum size of a file to be uploaded (in bytes).
943
- */
944
- maxSizeLimit?: number,
945
- /**
946
- * Specify how many threads (<=4) are to be used. Only valid when {useUploader} is true.
947
- */
948
- threads?: number,
949
- /**
950
- * Specify the names for the files in the form.
951
- * Example: "RemoteName<%06d>"
952
- */
953
- remoteName?: string,
954
- /**
955
- * Specify the name(s) (pattern) of the uploaded files.
956
- * Example: "uploadedFile<%06d>.jpg"
957
- */
958
- fileName?: string
959
- }
960
- };
961
- }
962
- export interface Status {
963
- bScanCompleted?: boolean;
964
- event?: string;
965
- result?: {
966
- currentPageNum?: number
967
- };
968
- }
969
- export interface TiffTag {
970
- tagIdentifier?: number;
971
- content?: string;
972
- useBase64Encoding?: boolean;
973
- }
974
- /**
975
- * Detailed information about a specific capability,
976
- */
977
- export interface CapabilityDetails {
978
- /**
979
- * The Capability.
980
- */
981
- capability: ValueAndLabel;
982
- /**
983
- * The container type of the Capability
984
- */
985
- conType: ValueAndLabel;
986
- /**
987
- * The index for the current value of the Capability
988
- */
989
- curIndex: number;
990
- /**
991
- * The current value of the Capability
992
- */
993
- curValue: ValueAndLabel;
994
- /**
995
- * The index for the default value of the Capability
996
- */
997
- defIndex: number;
998
- /**
999
- * The operation types that are supported by the Capability. Types include {"get", "set", "reset" "getdefault", "getcurrent"}
1000
- */
1001
- query: string[];
1002
- /**
1003
- * The value type of the Capability. Value types include
1004
- * TWTY_BOOL: 6
1005
- * TWTY_FIX32: 7
1006
- * TWTY_FRAME: 8
1007
- * TWTY_INT8: 0
1008
- * TWTY_INT16: 1
1009
- * TWTY_INT32: 2
1010
- * TWTY_STR32: 9
1011
- * TWTY_STR64: 10
1012
- * TWTY_STR128: 11
1013
- * TWTY_STR255: 12
1014
- * TWTY_UINT8: 3
1015
- * TWTY_UINT16: 4
1016
- * TWTY_int: 5
1017
- */
1018
- valueType: ValueAndLabel;
1019
- /**
1020
- * The available values of the Capability
1021
- */
1022
- values: ValueAndLabel[];
1023
- }
1024
- export interface ValueAndLabel {
1025
- /**
1026
- * Numeric representation of the item
1027
- */
1028
- value: Dynamsoft.EnumDWT_Cap | Dynamsoft.EnumDWT_CapType | Dynamsoft.EnumDWT_CapValueType | number;
1029
- /**
1030
- * Label or name of the item
1031
- */
1032
- label: string;
1033
- }
1034
- export interface Capabilities {
1035
- /**
1036
- * Whether to "ignore" or "fail" the request if an exception occurs. This is an overall setting that is inherited by all capabilities.
1037
- */
1038
- exceptition: string;
1039
- /**
1040
- * Specifies how to set capabilities
1041
- */
1042
- capabilities: CapabilitySetup[];
1043
- }
1044
- export interface CapabilitySetup {
1045
- /**
1046
- * Specify a capability
1047
- */
1048
- capability: Dynamsoft.EnumDWT_Cap | number;
1049
- /**
1050
- * The value to set to the capability or the value of the capability after setting.
1051
- */
1052
- curValue: number | string;
1053
- errorCode?: number;
1054
- errorString?: string;
1055
- /**
1056
- * Whether to "ignore" or "fail" the request if an exception occurs when setting this specific capability.
1057
- */
1058
- exception?: string;
1059
- }
1
+ import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
2
+ import { WebTwainEdit } from "./WebTwain.Edit";
3
+
4
+ export interface WebTwainAcquire extends WebTwainEdit {
5
+ /**
6
+ * Start image acquisition.
7
+ * @param deviceConfiguration Configuration for the acquisition.
8
+ * @param successCallback A callback function that is executed if the request succeeds.
9
+ * @param failureCallback A callback function that is executed if the request fails.
10
+ * @argument errorCode The error code.
11
+ * @argument errorString The error string.
12
+ */
13
+ AcquireImage(
14
+ successCallBack?: () => void,
15
+ failureCallBack?: (
16
+ errorCode: number,
17
+ errorString: string) => void
18
+ ): void;
19
+ AcquireImage(
20
+ deviceConfiguration?: DeviceConfiguration,
21
+ successCallBack?: () => void,
22
+ failureCallBack?: (
23
+ deviceConfiguration: DeviceConfiguration,
24
+ errorCode: number,
25
+ errorString: string) => void
26
+ ): void;
27
+ /**
28
+ * Close the data source (a TWAIN/ICA/SANE device which in most cases is a scanner) to free it to be used by other applications.
29
+ */
30
+ CloseSource(): boolean;
31
+ /**
32
+ * Close the data source (a TWAIN/ICA/SANE device which in most cases is a scanner) to free it to be used by other applications.
33
+ */
34
+ CloseSourceAsync(): Promise<boolean>;
35
+ /**
36
+ * Disable the data source (a TWAIN/ICA/SANE device which in most cases is a scanner) to stop the acquiring process. If the data source's user interface is displayed, it will be closed.
37
+ */
38
+ DisableSource(): boolean;
39
+ /**
40
+ * Enable the data source to start the acquiring process.
41
+ */
42
+ EnableSource(): boolean;
43
+ /**
44
+ * Display the TWAIN source's built-in user interface.
45
+ * @param successCallback A callback function that is executed if the request succeeds.
46
+ * @param failureCallback A callback function that is executed if the request fails.
47
+ * @argument errorCode The error code.
48
+ * @argument errorString The error string.
49
+ */
50
+ EnableSourceUI(
51
+ successCallBack: () => void,
52
+ failureCallBack: (
53
+ errorCode: number,
54
+ errorString: string) => void
55
+ ): void;
56
+ /**
57
+ * Load a data source to get it ready to acquire images.
58
+ */
59
+ OpenSource(): boolean;
60
+ /**
61
+ * Return all available data sources (scanners, etc.) and optionally all detailed information about them.
62
+ * @param bIncludeDetails Whether to return more details about the data sources or just their names.
63
+ */
64
+ /**
65
+ * Load a data source to get it ready to acquire images.
66
+ */
67
+ OpenSourceAsync(): Promise<boolean>;
68
+ GetSourceNames(bIncludeDetails?: boolean): string[] | SourceDetails[];
69
+ /**
70
+ * Return all available data sources (scanners, etc.) and optionally all detailed information about them.
71
+ * @param bIncludeDetails Whether to return more details about the data sources or just their names.
72
+ */
73
+ GetSourceNamesAsync(bIncludeDetails: boolean): Promise<string[] | SourceDetails[]>;
74
+ /**
75
+ * Bring up the Source Selection User Interface (UI) for the user to choose a data source.
76
+ * @param successCallback A callback function that is executed if the request succeeds.
77
+ * @param failureCallback A callback function that is executed if the request fails.
78
+ * @argument errorCode The error code.
79
+ * @argument errorString The error string.
80
+ */
81
+ SelectSource(
82
+ successCallBack?: () => void,
83
+ failureCallBack?: (errorCode: number, errorString: string) => void
84
+ ): boolean | void;
85
+ /**
86
+ * Bring up the Source Selection User Interface (UI) for the user to choose a data source.
87
+ * @param successCallback A callback function that is executed if the request succeeds.
88
+ * @param failureCallback A callback function that is executed if the request fails.
89
+ * @argument errorCode The error code.
90
+ * @argument errorString The error string.
91
+ */
92
+ SelectSourceAsync(
93
+ successCallBack?: () => void,
94
+ failureCallBack?: (errorCode: number, errorString: string) => void
95
+ ): Promise<boolean>;
96
+ /**
97
+ * Select a data source by its index.
98
+ * @param index The index of the data source.
99
+ */
100
+ SelectSourceByIndex(index: number): boolean;
101
+ /**
102
+ * Select a data source by its index.
103
+ * @param index The index of the data source.
104
+ */
105
+ SelectSourceByIndexAsync(index: number): Promise<boolean>;
106
+ /**
107
+ * Sets a timer which stops the data source opening process once it expires.
108
+ * @param duration Define the duration of the timer (in milliseconds).
109
+ */
110
+ SetOpenSourceTimeout(duration: number): boolean;
111
+ /**
112
+ * Start the acquisition by passing all settings at once.
113
+ * @param scanSetup Configuration for the acquisition.
114
+ */
115
+ startScan(scanSetup: ScanSetup): Promise<ScanSetup>;
116
+ /**
117
+ * Cancels all pending transfers.
118
+ */
119
+ CancelAllPendingTransfers(): boolean;
120
+ /**
121
+ * Closes and unloads Data Source Manager.
122
+ */
123
+ CloseSourceManager(): boolean;
124
+ /**
125
+ * Closes and unloads Data Source Manager.
126
+ */
127
+ CloseSourceManagerAsync(): Promise<boolean>;
128
+ /**
129
+ * Closes the scanning process to release resources on the machine.
130
+ */
131
+ CloseWorkingProcess(): boolean;
132
+ /**
133
+ * Ejects the current page and begins scanning the next page in the document feeder.
134
+ */
135
+ FeedPage(): boolean;
136
+ /**
137
+ * Get the custom data source data and saves the data in a specified file.
138
+ * @param fileName The path of the file to save the data source data to.
139
+ */
140
+ GetCustomDSData(fileName: string): boolean;
141
+ /**
142
+ * Gets custom DS data and returns it in a base64 string.
143
+ */
144
+ GetCustomDSDataEx(): string;
145
+ /**
146
+ * Inspect the current data source and return whether it is a scanner, a webcam, etc.
147
+ */
148
+ GetDeviceType(): number;
149
+ /**
150
+ * Get the name of a data source by its index in data source manager source list.
151
+ * @param index The index of the data source.
152
+ */
153
+ GetSourceNameItems(index: number): string;
154
+ /**
155
+ * Load and open data source manager.
156
+ */
157
+ OpenSourceManager(): boolean;
158
+ /**
159
+ * Load and open data source manager.
160
+ */
161
+ OpenSourceManagerAsync(): Promise<boolean>;
162
+ /**
163
+ * Reset the image layout in the data source.
164
+ */
165
+ ResetImageLayout(): boolean;
166
+ /**
167
+ * If called while {IfFeederEnabled} property is true, the data source will return the current page to the input area and return the last page from the output area into the acquisition area.
168
+ */
169
+ RewindPage(): boolean;
170
+ /**
171
+ * Sets custom data source data to be used for scanning, the data is stored in a file which can be regarded as a scanning profile.
172
+ * @param fileName The path of the file.
173
+ */
174
+ SetCustomDSData(fileName: string): boolean;
175
+ /**
176
+ * Set custom data source data to be used for scanning, the input is a base64 string.
177
+ * @param dsDataString The string that contains custom data source data.
178
+ */
179
+ SetCustomDSDataEx(dsDataString: string): boolean;
180
+ /**
181
+ * Set the file transfer information to be used in File Transfer mode.
182
+ * @param fileName The path to transfer the file to.
183
+ * @param fileFormat The format of the file.
184
+ */
185
+ SetFileXferInfo(
186
+ fileName: string,
187
+ fileFormat: Dynamsoft.EnumDWT_FileFormat | number
188
+ ): boolean;
189
+ /**
190
+ * Set the left, top, right, and bottom sides of the image layout
191
+ * rectangle for the current data source. The image layout rectangle
192
+ * defines a frame of the data source's scanning area to be acquired.
193
+ * @param left Specify the rectangle (leftmost coordinate).
194
+ * @param top Specify the rectangle (topmost coordinate).
195
+ * @param right Specify the rectangle (rightmost coordinate).
196
+ * @param bottom Specify the rectangle (bottommost coordinate).
197
+ */
198
+ SetImageLayout(
199
+ left: number,
200
+ top: number,
201
+ right: number,
202
+ bottom: number
203
+ ): boolean;
204
+ /**
205
+ * Return or set the pixel bit depth for the current value of `PixelType`.
206
+ */
207
+ BitDepth: number;
208
+ /**
209
+ * Return or set whether newly acquired images are inserted or appended.
210
+ */
211
+ IfAppendImage: boolean;
212
+ /**
213
+ * Return or set whether to close the user interface after all images have been acquired.
214
+ */
215
+ IfDisableSourceAfterAcquire: boolean;
216
+ /**
217
+ * Return or set whether to enable duplex scanning (in other words, whether to scan both sides of the paper).
218
+ */
219
+ IfDuplexEnabled: boolean;
220
+ /**
221
+ * Return or set whether a data source's Automatic Document Feeder (ADF) is enabled for scanning.
222
+ */
223
+ IfFeederEnabled: boolean;
224
+ /**
225
+ * Return or set whether the data source displays the user interface when scanning.
226
+ */
227
+ IfShowUI: boolean;
228
+ /**
229
+ * Return or set whether to use TWAIN or ICA protocol on macOS.
230
+ */
231
+ ImageCaptureDriverType: Dynamsoft.EnumDWT_Driver | number;
232
+ /**
233
+ * Return or set the page size the data source uses to acquire images.
234
+ */
235
+ PageSize: Dynamsoft.EnumDWT_CapSupportedSizes | number;
236
+ /**
237
+ * Return or set the pixel type used when acquiring images.
238
+ */
239
+ PixelType: Dynamsoft.EnumDWT_PixelType | number;
240
+ /**
241
+ * Return or set the resolution used when acquiring images.
242
+ */
243
+ Resolution: number;
244
+ /**
245
+ * Returns how many data sources are available on the local system.
246
+ */
247
+ readonly SourceCount: number;
248
+ /**
249
+ * Return or set the brightness to be used for scanning by the data source.
250
+ */
251
+ Brightness: number;
252
+ /**
253
+ * Return or set Contrast to be used for scanning by the data source.
254
+ */
255
+ Contrast: number;
256
+ /**
257
+ * Return the device name of current source.
258
+ */
259
+ readonly CurrentSourceName: string;
260
+ /**
261
+ * Return a value that indicates the data source status.
262
+ */
263
+ DataSourceStatus: number;
264
+ /**
265
+ * Return the name of the default source.
266
+ */
267
+ DefaultSourceName: string;
268
+ /**
269
+ * Return whether the source supports duplex. If yes, it further returns the level of duplex the data source supports.
270
+ */
271
+ readonly Duplex: Dynamsoft.EnumDWT_DUPLEX | number;
272
+ /**
273
+ * Return or set whether to enable the data source's auto-brightness feature.
274
+ */
275
+ IfAutoBright: boolean;
276
+ /**
277
+ * Return or set whether the data source (the scanner) discards blank images during scanning automatically.
278
+ */
279
+ IfAutoDiscardBlankpages: boolean;
280
+ /**
281
+ * Return or set whether to enable the data source's automatic document feeding process.
282
+ */
283
+ IfAutoFeed: boolean;
284
+ /**
285
+ * Return or set whether to enable the data source's automatic border detection feature.
286
+ */
287
+ IfAutomaticBorderDetection: boolean;
288
+ /**
289
+ * Return or set whether to enable the data source's automatic skew correction feature.
290
+ */
291
+ IfAutomaticDeskew: boolean;
292
+ /**
293
+ * Return or set whether to enable the data source's automatic document scanning process.
294
+ */
295
+ IfAutoScan: boolean;
296
+ /**
297
+ * Return whether or not there are documents loaded in the data source's feeder.
298
+ */
299
+ readonly IfFeederLoaded: boolean;
300
+ /**
301
+ * Return whether the Source has a paper sensor that can detect pages on the ADF or Flatbed.
302
+ */
303
+ readonly IfPaperDetectable: boolean;
304
+ /**
305
+ * Return or set whether the data source displays a progress indicator during acquisition and transfer.
306
+ */
307
+ IfShowIndicator: boolean;
308
+ /**
309
+ * Return whether the data source supports acquisitions with the UI (User Interface) disabled.
310
+ */
311
+ readonly IfUIControllable: boolean;
312
+ /**
313
+ * Return or set whether the new TWAIN DSM (data source Manager) is used for acquisitions. The new TWAIN DSM is a DLL called 'TWAINDSM.dll' while the default | old DSM is called 'twain_32.dll'.
314
+ */
315
+ IfUseTwainDSM: boolean;
316
+ /**
317
+ * Return the value of the bottom edge of the current image frame (in Unit).
318
+ */
319
+ readonly ImageLayoutFrameBottom: number;
320
+ /**
321
+ * Return the value of the left edge of the current image frame (in Unit).
322
+ */
323
+ readonly ImageLayoutFrameLeft: number;
324
+ /**
325
+ * Return the value of the right edge of the current image frame (in Unit).
326
+ */
327
+ readonly ImageLayoutFrameRight: number;
328
+ /**
329
+ * Return the value of the top edge of the current image frame (in Unit).
330
+ */
331
+ readonly ImageLayoutFrameTop: number;
332
+ /**
333
+ * Return the document number of the current image.
334
+ */
335
+ readonly ImageLayoutDocumentNumber: number;
336
+ /**
337
+ * Return the page number of the current image.
338
+ */
339
+ readonly ImageLayoutPageNumber: number;
340
+ /**
341
+ * Return the bit depth of the current image.
342
+ */
343
+ readonly ImageBitsPerPixel: number;
344
+ /**
345
+ * Return the pixel type of the current image.
346
+ */
347
+ readonly ImagePixelType: Dynamsoft.EnumDWT_PixelType | number;
348
+ /**
349
+ * Return the length of the current image.
350
+ */
351
+ readonly ImageLength: number;
352
+ /**
353
+ * Return the width of the current image.
354
+ */
355
+ readonly ImageWidth: number;
356
+ /**
357
+ * Return the horizontal resolution of the current image.
358
+ */
359
+ readonly ImageXResolution: number;
360
+ /**
361
+ * Return the vertical resolution of the current image.
362
+ */
363
+ readonly ImageYResolution: number;
364
+ /**
365
+ * Return the data of the magnetic data if the data source supports magnetic data recognition.
366
+ */
367
+ readonly MagData: string;
368
+ /**
369
+ * Return the type of the magnetic data if the data source supports magnetic data recognition.
370
+ */
371
+ readonly MagType: Dynamsoft.EnumDWT_MagType | number;
372
+ /**
373
+ * Return the number of transfers the data source is ready to supply upon demand.
374
+ */
375
+ readonly PendingXfers: number;
376
+ /**
377
+ * Return or set the pixel flavor to be used for acquiring images.
378
+ */
379
+ PixelFlavor: number;
380
+ /**
381
+ * Return or set the data source's transfer mode.
382
+ */
383
+ TransferMode: Dynamsoft.EnumDWT_TransferMode | number;
384
+ /**
385
+ * Return or set the unit of measure for all quantities.
386
+ */
387
+ Unit: Dynamsoft.EnumDWT_UnitType | number;
388
+ /**
389
+ * Return and set the number of images your application is willing to accept for each scan job.
390
+ */
391
+ XferCount: number;
392
+ /**
393
+ * Gets detailed information about all capabilities of the current data source.
394
+ * @param successCallback A callback function that is executed if the request succeeds.
395
+ * @param failureCallback A callback function that is executed if the request fails.
396
+ * @argument capabilityDetails Detailed information about the specified capabilities.
397
+ * @argument errorCode The error code.
398
+ * @argument errorString The error string.
399
+ */
400
+ getCapabilities(
401
+ succssCallback: (capabilityDetails: CapabilityDetails[]) => void,
402
+ failureCallback: (
403
+ errorCode: number,
404
+ errorString: string
405
+ ) => void
406
+ ): void;
407
+ /**
408
+ * Sets up one or multiple capabilities in one call.
409
+ * @param capabilities A object that describes how to set capabilities.
410
+ * @param successCallback A callback function that is executed if the request succeeds.
411
+ * @param failureCallback A callback function that is executed if the request fails.
412
+ * @argument capabilities The capabilities to set.
413
+ */
414
+ setCapabilities(
415
+ capabilities: Capabilities,
416
+ succssCallback: (capabilities: Capabilities) => void,
417
+ failureCallback: (capabilities: Capabilities) => void
418
+ ): void;
419
+ /**
420
+ * [Deprecation] Specifies the capabiltiy to be negotiated. This is a runtime property.
421
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
422
+ */
423
+ Capability: Dynamsoft.EnumDWT_Cap;
424
+ /**
425
+ * [Deprecation] Return or set the index (0-based) of
426
+ * a list to indicate the Current Value when the value of
427
+ * the CapType property is TWON_ENUMERATION. If the data type
428
+ * of the capability is String, the list is in CapItemsString property.
429
+ * For other data types, the list is in CapItems property. This is a runtime property.
430
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
431
+ */
432
+ CapCurrentIndex: number;
433
+ /**
434
+ * [Deprecation] Return or set the current value in a range when the
435
+ * value of the CapType property is TWON_RANGE. This is a runtime property.
436
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
437
+ */
438
+ CapCurrentValue: number;
439
+ /**
440
+ * [Deprecation] Return the index (0-based) of a list to indicate the
441
+ * Default Value when the value of the CapType property is TWON_ENUMERATION.
442
+ * If the data type of the capability is String, the list is in CapItemsString property.
443
+ * For other data types, the list is in CapItems property. This is a runtime, read-only property.
444
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
445
+ */
446
+ readonly CapDefaultIndex: number;
447
+ /**
448
+ * [Deprecation] Return the default value in a range when the value of the
449
+ * CapType property is TWON_RANGE. This is a runtime, read-only property.
450
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
451
+ */
452
+ CapDefaultValue: number;
453
+ /**
454
+ * [Deprecation] Retruns the description for a capability
455
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
456
+ */
457
+ CapDescription: string;
458
+ /**
459
+ * [Deprecation] Return or set the maximum value in a range when the
460
+ * value of the CapType property is TWON_RANGE. This is a runtime property.
461
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
462
+ */
463
+ CapMaxValue: number;
464
+ /**
465
+ * [Deprecation] Return or set the minimum value in a range when the
466
+ * value of the CapType property is TWON_RANGE. This is a runtime property.
467
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
468
+ */
469
+ CapMinValue: number;
470
+ /**
471
+ * [Deprecation] Return or set how many items are in the list when the
472
+ * value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
473
+ * For String data type, the list is in CapItemsString property.
474
+ * For other data types, the list is in CapItems property.
475
+ * This is a runtime property.
476
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
477
+ */
478
+ CapNumItems: number;
479
+ /**
480
+ * [Deprecation] Return or set the step size in a range when the value
481
+ * of the CapType property is TWON_RANGE. This is a runtime property.
482
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
483
+ */
484
+ CapStepSize: number;
485
+ /**
486
+ * [Deprecation] Return or set the type of capability container used
487
+ * to exchange capability information between application and source.
488
+ * This is a runtime property.
489
+ */
490
+ CapType: Dynamsoft.EnumDWT_CapType;
491
+ /**
492
+ * [Deprecation] Return or set the value of the capability specified by
493
+ * Capability property when the value of the CapType property is TWON_ONEVALUE.
494
+ * This is a runtime property.
495
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
496
+ */
497
+ CapValue: number;
498
+ /**
499
+ * [Deprecation] Return or set the string value for a capability when the
500
+ * value of the CapType property is TWON_ONEVALUE. This is a runtime property.
501
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
502
+ */
503
+ CapValueString: string;
504
+ /**
505
+ * [Deprecation] Return or set the value type for reading the value of a capability.
506
+ * This is a runtime property.
507
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
508
+ */
509
+ CapValueType: number;
510
+ /**
511
+ * [Deprecation] Gets information of the capability specified by the Capability property.
512
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
513
+ */
514
+ CapGet(): boolean;
515
+ /**
516
+ * [Deprecation] Return the Source's current Value for the specified capability.
517
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
518
+ */
519
+ CapGetCurrent(): boolean;
520
+ /**
521
+ * [Deprecation] Return the Source's Default Value for the specified capability.
522
+ * This is the Source's preferred default value.
523
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
524
+ */
525
+ CapGetDefault(): boolean;
526
+ /**
527
+ * [Deprecation] Return the value of the bottom-most edge of the specified frame.
528
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
529
+ * @param index specifies the value of which frame to get. The index is 0-based.
530
+ */
531
+ CapGetFrameBottom(index: number): number;
532
+ /**
533
+ * [Deprecation] Return the value (in Unit) of the left-most edge of the specified frame.
534
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
535
+ * @param index specifies the value of which frame to get. The index is 0-based.
536
+ */
537
+ CapGetFrameLeft(index: number): number;
538
+ /**
539
+ * [Deprecation] Return the value (in Unit) of the left-most edge of the specified frame.
540
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
541
+ * @param index specifies the value of which frame to get. The index is 0-based.
542
+ */
543
+ CapGetFrameRight(index: number): number;
544
+ /**
545
+ * [Deprecation] Return the value (in Unit) of the top-most edge of the specified frame.
546
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
547
+ * @param index specifies the value of which frame to get. The index is 0-based.
548
+ */
549
+ CapGetFrameTop(index: number): number;
550
+ /**
551
+ * [Deprecation] Use getCapabilities() and setCapabilities() instead.
552
+ */
553
+ CapGetHelp(index: number): number;
554
+ /**
555
+ * [Deprecation] Use getCapabilities() and setCapabilities() instead.
556
+ */
557
+ CapGetLabel(index: number): number;
558
+ /**
559
+ * [Deprecation] Use getCapabilities() and setCapabilities() instead.
560
+ */
561
+ CapGetLabels(index: number): number;
562
+ /**
563
+ * [Deprecation] Queries whether the Source supports a particular operation on the capability.
564
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
565
+ * @param {Dynamsoft.EnumDWT_MessageType} messageType specifies the type of capability operation.
566
+ */
567
+ CapIfSupported(messageType: Dynamsoft.EnumDWT_MessageType): boolean;
568
+ /**
569
+ * [Deprecation] Changes the Current Value of the capability specified by
570
+ * Capability property back to its power-on value.
571
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
572
+ */
573
+ CapReset(): boolean;
574
+ /**
575
+ * [Deprecation] Sets the current capability using the container type specified by
576
+ * CapType property. The current capability is specified by Capability property.
577
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
578
+ */
579
+ CapSet(): boolean;
580
+ /**
581
+ * [Deprecation] Sets the values of the specified frame.
582
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
583
+ * @param index specifies the values of which frame to set. The index is 0-based.
584
+ * @param left the value (in Unit) of the left-most edge of the specified frame.
585
+ * @param top the value (in Unit) of the top-most edge of the specified frame.
586
+ * @param right the value (in Unit) of the right-most edge of the specified frame.
587
+ * @param bottom the value (in Unit) of the bottom-most edge of the specified frame.
588
+ */
589
+ CapSetFrame(index: number, left: number, top: number, right: number, bottom: number): boolean;
590
+ /**
591
+ * Get the cap item value of the capability specified by Capability property,
592
+ * when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
593
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
594
+ * @param index Index is 0-based. It is the index of the cap item.
595
+ */
596
+ GetCapItems(index: number): number;
597
+ /**
598
+ * Returns the cap item value of the capability specified by Capability property,
599
+ * when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
600
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
601
+ * @param index Index is 0-based. It is the index of the cap item.
602
+ */
603
+ GetCapItemsString(index: number): string;
604
+ /**
605
+ * [Deprecation] Set the value of the specified cap item.
606
+ * @param index Index is 0-based. It is the index of the cap item.
607
+ * @param newVal For string type, please use CapItemsstring property.
608
+ */
609
+ SetCapItems(index: number, newVal: number): void;
610
+ /**
611
+ * [Deprecation] Set the cap item value of the capability specified by Capability property,
612
+ * when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION.
613
+ * [Alternative] Use getCapabilities() and setCapabilities() instead.
614
+ * @param index Index is 0-based. It is the index of the cap item.
615
+ * @param newVal The new value to be set.
616
+ */
617
+ SetCapItemsString(index: number, newVal: string): void;
618
+ }
619
+ export interface DeviceConfiguration {
620
+ /**
621
+ * Whether to show the built-in User Interface from the device vendor
622
+ */
623
+ IfShowUI?: boolean;
624
+ /**
625
+ * How a pixel is represented. Basically it means whether to scan in color, grey or black & white
626
+ */
627
+ PixelType?: Dynamsoft.EnumDWT_PixelType | number | string;
628
+ /**
629
+ * How detailed is the acquisition. Measured by dots per pixel (DPI)
630
+ */
631
+ Resolution?: number;
632
+ /**
633
+ * Whether to use the document feeder or the flatbed of the device.
634
+ */
635
+ IfFeederEnabled?: boolean;
636
+ /**
637
+ * Whether to scan one side or both sides of each paper.
638
+ */
639
+ IfDuplexEnabled?: boolean;
640
+ /**
641
+ * Whether to close the built-in User Interface after aquisition. Only valid when {IfShowUI} is true.
642
+ */
643
+ IfDisableSourceAfterAcquire?: boolean;
644
+ /**
645
+ * Whether to retrieve information about the image after it's transferred.
646
+ */
647
+ IfGetImageInfo?: boolean;
648
+ /**
649
+ * Whether to retrieve extended information about the image after it's transferred.
650
+ */
651
+ IfGetExtImageInfo?: boolean;
652
+ /**
653
+ * How much extended information is retrieved. Only valid when {IfGetExtImageInfo} is true.
654
+ */
655
+ extendedImageInfoQueryLevel?: number;
656
+ }
657
+ export interface SourceDetails {
658
+ /**
659
+ * The driver type which can be "TWAIN" | "ICA" | "SANE"
660
+ */
661
+ DriverType?: string;
662
+ /**
663
+ * Information about the driver if it's DriverType is "ICA"
664
+ */
665
+ DeviceInfo?: any;
666
+ /**
667
+ * The name of the data source. E.g. "TWAIN2 FreeImage Software Scanner".
668
+ */
669
+ ProductName?: string;
670
+ /**
671
+ * Whether it is the default source.
672
+ */
673
+ IsDefaultSource?: boolean;
674
+ /**
675
+ * Whether it is the current source.
676
+ */
677
+ IsCurrentSource?: boolean;
678
+ /**
679
+ * The family name of the data source. E.g. "Software Scan".
680
+ */
681
+ ProductFamily?: string;
682
+ /**
683
+ * The manufacturer of the data source. E.g. "TWAIN Working Group".
684
+ */
685
+ Manufacturer?: string;
686
+ /**
687
+ * Supported Groups
688
+ */
689
+ SupportedGroups?: number;
690
+ /**
691
+ * The version of the protocol based on which the data source is developed.
692
+ */
693
+ ProtocolMajor?: number;
694
+ ProtocolMinor?: number;
695
+ /**
696
+ * Detailed version of the data source.
697
+ */
698
+ Version?: Version;
699
+ }
700
+ export interface Version {
701
+ MajorNum?: number;
702
+ MinorNum?: number;
703
+ Language?: number;
704
+ Country?: number;
705
+ Info?: string;
706
+ }
707
+ export interface ScanSetup {
708
+ /**
709
+ * An id that specifies this specific setup.
710
+ */
711
+ setupId?: string;
712
+ /**
713
+ * Whether to ignore or fail the acquistion when an exception is raised. Set "ignore" or "fail".
714
+ */
715
+ exception?: string;
716
+ /**
717
+ * The name of the data source (the scanner). If not set, the default data source is used.
718
+ */
719
+ scanner?: string;
720
+ ui?: {
721
+ /**
722
+ * Whether to show the UI of the device.
723
+ */
724
+ bShowUI?: boolean,
725
+ /**
726
+ * Whether to show the indicator of the device.
727
+ */
728
+ bShowIndicator?: boolean,
729
+ };
730
+ /**
731
+ * The TWAIN transfer mode.
732
+ */
733
+ transferMode?: Dynamsoft.EnumDWT_TransferMode | number;
734
+ /**
735
+ * Set how the transfer is done.
736
+ */
737
+ fileXfer?: {
738
+ /**
739
+ * Specify the file name (or pattern) for file transfer.
740
+ * Example: "C:\\WebTWAIN<%06d>.bmp"
741
+ */
742
+ fileName?: string,
743
+ /**
744
+ * Specify the file format.
745
+ */
746
+ fileFormat?: Dynamsoft.EnumDWT_FileFormat | number,
747
+ /**
748
+ * Specify the quality of JPEG files.
749
+ */
750
+ jpegQuality?: number,
751
+ /**
752
+ * Specify the compression type of the file.
753
+ */
754
+ compressionType?: Dynamsoft.EnumDWT_CompressionType | number
755
+ };
756
+ /**
757
+ * Set where the scanned images are inserted.
758
+ */
759
+ insertingIndex?: number;
760
+ /**
761
+ * The profile is a base64 string, if present, it overrides settings and more settings.
762
+ */
763
+ profile?: string;
764
+ /**
765
+ * Basic settings.
766
+ */
767
+ settings?: {
768
+ /**
769
+ * "ignore" (default) or "fail".
770
+ */
771
+ exception?: string,
772
+ /**
773
+ * Specify the pixel type.
774
+ */
775
+ pixelType?: Dynamsoft.EnumDWT_PixelType | number,
776
+ /**
777
+ * Specify the resolution.
778
+ */
779
+ resolution?: number,
780
+ /**
781
+ * Whether to enable document feader.
782
+ */
783
+ bFeeder?: boolean,
784
+ /**
785
+ * Whether to enable duplex scan.
786
+ */
787
+ bDuplex?: boolean
788
+ };
789
+ moreSettings?: {
790
+ /**
791
+ * "ignore" (default) or "fail".
792
+ */
793
+ exception?: string,
794
+ /**
795
+ * Specify the bit depth.
796
+ */
797
+ bitDepth?: number,
798
+ /**
799
+ * Specify the page size.
800
+ */
801
+ pageSize?: Dynamsoft.EnumDWT_CapSupportedSizes | number,
802
+ /**
803
+ * Specify the unit.
804
+ */
805
+ unit?: Dynamsoft.EnumDWT_UnitType | number,
806
+ /**
807
+ * Specify a layout to scan, if present, it'll override pageSize.
808
+ */
809
+ layout?: {
810
+ left?: number,
811
+ top?: number,
812
+ right?: number,
813
+ bottom?: number
814
+ },
815
+ /**
816
+ * Specify the pixel flavor.
817
+ */
818
+ pixelFlavor?: Dynamsoft.EnumDWT_CapPixelFlavor | number,
819
+ /**
820
+ * Specify Brightness.
821
+ */
822
+ brightness?: number,
823
+ /**
824
+ * Specify contrast.
825
+ */
826
+ contrast?: number,
827
+ /**
828
+ * Specify how many images are transferred per session.
829
+ */
830
+ nXferCount?: number,
831
+ /**
832
+ * Whether to enable automatic blank image detection and removal.
833
+ */
834
+ autoDiscardBlankPages?: boolean,
835
+ /**
836
+ * Whether to enable automatic border detection.
837
+ */
838
+ autoBorderDetection?: boolean,
839
+ /**
840
+ * Whether to enable automatic skew correction.
841
+ */
842
+ autoDeskew?: boolean,
843
+ /**
844
+ * Whether to enable automatic brightness adjustment.
845
+ */
846
+ autoBright?: boolean
847
+ };
848
+ /**
849
+ * A callback triggered before the scan, after the scan and after each page has been transferred.
850
+ */
851
+ funcScanStatus?: (status: Status) => void;
852
+ /**
853
+ * Set up how the scanned images are outputted.
854
+ */
855
+ outputSetup?: {
856
+ /**
857
+ * Output type. "http" is the only supported type for now.
858
+ */
859
+ type?: string,
860
+ /**
861
+ * Set the output format.
862
+ */
863
+ format?: Dynamsoft.EnumDWT_ImageType | number,
864
+ /**
865
+ * Specify how many times the library will try the output.
866
+ */
867
+ reTries?: number,
868
+ /**
869
+ * Whether to use the FileUploader.
870
+ */
871
+ useUploader?: false,
872
+ /**
873
+ * Whether to upload all images in one HTTP post.
874
+ */
875
+ singlePost?: boolean,
876
+ /**
877
+ * Whether to show a progress bar when outputting.
878
+ */
879
+ showProgressBar?: boolean,
880
+ /**
881
+ * Whether to remove the images after outputting.
882
+ */
883
+ removeAfterOutput?: boolean,
884
+ /**
885
+ * A callback triggered during the outputting.
886
+ * @argument fileInfo A JSON object that contains the fileName, percentage, statusCode, responseString, etc.
887
+ */
888
+ funcHttpUploadStatus?: (fileInfo: any) => void,
889
+ /**
890
+ * Setup for PDF output.
891
+ */
892
+ pdfSetup?: {
893
+ author?: string,
894
+ compression?: Dynamsoft.EnumDWT_PDFCompressionType | number,
895
+ creator?: string,
896
+ /**
897
+ * Example: 'D:20181231'
898
+ */
899
+ creationDate?: string,
900
+ keyWords?: string,
901
+ /**
902
+ * Example: 'D:20181231'
903
+ */
904
+ modifiedDate?: string,
905
+ producer?: string,
906
+ subject?: string,
907
+ title?: string,
908
+ version?: number,
909
+ quality?: number
910
+ },
911
+ /**
912
+ * Setup for TIFF output.
913
+ */
914
+ tiffSetup?: {
915
+ quality?: number,
916
+ compression?: Dynamsoft.EnumDWT_TIFFCompressionType | number,
917
+ /**
918
+ * Specify Tiff custom tags.
919
+ */
920
+ tiffTags?: TiffTag[]
921
+ },
922
+ /**
923
+ * Setup for HTTP upload via Post.
924
+ */
925
+ httpParams?: {
926
+ /**
927
+ * Target of the request.
928
+ * Example: "http://dynamsoft.com/receivepost.aspx"
929
+ */
930
+ url?: string,
931
+ /**
932
+ * Custom headers in the form.
933
+ * Example: {md5: ""}
934
+ */
935
+ headers?: any,
936
+ /**
937
+ * Custom form fields.
938
+ * Example: {"UploadedBy": "Dynamsoft"}
939
+ */
940
+ formFields?: any,
941
+ /**
942
+ * The maximum size of a file to be uploaded (in bytes).
943
+ */
944
+ maxSizeLimit?: number,
945
+ /**
946
+ * Specify how many threads (<=4) are to be used. Only valid when {useUploader} is true.
947
+ */
948
+ threads?: number,
949
+ /**
950
+ * Specify the names for the files in the form.
951
+ * Example: "RemoteName<%06d>"
952
+ */
953
+ remoteName?: string,
954
+ /**
955
+ * Specify the name(s) (pattern) of the uploaded files.
956
+ * Example: "uploadedFile<%06d>.jpg"
957
+ */
958
+ fileName?: string
959
+ }
960
+ };
961
+ }
962
+ export interface Status {
963
+ bScanCompleted?: boolean;
964
+ event?: string;
965
+ result?: {
966
+ currentPageNum?: number
967
+ };
968
+ }
969
+ export interface TiffTag {
970
+ tagIdentifier?: number;
971
+ content?: string;
972
+ useBase64Encoding?: boolean;
973
+ }
974
+ /**
975
+ * Detailed information about a specific capability,
976
+ */
977
+ export interface CapabilityDetails {
978
+ /**
979
+ * The Capability.
980
+ */
981
+ capability: ValueAndLabel;
982
+ /**
983
+ * The container type of the Capability
984
+ */
985
+ conType: ValueAndLabel;
986
+ /**
987
+ * The index for the current value of the Capability
988
+ */
989
+ curIndex: number;
990
+ /**
991
+ * The current value of the Capability
992
+ */
993
+ curValue: ValueAndLabel;
994
+ /**
995
+ * The index for the default value of the Capability
996
+ */
997
+ defIndex: number;
998
+ /**
999
+ * The operation types that are supported by the Capability. Types include {"get", "set", "reset" "getdefault", "getcurrent"}
1000
+ */
1001
+ query: string[];
1002
+ /**
1003
+ * The value type of the Capability. Value types include
1004
+ * TWTY_BOOL: 6
1005
+ * TWTY_FIX32: 7
1006
+ * TWTY_FRAME: 8
1007
+ * TWTY_INT8: 0
1008
+ * TWTY_INT16: 1
1009
+ * TWTY_INT32: 2
1010
+ * TWTY_STR32: 9
1011
+ * TWTY_STR64: 10
1012
+ * TWTY_STR128: 11
1013
+ * TWTY_STR255: 12
1014
+ * TWTY_UINT8: 3
1015
+ * TWTY_UINT16: 4
1016
+ * TWTY_int: 5
1017
+ */
1018
+ valueType: ValueAndLabel;
1019
+ /**
1020
+ * The available values of the Capability
1021
+ */
1022
+ values: ValueAndLabel[];
1023
+ }
1024
+ export interface ValueAndLabel {
1025
+ /**
1026
+ * Numeric representation of the item
1027
+ */
1028
+ value: Dynamsoft.EnumDWT_Cap | Dynamsoft.EnumDWT_CapType | Dynamsoft.EnumDWT_CapValueType | number;
1029
+ /**
1030
+ * Label or name of the item
1031
+ */
1032
+ label: string;
1033
+ }
1034
+ export interface Capabilities {
1035
+ /**
1036
+ * Whether to "ignore" or "fail" the request if an exception occurs. This is an overall setting that is inherited by all capabilities.
1037
+ */
1038
+ exceptition: string;
1039
+ /**
1040
+ * Specifies how to set capabilities
1041
+ */
1042
+ capabilities: CapabilitySetup[];
1043
+ }
1044
+ export interface CapabilitySetup {
1045
+ /**
1046
+ * Specify a capability
1047
+ */
1048
+ capability: Dynamsoft.EnumDWT_Cap | number;
1049
+ /**
1050
+ * The value to set to the capability or the value of the capability after setting.
1051
+ */
1052
+ curValue: number | string;
1053
+ errorCode?: number;
1054
+ errorString?: string;
1055
+ /**
1056
+ * Whether to "ignore" or "fail" the request if an exception occurs when setting this specific capability.
1057
+ */
1058
+ exception?: string;
1059
+ }