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.
- package/README.md +16 -12
- package/dist/addon/dbrjs/dbr-7.6.0.full.wasm.js +4016 -4016
- package/dist/addon/dbrjs/dbr-7.6.0.worker.js +107 -107
- package/dist/addon/dbrjs/dbr.js +10 -10
- package/dist/dist/DynamsoftServiceSetup.deb +0 -0
- package/dist/dist/DynamsoftServiceSetup.msi +0 -0
- package/dist/dist/DynamsoftServiceSetup.pkg +0 -0
- package/dist/dist/DynamsoftServiceSetup.rpm +0 -0
- package/dist/dist/LICENSE +95 -95
- package/dist/dynamsoft.webtwain.min.js +209 -209
- package/dist/dynamsoft.webtwain.min.mjs +208 -208
- package/dist/src/dynamsoft.imageio_wasm-1.6.2.js +93 -93
- package/dist/src/dynamsoft.webtwain.css +1045 -1045
- package/dist/types/Addon.BarcodeReader.d.ts +168 -168
- package/dist/types/Addon.Camera.d.ts +125 -125
- package/dist/types/Addon.OCR.d.ts +264 -264
- package/dist/types/Addon.OCRPro.d.ts +251 -251
- package/dist/types/Addon.PDF.d.ts +110 -110
- package/dist/types/Addon.Webcam.d.ts +257 -257
- package/dist/types/Dynamsoft.Enum.d.ts +1850 -1849
- package/dist/types/Dynamsoft.FileUploader.d.ts +130 -130
- package/dist/types/Dynamsoft.d.ts +495 -495
- package/dist/types/WebTwain.Acquire.d.ts +1059 -1059
- package/dist/types/WebTwain.Buffer.d.ts +259 -259
- package/dist/types/WebTwain.Edit.d.ts +434 -434
- package/dist/types/WebTwain.IO.d.ts +951 -951
- package/dist/types/WebTwain.Util.d.ts +102 -102
- package/dist/types/WebTwain.Viewer.d.ts +795 -795
- package/dist/types/WebTwain.d.ts +51 -51
- package/dist/types/index.d.ts +20 -20
- package/package.json +2 -2
- package/samples/1.AcquireImage.html +0 -69
- package/samples/2.CustomScan.html +0 -98
- package/samples/3.PDFRasterizer.html +0 -73
- package/samples/4.OCRADocument.html +0 -156
- package/samples/5.ReadBarcode.html +0 -231
- package/samples/6.ScanOrCapture.html +0 -189
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
|
|
2
|
-
|
|
3
|
-
export interface BarcodeReader {
|
|
4
|
-
/**
|
|
5
|
-
* Read an image in the buffer and try to locate and decode barcode(s) on it.
|
|
6
|
-
* @param index Specify the image to decode.
|
|
7
|
-
*/
|
|
8
|
-
decode(index: number): Promise<TextResults>;
|
|
9
|
-
/**
|
|
10
|
-
* Return the current runtime settings or the settings of the specified built-in template.
|
|
11
|
-
* @param template Specify a built-in template.
|
|
12
|
-
*/
|
|
13
|
-
getRuntimeSettings(template?: string): Promise<RuntimeSettings>;
|
|
14
|
-
/**
|
|
15
|
-
* Set up the barcode reader with advanced settings.
|
|
16
|
-
* @param settings The runtime setting in the form of a string.
|
|
17
|
-
*/
|
|
18
|
-
initRuntimeSettingsWithString(settings: string): Promise<RuntimeSettings>;
|
|
19
|
-
/**
|
|
20
|
-
* Update the runtime settings with a given object or use the string "speed", "balance", or "coverage" to use our preset settings. The default setting is "coverage".
|
|
21
|
-
* @param settings Specify the runtime settings.
|
|
22
|
-
*/
|
|
23
|
-
updateRuntimeSettings(settings: RuntimeSettings): Promise<RuntimeSettings>;
|
|
24
|
-
/**
|
|
25
|
-
* Reset all runtime settings to default values.
|
|
26
|
-
*/
|
|
27
|
-
resetRuntimeSettings(): Promise<RuntimeSettings>;
|
|
28
|
-
}
|
|
29
|
-
export interface TextResults extends Array<any> {
|
|
30
|
-
[index: number]: TextResult;
|
|
31
|
-
description?: string;
|
|
32
|
-
exception?: number;
|
|
33
|
-
imageid?: number;
|
|
34
|
-
}
|
|
35
|
-
export interface TextResult {
|
|
36
|
-
/**
|
|
37
|
-
* Barcode result content in a byte array.
|
|
38
|
-
*/
|
|
39
|
-
barcodeBytes: number[];
|
|
40
|
-
/**
|
|
41
|
-
* The barcode format.
|
|
42
|
-
*/
|
|
43
|
-
barcodeFormat: Dynamsoft.EnumBarcodeFormat | number;
|
|
44
|
-
/**
|
|
45
|
-
* Extra barcde formats.
|
|
46
|
-
*/
|
|
47
|
-
barcodeFormat_2: Dynamsoft.EnumBarcodeFormat_2 | number;
|
|
48
|
-
/**
|
|
49
|
-
* Barcode formats as a string.
|
|
50
|
-
*/
|
|
51
|
-
barcodeFormatString: string;
|
|
52
|
-
/**
|
|
53
|
-
* Extra barcode formats as a string.
|
|
54
|
-
*/
|
|
55
|
-
barcodeFormatString_2: string;
|
|
56
|
-
/**
|
|
57
|
-
* The barcode result text.
|
|
58
|
-
*/
|
|
59
|
-
barcodeText: string;
|
|
60
|
-
/**
|
|
61
|
-
* Detailed result information.
|
|
62
|
-
*/
|
|
63
|
-
detailedResult: any;
|
|
64
|
-
/**
|
|
65
|
-
* The corresponding localization result.
|
|
66
|
-
*/
|
|
67
|
-
localizationResult: LocalizationResult;
|
|
68
|
-
/**
|
|
69
|
-
* Other information
|
|
70
|
-
*/
|
|
71
|
-
results: Result[];
|
|
72
|
-
}
|
|
73
|
-
export interface LocalizationResult {
|
|
74
|
-
/**
|
|
75
|
-
* The angle of a barcode. Values range from 0 to 360.
|
|
76
|
-
*/
|
|
77
|
-
angle: number;
|
|
78
|
-
/**
|
|
79
|
-
* The X coordinate of the left-most point.
|
|
80
|
-
*/
|
|
81
|
-
x1: number;
|
|
82
|
-
/**
|
|
83
|
-
* The X coordinate of the second point in a clockwise direction.
|
|
84
|
-
*/
|
|
85
|
-
x2: number;
|
|
86
|
-
/**
|
|
87
|
-
* The X coordinate of the third point in a clockwise direction.
|
|
88
|
-
*/
|
|
89
|
-
x3: number;
|
|
90
|
-
/**
|
|
91
|
-
* The X coordinate of the fourth point in a clockwise direction.
|
|
92
|
-
*/
|
|
93
|
-
x4: number;
|
|
94
|
-
/**
|
|
95
|
-
* The Y coordinate of the left-most point.
|
|
96
|
-
*/
|
|
97
|
-
y1: number;
|
|
98
|
-
/**
|
|
99
|
-
* The Y coordinate of the second point in a clockwise direction.
|
|
100
|
-
*/
|
|
101
|
-
y2: number;
|
|
102
|
-
/**
|
|
103
|
-
* The Y coordinate of the third point in a clockwise direction.
|
|
104
|
-
*/
|
|
105
|
-
y3: number;
|
|
106
|
-
/**
|
|
107
|
-
* The Y coordinate of the fourth point in a clockwise direction.
|
|
108
|
-
*/
|
|
109
|
-
y4: number;
|
|
110
|
-
moduleSize: number;
|
|
111
|
-
pageNumber: number;
|
|
112
|
-
regionName: number;
|
|
113
|
-
resultCoordinateType: number;
|
|
114
|
-
terminatePhase: number;
|
|
115
|
-
}
|
|
116
|
-
export interface Result {
|
|
117
|
-
accompanyingTextBytes: number[];
|
|
118
|
-
clarity: number;
|
|
119
|
-
confidence: number;
|
|
120
|
-
deformation: number;
|
|
121
|
-
resultType: number;
|
|
122
|
-
}
|
|
123
|
-
export interface RuntimeSettings {
|
|
124
|
-
barcodeFormatIds: number;
|
|
125
|
-
barcodeFormatIds_2: number;
|
|
126
|
-
binarizationModes: number[];
|
|
127
|
-
deblurLevel: number;
|
|
128
|
-
expectedBarcodesCount: number;
|
|
129
|
-
furtherModes: FurtherModes;
|
|
130
|
-
intermediateResultSavingMode: number;
|
|
131
|
-
intermediateResultTypes: number;
|
|
132
|
-
localizationModes: number[];
|
|
133
|
-
maxAlgorithmThreadCount: number;
|
|
134
|
-
minBarcodeTextLength: number;
|
|
135
|
-
minResultConfidence: number;
|
|
136
|
-
pdfRasterDPI: number;
|
|
137
|
-
pdfReadingMode: number;
|
|
138
|
-
region: Region;
|
|
139
|
-
resultCoordinateType: number;
|
|
140
|
-
returnBarcodeZoneClarity: number;
|
|
141
|
-
scaleDownThreshold: number;
|
|
142
|
-
scaleUpModes: number[];
|
|
143
|
-
terminatePhase: number;
|
|
144
|
-
textResultOrderModes: number[];
|
|
145
|
-
timeout: number;
|
|
146
|
-
}
|
|
147
|
-
export interface FurtherModes {
|
|
148
|
-
accompanyingTextRecognitionModes: number[];
|
|
149
|
-
barcodeColourModes: number[];
|
|
150
|
-
barcodeComplementModes: number[];
|
|
151
|
-
colourClusteringModes: number[];
|
|
152
|
-
colourConversionModes: number[];
|
|
153
|
-
deformationResistingModes: number[];
|
|
154
|
-
dpmCodeReadingModes: number[];
|
|
155
|
-
grayscaleTransformationModes: number[];
|
|
156
|
-
imagePreprocessingModes: number[];
|
|
157
|
-
regionPredetectionModes: number[];
|
|
158
|
-
textAssistedCorrectionMode: number;
|
|
159
|
-
textFilterModes: number[];
|
|
160
|
-
textureDetectionModes: number[];
|
|
161
|
-
}
|
|
162
|
-
export interface Region {
|
|
163
|
-
regionBottom: number;
|
|
164
|
-
regionLeft: number;
|
|
165
|
-
regionMeasuredByPercentage: number;
|
|
166
|
-
regionRight: number;
|
|
167
|
-
regionTop: number;
|
|
168
|
-
}
|
|
1
|
+
import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
|
|
2
|
+
|
|
3
|
+
export interface BarcodeReader {
|
|
4
|
+
/**
|
|
5
|
+
* Read an image in the buffer and try to locate and decode barcode(s) on it.
|
|
6
|
+
* @param index Specify the image to decode.
|
|
7
|
+
*/
|
|
8
|
+
decode(index: number): Promise<TextResults>;
|
|
9
|
+
/**
|
|
10
|
+
* Return the current runtime settings or the settings of the specified built-in template.
|
|
11
|
+
* @param template Specify a built-in template.
|
|
12
|
+
*/
|
|
13
|
+
getRuntimeSettings(template?: string): Promise<RuntimeSettings>;
|
|
14
|
+
/**
|
|
15
|
+
* Set up the barcode reader with advanced settings.
|
|
16
|
+
* @param settings The runtime setting in the form of a string.
|
|
17
|
+
*/
|
|
18
|
+
initRuntimeSettingsWithString(settings: string): Promise<RuntimeSettings>;
|
|
19
|
+
/**
|
|
20
|
+
* Update the runtime settings with a given object or use the string "speed", "balance", or "coverage" to use our preset settings. The default setting is "coverage".
|
|
21
|
+
* @param settings Specify the runtime settings.
|
|
22
|
+
*/
|
|
23
|
+
updateRuntimeSettings(settings: RuntimeSettings): Promise<RuntimeSettings>;
|
|
24
|
+
/**
|
|
25
|
+
* Reset all runtime settings to default values.
|
|
26
|
+
*/
|
|
27
|
+
resetRuntimeSettings(): Promise<RuntimeSettings>;
|
|
28
|
+
}
|
|
29
|
+
export interface TextResults extends Array<any> {
|
|
30
|
+
[index: number]: TextResult;
|
|
31
|
+
description?: string;
|
|
32
|
+
exception?: number;
|
|
33
|
+
imageid?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface TextResult {
|
|
36
|
+
/**
|
|
37
|
+
* Barcode result content in a byte array.
|
|
38
|
+
*/
|
|
39
|
+
barcodeBytes: number[];
|
|
40
|
+
/**
|
|
41
|
+
* The barcode format.
|
|
42
|
+
*/
|
|
43
|
+
barcodeFormat: Dynamsoft.EnumBarcodeFormat | number;
|
|
44
|
+
/**
|
|
45
|
+
* Extra barcde formats.
|
|
46
|
+
*/
|
|
47
|
+
barcodeFormat_2: Dynamsoft.EnumBarcodeFormat_2 | number;
|
|
48
|
+
/**
|
|
49
|
+
* Barcode formats as a string.
|
|
50
|
+
*/
|
|
51
|
+
barcodeFormatString: string;
|
|
52
|
+
/**
|
|
53
|
+
* Extra barcode formats as a string.
|
|
54
|
+
*/
|
|
55
|
+
barcodeFormatString_2: string;
|
|
56
|
+
/**
|
|
57
|
+
* The barcode result text.
|
|
58
|
+
*/
|
|
59
|
+
barcodeText: string;
|
|
60
|
+
/**
|
|
61
|
+
* Detailed result information.
|
|
62
|
+
*/
|
|
63
|
+
detailedResult: any;
|
|
64
|
+
/**
|
|
65
|
+
* The corresponding localization result.
|
|
66
|
+
*/
|
|
67
|
+
localizationResult: LocalizationResult;
|
|
68
|
+
/**
|
|
69
|
+
* Other information
|
|
70
|
+
*/
|
|
71
|
+
results: Result[];
|
|
72
|
+
}
|
|
73
|
+
export interface LocalizationResult {
|
|
74
|
+
/**
|
|
75
|
+
* The angle of a barcode. Values range from 0 to 360.
|
|
76
|
+
*/
|
|
77
|
+
angle: number;
|
|
78
|
+
/**
|
|
79
|
+
* The X coordinate of the left-most point.
|
|
80
|
+
*/
|
|
81
|
+
x1: number;
|
|
82
|
+
/**
|
|
83
|
+
* The X coordinate of the second point in a clockwise direction.
|
|
84
|
+
*/
|
|
85
|
+
x2: number;
|
|
86
|
+
/**
|
|
87
|
+
* The X coordinate of the third point in a clockwise direction.
|
|
88
|
+
*/
|
|
89
|
+
x3: number;
|
|
90
|
+
/**
|
|
91
|
+
* The X coordinate of the fourth point in a clockwise direction.
|
|
92
|
+
*/
|
|
93
|
+
x4: number;
|
|
94
|
+
/**
|
|
95
|
+
* The Y coordinate of the left-most point.
|
|
96
|
+
*/
|
|
97
|
+
y1: number;
|
|
98
|
+
/**
|
|
99
|
+
* The Y coordinate of the second point in a clockwise direction.
|
|
100
|
+
*/
|
|
101
|
+
y2: number;
|
|
102
|
+
/**
|
|
103
|
+
* The Y coordinate of the third point in a clockwise direction.
|
|
104
|
+
*/
|
|
105
|
+
y3: number;
|
|
106
|
+
/**
|
|
107
|
+
* The Y coordinate of the fourth point in a clockwise direction.
|
|
108
|
+
*/
|
|
109
|
+
y4: number;
|
|
110
|
+
moduleSize: number;
|
|
111
|
+
pageNumber: number;
|
|
112
|
+
regionName: number;
|
|
113
|
+
resultCoordinateType: number;
|
|
114
|
+
terminatePhase: number;
|
|
115
|
+
}
|
|
116
|
+
export interface Result {
|
|
117
|
+
accompanyingTextBytes: number[];
|
|
118
|
+
clarity: number;
|
|
119
|
+
confidence: number;
|
|
120
|
+
deformation: number;
|
|
121
|
+
resultType: number;
|
|
122
|
+
}
|
|
123
|
+
export interface RuntimeSettings {
|
|
124
|
+
barcodeFormatIds: number;
|
|
125
|
+
barcodeFormatIds_2: number;
|
|
126
|
+
binarizationModes: number[];
|
|
127
|
+
deblurLevel: number;
|
|
128
|
+
expectedBarcodesCount: number;
|
|
129
|
+
furtherModes: FurtherModes;
|
|
130
|
+
intermediateResultSavingMode: number;
|
|
131
|
+
intermediateResultTypes: number;
|
|
132
|
+
localizationModes: number[];
|
|
133
|
+
maxAlgorithmThreadCount: number;
|
|
134
|
+
minBarcodeTextLength: number;
|
|
135
|
+
minResultConfidence: number;
|
|
136
|
+
pdfRasterDPI: number;
|
|
137
|
+
pdfReadingMode: number;
|
|
138
|
+
region: Region;
|
|
139
|
+
resultCoordinateType: number;
|
|
140
|
+
returnBarcodeZoneClarity: number;
|
|
141
|
+
scaleDownThreshold: number;
|
|
142
|
+
scaleUpModes: number[];
|
|
143
|
+
terminatePhase: number;
|
|
144
|
+
textResultOrderModes: number[];
|
|
145
|
+
timeout: number;
|
|
146
|
+
}
|
|
147
|
+
export interface FurtherModes {
|
|
148
|
+
accompanyingTextRecognitionModes: number[];
|
|
149
|
+
barcodeColourModes: number[];
|
|
150
|
+
barcodeComplementModes: number[];
|
|
151
|
+
colourClusteringModes: number[];
|
|
152
|
+
colourConversionModes: number[];
|
|
153
|
+
deformationResistingModes: number[];
|
|
154
|
+
dpmCodeReadingModes: number[];
|
|
155
|
+
grayscaleTransformationModes: number[];
|
|
156
|
+
imagePreprocessingModes: number[];
|
|
157
|
+
regionPredetectionModes: number[];
|
|
158
|
+
textAssistedCorrectionMode: number;
|
|
159
|
+
textFilterModes: number[];
|
|
160
|
+
textureDetectionModes: number[];
|
|
161
|
+
}
|
|
162
|
+
export interface Region {
|
|
163
|
+
regionBottom: number;
|
|
164
|
+
regionLeft: number;
|
|
165
|
+
regionMeasuredByPercentage: number;
|
|
166
|
+
regionRight: number;
|
|
167
|
+
regionTop: number;
|
|
168
|
+
}
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
export interface Camera {
|
|
2
|
-
/**
|
|
3
|
-
* Hide the camera interface.
|
|
4
|
-
*/
|
|
5
|
-
hide(): void;
|
|
6
|
-
/**
|
|
7
|
-
* Show the camera interface.
|
|
8
|
-
*/
|
|
9
|
-
show(): void;
|
|
10
|
-
/**
|
|
11
|
-
* Return a list of all available cameras.
|
|
12
|
-
*/
|
|
13
|
-
getSourceList(): Promise<DeviceInfo[]>;
|
|
14
|
-
/**
|
|
15
|
-
* Select a camera to use.
|
|
16
|
-
* @param deviceId Specify the camera with its deviceId.
|
|
17
|
-
*/
|
|
18
|
-
selectSource(deviceId: string): Promise<DeviceInfo>;
|
|
19
|
-
/**
|
|
20
|
-
* Return the info about the current camera.
|
|
21
|
-
*/
|
|
22
|
-
getCurrentSource(): DeviceInfo;
|
|
23
|
-
/**
|
|
24
|
-
* Close the current camera.
|
|
25
|
-
*/
|
|
26
|
-
closeSource(): Promise<DeviceInfo>;
|
|
27
|
-
/**
|
|
28
|
-
* Return the resolutions supported by the current camera.
|
|
29
|
-
*/
|
|
30
|
-
getResolution(): Promise<Resolution[]>;
|
|
31
|
-
/**
|
|
32
|
-
* Set the resolution for the current camera.
|
|
33
|
-
* @param resolution Specify the resolution.
|
|
34
|
-
*/
|
|
35
|
-
setResolution(resolution: Resolution): Promise<Resolution>;
|
|
36
|
-
/**
|
|
37
|
-
* Return the resolution of the current camera.
|
|
38
|
-
*/
|
|
39
|
-
getCurrentResolution(): Promise<Resolution>;
|
|
40
|
-
/**
|
|
41
|
-
* Start streaming video from the current camera.
|
|
42
|
-
* @param element Specify an HTML element to put the video stream in.
|
|
43
|
-
* @param resolution Specify the initial resolution.
|
|
44
|
-
*/
|
|
45
|
-
play(element?: HTMLElement,
|
|
46
|
-
resolution?: Resolution
|
|
47
|
-
): Promise<Resolution>;
|
|
48
|
-
/**
|
|
49
|
-
* Pause the video stream.
|
|
50
|
-
*/
|
|
51
|
-
pause(): void;
|
|
52
|
-
/**
|
|
53
|
-
* Resume the video stream.
|
|
54
|
-
*/
|
|
55
|
-
resume(): void;
|
|
56
|
-
/**
|
|
57
|
-
* Stop the video stream.
|
|
58
|
-
*/
|
|
59
|
-
stop(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Return the status of the current camera.
|
|
62
|
-
*/
|
|
63
|
-
getStatus(): string;
|
|
64
|
-
/**
|
|
65
|
-
* Capture a frame from the video stream.
|
|
66
|
-
*/
|
|
67
|
-
capture(): Promise<Blob>;
|
|
68
|
-
/**
|
|
69
|
-
* Start streaming video from the current camera in the viewer.
|
|
70
|
-
* @param deviceId Specify a camera.
|
|
71
|
-
* @param resolution Specify the initial resolution.
|
|
72
|
-
* @param mode Specify the mode. Allowed values are 'picture' and 'document'. Setting to 'document' mode will enable border detection.
|
|
73
|
-
* @param fill Whether to leave blank margins when showing
|
|
74
|
-
*/
|
|
75
|
-
showVideo(deviceId?: string,
|
|
76
|
-
resolution?: Resolution,
|
|
77
|
-
mode?: string,
|
|
78
|
-
fill?: boolean
|
|
79
|
-
): Promise<Resolution>;
|
|
80
|
-
/**
|
|
81
|
-
* Close the camera and hide the video streaming UI.
|
|
82
|
-
*/
|
|
83
|
-
closeVideo(): void;
|
|
84
|
-
/**
|
|
85
|
-
* Specify an event listener for the specified built-in viewer event.
|
|
86
|
-
* @param name Specify the event name.
|
|
87
|
-
* @param callback The event listener.
|
|
88
|
-
*/
|
|
89
|
-
on(name: string, callback: (event?: any, event1?: any, event2?: any) => void): void;
|
|
90
|
-
/**
|
|
91
|
-
* Remove a built-in viewer event handler.
|
|
92
|
-
* @param eventName Specify the event name.
|
|
93
|
-
*/
|
|
94
|
-
off(eventName: string, callback?: (event: ViewerEvent) => void): boolean;
|
|
95
|
-
}
|
|
96
|
-
export interface DeviceInfo {
|
|
97
|
-
deviceId: string;
|
|
98
|
-
label: string;
|
|
99
|
-
}
|
|
100
|
-
export interface Resolution {
|
|
101
|
-
width: number;
|
|
102
|
-
height: number;
|
|
103
|
-
}
|
|
104
|
-
export interface ViewerEvent {
|
|
105
|
-
/**
|
|
106
|
-
* The index of the current image.
|
|
107
|
-
*/
|
|
108
|
-
index: number;
|
|
109
|
-
/**
|
|
110
|
-
* The x-coordinate of the upper-left corner of the image.
|
|
111
|
-
*/
|
|
112
|
-
imageX: number;
|
|
113
|
-
/**
|
|
114
|
-
* The y-coordinate of the upper-left corner of the image.
|
|
115
|
-
*/
|
|
116
|
-
imageY: number;
|
|
117
|
-
/**
|
|
118
|
-
* The x-coordinate relative to the browser page.
|
|
119
|
-
*/
|
|
120
|
-
pageX: number;
|
|
121
|
-
/**
|
|
122
|
-
* The y-coordinate relative to the browser page.
|
|
123
|
-
*/
|
|
124
|
-
pageY: number;
|
|
125
|
-
}
|
|
1
|
+
export interface Camera {
|
|
2
|
+
/**
|
|
3
|
+
* Hide the camera interface.
|
|
4
|
+
*/
|
|
5
|
+
hide(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Show the camera interface.
|
|
8
|
+
*/
|
|
9
|
+
show(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Return a list of all available cameras.
|
|
12
|
+
*/
|
|
13
|
+
getSourceList(): Promise<DeviceInfo[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Select a camera to use.
|
|
16
|
+
* @param deviceId Specify the camera with its deviceId.
|
|
17
|
+
*/
|
|
18
|
+
selectSource(deviceId: string): Promise<DeviceInfo>;
|
|
19
|
+
/**
|
|
20
|
+
* Return the info about the current camera.
|
|
21
|
+
*/
|
|
22
|
+
getCurrentSource(): DeviceInfo;
|
|
23
|
+
/**
|
|
24
|
+
* Close the current camera.
|
|
25
|
+
*/
|
|
26
|
+
closeSource(): Promise<DeviceInfo>;
|
|
27
|
+
/**
|
|
28
|
+
* Return the resolutions supported by the current camera.
|
|
29
|
+
*/
|
|
30
|
+
getResolution(): Promise<Resolution[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Set the resolution for the current camera.
|
|
33
|
+
* @param resolution Specify the resolution.
|
|
34
|
+
*/
|
|
35
|
+
setResolution(resolution: Resolution): Promise<Resolution>;
|
|
36
|
+
/**
|
|
37
|
+
* Return the resolution of the current camera.
|
|
38
|
+
*/
|
|
39
|
+
getCurrentResolution(): Promise<Resolution>;
|
|
40
|
+
/**
|
|
41
|
+
* Start streaming video from the current camera.
|
|
42
|
+
* @param element Specify an HTML element to put the video stream in.
|
|
43
|
+
* @param resolution Specify the initial resolution.
|
|
44
|
+
*/
|
|
45
|
+
play(element?: HTMLElement,
|
|
46
|
+
resolution?: Resolution
|
|
47
|
+
): Promise<Resolution>;
|
|
48
|
+
/**
|
|
49
|
+
* Pause the video stream.
|
|
50
|
+
*/
|
|
51
|
+
pause(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Resume the video stream.
|
|
54
|
+
*/
|
|
55
|
+
resume(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Stop the video stream.
|
|
58
|
+
*/
|
|
59
|
+
stop(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Return the status of the current camera.
|
|
62
|
+
*/
|
|
63
|
+
getStatus(): string;
|
|
64
|
+
/**
|
|
65
|
+
* Capture a frame from the video stream.
|
|
66
|
+
*/
|
|
67
|
+
capture(): Promise<Blob>;
|
|
68
|
+
/**
|
|
69
|
+
* Start streaming video from the current camera in the viewer.
|
|
70
|
+
* @param deviceId Specify a camera.
|
|
71
|
+
* @param resolution Specify the initial resolution.
|
|
72
|
+
* @param mode Specify the mode. Allowed values are 'picture' and 'document'. Setting to 'document' mode will enable border detection.
|
|
73
|
+
* @param fill Whether to leave blank margins when showing
|
|
74
|
+
*/
|
|
75
|
+
showVideo(deviceId?: string,
|
|
76
|
+
resolution?: Resolution,
|
|
77
|
+
mode?: string,
|
|
78
|
+
fill?: boolean
|
|
79
|
+
): Promise<Resolution>;
|
|
80
|
+
/**
|
|
81
|
+
* Close the camera and hide the video streaming UI.
|
|
82
|
+
*/
|
|
83
|
+
closeVideo(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Specify an event listener for the specified built-in viewer event.
|
|
86
|
+
* @param name Specify the event name.
|
|
87
|
+
* @param callback The event listener.
|
|
88
|
+
*/
|
|
89
|
+
on(name: string, callback: (event?: any, event1?: any, event2?: any) => void): void;
|
|
90
|
+
/**
|
|
91
|
+
* Remove a built-in viewer event handler.
|
|
92
|
+
* @param eventName Specify the event name.
|
|
93
|
+
*/
|
|
94
|
+
off(eventName: string, callback?: (event: ViewerEvent) => void): boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface DeviceInfo {
|
|
97
|
+
deviceId: string;
|
|
98
|
+
label: string;
|
|
99
|
+
}
|
|
100
|
+
export interface Resolution {
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
}
|
|
104
|
+
export interface ViewerEvent {
|
|
105
|
+
/**
|
|
106
|
+
* The index of the current image.
|
|
107
|
+
*/
|
|
108
|
+
index: number;
|
|
109
|
+
/**
|
|
110
|
+
* The x-coordinate of the upper-left corner of the image.
|
|
111
|
+
*/
|
|
112
|
+
imageX: number;
|
|
113
|
+
/**
|
|
114
|
+
* The y-coordinate of the upper-left corner of the image.
|
|
115
|
+
*/
|
|
116
|
+
imageY: number;
|
|
117
|
+
/**
|
|
118
|
+
* The x-coordinate relative to the browser page.
|
|
119
|
+
*/
|
|
120
|
+
pageX: number;
|
|
121
|
+
/**
|
|
122
|
+
* The y-coordinate relative to the browser page.
|
|
123
|
+
*/
|
|
124
|
+
pageY: number;
|
|
125
|
+
}
|