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.
Files changed (154) hide show
  1. package/Libraries.txt +439 -16
  2. package/RNScanbotBarcodeSDK.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/gradle.properties +4 -4
  5. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt +27 -25
  6. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPluginResultDelegate.kt +2 -2
  7. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewEvents.kt +4 -4
  8. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewManager.kt +0 -1
  9. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/models/ScanbotBarcodeScannerModels.kt +4 -10
  10. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.m +4 -4
  11. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.mm +0 -4
  12. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.h +0 -3
  13. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.m +1 -5
  14. package/ios/ScanbotBarcodeSdk.m +57 -48
  15. package/ios/ScanbotBarcodeSdkPluginResultDelegate.h +1 -1
  16. package/ios/ScanbotBarcodeSdkPluginResultDelegate.m +13 -13
  17. package/lib/commonjs/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
  18. package/lib/commonjs/documents/BarcodeDocumentModel.js +612 -613
  19. package/lib/commonjs/documents/BarcodeDocumentModel.js.map +1 -1
  20. package/lib/commonjs/documents/GenericDocument.js +82 -49
  21. package/lib/commonjs/documents/GenericDocument.js.map +1 -1
  22. package/lib/commonjs/index.js +15 -13
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js +10 -47
  25. package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
  26. package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
  27. package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
  28. package/lib/commonjs/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
  29. package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js +8 -4
  30. package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
  31. package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
  32. package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
  33. package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
  34. package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
  35. package/lib/commonjs/ui_v2/common/CameraPermission.js +22 -6
  36. package/lib/commonjs/ui_v2/common/CameraPermission.js.map +1 -1
  37. package/lib/commonjs/ui_v2/common/Common.js +175 -5
  38. package/lib/commonjs/ui_v2/common/Common.js.map +1 -1
  39. package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js +6 -0
  40. package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
  41. package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js +27 -5
  42. package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
  43. package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js +48 -1
  44. package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
  45. package/lib/commonjs/ui_v2/index.js +14 -1
  46. package/lib/commonjs/ui_v2/index.js.map +1 -1
  47. package/lib/commonjs/utils.js +8 -1
  48. package/lib/commonjs/utils.js.map +1 -1
  49. package/lib/module/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
  50. package/lib/module/documents/BarcodeDocumentModel.js +611 -612
  51. package/lib/module/documents/BarcodeDocumentModel.js.map +1 -1
  52. package/lib/module/documents/GenericDocument.js +84 -51
  53. package/lib/module/documents/GenericDocument.js.map +1 -1
  54. package/lib/module/index.js +7 -1
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js +1 -36
  57. package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
  58. package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
  59. package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
  60. package/lib/module/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
  61. package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js +6 -2
  62. package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
  63. package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
  64. package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
  65. package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
  66. package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
  67. package/lib/module/ui_v2/common/CameraPermission.js +22 -6
  68. package/lib/module/ui_v2/common/CameraPermission.js.map +1 -1
  69. package/lib/module/ui_v2/common/Common.js +168 -2
  70. package/lib/module/ui_v2/common/Common.js.map +1 -1
  71. package/lib/module/ui_v2/common/NavigationBarConfiguration.js +2 -0
  72. package/lib/module/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
  73. package/lib/module/ui_v2/common/ScanbotAlertDialog.js +28 -5
  74. package/lib/module/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
  75. package/lib/module/ui_v2/common/UserGuidanceConfiguration.js +47 -0
  76. package/lib/module/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
  77. package/lib/module/ui_v2/index.js +3 -1
  78. package/lib/module/ui_v2/index.js.map +1 -1
  79. package/lib/module/utils.js +6 -0
  80. package/lib/module/utils.js.map +1 -1
  81. package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts +3 -5
  82. package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts.map +1 -1
  83. package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts +0 -1
  84. package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts.map +1 -1
  85. package/lib/typescript/src/configurations.d.ts +13 -5
  86. package/lib/typescript/src/configurations.d.ts.map +1 -1
  87. package/lib/typescript/src/customConfigurations.d.ts +19 -3
  88. package/lib/typescript/src/customConfigurations.d.ts.map +1 -1
  89. package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts +70 -71
  90. package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts.map +1 -1
  91. package/lib/typescript/src/documents/CommonFieldType.d.ts +58 -109
  92. package/lib/typescript/src/documents/CommonFieldType.d.ts.map +1 -1
  93. package/lib/typescript/src/documents/GenericDocument.d.ts +95 -86
  94. package/lib/typescript/src/documents/GenericDocument.d.ts.map +1 -1
  95. package/lib/typescript/src/index.d.ts +5 -1
  96. package/lib/typescript/src/index.d.ts.map +1 -1
  97. package/lib/typescript/src/results.d.ts +1 -13
  98. package/lib/typescript/src/results.d.ts.map +1 -1
  99. package/lib/typescript/src/types.d.ts +25 -20
  100. package/lib/typescript/src/types.d.ts.map +1 -1
  101. package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts +1 -22
  102. package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts.map +1 -1
  103. package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts +41 -19
  104. package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts.map +1 -1
  105. package/lib/typescript/src/ui_v2/barcode/BarcodeScannerConfiguration.d.ts.map +1 -1
  106. package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts +4 -0
  107. package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts.map +1 -1
  108. package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts +5 -0
  109. package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts.map +1 -1
  110. package/lib/typescript/src/ui_v2/common/CameraPermission.d.ts.map +1 -1
  111. package/lib/typescript/src/ui_v2/common/Common.d.ts +103 -1
  112. package/lib/typescript/src/ui_v2/common/Common.d.ts.map +1 -1
  113. package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts +12 -0
  114. package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts.map +1 -0
  115. package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts +4 -0
  116. package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts.map +1 -1
  117. package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts +25 -0
  118. package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts.map +1 -1
  119. package/lib/typescript/src/ui_v2/index.d.ts +1 -0
  120. package/lib/typescript/src/ui_v2/index.d.ts.map +1 -1
  121. package/lib/typescript/src/utils.d.ts +5 -0
  122. package/lib/typescript/src/utils.d.ts.map +1 -1
  123. package/package.json +2 -2
  124. package/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.ts +2 -5
  125. package/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.ts +0 -1
  126. package/src/configurations.ts +19 -7
  127. package/src/customConfigurations.ts +19 -3
  128. package/src/documents/BarcodeDocumentModel.ts +644 -623
  129. package/src/documents/CommonFieldType.ts +59 -82
  130. package/src/documents/GenericDocument.ts +104 -86
  131. package/src/index.ts +7 -1
  132. package/src/results.ts +1 -16
  133. package/src/types.ts +26 -23
  134. package/src/ui_v2/barcode/ArTrackingOverlayConfiguration.ts +1 -36
  135. package/src/ui_v2/barcode/BarcodeRecognizerConfiguration.ts +60 -22
  136. package/src/ui_v2/barcode/BarcodeScannerConfiguration.ts +2 -2
  137. package/src/ui_v2/barcode/BarcodeUseCase.ts +1 -1
  138. package/src/ui_v2/barcode/FindAndPickScanningModeUseCase.ts +6 -2
  139. package/src/ui_v2/barcode/MultipleScanningModeUseCase.ts +9 -1
  140. package/src/ui_v2/barcode/SingleScanningModeUseCase.ts +1 -1
  141. package/src/ui_v2/common/CameraPermission.ts +22 -6
  142. package/src/ui_v2/common/Common.ts +168 -2
  143. package/src/ui_v2/common/NavigationBarConfiguration.ts +13 -0
  144. package/src/ui_v2/common/ScanbotAlertDialog.ts +25 -6
  145. package/src/ui_v2/common/UserGuidanceConfiguration.ts +41 -0
  146. package/src/ui_v2/index.ts +5 -9
  147. package/src/utils.ts +10 -0
  148. package/lib/commonjs/documents/Point.js +0 -14
  149. package/lib/commonjs/documents/Point.js.map +0 -1
  150. package/lib/module/documents/Point.js +0 -7
  151. package/lib/module/documents/Point.js.map +0 -1
  152. package/lib/typescript/src/documents/Point.d.ts +0 -6
  153. package/lib/typescript/src/documents/Point.d.ts.map +0 -1
  154. 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
