@regulaforensics/vp-frontend-document-components 7.5.1968-nightly → 7.5.1970-rc
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 +59 -88
- package/dist/index.d.ts +18 -43
- package/dist/main.iife.js +50 -24
- package/dist/main.js +15373 -12089
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -268,7 +268,6 @@ After adding `DocumentReaderService` to the global variable, you can change the
|
|
|
268
268
|
| **scenario** | Recognition scenario. | string | 'MrzAndLocate' | 'MrzAndLocate', 'MrzOrLocate', 'Mrz', 'Locate' |
|
|
269
269
|
| **multipageProcessing** | Whether to enable multi-page document processing mode. | boolean | `true` | `true`, `false` |
|
|
270
270
|
| **timeout** | Recognition timeout in milliseconds. After this time process will be finished. | number | 2000 | numbers > 0 |
|
|
271
|
-
| **timeoutFromFirstDetect** | Start the countdown from the moment the document is detected. | number | 5000 | numbers > 0 |
|
|
272
271
|
| **resultTypeOutput** | Types of results to return in response. [] - all available types. | number[] | [] | `1` - DocumentImageResult, `3` - TextDataResult, `5` - DocBarCodeInfo, `6` - GraphicsResult, `8` - DocumentTypesCandidatesResult, `9` - ChosenDocumentTypeResult, `20` - AuthenticityResult, `15` - LexicalAnalysisResult, `17` - TextDataResult, `18` - TextDataResult, `19` - GraphicsResult, `30` - ImageQualityResult, `33` - StatusResult, `36` - TextResult, `37` - ImagesResult, `85` - DocumentPositionResult, `102` - TextDataResult, `103` - GraphicsResult, `50` - LicenseResult, `49` - EncryptedRCLResult |
|
|
273
272
|
| **returnPackageForReprocess** | When enabled, returns the package for reprocessing on the backend. | boolean | `false` | `true`, `false` |
|
|
274
273
|
| **imageQa** | When enabled, image quality checks status affects document optical and overall status. | | | |
|
|
@@ -278,6 +277,7 @@ After adding `DocumentReaderService` to the global variable, you can change the
|
|
|
278
277
|
| **glaresCheckParams** | Settings for glare check. | | | |
|
|
279
278
|
| **imageOutputMaxHeight** | This parameter allows setting maximum height in pixels of output images and thus reducing image size to desired. Does not change the aspect ratio. Changes disabled if equals to 0. | number | 0 | numbers > 0 |
|
|
280
279
|
| **imageOutputMaxWidth** | This parameter allows setting maximum width in pixels of output images and thus reducing image size to desired. Does not change the aspect ratio. Changes disabled if equals to 0. | number | 0 | numbers > 0 |
|
|
280
|
+
| **fieldTypesFilter** | List of text field types to extract. If empty, all text fields from template will be extracted. Narrowing the list can shorten processing time. | number[] | [] | |
|
|
281
281
|
| **dateFormat** | This option allows you to set dates format so that solution will return dates in this format. For example, if you supply 'MM/dd/yyyy', and document have printed date '09 JUL 2020' for the date os issue, you will get '07/09/2020' as a result. By default it is set to system locale default (where the service is running). | string | | 'MM/dd/yyyy' |
|
|
282
282
|
| **measureSystem** | This option allows you to set the system of measurement used for converting original values in document to output result values. Metric by default. | number | 0 | `0` - Metric, `1` - Imperial |
|
|
283
283
|
| **imageDpiOutMax** | This parameter controls maximum resolution in dpi of output images. Resolution will remain original in case 0 is supplied. By default is set to return images in response with resolution not greater than 300 dpi for all scenarios except FullAuth. In FullAuth scenario this limit is 1000 dpi by default. | number | | numbers > 0 |
|
|
@@ -425,7 +425,6 @@ Available fields of `event.detail.data` object:
|
|
|
425
425
|
| `NO_CAMERA` | There is no camera available |
|
|
426
426
|
| `INCORRECT_CAMERA_ID` | Camera with this ID was not found |
|
|
427
427
|
| `CONNECTION_ERROR` | Connection errors |
|
|
428
|
-
| `BAD_CONFIGURATION` | Incompatible component settings are installed |
|
|
429
428
|
|
|
430
429
|
#### Remote action data
|
|
431
430
|
|
|
@@ -1008,53 +1007,51 @@ This method gives more flexibility in setup, in addition, all new parameters in
|
|
|
1008
1007
|
|
|
1009
1008
|
See all component's settings and attributes in the following table.
|
|
1010
1009
|
|
|
1011
|
-
| Setting name
|
|
1012
|
-
|
|
1013
|
-
| **locale**
|
|
1014
|
-
| **internalScenario**
|
|
1015
|
-
| **multipageProcessing**
|
|
1016
|
-
| **startScreen**
|
|
1017
|
-
| **multipleFileInput**
|
|
1018
|
-
| **cameraId**
|
|
1019
|
-
| **devLicense**
|
|
1020
|
-
| **regulaLogo**
|
|
1021
|
-
| **changeCameraButton**
|
|
1022
|
-
| **closeButton**
|
|
1023
|
-
| **captureButton**
|
|
1024
|
-
| **
|
|
1025
|
-
| **
|
|
1026
|
-
| **
|
|
1027
|
-
| **
|
|
1028
|
-
| **
|
|
1029
|
-
| **
|
|
1030
|
-
| **
|
|
1031
|
-
| **
|
|
1032
|
-
| **
|
|
1033
|
-
| **
|
|
1034
|
-
| **
|
|
1035
|
-
| **
|
|
1036
|
-
| **
|
|
1037
|
-
| **
|
|
1038
|
-
| **
|
|
1039
|
-
| **
|
|
1040
|
-
| **
|
|
1041
|
-
| **
|
|
1042
|
-
| **
|
|
1043
|
-
| **
|
|
1044
|
-
| **
|
|
1045
|
-
| **
|
|
1046
|
-
| **
|
|
1047
|
-
| **
|
|
1048
|
-
| **
|
|
1049
|
-
| **
|
|
1050
|
-
| **
|
|
1051
|
-
| **
|
|
1052
|
-
| **
|
|
1053
|
-
| **
|
|
1054
|
-
| **
|
|
1055
|
-
| **
|
|
1056
|
-
| **mirrorType** | | Sets the initial value of video mirroring. | string | `mirror` - for front camera, `noMirror` - for back camera, | `mirror`, `noMirror` | `document-reader`, `camera-snapshot` |
|
|
1057
|
-
| **mobileDelegate** | | Changes the success screen in case of delegating scanning via a mobile device. | boolean | `false` | `true`, `false` | `document-reader` |
|
|
1010
|
+
| Setting name | Attribute name | Description | Data type | Default value | Values | Available in |
|
|
1011
|
+
|:------------------------------------------|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------:|:----------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------:|
|
|
1012
|
+
| **locale** | **locale** | The language of the component interface. If empty, the language is selected from the browser settings, if it is not found, the system language is taken. | string | `en` | `ru`, `en`, `de`, `pl`, `it`, `hu`, `zh`, `sk`, `uk`, `fr`, `es`, `pt`, `ar`, `nl`, `id`, `vi`, `ko`, `ms`, `ro`, `el`, `tr`, `ja`, `cs`, `th`, `hi`, `bn`, `he`, `fi`, `sv`, `da`, `hr`, `no` | `document-reader`, `camera-snapshot` |
|
|
1013
|
+
| **internalScenario** | **internal-scenario** | The component document verification scenario. | string | `MrzAndLocate` | `MrzAndLocate`, `MrzOrLocate`, `Mrz`, `Locate`, `Barcode`, `MrzOrBarcode`, `BarcodeAndLocate` | `document-reader` |
|
|
1014
|
+
| **multipageProcessing** | **multipage-processing** | Whether to allow processing of two pages in cases when the component detects an ID1-sized document. Multipage processing is not triggered for documents of other formats. If `true`, the component asks for the second page and processes it. If `false`, only one page/side of the document is processed regardless the document format. | boolean | `false` | `true`, `false` | `document-reader` |
|
|
1015
|
+
| **startScreen** | **start-screen** | Whether to show the start screen with two options for the document image uploading: From camera and From gallery. If `true`, the start screen is shown. If `false`, no start screen is shown and instead the camera of the device is turned on automatically to capture the image of the document. | boolean | `false` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1016
|
+
| **multipleFileInput** | **multiple** | Whether to allow uploading more than one file via the file system. Can be set to `true` only if `startScreen` is `true`. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1017
|
+
| **cameraId** | **camera-id** | Ability to select a camera. You can get the device ID using [navigator.mediaDevices.enumerateDevices()](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices). | string | `undefined` | `camera id string value` | `document-reader`, `camera-snapshot` |
|
|
1018
|
+
| **devLicense** | **license** | To use the component on test environments, set the base64 license value to the `license` attribute. | string | `undefined` | `base64 license value` | `document-reader` |
|
|
1019
|
+
| **regulaLogo** | **copyright** | Show Regula copyright footer. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1020
|
+
| **changeCameraButton** | **change-camera** | Show the camera switch button. | boolean | `false` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1021
|
+
| **closeButton** | **close-button** | Show the close button. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1022
|
+
| **captureButton** | **capture-button** | Show the capture button. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1023
|
+
| **skipButton** | | Show the skip button for the second page. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1024
|
+
| **captureMode** | | Sets the capture mode. Mode `auto` - recognition starts immediately after the camera starts working. Mode `captureFrame` - recognition of the frame received after pressing the capture button. Mode `captureVideo` - recognition begins after pressing the button, pressing the button again will send the received frame for processing. | string | `auto` | `auto`, `captureVideo`, `captureFrame` | `document-reader` |
|
|
1025
|
+
| **resolution** | | Sets the resolution of the video stream from the camera. | object | `{ width: 1920, height: 1080 }` | `{ width: number, height: number }` | `document-reader`, `camera-snapshot` |
|
|
1026
|
+
| **cameraMode** | | Selects the front or rear camera of the device. | object | `environment` | `environment`, `user` | `document-reader`, `camera-snapshot` |
|
|
1027
|
+
| **flipFrontIcon** | | Sets the front side of the document flip icon. You can set link (`https://example.link.com/icon.png`), image in base64 string (`data:image/svg+xml;base64,PHN2ZyBjbGF...`) or imported image if you use module bundler. | string | `undefined` | `link to image`, `base64 string`, `imported image` | `document-reader` |
|
|
1028
|
+
| **flipBackIcon** | | Sets the back side of the document flip icon. You can set link (`https://example.link.com/icon.png`), image in base64 string (`data:image/svg+xml;base64,PHN2ZyBjbGF...`) or imported image if you use module bundler. | string | `undefined` | `link to image`, `base64 string`, `imported image` | `document-reader` |
|
|
1029
|
+
| **cameraFrameBorderWidth** | | Sets the thickness of the document capture frame. | number | 5 | `any number` | `document-reader` |
|
|
1030
|
+
| **backgroundMaskAlpha** | | Sets the transparency of the background outside the frame. | number | 0.5 | `from 0 to 1` | `document-reader` |
|
|
1031
|
+
| **cameraFrameLandscapeAspectRatio** | | Sets the aspect ratio of the capture frame for landscape mode. | number | depends on the scenario | `any number` | `document-reader` |
|
|
1032
|
+
| **cameraFramePortraitAspectRatio** | | Sets the aspect ratio of the capture frame for portrait mode. | number | depends on the scenario | `any number` | `document-reader` |
|
|
1033
|
+
| **statusIcon** | | Show status icon. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1034
|
+
| **statusPositionMultiplier** | | Sets the vertical position of the status message. | number | `undefined` | `from 0 to 2` | `document-reader` |
|
|
1035
|
+
| **cameraFrameOffsetWidth** | | Sets the offset of the capture frame. | number | `undefined` | `any number` | `document-reader` |
|
|
1036
|
+
| **cameraFrameVerticalPositionMultiplier** | | Sets the offset of the capture frame from the top edge. | number | `undefined` | `from 0 to 2` | `document-reader` |
|
|
1037
|
+
| **cameraFrameShapeType** | | Sets the capture frame shape type. | string | `line` | `line`, `corners` | `document-reader` |
|
|
1038
|
+
| **cameraFrameLineCap** | | Sets the style of the end of the capture frame line when `cameraFrameShapeType='corners'` | string | `butt` | `butt`, `round`, `square` | `document-reader` |
|
|
1039
|
+
| **cameraFrameLineLength** | | Sets the length of the capture frame line when `cameraFrameShapeType='corners'` | number | 5 | `any number` | `document-reader` |
|
|
1040
|
+
| **cameraFrameCornerRadius** | | Sets the radius of rounding of the capture frame. | number | 15 | `any number` | `document-reader` |
|
|
1041
|
+
| **cameraFrameDefaultColor** | | Sets the color of the capture frame. | string | `rgba(255, 255, 255, 0.9)` | `any color string` | `document-reader` |
|
|
1042
|
+
| **cameraFrameActiveColor** | | Sets the capture frame color when a document is detected. | string | `rgba(30, 130, 76, 0.9)` | `any color string` | `document-reader` |
|
|
1043
|
+
| **statusTextColor** | | Sets the color of the text message status. | string | `white` | `any color string` | `document-reader`, `camera-snapshot` |
|
|
1044
|
+
| **statusBackgroundColor** | | Sets the background color of the message status. | string | `rgba(27, 16, 31, 0.5)` | `any color string` | `document-reader`, `camera-snapshot` |
|
|
1045
|
+
| **cameraFrame** | | Show the capture frame. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1046
|
+
| **captureButtonDelay** | | Show the capture button after delay. | number | `undefined` | `any number` | `document-reader` |
|
|
1047
|
+
| **nonce** | | Sets the unique nonce value to maintain the CSP policy. | string | `undefined` | `unique nonce value` | `document-reader`, `camera-snapshot` |
|
|
1048
|
+
| **videoRecord** | | Sets the ability to record a video of the document scanning process. If set to true it records the entire process. You can also set the recording delay and recording duration. The video will be available in the component response. | boolean or object | `undefined` | `true`, `false`, `{ delay: number, duration: number }` | `document-reader` |
|
|
1049
|
+
| **videoCaptureMotionControl** | | Enables device shaking control. | boolean | `false` | `true`, `false` | `document-reader` |
|
|
1050
|
+
| **fromCameraButton** | | Show the camera button. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1051
|
+
| **uploadFileButton** | | Show the files button. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1052
|
+
| **mirrorButton** | | Show the mirroring button. | boolean | `false` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1053
|
+
| **mirrorType** | | Sets the initial value of video mirroring. | string | `mirror` - for front camera, `noMirror` - for back camera, | `mirror`, `noMirror` | `document-reader`, `camera-snapshot` |
|
|
1054
|
+
| **mobileDelegate** | | Changes the success screen in case of delegating scanning via a mobile device. | boolean | `false` | `true`, `false` | `document-reader` |
|
|
1058
1055
|
|
|
1059
1056
|
### Backend reprocessing
|
|
1060
1057
|
|
|
@@ -1064,7 +1061,6 @@ You can send the results to the backend for further processing:
|
|
|
1064
1061
|
```javascript
|
|
1065
1062
|
window.RegulaDocumentSDK.recognizerProcessParam = {
|
|
1066
1063
|
processParam: {
|
|
1067
|
-
scenario: InternalScenarios.MrzAndLocate,
|
|
1068
1064
|
backendProcessing: {
|
|
1069
1065
|
serviceURL: 'YOUR_SERVICE_URL',
|
|
1070
1066
|
httpHeaders: { // you can set http headers if necessary
|
|
@@ -1094,19 +1090,11 @@ For cases when user's main device lacks camera or does not succeed to scan with
|
|
|
1094
1090
|
you have an option to delegate scanning to another available device (i.e. phone).
|
|
1095
1091
|
|
|
1096
1092
|
#### 1. "From other phone" action may be configured on the start screen:
|
|
1097
|
-
-
|
|
1093
|
+
- configure [backend reprocessing](#backend-reprocessing)
|
|
1094
|
+
- add 'delegateURL' and 'tag':
|
|
1098
1095
|
```javascript
|
|
1099
1096
|
processor.recognizerProcessParam = {
|
|
1100
|
-
|
|
1101
|
-
scenario: InternalScenarios.MrzAndLocate,
|
|
1102
|
-
},
|
|
1103
|
-
delegateProcessing: {
|
|
1104
|
-
delegateURL: 'https://your-page.com?tag={tag}', // the page which will be used by other device
|
|
1105
|
-
serviceURL: 'https://my-service.com', // your backend service
|
|
1106
|
-
httpHeaders: { // http headers if needed
|
|
1107
|
-
header: 'value'
|
|
1108
|
-
}
|
|
1109
|
-
},
|
|
1097
|
+
delegateURL: 'https://your-page.com?tag={tag}', // the page which will be used by other device
|
|
1110
1098
|
tag: 123 // your session id, will be added to delegateURL in place of {tag} substring
|
|
1111
1099
|
}
|
|
1112
1100
|
```
|
|
@@ -1119,35 +1107,22 @@ you have an option to delegate scanning to another available device (i.e. phone)
|
|
|
1119
1107
|
|
|
1120
1108
|
#### 2. Configure Delegate page component on delegateURL:
|
|
1121
1109
|
- configure [backend reprocessing](#backend-reprocessing)
|
|
1122
|
-
- backendProcessing setting for the device and delegateProcessing setting for the main page must match
|
|
1123
|
-
- set transaction tag
|
|
1124
|
-
```javascript
|
|
1125
|
-
processor.recognizerProcessParam = {
|
|
1126
|
-
tag: new URL(window.location.href).searchParams.get('tag') // assume session Id tag was added to URL params
|
|
1127
|
-
}
|
|
1128
|
-
```
|
|
1129
1110
|
- use the same tag as on the main page
|
|
1130
1111
|
```javascript
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1112
|
+
window.RegulaDocumentSDK.recognizerProcessParam = {
|
|
1113
|
+
tag: 123 // your session id, i.e. it can be extracted from your delegate page URL
|
|
1114
|
+
};
|
|
1115
|
+
|
|
1116
|
+
element.settings = {
|
|
1117
|
+
startScreen: false, // From camera recognition is expected
|
|
1118
|
+
}
|
|
1135
1119
|
```
|
|
1136
1120
|
- use finalizePackage() to send the data for further reprocessing
|
|
1137
1121
|
|
|
1138
|
-
### Appearance Customization
|
|
1139
|
-
|
|
1140
|
-
#### CSS part
|
|
1141
|
-
|
|
1142
|
-
Using ::part CSS pseudo-elements, you can set your own styles for component elements. Select the element you need in the developer console and use its part name to customize it.
|
|
1143
1122
|
|
|
1144
|
-
|
|
1145
|
-
document-reader::part(container) {
|
|
1146
|
-
background: red;
|
|
1147
|
-
}
|
|
1148
|
-
```
|
|
1123
|
+
### Appearance Customization
|
|
1149
1124
|
|
|
1150
|
-
####
|
|
1125
|
+
#### Font and Colors
|
|
1151
1126
|
|
|
1152
1127
|
Using CSS variables, you can change the font and the main colors of the components. See the table for the details.
|
|
1153
1128
|
|
|
@@ -1243,7 +1218,7 @@ See the following table with localized labels, used in the components.
|
|
|
1243
1218
|
| **keepDeviceStill** | Hold the device still | `document-reader` |
|
|
1244
1219
|
| **positionDocumentCenter** | Position the document in the center | `camera-snapshot` |
|
|
1245
1220
|
| **uploadPhoto** | Upload a photo | `camera-snapshot` |
|
|
1246
|
-
| **
|
|
1221
|
+
| **scanQRCode** | Scan QR code | `document-reader` |
|
|
1247
1222
|
| **openPhoneCamera** | Open the camera on your mobile device, scan the QR code, and follow the link | `document-reader` |
|
|
1248
1223
|
| **pleaseWait** | Please wait... | `document-reader` |
|
|
1249
1224
|
| **mobileDevice** | Mobile device | `document-reader` |
|
|
@@ -1258,8 +1233,6 @@ See the following table with localized labels, used in the components.
|
|
|
1258
1233
|
| **fromFilesDesktop** | Pick a document from the files and upload it | `document-reader` |
|
|
1259
1234
|
| **fromMobileDesktop** | Use your mobile camera to capture a document | `document-reader` |
|
|
1260
1235
|
| **fromGalleryMobile** | Pick a document from the gallery and upload it | `document-reader` |
|
|
1261
|
-
| **returnToComputer** | Return to the computer | `document-reader` |
|
|
1262
|
-
| **documentCaptured** | Your document has been captured | `document-reader` |
|
|
1263
1236
|
|
|
1264
1237
|
## Document Reader Processor
|
|
1265
1238
|
|
|
@@ -1613,8 +1586,6 @@ In the given examples, change the `workerPath` parameter value to your custom so
|
|
|
1613
1586
|
|
|
1614
1587
|
**Attention!** The files must be located in the same directory and have the same names as were previously specified.
|
|
1615
1588
|
|
|
1616
|
-
To decrease files size, you can apply compression. On your server, you need to determine which <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding" target="_blank">compression method</a> is used for the files.
|
|
1617
|
-
|
|
1618
1589
|
## Potential Problems
|
|
1619
1590
|
|
|
1620
1591
|
UI components and SDK use the `getUserMedia` method to display the video stream from the camera. This feature is available only in secure contexts (HTTPS).
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,9 @@ import { DocumentFormat } from '@regulaforensics/document-reader-webclient';
|
|
|
3
3
|
import { GetTransactionsByTagResponse } from '@regulaforensics/document-reader-webclient';
|
|
4
4
|
import { MeasureSystem } from '@regulaforensics/document-reader-webclient';
|
|
5
5
|
import { MRZFormat } from '@regulaforensics/document-reader-webclient';
|
|
6
|
-
import { ProcessResponse } from '@regulaforensics/document-reader-webclient';
|
|
7
6
|
import { Response as Response_2 } from '@regulaforensics/document-reader-webclient';
|
|
8
7
|
import { Result } from '@regulaforensics/document-reader-webclient';
|
|
9
8
|
import { TextFieldType } from '@regulaforensics/document-reader-webclient';
|
|
10
|
-
import { TransactionInfo } from '@regulaforensics/document-reader-webclient';
|
|
11
9
|
|
|
12
10
|
export declare interface BaseRequest {
|
|
13
11
|
tag?: string;
|
|
@@ -42,7 +40,6 @@ export declare interface CameraSnapshotSettings {
|
|
|
42
40
|
locale?: Locales | string;
|
|
43
41
|
multipleFileInput?: boolean;
|
|
44
42
|
regulaLogo?: boolean;
|
|
45
|
-
copyright?: boolean;
|
|
46
43
|
cameraId?: string;
|
|
47
44
|
changeCameraButton?: boolean;
|
|
48
45
|
closeButton?: boolean;
|
|
@@ -149,8 +146,8 @@ export declare class DocumentReaderProcessor {
|
|
|
149
146
|
isInitialized: boolean;
|
|
150
147
|
videoElement: HTMLVideoElement | null;
|
|
151
148
|
constructor(videoElement?: HTMLVideoElement);
|
|
152
|
-
get recognizeListener(): ((data: Response_2
|
|
153
|
-
set recognizeListener(listener: ((data: Response_2
|
|
149
|
+
get recognizeListener(): ((data: Response_2) => void) | null;
|
|
150
|
+
set recognizeListener(listener: ((data: Response_2) => void) | null);
|
|
154
151
|
get streamParam(): Partial<StreamParams>;
|
|
155
152
|
set streamParam(params: Partial<StreamParams>);
|
|
156
153
|
get recognizerProcessParam(): ProcessingRequest;
|
|
@@ -224,7 +221,9 @@ export declare interface DocumentReaderProcessParam {
|
|
|
224
221
|
};
|
|
225
222
|
}
|
|
226
223
|
|
|
227
|
-
export declare type DocumentReaderResponseType = Response_2
|
|
224
|
+
export declare type DocumentReaderResponseType = Response_2 & {
|
|
225
|
+
TransactionInfo?: TransactionInfo;
|
|
226
|
+
};
|
|
228
227
|
|
|
229
228
|
export declare class DocumentReaderService {
|
|
230
229
|
private _worker;
|
|
@@ -232,12 +231,11 @@ export declare class DocumentReaderService {
|
|
|
232
231
|
private _initializeListener;
|
|
233
232
|
private _processingListener;
|
|
234
233
|
private _queueService;
|
|
235
|
-
private _initProcess;
|
|
236
|
-
onFinalize: TOnFinalize | null;
|
|
237
234
|
isAutoPrepare: boolean;
|
|
238
235
|
isPrepared: boolean;
|
|
239
236
|
isInitialized: boolean;
|
|
240
237
|
isProcessing: boolean;
|
|
238
|
+
_initProcess: Promise<License> | null;
|
|
241
239
|
initData: License | null;
|
|
242
240
|
recognizerProcessParam: ProcessingRequest;
|
|
243
241
|
imageProcessParam: ImageProcessingRequest;
|
|
@@ -261,14 +259,13 @@ export declare class DocumentReaderService {
|
|
|
261
259
|
doInitialize(initData?: {
|
|
262
260
|
license: string | undefined;
|
|
263
261
|
}): Promise<License>;
|
|
264
|
-
private doProcess;
|
|
265
262
|
processImageBase64(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<Response_2>;
|
|
266
263
|
process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response_2>;
|
|
267
264
|
processImage(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response_2>;
|
|
268
265
|
startNewPage(): Promise<void>;
|
|
269
266
|
startNewDocument(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
270
267
|
createBackendTransaction(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
271
|
-
finalizePackage(): Promise<
|
|
268
|
+
finalizePackage(): Promise<TransactionInfo>;
|
|
272
269
|
addDataToPackage(data: Uint8ClampedArray, params: PackageParams): Promise<void>;
|
|
273
270
|
shutdown(): void;
|
|
274
271
|
}
|
|
@@ -290,7 +287,6 @@ export declare interface DocumentReaderSettings extends CameraSnapshotSettings {
|
|
|
290
287
|
statusIcon?: boolean;
|
|
291
288
|
cameraFrameOffsetWidth?: number;
|
|
292
289
|
cameraFrameVerticalPositionMultiplier?: number;
|
|
293
|
-
cameraFrameHorizontalPositionMultiplier?: number;
|
|
294
290
|
cameraFrameShapeType?: FrameShapeType;
|
|
295
291
|
cameraFrameLineCap?: FrameLineCap;
|
|
296
292
|
cameraFrameLineLength?: number;
|
|
@@ -387,8 +383,7 @@ export declare enum ErrorTypes {
|
|
|
387
383
|
INCORRECT_CAMERA_ID = "INCORRECT_CAMERA_ID",
|
|
388
384
|
CONNECTION_ERROR = "CONNECTION_ERROR",
|
|
389
385
|
HTTP_NOT_SUPPORTED = "HTTP_NOT_SUPPORTED",
|
|
390
|
-
INSECURE_PAGE_CONTEXT = "INSECURE_PAGE_CONTEXT"
|
|
391
|
-
BAD_CONFIGURATION = "BAD_CONFIGURATION"
|
|
386
|
+
INSECURE_PAGE_CONTEXT = "INSECURE_PAGE_CONTEXT"
|
|
392
387
|
}
|
|
393
388
|
|
|
394
389
|
export declare enum EventActions {
|
|
@@ -507,7 +502,13 @@ export declare enum MirrorType {
|
|
|
507
502
|
|
|
508
503
|
export declare interface NewTransaction {
|
|
509
504
|
ContainerList: ContainerList;
|
|
510
|
-
TransactionInfo:
|
|
505
|
+
TransactionInfo: {
|
|
506
|
+
ComputerName: string;
|
|
507
|
+
DateTime: string;
|
|
508
|
+
SystemInfo: string;
|
|
509
|
+
Tag: string;
|
|
510
|
+
TransactionID: string;
|
|
511
|
+
};
|
|
511
512
|
sessionLogFolder: string;
|
|
512
513
|
}
|
|
513
514
|
|
|
@@ -519,23 +520,13 @@ export declare interface PackageParams {
|
|
|
519
520
|
|
|
520
521
|
export declare interface ProcessingRequest extends BaseRequest {
|
|
521
522
|
metadata?: Record<string, any>;
|
|
522
|
-
|
|
523
|
-
serviceURL: string;
|
|
524
|
-
delegateURL: string;
|
|
525
|
-
httpHeaders?: Record<string, string>;
|
|
526
|
-
};
|
|
523
|
+
delegateURL?: string;
|
|
527
524
|
processParam: DocumentReaderProcessParam;
|
|
528
525
|
imagesList?: Array<DocumentReaderImage>;
|
|
529
526
|
imageInputParam?: ImageInputParamType;
|
|
530
527
|
}
|
|
531
528
|
|
|
532
|
-
|
|
533
|
-
licensing_code: number;
|
|
534
|
-
reject_message: string;
|
|
535
|
-
reject_reason: number;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
declare type RecognizeListener = (data: Response_2 | ProcessRejectResponse) => void;
|
|
529
|
+
declare type RecognizeListener = (data: Response_2) => void;
|
|
539
530
|
|
|
540
531
|
export declare type Resolution = Partial<WidthAndHeight>;
|
|
541
532
|
|
|
@@ -558,8 +549,6 @@ declare type TInitializeListener = ({ isInitialized }: {
|
|
|
558
549
|
isInitialized: boolean;
|
|
559
550
|
}) => void;
|
|
560
551
|
|
|
561
|
-
declare type TOnFinalize = (transaction: TransactionIdentifier) => void;
|
|
562
|
-
|
|
563
552
|
declare type TPrepareListener = ({ isPrepared }: {
|
|
564
553
|
isPrepared: boolean;
|
|
565
554
|
}) => void;
|
|
@@ -573,8 +562,7 @@ export declare interface TransactionEvent {
|
|
|
573
562
|
data: GetTransactionsByTagResponse;
|
|
574
563
|
}
|
|
575
564
|
|
|
576
|
-
export declare interface
|
|
577
|
-
metadata?: unknown;
|
|
565
|
+
export declare interface TransactionInfo {
|
|
578
566
|
tag: string;
|
|
579
567
|
transactionId: string;
|
|
580
568
|
}
|
|
@@ -610,7 +598,6 @@ export declare interface VideoData {
|
|
|
610
598
|
export declare interface VideoRecordSettings {
|
|
611
599
|
delay?: number;
|
|
612
600
|
duration?: number;
|
|
613
|
-
bitrate?: number;
|
|
614
601
|
}
|
|
615
602
|
|
|
616
603
|
export declare interface WidthAndHeight {
|
|
@@ -630,15 +617,3 @@ declare global {
|
|
|
630
617
|
RegulaDocumentSDK: DocumentReaderService;
|
|
631
618
|
}
|
|
632
619
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
declare namespace v3 {
|
|
636
|
-
var DNS: string;
|
|
637
|
-
var URL: string;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
declare namespace v5 {
|
|
642
|
-
var DNS: string;
|
|
643
|
-
var URL: string;
|
|
644
|
-
}
|