react-native-scanbot-barcode-scanner-sdk 5.1.2-alpha.1 → 6.1.0-rc.1
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/Libraries.txt +439 -16
- package/RNScanbotBarcodeSDK.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/gradle.properties +4 -4
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt +27 -25
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPluginResultDelegate.kt +2 -2
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewEvents.kt +4 -4
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewManager.kt +0 -1
- package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/models/ScanbotBarcodeScannerModels.kt +4 -10
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.m +4 -4
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.mm +0 -4
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.h +0 -3
- package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.m +1 -5
- package/ios/ScanbotBarcodeSdk.m +57 -48
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.h +1 -1
- package/ios/ScanbotBarcodeSdkPluginResultDelegate.m +13 -13
- package/lib/commonjs/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/documents/BarcodeDocumentModel.js +612 -613
- package/lib/commonjs/documents/BarcodeDocumentModel.js.map +1 -1
- package/lib/commonjs/documents/GenericDocument.js +82 -49
- package/lib/commonjs/documents/GenericDocument.js.map +1 -1
- package/lib/commonjs/index.js +15 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js +10 -47
- package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
- package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js +8 -4
- package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
- package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
- package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
- package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
- package/lib/commonjs/ui_v2/common/CameraPermission.js +22 -6
- package/lib/commonjs/ui_v2/common/CameraPermission.js.map +1 -1
- package/lib/commonjs/ui_v2/common/Common.js +175 -5
- package/lib/commonjs/ui_v2/common/Common.js.map +1 -1
- package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js +6 -0
- package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
- package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js +27 -5
- package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
- package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js +48 -1
- package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
- package/lib/commonjs/ui_v2/index.js +14 -1
- package/lib/commonjs/ui_v2/index.js.map +1 -1
- package/lib/commonjs/utils.js +8 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
- package/lib/module/documents/BarcodeDocumentModel.js +611 -612
- package/lib/module/documents/BarcodeDocumentModel.js.map +1 -1
- package/lib/module/documents/GenericDocument.js +84 -51
- package/lib/module/documents/GenericDocument.js.map +1 -1
- package/lib/module/index.js +7 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js +1 -36
- package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
- package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
- package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
- package/lib/module/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
- package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js +6 -2
- package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
- package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
- package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
- package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
- package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
- package/lib/module/ui_v2/common/CameraPermission.js +22 -6
- package/lib/module/ui_v2/common/CameraPermission.js.map +1 -1
- package/lib/module/ui_v2/common/Common.js +168 -2
- package/lib/module/ui_v2/common/Common.js.map +1 -1
- package/lib/module/ui_v2/common/NavigationBarConfiguration.js +2 -0
- package/lib/module/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
- package/lib/module/ui_v2/common/ScanbotAlertDialog.js +28 -5
- package/lib/module/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
- package/lib/module/ui_v2/common/UserGuidanceConfiguration.js +47 -0
- package/lib/module/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
- package/lib/module/ui_v2/index.js +3 -1
- package/lib/module/ui_v2/index.js.map +1 -1
- package/lib/module/utils.js +6 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts +3 -5
- package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts.map +1 -1
- package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts +0 -1
- package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/configurations.d.ts +13 -5
- package/lib/typescript/src/configurations.d.ts.map +1 -1
- package/lib/typescript/src/customConfigurations.d.ts +19 -3
- package/lib/typescript/src/customConfigurations.d.ts.map +1 -1
- package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts +70 -71
- package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts.map +1 -1
- package/lib/typescript/src/documents/CommonFieldType.d.ts +58 -109
- package/lib/typescript/src/documents/CommonFieldType.d.ts.map +1 -1
- package/lib/typescript/src/documents/GenericDocument.d.ts +95 -86
- package/lib/typescript/src/documents/GenericDocument.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/results.d.ts +1 -13
- package/lib/typescript/src/results.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +25 -20
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts +1 -22
- package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts +41 -19
- package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/BarcodeScannerConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts +4 -0
- package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts +5 -0
- package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/CameraPermission.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/Common.d.ts +103 -1
- package/lib/typescript/src/ui_v2/common/Common.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts +12 -0
- package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts.map +1 -0
- package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts +4 -0
- package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts +25 -0
- package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts.map +1 -1
- package/lib/typescript/src/ui_v2/index.d.ts +1 -0
- package/lib/typescript/src/ui_v2/index.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +5 -0
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.ts +2 -5
- package/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.ts +0 -1
- package/src/configurations.ts +19 -7
- package/src/customConfigurations.ts +19 -3
- package/src/documents/BarcodeDocumentModel.ts +644 -623
- package/src/documents/CommonFieldType.ts +59 -82
- package/src/documents/GenericDocument.ts +104 -86
- package/src/index.ts +7 -1
- package/src/results.ts +1 -16
- package/src/types.ts +26 -23
- package/src/ui_v2/barcode/ArTrackingOverlayConfiguration.ts +1 -36
- package/src/ui_v2/barcode/BarcodeRecognizerConfiguration.ts +60 -22
- package/src/ui_v2/barcode/BarcodeScannerConfiguration.ts +2 -2
- package/src/ui_v2/barcode/BarcodeUseCase.ts +1 -1
- package/src/ui_v2/barcode/FindAndPickScanningModeUseCase.ts +6 -2
- package/src/ui_v2/barcode/MultipleScanningModeUseCase.ts +9 -1
- package/src/ui_v2/barcode/SingleScanningModeUseCase.ts +1 -1
- package/src/ui_v2/common/CameraPermission.ts +22 -6
- package/src/ui_v2/common/Common.ts +168 -2
- package/src/ui_v2/common/NavigationBarConfiguration.ts +13 -0
- package/src/ui_v2/common/ScanbotAlertDialog.ts +25 -6
- package/src/ui_v2/common/UserGuidanceConfiguration.ts +41 -0
- package/src/ui_v2/index.ts +5 -9
- package/src/utils.ts +10 -0
- package/lib/commonjs/documents/Point.js +0 -14
- package/lib/commonjs/documents/Point.js.map +0 -1
- package/lib/module/documents/Point.js +0 -7
- package/lib/module/documents/Point.js.map +0 -1
- package/lib/typescript/src/documents/Point.d.ts +0 -6
- package/lib/typescript/src/documents/Point.d.ts.map +0 -1
- package/src/documents/Point.ts +0 -10
|
@@ -1,112 +1,89 @@
|
|
|
1
1
|
/**
|
|
2
2
|
Common field types
|
|
3
|
+
|
|
4
|
+
- `ID`:
|
|
5
|
+
Document ID
|
|
6
|
+
- `SURNAME`:
|
|
7
|
+
Person surname field
|
|
8
|
+
- `MAIDEN_NAME`:
|
|
9
|
+
Person maiden name field
|
|
10
|
+
- `GIVEN_NAMES`:
|
|
11
|
+
Person given names field
|
|
12
|
+
- `BIRTH_DATE`:
|
|
13
|
+
Person birth date field
|
|
14
|
+
- `NATIONALITY`:
|
|
15
|
+
Person nationality field
|
|
16
|
+
- `BIRTHPLACE`:
|
|
17
|
+
Person birthplace field
|
|
18
|
+
- `EXPIRY_DATE`:
|
|
19
|
+
Document expiry date field
|
|
20
|
+
- `EYE_COLOR`:
|
|
21
|
+
Person height field
|
|
22
|
+
- `HEIGHT`:
|
|
23
|
+
Person height field
|
|
24
|
+
- `ISSUE_DATE`:
|
|
25
|
+
Document issue date field
|
|
26
|
+
- `ISSUING_AUTHORITY`:
|
|
27
|
+
Document issuing authority field
|
|
28
|
+
- `ADDRESS`:
|
|
29
|
+
Address field
|
|
30
|
+
- `PSEUDONYM`:
|
|
31
|
+
Pseudonym field
|
|
32
|
+
- `MRZ`:
|
|
33
|
+
MRZ field
|
|
34
|
+
- `COUNTRY_CODE`:
|
|
35
|
+
Country code (ISO-3166 Alpha-3) field
|
|
36
|
+
- `GENDER`:
|
|
37
|
+
Gender field
|
|
38
|
+
- `SIGNATURE`:
|
|
39
|
+
Signature field
|
|
40
|
+
- `PHOTO`:
|
|
41
|
+
Photo field
|
|
42
|
+
- `VALID_FROM_DATE`:
|
|
43
|
+
Date of start of validity field
|
|
44
|
+
- `ROUTING_NUMBER`:
|
|
45
|
+
Check routing number
|
|
46
|
+
- `ACCOUNT_NUMBER`:
|
|
47
|
+
Check account number
|
|
48
|
+
- `PLACE_OF_ISSUE`:
|
|
49
|
+
Place of issue for the identity card
|
|
50
|
+
- `TITLE_TYPE`:
|
|
51
|
+
Type of the title field in the identity document
|
|
52
|
+
- `REMARKS`:
|
|
53
|
+
Remarks field in the identity document
|
|
54
|
+
- `NAME`:
|
|
55
|
+
Full name field
|
|
56
|
+
- `CARD_ACCESS_NUMBER`:
|
|
57
|
+
Card access number field
|
|
58
|
+
- `NONE`:
|
|
59
|
+
Not valid type
|
|
3
60
|
*/
|
|
4
61
|
export type CommonFieldType =
|
|
5
|
-
/**
|
|
6
|
-
Document ID
|
|
7
|
-
*/
|
|
8
62
|
| 'ID'
|
|
9
|
-
/**
|
|
10
|
-
Person surname field
|
|
11
|
-
*/
|
|
12
63
|
| 'SURNAME'
|
|
13
|
-
/**
|
|
14
|
-
Person maiden name field
|
|
15
|
-
*/
|
|
16
64
|
| 'MAIDEN_NAME'
|
|
17
|
-
/**
|
|
18
|
-
Person given names field
|
|
19
|
-
*/
|
|
20
65
|
| 'GIVEN_NAMES'
|
|
21
|
-
/**
|
|
22
|
-
Person birth date field
|
|
23
|
-
*/
|
|
24
66
|
| 'BIRTH_DATE'
|
|
25
|
-
/**
|
|
26
|
-
Person nationality field
|
|
27
|
-
*/
|
|
28
67
|
| 'NATIONALITY'
|
|
29
|
-
/**
|
|
30
|
-
Person birthplace field
|
|
31
|
-
*/
|
|
32
68
|
| 'BIRTHPLACE'
|
|
33
|
-
/**
|
|
34
|
-
Document expiry date field
|
|
35
|
-
*/
|
|
36
69
|
| 'EXPIRY_DATE'
|
|
37
|
-
/**
|
|
38
|
-
Person height field
|
|
39
|
-
*/
|
|
40
70
|
| 'EYE_COLOR'
|
|
41
|
-
/**
|
|
42
|
-
Person height field
|
|
43
|
-
*/
|
|
44
71
|
| 'HEIGHT'
|
|
45
|
-
/**
|
|
46
|
-
Document issue date field
|
|
47
|
-
*/
|
|
48
72
|
| 'ISSUE_DATE'
|
|
49
|
-
/**
|
|
50
|
-
Document issuing authority field
|
|
51
|
-
*/
|
|
52
73
|
| 'ISSUING_AUTHORITY'
|
|
53
|
-
/**
|
|
54
|
-
Address field
|
|
55
|
-
*/
|
|
56
74
|
| 'ADDRESS'
|
|
57
|
-
/**
|
|
58
|
-
Pseudonym field
|
|
59
|
-
*/
|
|
60
75
|
| 'PSEUDONYM'
|
|
61
|
-
/**
|
|
62
|
-
MRZ field
|
|
63
|
-
*/
|
|
64
76
|
| 'MRZ'
|
|
65
|
-
/**
|
|
66
|
-
Country code (ISO-3166 Alpha-3) field
|
|
67
|
-
*/
|
|
68
77
|
| 'COUNTRY_CODE'
|
|
69
|
-
/**
|
|
70
|
-
Gender field
|
|
71
|
-
*/
|
|
72
78
|
| 'GENDER'
|
|
73
|
-
/**
|
|
74
|
-
Signature field
|
|
75
|
-
*/
|
|
76
79
|
| 'SIGNATURE'
|
|
77
|
-
/**
|
|
78
|
-
Photo field
|
|
79
|
-
*/
|
|
80
80
|
| 'PHOTO'
|
|
81
|
-
/**
|
|
82
|
-
Date of start of validity field
|
|
83
|
-
*/
|
|
84
81
|
| 'VALID_FROM_DATE'
|
|
85
|
-
/**
|
|
86
|
-
Check routing number
|
|
87
|
-
*/
|
|
88
82
|
| 'ROUTING_NUMBER'
|
|
89
|
-
/**
|
|
90
|
-
Check account number
|
|
91
|
-
*/
|
|
92
83
|
| 'ACCOUNT_NUMBER'
|
|
93
|
-
/**
|
|
94
|
-
Place of issue for the identity card
|
|
95
|
-
*/
|
|
96
84
|
| 'PLACE_OF_ISSUE'
|
|
97
|
-
/**
|
|
98
|
-
Type of the title field in the identity document
|
|
99
|
-
*/
|
|
100
85
|
| 'TITLE_TYPE'
|
|
101
|
-
/**
|
|
102
|
-
Remarks field in the identity document
|
|
103
|
-
*/
|
|
104
86
|
| 'REMARKS'
|
|
105
|
-
/**
|
|
106
|
-
Full name field
|
|
107
|
-
*/
|
|
108
87
|
| 'NAME'
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*/
|
|
112
|
-
| 'CARD_ACCESS_NUMBER';
|
|
88
|
+
| 'CARD_ACCESS_NUMBER'
|
|
89
|
+
| 'NONE';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { CommonFieldType } from './CommonFieldType';
|
|
2
|
-
import { DeepPartial, PartiallyConstructible } from '../utils';
|
|
2
|
+
import { DeepPartial, PartiallyConstructible, Point } from '../utils';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
Result of OCR text recognition.
|
|
6
|
-
*/
|
|
5
|
+
Result of OCR text recognition.
|
|
6
|
+
*/
|
|
7
7
|
export class OcrResult extends PartiallyConstructible {
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
public text: string;
|
|
9
|
+
Maximum number of accumulated frames to inspect before actual result is returned.
|
|
10
|
+
*/
|
|
11
|
+
public readonly text: string;
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
public confidence: number;
|
|
13
|
+
Minimum number of accumulated frames that have equal result.
|
|
14
|
+
*/
|
|
15
|
+
public readonly confidence: number;
|
|
16
16
|
|
|
17
|
+
/** @param source {@displayType `DeepPartial<OcrResult>`} */
|
|
17
18
|
public constructor(source: DeepPartial<OcrResult> = {}) {
|
|
18
19
|
super();
|
|
19
20
|
if (source.text !== undefined) {
|
|
@@ -30,39 +31,36 @@ export class OcrResult extends PartiallyConstructible {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
Field validation status.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
Field value passed validation.
|
|
42
|
-
*/
|
|
43
|
-
| 'VALID'
|
|
44
|
-
/**
|
|
45
|
-
Field value was confirmed.
|
|
46
|
-
*/
|
|
47
|
-
| 'CONFIRMED';
|
|
34
|
+
Field validation status.
|
|
35
|
+
- `UNDEFINED`: Field value was not considered during validation. iOS only
|
|
36
|
+
- `INVALID`: Field value failed validation.
|
|
37
|
+
- `VALID`: Field value passed validation.
|
|
38
|
+
- `CONFIRMED`: Field value was confirmed.
|
|
39
|
+
*/
|
|
40
|
+
export type ValidationStatus = 'UNDEFINED' | 'INVALID' | 'VALID' | 'CONFIRMED';
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
Generic document field
|
|
51
|
-
*/
|
|
42
|
+
/**`
|
|
43
|
+
Generic document field
|
|
44
|
+
*/
|
|
52
45
|
export class Field extends PartiallyConstructible {
|
|
53
46
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
public type: Field.Type;
|
|
47
|
+
The type of the field.
|
|
48
|
+
*/
|
|
49
|
+
public readonly type: Field.Type;
|
|
50
|
+
/**
|
|
51
|
+
Value of the field. Applicable only to text fields.
|
|
52
|
+
*/
|
|
53
|
+
public readonly value: OcrResult | null;
|
|
57
54
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
public
|
|
55
|
+
Coordinates of the field in the root document coordinate system. Android only.
|
|
56
|
+
*/
|
|
57
|
+
public readonly polygonInRoot?: Point[];
|
|
61
58
|
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
public validationStatus: ValidationStatus | null;
|
|
59
|
+
Field validation status. Applicable only to fields that support some kind of validation.
|
|
60
|
+
*/
|
|
61
|
+
public readonly validationStatus: ValidationStatus | null;
|
|
65
62
|
|
|
63
|
+
/** @param source {@displayType `DeepPartial<Field>`} */
|
|
66
64
|
public constructor(source: DeepPartial<Field> = {}) {
|
|
67
65
|
super();
|
|
68
66
|
if (source.type !== undefined) {
|
|
@@ -75,6 +73,9 @@ export class Field extends PartiallyConstructible {
|
|
|
75
73
|
} else {
|
|
76
74
|
throw new Error('value must be present in constructor argument');
|
|
77
75
|
}
|
|
76
|
+
if (source.polygonInRoot !== undefined) {
|
|
77
|
+
this.polygonInRoot = source.polygonInRoot.map((it) => new Point(it.x, it.y));
|
|
78
|
+
}
|
|
78
79
|
if (source.validationStatus !== undefined) {
|
|
79
80
|
this.validationStatus = source.validationStatus != null ? source.validationStatus : null;
|
|
80
81
|
} else {
|
|
@@ -85,30 +86,35 @@ export class Field extends PartiallyConstructible {
|
|
|
85
86
|
|
|
86
87
|
export namespace Field {
|
|
87
88
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
Generic Document Type
|
|
90
|
+
*/
|
|
90
91
|
export class Type extends PartiallyConstructible {
|
|
91
92
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
public name: string;
|
|
93
|
+
Local field type name scoped to the containing document type
|
|
94
|
+
*/
|
|
95
|
+
public readonly name: string;
|
|
96
|
+
/**
|
|
97
|
+
Unique global field type name prefixed with the document types of all containing documents
|
|
98
|
+
*/
|
|
99
|
+
public readonly fullName: string;
|
|
95
100
|
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
public
|
|
101
|
+
Normalized global field type name. Fields in document types derived from the same base document type in the schema will have the same normalized name.
|
|
102
|
+
*/
|
|
103
|
+
public readonly normalizedName: string;
|
|
99
104
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
public
|
|
105
|
+
Commonly occurring fields that have the same semantic meaning in different document types will often have a set common type.
|
|
106
|
+
*/
|
|
107
|
+
public readonly commonType: CommonFieldType | null;
|
|
103
108
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
public
|
|
109
|
+
The friendly, human-readable display name of this field type in English. iOS only.
|
|
110
|
+
*/
|
|
111
|
+
public displayText?: string | null = null;
|
|
107
112
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
public listIndex: number | null = null;
|
|
113
|
+
A document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field
|
|
114
|
+
*/
|
|
115
|
+
public readonly listIndex: number | null = null;
|
|
111
116
|
|
|
117
|
+
/** @param source {@displayType `DeepPartial<Type>`} */
|
|
112
118
|
public constructor(source: DeepPartial<Type> = {}) {
|
|
113
119
|
super();
|
|
114
120
|
if (source.name !== undefined) {
|
|
@@ -131,6 +137,9 @@ export namespace Field {
|
|
|
131
137
|
} else {
|
|
132
138
|
throw new Error('commonType must be present in constructor argument');
|
|
133
139
|
}
|
|
140
|
+
if (source.displayText !== undefined) {
|
|
141
|
+
this.displayText = source.displayText;
|
|
142
|
+
}
|
|
134
143
|
if (source.listIndex !== undefined) {
|
|
135
144
|
this.listIndex = source.listIndex != null ? source.listIndex : null;
|
|
136
145
|
}
|
|
@@ -139,32 +148,33 @@ export namespace Field {
|
|
|
139
148
|
}
|
|
140
149
|
|
|
141
150
|
/**
|
|
142
|
-
Generic document
|
|
143
|
-
*/
|
|
151
|
+
Generic document
|
|
152
|
+
*/
|
|
144
153
|
export class GenericDocument extends PartiallyConstructible {
|
|
145
154
|
/**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
public type: GenericDocument.Type;
|
|
155
|
+
Document type
|
|
156
|
+
*/
|
|
157
|
+
public readonly type: GenericDocument.Type;
|
|
149
158
|
/**
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
public fields: Field[];
|
|
159
|
+
List of document fields
|
|
160
|
+
*/
|
|
161
|
+
public readonly fields: Field[];
|
|
153
162
|
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
public children: GenericDocument[];
|
|
163
|
+
List of document sub-documents
|
|
164
|
+
*/
|
|
165
|
+
public readonly children: GenericDocument[];
|
|
157
166
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
public confidence: number = 0.0;
|
|
167
|
+
The average confidence in the accuracy of the document recognition result
|
|
168
|
+
Default is 0
|
|
169
|
+
*/
|
|
170
|
+
public readonly confidence: number = 0.0;
|
|
162
171
|
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
public confidenceWeight: number = 0.0;
|
|
172
|
+
The weight of the confidence. Can be used to calculate the weighted average confidence of two documents.
|
|
173
|
+
Default is 0
|
|
174
|
+
*/
|
|
175
|
+
public readonly confidenceWeight: number = 0.0;
|
|
167
176
|
|
|
177
|
+
/** @param source {@displayType `DeepPartial<GenericDocument>`} */
|
|
168
178
|
public constructor(source: DeepPartial<GenericDocument> = {}) {
|
|
169
179
|
super();
|
|
170
180
|
if (source.type !== undefined) {
|
|
@@ -197,26 +207,31 @@ export class GenericDocument extends PartiallyConstructible {
|
|
|
197
207
|
|
|
198
208
|
export namespace GenericDocument {
|
|
199
209
|
/**
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
Generic Document Type
|
|
211
|
+
*/
|
|
202
212
|
export class Type extends PartiallyConstructible {
|
|
203
213
|
/**
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
public name: string;
|
|
214
|
+
Local document type name
|
|
215
|
+
*/
|
|
216
|
+
public readonly name: string;
|
|
207
217
|
/**
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
public fullName: string;
|
|
218
|
+
Unique global document type name prefixed with the document types of all containing documents
|
|
219
|
+
*/
|
|
220
|
+
public readonly fullName: string;
|
|
211
221
|
/**
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
public normalizedName: string;
|
|
222
|
+
Normalized global document type name. Common document types appearing as child documents in different places will often have the same normalized type name.
|
|
223
|
+
*/
|
|
224
|
+
public readonly normalizedName: string;
|
|
215
225
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
public
|
|
226
|
+
The friendly, human-readable display name of this document type in English. iOS only.
|
|
227
|
+
*/
|
|
228
|
+
public displayText?: string | null = null;
|
|
229
|
+
/**
|
|
230
|
+
A document can contain multiple fields of the same name, the property serves for storing natural order of such fields, null if multiple entries aren't allowed for this field
|
|
231
|
+
*/
|
|
232
|
+
public readonly listIndex: number | null = null;
|
|
219
233
|
|
|
234
|
+
/** @param source {@displayType `DeepPartial<Type>`} */
|
|
220
235
|
public constructor(source: DeepPartial<Type> = {}) {
|
|
221
236
|
super();
|
|
222
237
|
if (source.name !== undefined) {
|
|
@@ -234,6 +249,9 @@ export namespace GenericDocument {
|
|
|
234
249
|
} else {
|
|
235
250
|
throw new Error('normalizedName must be present in constructor argument');
|
|
236
251
|
}
|
|
252
|
+
if (source.displayText !== undefined) {
|
|
253
|
+
this.displayText = source.displayText;
|
|
254
|
+
}
|
|
237
255
|
if (source.listIndex !== undefined) {
|
|
238
256
|
this.listIndex = source.listIndex != null ? source.listIndex : null;
|
|
239
257
|
}
|
package/src/index.ts
CHANGED
|
@@ -123,6 +123,12 @@ const ScanbotBarcodeSDK = {
|
|
|
123
123
|
extractImagesFromPDF: (args: ExtractImagesFromPdfArguments): Promise<ResultWrapper<string[]>> => {
|
|
124
124
|
return ScanbotBarcodeSDKImpl.extractImagesFromPDF(args);
|
|
125
125
|
},
|
|
126
|
+
/**
|
|
127
|
+
* Returns the Base 64 encoded representation of the image data.
|
|
128
|
+
*/
|
|
129
|
+
getImageData(imageFileUri: string): Promise<ResultWrapper<string>> {
|
|
130
|
+
return ScanbotBarcodeSDKImpl.getImageData(imageFileUri);
|
|
131
|
+
},
|
|
126
132
|
};
|
|
127
133
|
|
|
128
134
|
export default ScanbotBarcodeSDK;
|
|
@@ -132,11 +138,11 @@ export * from './customTypes';
|
|
|
132
138
|
export * from './results';
|
|
133
139
|
export * from './configurations';
|
|
134
140
|
export * from './customConfigurations';
|
|
141
|
+
export { Point } from './utils';
|
|
135
142
|
|
|
136
143
|
export * from './documents/BarcodeDocumentModel';
|
|
137
144
|
export * from './documents/CommonFieldType';
|
|
138
145
|
export * from './documents/GenericDocument';
|
|
139
|
-
export * from './documents/Point';
|
|
140
146
|
|
|
141
147
|
export * from './component/barcode-camera-view/ScanbotBarcodeCameraViewProperties';
|
|
142
148
|
export { ScanbotBarcodeCameraView };
|
package/src/results.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BarcodeResultField,
|
|
1
|
+
import { BarcodeResultField, LicenseStatus } from './types';
|
|
2
2
|
|
|
3
3
|
export interface BarcodeScannerResult {
|
|
4
4
|
/** The array of detected barcodes */
|
|
@@ -7,21 +7,6 @@ export interface BarcodeScannerResult {
|
|
|
7
7
|
|
|
8
8
|
export interface BatchBarcodeScannerResult extends BarcodeScannerResult {}
|
|
9
9
|
|
|
10
|
-
export interface DetectBarcodesOnImageResult {
|
|
11
|
-
/** The detected barcodes */
|
|
12
|
-
barcodes: BarcodeResultField[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface DetectBarcodesOnImagesResult {
|
|
16
|
-
/** An array for which each element has a imageUri and the list of detected barcodes */
|
|
17
|
-
results: DetectBarcodesOnImagesField[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ExtractImagesFromPdfResult {
|
|
21
|
-
/** The URIs of the extracted images */
|
|
22
|
-
imageFilesUrls: string[];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
10
|
export interface LicenseInfoResult {
|
|
26
11
|
/** True if the license is valid, false otherwise */
|
|
27
12
|
isLicenseValid: boolean;
|
package/src/types.ts
CHANGED
|
@@ -99,7 +99,15 @@ export type BarcodeFormat =
|
|
|
99
99
|
/** GS1 DataBar Composite */
|
|
100
100
|
| 'GS1_COMPOSITE'
|
|
101
101
|
/** Micro pdf 417 */
|
|
102
|
-
| 'MICRO_PDF_417'
|
|
102
|
+
| 'MICRO_PDF_417'
|
|
103
|
+
/** Maxicode */
|
|
104
|
+
| 'MAXI_CODE'
|
|
105
|
+
/** rMQR Code */
|
|
106
|
+
| 'RMQR_CODE'
|
|
107
|
+
/** Code 11 */
|
|
108
|
+
| 'CODE_11'
|
|
109
|
+
/** Code 32 */
|
|
110
|
+
| 'CODE_32';
|
|
103
111
|
|
|
104
112
|
/** A filter for extended EAN and UPC barcodes. */
|
|
105
113
|
export type BarcodesExtensionFilter =
|
|
@@ -136,6 +144,13 @@ export type MSIPlesseyChecksumAlgorithm =
|
|
|
136
144
|
/** Mod1110NCR checksum algorithm */
|
|
137
145
|
| 'MOD_1110_NCR';
|
|
138
146
|
|
|
147
|
+
/** The customer format used in AUSTRALIA_POST codes. Only relevant for format codes 59 and 62. */
|
|
148
|
+
export type AustraliaPostCustomerFormat =
|
|
149
|
+
/** The numeric format. */
|
|
150
|
+
| 'NUMERIC'
|
|
151
|
+
/** The alphanumeric format. */
|
|
152
|
+
| 'ALPHA_NUMERIC';
|
|
153
|
+
|
|
139
154
|
/** Barcode scanner engine mode */
|
|
140
155
|
export type EngineMode =
|
|
141
156
|
/** Recommended barcode scanning mode. Used by default */
|
|
@@ -170,13 +185,6 @@ export interface Size {
|
|
|
170
185
|
height: number;
|
|
171
186
|
}
|
|
172
187
|
|
|
173
|
-
/** The expected density of QR codes in an image. */
|
|
174
|
-
export type CodeDensity =
|
|
175
|
-
/** Up to 6 QR codes per image. */
|
|
176
|
-
| 'LOW'
|
|
177
|
-
/** Up to 24 QR codes per image. */
|
|
178
|
-
| 'HIGH';
|
|
179
|
-
|
|
180
188
|
/** Represents camera preview modes */
|
|
181
189
|
export type CameraPreviewMode =
|
|
182
190
|
/** In this mode camera preview frames will be downscaled to the layout view size - full preview frame content will be visible, but unused edges could be appeared in the preview layout. */
|
|
@@ -195,14 +203,18 @@ export type BarcodeOverlayTextFormat =
|
|
|
195
203
|
|
|
196
204
|
/** GS1 handling mode */
|
|
197
205
|
export type Gs1HandlingMode =
|
|
198
|
-
/**
|
|
206
|
+
/** The (FNC1) character is simply stripped from the result in barcodes that implement this mode. Do not use. Will be removed in a future release. */
|
|
199
207
|
| 'NONE'
|
|
200
|
-
/** GS1 messages are converted to machine-readable format per the GS1 spec (the special character is converted to ASCII \x1D).
|
|
208
|
+
/** GS1 messages are converted to the machine-readable format per the GS1 spec (the special FNC1 character is converted to ASCII \x1D). The implied 01 AI key is prepended to DataBar results. No validation is performed. */
|
|
201
209
|
| 'PARSE'
|
|
202
|
-
/**
|
|
203
|
-
| '
|
|
204
|
-
/** GS1 strings are converted to human-readable format
|
|
205
|
-
| '
|
|
210
|
+
/** Same as PARSE. Additionally, messages containing unknown AI keys, or containing values of incorrect format for known keys, are not returned. */
|
|
211
|
+
| 'VALIDATE_STRUCTURE'
|
|
212
|
+
/** Same as VALIDATE_STRUCTURE, except that GS1 strings are converted to the human-readable format, instead (with parentheses used to wrap AI keys, e.g. (01)123456789). The \x1D character is never used in this representation. */
|
|
213
|
+
| 'DECODE_STRUCTURE'
|
|
214
|
+
/** Full validation including linting and checksums. This is the most strict mode. */
|
|
215
|
+
| 'VALIDATE_FULL'
|
|
216
|
+
/** Same as DECODE_STRUCTURE, but with full validation. */
|
|
217
|
+
| 'DECODE_FULL';
|
|
206
218
|
|
|
207
219
|
/** Barcode Selection Overlay configuration */
|
|
208
220
|
export interface SelectionOverlayConfiguration {
|
|
@@ -409,15 +421,6 @@ export type LicenseStatus =
|
|
|
409
421
|
/** No license set yet. The SDKs trial mode is over. */
|
|
410
422
|
| 'NotSet';
|
|
411
423
|
|
|
412
|
-
/** Detect Barcodes On Images Result Field */
|
|
413
|
-
export interface DetectBarcodesOnImagesField {
|
|
414
|
-
/** The URI of the image file the barcodes have been detected on */
|
|
415
|
-
imageFileUri: string;
|
|
416
|
-
|
|
417
|
-
/** The array of detected barcodes */
|
|
418
|
-
barcodeResults: BarcodeResultField[];
|
|
419
|
-
}
|
|
420
|
-
|
|
421
424
|
/** File encryption mode, 'AES128' or 'AES256'. */
|
|
422
425
|
export type FileEncryptionMode =
|
|
423
426
|
/** AES128 encryption mode */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BackgroundStyle } from '../common/Common';
|
|
2
2
|
import { DeepPartial, PartiallyConstructible } from '../../utils';
|
|
3
|
+
import { BadgeStyle } from '../common/Common';
|
|
3
4
|
import { PolygonStyle } from '../common/Common';
|
|
4
5
|
import { StyledText } from '../common/Common';
|
|
5
6
|
|
|
@@ -143,42 +144,6 @@ export class BarcodeItemConfiguration extends PartiallyConstructible {
|
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
/**
|
|
147
|
-
Configuration of the round button.
|
|
148
|
-
*/
|
|
149
|
-
export class BadgeStyle extends PartiallyConstructible {
|
|
150
|
-
/**
|
|
151
|
-
Control the visibility of the badge.
|
|
152
|
-
Default is true
|
|
153
|
-
*/
|
|
154
|
-
public visible: boolean = true;
|
|
155
|
-
/**
|
|
156
|
-
The style of the button's background.
|
|
157
|
-
*/
|
|
158
|
-
public background: BackgroundStyle;
|
|
159
|
-
/**
|
|
160
|
-
Color of the button foreground (icon, text).
|
|
161
|
-
Default is "?sbColorOnSurface"
|
|
162
|
-
*/
|
|
163
|
-
public foregroundColor: string = '?sbColorOnSurface';
|
|
164
|
-
|
|
165
|
-
/** @param source {@displayType `DeepPartial<BadgeStyle>`} */
|
|
166
|
-
public constructor(source: DeepPartial<BadgeStyle> = {}) {
|
|
167
|
-
super();
|
|
168
|
-
if (source.visible !== undefined) {
|
|
169
|
-
this.visible = source.visible;
|
|
170
|
-
}
|
|
171
|
-
if (source.background !== undefined) {
|
|
172
|
-
this.background = new BackgroundStyle(source.background);
|
|
173
|
-
} else {
|
|
174
|
-
throw new Error('background must be present in constructor argument');
|
|
175
|
-
}
|
|
176
|
-
if (source.foregroundColor !== undefined) {
|
|
177
|
-
this.foregroundColor = source.foregroundColor;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
147
|
/**
|
|
183
148
|
Configuration of the AR overlay displayed on top of barcodes in the camera preview.
|
|
184
149
|
*/
|