@regulaforensics/vp-frontend-document-components 7.5.1970-rc → 7.5.1972-nightly
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 +88 -59
- package/dist/index.d.ts +43 -18
- package/dist/main.iife.js +24 -50
- package/dist/main.js +12089 -15373
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -268,6 +268,7 @@ 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 |
|
|
271
272
|
| **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 |
|
|
272
273
|
| **returnPackageForReprocess** | When enabled, returns the package for reprocessing on the backend. | boolean | `false` | `true`, `false` |
|
|
273
274
|
| **imageQa** | When enabled, image quality checks status affects document optical and overall status. | | | |
|
|
@@ -277,7 +278,6 @@ After adding `DocumentReaderService` to the global variable, you can change the
|
|
|
277
278
|
| **glaresCheckParams** | Settings for glare check. | | | |
|
|
278
279
|
| **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 |
|
|
279
280
|
| **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,6 +425,7 @@ 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 |
|
|
428
429
|
|
|
429
430
|
#### Remote action data
|
|
430
431
|
|
|
@@ -1007,51 +1008,53 @@ This method gives more flexibility in setup, in addition, all new parameters in
|
|
|
1007
1008
|
|
|
1008
1009
|
See all component's settings and attributes in the following table.
|
|
1009
1010
|
|
|
1010
|
-
| Setting name
|
|
1011
|
-
|
|
1012
|
-
| **locale**
|
|
1013
|
-
| **internalScenario**
|
|
1014
|
-
| **multipageProcessing**
|
|
1015
|
-
| **startScreen**
|
|
1016
|
-
| **multipleFileInput**
|
|
1017
|
-
| **cameraId**
|
|
1018
|
-
| **devLicense**
|
|
1019
|
-
| **regulaLogo**
|
|
1020
|
-
| **changeCameraButton**
|
|
1021
|
-
| **closeButton**
|
|
1022
|
-
| **captureButton**
|
|
1023
|
-
| **
|
|
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
|
-
| **
|
|
1011
|
+
| Setting name | Attribute name | Description | Data type | Default value | Values | Available in |
|
|
1012
|
+
|:--------------------------------------------|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------:|:----------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------:|
|
|
1013
|
+
| **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` |
|
|
1014
|
+
| **internalScenario** | **internal-scenario** | The component document verification scenario. | string | `MrzAndLocate` | `MrzAndLocate`, `MrzOrLocate`, `Mrz`, `Locate`, `Barcode`, `MrzOrBarcode`, `BarcodeAndLocate` | `document-reader` |
|
|
1015
|
+
| **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` |
|
|
1016
|
+
| **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` |
|
|
1017
|
+
| **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` |
|
|
1018
|
+
| **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` |
|
|
1019
|
+
| **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` |
|
|
1020
|
+
| **regulaLogo** | **copyright** | Show Regula copyright footer. (deprecated, use copyright instead) | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1021
|
+
| **changeCameraButton** | **change-camera** | Show the camera switch button. | boolean | `false` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1022
|
+
| **closeButton** | **close-button** | Show the close button. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1023
|
+
| **captureButton** | **capture-button** | Show the capture button. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1024
|
+
| **copyright** | | Show Regula copyright footer. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1025
|
+
| **skipButton** | | Show the skip button for the second page. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1026
|
+
| **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` |
|
|
1027
|
+
| **resolution** | | Sets the resolution of the video stream from the camera. | object | `{ width: 1920, height: 1080 }` | `{ width: number, height: number }` | `document-reader`, `camera-snapshot` |
|
|
1028
|
+
| **cameraMode** | | Selects the front or rear camera of the device. | object | `environment` | `environment`, `user` | `document-reader`, `camera-snapshot` |
|
|
1029
|
+
| **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` |
|
|
1030
|
+
| **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` |
|
|
1031
|
+
| **cameraFrameBorderWidth** | | Sets the thickness of the document capture frame. | number | 5 | `any number` | `document-reader` |
|
|
1032
|
+
| **backgroundMaskAlpha** | | Sets the transparency of the background outside the frame. | number | 0.5 | `from 0 to 1` | `document-reader` |
|
|
1033
|
+
| **cameraFrameLandscapeAspectRatio** | | Sets the aspect ratio of the capture frame for landscape mode. | number | depends on the scenario | `any number` | `document-reader` |
|
|
1034
|
+
| **cameraFramePortraitAspectRatio** | | Sets the aspect ratio of the capture frame for portrait mode. | number | depends on the scenario | `any number` | `document-reader` |
|
|
1035
|
+
| **statusIcon** | | Show status icon. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1036
|
+
| **statusPositionMultiplier** | | Sets the vertical position of the status message. | number | `undefined` | `from 0 to 2` | `document-reader` |
|
|
1037
|
+
| **cameraFrameOffsetWidth** | | Sets the offset of the capture frame. | number | `undefined` | `any number` | `document-reader` |
|
|
1038
|
+
| **cameraFrameVerticalPositionMultiplier** | | Sets the offset of the capture frame from the top edge. | number | `undefined` | `from 0 to 2` | `document-reader` |
|
|
1039
|
+
| **cameraFrameHorizontalPositionMultiplier** | | Sets the offset of the capture frame from the right edge. | number | `undefined` | `from 0 to 2` | `document-reader` |
|
|
1040
|
+
| **cameraFrameShapeType** | | Sets the capture frame shape type. | string | `line` | `line`, `corners` | `document-reader` |
|
|
1041
|
+
| **cameraFrameLineCap** | | Sets the style of the end of the capture frame line when `cameraFrameShapeType='corners'` | string | `butt` | `butt`, `round`, `square` | `document-reader` |
|
|
1042
|
+
| **cameraFrameLineLength** | | Sets the length of the capture frame line when `cameraFrameShapeType='corners'` | number | 5 | `any number` | `document-reader` |
|
|
1043
|
+
| **cameraFrameCornerRadius** | | Sets the radius of rounding of the capture frame. | number | 15 | `any number` | `document-reader` |
|
|
1044
|
+
| **cameraFrameDefaultColor** | | Sets the color of the capture frame. | string | `rgba(255, 255, 255, 0.9)` | `any color string` | `document-reader` |
|
|
1045
|
+
| **cameraFrameActiveColor** | | Sets the capture frame color when a document is detected. | string | `rgba(30, 130, 76, 0.9)` | `any color string` | `document-reader` |
|
|
1046
|
+
| **statusTextColor** | | Sets the color of the text message status. | string | `white` | `any color string` | `document-reader`, `camera-snapshot` |
|
|
1047
|
+
| **statusBackgroundColor** | | Sets the background color of the message status. | string | `rgba(27, 16, 31, 0.5)` | `any color string` | `document-reader`, `camera-snapshot` |
|
|
1048
|
+
| **cameraFrame** | | Show the capture frame. | boolean | `true` | `true`, `false` | `document-reader` |
|
|
1049
|
+
| **captureButtonDelay** | | Show the capture button after delay. | number | `undefined` | `any number` | `document-reader` |
|
|
1050
|
+
| **nonce** | | Sets the unique nonce value to maintain the CSP policy. | string | `undefined` | `unique nonce value` | `document-reader`, `camera-snapshot` |
|
|
1051
|
+
| **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, bitrate: number }` | `document-reader` |
|
|
1052
|
+
| **videoCaptureMotionControl** | | Enables device shaking control. | boolean | `false` | `true`, `false` | `document-reader` |
|
|
1053
|
+
| **fromCameraButton** | | Show the camera button. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1054
|
+
| **uploadFileButton** | | Show the files button. | boolean | `true` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
1055
|
+
| **mirrorButton** | | Show the mirroring button. | boolean | `false` | `true`, `false` | `document-reader`, `camera-snapshot` |
|
|
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` |
|
|
1055
1058
|
|
|
1056
1059
|
### Backend reprocessing
|
|
1057
1060
|
|
|
@@ -1061,6 +1064,7 @@ You can send the results to the backend for further processing:
|
|
|
1061
1064
|
```javascript
|
|
1062
1065
|
window.RegulaDocumentSDK.recognizerProcessParam = {
|
|
1063
1066
|
processParam: {
|
|
1067
|
+
scenario: InternalScenarios.MrzAndLocate,
|
|
1064
1068
|
backendProcessing: {
|
|
1065
1069
|
serviceURL: 'YOUR_SERVICE_URL',
|
|
1066
1070
|
httpHeaders: { // you can set http headers if necessary
|
|
@@ -1090,11 +1094,19 @@ For cases when user's main device lacks camera or does not succeed to scan with
|
|
|
1090
1094
|
you have an option to delegate scanning to another available device (i.e. phone).
|
|
1091
1095
|
|
|
1092
1096
|
#### 1. "From other phone" action may be configured on the start screen:
|
|
1093
|
-
-
|
|
1094
|
-
- add 'delegateURL' and 'tag':
|
|
1097
|
+
- add 'delegateProcessing' and 'tag':
|
|
1095
1098
|
```javascript
|
|
1096
1099
|
processor.recognizerProcessParam = {
|
|
1097
|
-
|
|
1100
|
+
processParam: {
|
|
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
|
+
},
|
|
1098
1110
|
tag: 123 // your session id, will be added to delegateURL in place of {tag} substring
|
|
1099
1111
|
}
|
|
1100
1112
|
```
|
|
@@ -1107,22 +1119,35 @@ you have an option to delegate scanning to another available device (i.e. phone)
|
|
|
1107
1119
|
|
|
1108
1120
|
#### 2. Configure Delegate page component on delegateURL:
|
|
1109
1121
|
- 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
|
+
```
|
|
1110
1129
|
- use the same tag as on the main page
|
|
1111
1130
|
```javascript
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
element.settings = {
|
|
1117
|
-
startScreen: false, // From camera recognition is expected
|
|
1118
|
-
}
|
|
1131
|
+
element.settings = {
|
|
1132
|
+
startScreen: false, // From camera recognition is expected
|
|
1133
|
+
mobileDelegate: true
|
|
1134
|
+
}
|
|
1119
1135
|
```
|
|
1120
1136
|
- use finalizePackage() to send the data for further reprocessing
|
|
1121
1137
|
|
|
1122
|
-
|
|
1123
1138
|
### Appearance Customization
|
|
1124
1139
|
|
|
1125
|
-
####
|
|
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
|
+
|
|
1144
|
+
```css
|
|
1145
|
+
document-reader::part(container) {
|
|
1146
|
+
background: red;
|
|
1147
|
+
}
|
|
1148
|
+
```
|
|
1149
|
+
|
|
1150
|
+
#### CSS variables
|
|
1126
1151
|
|
|
1127
1152
|
Using CSS variables, you can change the font and the main colors of the components. See the table for the details.
|
|
1128
1153
|
|
|
@@ -1218,7 +1243,7 @@ See the following table with localized labels, used in the components.
|
|
|
1218
1243
|
| **keepDeviceStill** | Hold the device still | `document-reader` |
|
|
1219
1244
|
| **positionDocumentCenter** | Position the document in the center | `camera-snapshot` |
|
|
1220
1245
|
| **uploadPhoto** | Upload a photo | `camera-snapshot` |
|
|
1221
|
-
| **
|
|
1246
|
+
| **switchToMobile** | Switch to mobile | `document-reader` |
|
|
1222
1247
|
| **openPhoneCamera** | Open the camera on your mobile device, scan the QR code, and follow the link | `document-reader` |
|
|
1223
1248
|
| **pleaseWait** | Please wait... | `document-reader` |
|
|
1224
1249
|
| **mobileDevice** | Mobile device | `document-reader` |
|
|
@@ -1233,6 +1258,8 @@ See the following table with localized labels, used in the components.
|
|
|
1233
1258
|
| **fromFilesDesktop** | Pick a document from the files and upload it | `document-reader` |
|
|
1234
1259
|
| **fromMobileDesktop** | Use your mobile camera to capture a document | `document-reader` |
|
|
1235
1260
|
| **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` |
|
|
1236
1263
|
|
|
1237
1264
|
## Document Reader Processor
|
|
1238
1265
|
|
|
@@ -1586,6 +1613,8 @@ In the given examples, change the `workerPath` parameter value to your custom so
|
|
|
1586
1613
|
|
|
1587
1614
|
**Attention!** The files must be located in the same directory and have the same names as were previously specified.
|
|
1588
1615
|
|
|
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
|
+
|
|
1589
1618
|
## Potential Problems
|
|
1590
1619
|
|
|
1591
1620
|
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,9 +3,11 @@ 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';
|
|
6
7
|
import { Response as Response_2 } from '@regulaforensics/document-reader-webclient';
|
|
7
8
|
import { Result } from '@regulaforensics/document-reader-webclient';
|
|
8
9
|
import { TextFieldType } from '@regulaforensics/document-reader-webclient';
|
|
10
|
+
import { TransactionInfo } from '@regulaforensics/document-reader-webclient';
|
|
9
11
|
|
|
10
12
|
export declare interface BaseRequest {
|
|
11
13
|
tag?: string;
|
|
@@ -40,6 +42,7 @@ export declare interface CameraSnapshotSettings {
|
|
|
40
42
|
locale?: Locales | string;
|
|
41
43
|
multipleFileInput?: boolean;
|
|
42
44
|
regulaLogo?: boolean;
|
|
45
|
+
copyright?: boolean;
|
|
43
46
|
cameraId?: string;
|
|
44
47
|
changeCameraButton?: boolean;
|
|
45
48
|
closeButton?: boolean;
|
|
@@ -146,8 +149,8 @@ export declare class DocumentReaderProcessor {
|
|
|
146
149
|
isInitialized: boolean;
|
|
147
150
|
videoElement: HTMLVideoElement | null;
|
|
148
151
|
constructor(videoElement?: HTMLVideoElement);
|
|
149
|
-
get recognizeListener(): ((data: Response_2) => void) | null;
|
|
150
|
-
set recognizeListener(listener: ((data: Response_2) => void) | null);
|
|
152
|
+
get recognizeListener(): ((data: Response_2 | ProcessRejectResponse) => void) | null;
|
|
153
|
+
set recognizeListener(listener: ((data: Response_2 | ProcessRejectResponse) => void) | null);
|
|
151
154
|
get streamParam(): Partial<StreamParams>;
|
|
152
155
|
set streamParam(params: Partial<StreamParams>);
|
|
153
156
|
get recognizerProcessParam(): ProcessingRequest;
|
|
@@ -221,9 +224,7 @@ export declare interface DocumentReaderProcessParam {
|
|
|
221
224
|
};
|
|
222
225
|
}
|
|
223
226
|
|
|
224
|
-
export declare type DocumentReaderResponseType = Response_2
|
|
225
|
-
TransactionInfo?: TransactionInfo;
|
|
226
|
-
};
|
|
227
|
+
export declare type DocumentReaderResponseType = Response_2;
|
|
227
228
|
|
|
228
229
|
export declare class DocumentReaderService {
|
|
229
230
|
private _worker;
|
|
@@ -231,11 +232,12 @@ export declare class DocumentReaderService {
|
|
|
231
232
|
private _initializeListener;
|
|
232
233
|
private _processingListener;
|
|
233
234
|
private _queueService;
|
|
235
|
+
private _initProcess;
|
|
236
|
+
onFinalize: TOnFinalize | null;
|
|
234
237
|
isAutoPrepare: boolean;
|
|
235
238
|
isPrepared: boolean;
|
|
236
239
|
isInitialized: boolean;
|
|
237
240
|
isProcessing: boolean;
|
|
238
|
-
_initProcess: Promise<License> | null;
|
|
239
241
|
initData: License | null;
|
|
240
242
|
recognizerProcessParam: ProcessingRequest;
|
|
241
243
|
imageProcessParam: ImageProcessingRequest;
|
|
@@ -259,13 +261,14 @@ export declare class DocumentReaderService {
|
|
|
259
261
|
doInitialize(initData?: {
|
|
260
262
|
license: string | undefined;
|
|
261
263
|
}): Promise<License>;
|
|
264
|
+
private doProcess;
|
|
262
265
|
processImageBase64(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<Response_2>;
|
|
263
266
|
process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response_2>;
|
|
264
267
|
processImage(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response_2>;
|
|
265
268
|
startNewPage(): Promise<void>;
|
|
266
269
|
startNewDocument(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
267
270
|
createBackendTransaction(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
268
|
-
finalizePackage(): Promise<
|
|
271
|
+
finalizePackage(): Promise<TransactionIdentifier>;
|
|
269
272
|
addDataToPackage(data: Uint8ClampedArray, params: PackageParams): Promise<void>;
|
|
270
273
|
shutdown(): void;
|
|
271
274
|
}
|
|
@@ -287,6 +290,7 @@ export declare interface DocumentReaderSettings extends CameraSnapshotSettings {
|
|
|
287
290
|
statusIcon?: boolean;
|
|
288
291
|
cameraFrameOffsetWidth?: number;
|
|
289
292
|
cameraFrameVerticalPositionMultiplier?: number;
|
|
293
|
+
cameraFrameHorizontalPositionMultiplier?: number;
|
|
290
294
|
cameraFrameShapeType?: FrameShapeType;
|
|
291
295
|
cameraFrameLineCap?: FrameLineCap;
|
|
292
296
|
cameraFrameLineLength?: number;
|
|
@@ -383,7 +387,8 @@ export declare enum ErrorTypes {
|
|
|
383
387
|
INCORRECT_CAMERA_ID = "INCORRECT_CAMERA_ID",
|
|
384
388
|
CONNECTION_ERROR = "CONNECTION_ERROR",
|
|
385
389
|
HTTP_NOT_SUPPORTED = "HTTP_NOT_SUPPORTED",
|
|
386
|
-
INSECURE_PAGE_CONTEXT = "INSECURE_PAGE_CONTEXT"
|
|
390
|
+
INSECURE_PAGE_CONTEXT = "INSECURE_PAGE_CONTEXT",
|
|
391
|
+
BAD_CONFIGURATION = "BAD_CONFIGURATION"
|
|
387
392
|
}
|
|
388
393
|
|
|
389
394
|
export declare enum EventActions {
|
|
@@ -502,13 +507,7 @@ export declare enum MirrorType {
|
|
|
502
507
|
|
|
503
508
|
export declare interface NewTransaction {
|
|
504
509
|
ContainerList: ContainerList;
|
|
505
|
-
TransactionInfo:
|
|
506
|
-
ComputerName: string;
|
|
507
|
-
DateTime: string;
|
|
508
|
-
SystemInfo: string;
|
|
509
|
-
Tag: string;
|
|
510
|
-
TransactionID: string;
|
|
511
|
-
};
|
|
510
|
+
TransactionInfo: TransactionInfo;
|
|
512
511
|
sessionLogFolder: string;
|
|
513
512
|
}
|
|
514
513
|
|
|
@@ -520,13 +519,23 @@ export declare interface PackageParams {
|
|
|
520
519
|
|
|
521
520
|
export declare interface ProcessingRequest extends BaseRequest {
|
|
522
521
|
metadata?: Record<string, any>;
|
|
523
|
-
|
|
522
|
+
delegateProcessing?: {
|
|
523
|
+
serviceURL: string;
|
|
524
|
+
delegateURL: string;
|
|
525
|
+
httpHeaders?: Record<string, string>;
|
|
526
|
+
};
|
|
524
527
|
processParam: DocumentReaderProcessParam;
|
|
525
528
|
imagesList?: Array<DocumentReaderImage>;
|
|
526
529
|
imageInputParam?: ImageInputParamType;
|
|
527
530
|
}
|
|
528
531
|
|
|
529
|
-
declare
|
|
532
|
+
export declare interface ProcessRejectResponse extends ProcessResponse {
|
|
533
|
+
licensing_code: number;
|
|
534
|
+
reject_message: string;
|
|
535
|
+
reject_reason: number;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
declare type RecognizeListener = (data: Response_2 | ProcessRejectResponse) => void;
|
|
530
539
|
|
|
531
540
|
export declare type Resolution = Partial<WidthAndHeight>;
|
|
532
541
|
|
|
@@ -549,6 +558,8 @@ declare type TInitializeListener = ({ isInitialized }: {
|
|
|
549
558
|
isInitialized: boolean;
|
|
550
559
|
}) => void;
|
|
551
560
|
|
|
561
|
+
declare type TOnFinalize = (transaction: TransactionIdentifier) => void;
|
|
562
|
+
|
|
552
563
|
declare type TPrepareListener = ({ isPrepared }: {
|
|
553
564
|
isPrepared: boolean;
|
|
554
565
|
}) => void;
|
|
@@ -562,7 +573,8 @@ export declare interface TransactionEvent {
|
|
|
562
573
|
data: GetTransactionsByTagResponse;
|
|
563
574
|
}
|
|
564
575
|
|
|
565
|
-
export declare interface
|
|
576
|
+
export declare interface TransactionIdentifier {
|
|
577
|
+
metadata?: unknown;
|
|
566
578
|
tag: string;
|
|
567
579
|
transactionId: string;
|
|
568
580
|
}
|
|
@@ -598,6 +610,7 @@ export declare interface VideoData {
|
|
|
598
610
|
export declare interface VideoRecordSettings {
|
|
599
611
|
delay?: number;
|
|
600
612
|
duration?: number;
|
|
613
|
+
bitrate?: number;
|
|
601
614
|
}
|
|
602
615
|
|
|
603
616
|
export declare interface WidthAndHeight {
|
|
@@ -617,3 +630,15 @@ declare global {
|
|
|
617
630
|
RegulaDocumentSDK: DocumentReaderService;
|
|
618
631
|
}
|
|
619
632
|
}
|
|
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
|
+
}
|