- Card access number field
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
- Maximum number of accumulated frames to inspect before actual result is returned.
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
- Minimum number of accumulated frames that have equal result.
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
- export type ValidationStatus =
36
- /**
37
- Field value failed validation.
38
- */
39
- | 'INVALID'
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
- The type of the field.
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
- Value of the field. Applicable only to text fields.
59
- */
60
- public value: OcrResult | null;
55
+ Coordinates of the field in the root document coordinate system. Android only.
56
+ */
57
+ public readonly polygonInRoot?: Point[];
61
58
  /**
62
- Field validation status. Applicable only to fields that support some kind of validation.
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
- Generic Document Type
89
- */
89
+ Generic Document Type
90
+ */
90
91
  export class Type extends PartiallyConstructible {
91
92
  /**
92
- Local field type name scoped to the containing document type
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
- Unique global field type name prefixed with the document types of all containing documents
97
- */
98
- public fullName: string;
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
- 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.
101
- */
102
- public normalizedName: string;
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
- Commonly occurring fields that have the same semantic meaning in different document types will often have a set common type.
105
- */
106
- public commonType: CommonFieldType | null;
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
- 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
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
- Document type
147
- */
148
- public type: GenericDocument.Type;
155
+ Document type
156
+ */
157
+ public readonly type: GenericDocument.Type;
149
158
  /**
150
- List of document fields
151
- */
152
- public fields: Field[];
159
+ List of document fields
160
+ */
161
+ public readonly fields: Field[];
153
162
  /**
154
- List of document sub-documents
155
- */
156
- public children: GenericDocument[];
163
+ List of document sub-documents
164
+ */
165
+ public readonly children: GenericDocument[];
157
166
  /**
158
- The average confidence in the accuracy of the document recognition result
159
- Default is 0
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
- The weight of the confidence. Can be used to calculate the weighted average confidence of two documents.
164
- Default is 0
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
- Generic Document Type
201
- */
210
+ Generic Document Type
211
+ */
202
212
  export class Type extends PartiallyConstructible {
203
213
  /**
204
- Local document type name
205
- */
206
- public name: string;
214
+ Local document type name
215
+ */
216
+ public readonly name: string;
207
217
  /**
208
- Unique global document type name prefixed with the document types of all containing documents
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
- Normalized global document type name. Common document types appearing as child documents in different places will often have the same normalized type name.
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
- 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
217
- */
218
- public listIndex: number | null = null;
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, DetectBarcodesOnImagesField, LicenseStatus } from './types';
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
- /** No special handling for GS1-formatted results. Special (FNC1) characters are stripped. Equivalent to assumeGS1=false in ZXing for Code128 results. */
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). Message is not validated. This is the default. The implied 01 AI key is prepended to DataBar results. Equivalent to assumeGS1=true in ZXing for Code128 results. */
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
- /** GS1 messages are converted to machine-readable format per the GS1 spec (the special character is converted to ASCII \x1D) and validated. The implied 01 AI key is prepended to DataBar results. Invalid messages are not returned. */
203
- | 'VALIDATE'
204
- /** GS1 strings are converted to human-readable format and validated. The implied (01) AI key is prepended to DataBar results. Invalid messages are not returned. */
205
- | 'DECODE';
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
  */