@scandit/web-datacapture-id 7.0.0-beta.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/LICENSE +4 -0
- package/README.md +3 -0
- package/THIRD-PARTY.txt +73 -0
- package/build/js/AamvaBarcodeVerifier.d.ts +9 -0
- package/build/js/AamvaBarcodeVerifierResult.d.ts +6 -0
- package/build/js/Defaults.d.ts +51 -0
- package/build/js/Enums.d.ts +59 -0
- package/build/js/IdCapture.d.ts +104 -0
- package/build/js/IdCaptureError.d.ts +15 -0
- package/build/js/IdCaptureFeedback.d.ts +15 -0
- package/build/js/IdCaptureOverlay.d.ts +85 -0
- package/build/js/IdCaptureSettings.d.ts +33 -0
- package/build/js/Listener.d.ts +9 -0
- package/build/js/Region.d.ts +254 -0
- package/build/js/RejectionReason.d.ts +7 -0
- package/build/js/SerializedTypes.d.ts +263 -0
- package/build/js/assets/idCaptureAssets.d.ts +1 -0
- package/build/js/captured-id/BarcodeResult.d.ts +94 -0
- package/build/js/captured-id/CapturedId.d.ts +50 -0
- package/build/js/captured-id/DateResult.d.ts +10 -0
- package/build/js/captured-id/DrivingLicenseCategory.d.ts +11 -0
- package/build/js/captured-id/DrivingLicenseDetails.d.ts +11 -0
- package/build/js/captured-id/IdImages.d.ts +14 -0
- package/build/js/captured-id/LocalizedOnlyId.d.ts +9 -0
- package/build/js/captured-id/MRZResult.d.ts +22 -0
- package/build/js/captured-id/ProfessionalDrivingPermit.d.ts +10 -0
- package/build/js/captured-id/VIZResult.d.ts +36 -0
- package/build/js/captured-id/VehicleRestriction.d.ts +11 -0
- package/build/js/document/DriverLicense.d.ts +11 -0
- package/build/js/document/HealthInsuranceCard.d.ts +11 -0
- package/build/js/document/IdCaptureDocument.d.ts +28 -0
- package/build/js/document/IdCard.d.ts +11 -0
- package/build/js/document/Passport.d.ts +11 -0
- package/build/js/document/RegionSpecific.d.ts +14 -0
- package/build/js/document/RegionSpecificSubtype.d.ts +66 -0
- package/build/js/document/ResidencePermit.d.ts +11 -0
- package/build/js/document/VisaIcao.d.ts +11 -0
- package/build/js/index.d.ts +51 -0
- package/build/js/index.js +12 -0
- package/build/js/scandit-web-datacapture-id-private.d.ts +5 -0
- package/build/js/scanner/FullDocumentScanner.d.ts +14 -0
- package/build/js/scanner/Scanner.d.ts +9 -0
- package/build/js/scanner/SingleSideScanner.d.ts +20 -0
- package/build/js/translations.d.ts +10 -0
- package/build/js/worker/IdCaptureWorkerManager.d.ts +20 -0
- package/build/js/worker/WorkerMain.d.ts +9 -0
- package/build/js/worker/dataCapture.inlineWorker.d.ts +3 -0
- package/build/js/worker/dataCaptureEngine.d.ts +86 -0
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +305 -0
- package/build/js/worker/index.d.ts +1 -0
- package/package.json +116 -0
- package/sdc-lib/idcapture/Centaurus.worker.min.js +1 -0
- package/sdc-lib/idcapture/lightweight/advanced/Centaurus.data +0 -0
- package/sdc-lib/idcapture/lightweight/advanced/Centaurus.js +1 -0
- package/sdc-lib/idcapture/lightweight/advanced/Centaurus.wasm +0 -0
- package/sdc-lib/idcapture/lightweight/advanced-threads/Centaurus.data +0 -0
- package/sdc-lib/idcapture/lightweight/advanced-threads/Centaurus.js +1 -0
- package/sdc-lib/idcapture/lightweight/advanced-threads/Centaurus.wasm +0 -0
- package/sdc-lib/idcapture/lightweight/advanced-threads/Centaurus.worker.js +1 -0
- package/sdc-lib/idcapture/lightweight/basic/Centaurus.data +0 -0
- package/sdc-lib/idcapture/lightweight/basic/Centaurus.js +1 -0
- package/sdc-lib/idcapture/lightweight/basic/Centaurus.wasm +0 -0
- package/sdc-lib/resources/models/barcode_classification_default_model.5ed1ecfaacbd108767a80013d11d9af73b8e1d5e.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_default_model.f88251f1bff0c68526d9898ef4c8f3b411c3c59e.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_dpm_default_model.acd01c12893d98af3a7e472200dbce4afd57631d.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_french_post_default_model.e1d7ffb4d1fb636b1c267d2da0ad6003584e668d.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default_model.7852c9b58cc2d253466ca3ea60bbd02ca09533ca.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_oned_default_model.058a356e6c57475ec928de2f95440aefa46ed5fe.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_twod_default_model.54c8ddfd8620c8b508f4108fcba6529ce45f8440.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_upu_enhanced_orange.656bffc22efe3137515d791184b1aa471d439310.model +0 -0
- package/sdc-lib/resources/models/eu_dl_localization_model.579be0f8cae6c931b93e199d1afec3b61542474c.model +0 -0
- package/sdc-lib/resources/models/id_ocr_model.f5b3ffba2d21fa97fa4945f0bb0c1cff9651c677.model +0 -0
- package/sdc-lib/resources/models/invalidated_id_classification_default.1f8f6e0345ece7d50a7126f2e5d15aa6b2e2a9bf.model +0 -0
- package/sdc-lib/resources/models/mrz_line_localization_model.98a5b38e889546c69f1d43beeda91071ad132340.model +0 -0
- package/sdc-lib/resources/models/mrz_localization_model.87d7e0dacb3845548449cc8ccb78526d93212cff.model +0 -0
- package/sdc-lib/resources/models/ocr_mrz_default_model.e0dd4c48916ff4ee266439f87cc68eb1793093c3.model +0 -0
- package/sdc-lib/resources/models/uk_dl_code_localization_model.579be0f8cae6c931b93e199d1afec3b61542474c.model +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-pthreads.js +1 -0
- package/sdc-lib/scandit-datacapture-sdk-id-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-pthreads.worker.js +1 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd-pthreads.js +1 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd-pthreads.worker.js +1 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd.js +1 -0
- package/sdc-lib/scandit-datacapture-sdk-id-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-id.js +1 -0
- package/sdc-lib/scandit-datacapture-sdk-id.wasm +0 -0
package/LICENSE
ADDED
package/README.md
ADDED
package/THIRD-PARTY.txt
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Apache License, Version 2.0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
|
|
2
|
+
|
|
3
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
4
|
+
|
|
5
|
+
1. Definitions.
|
|
6
|
+
|
|
7
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
8
|
+
|
|
9
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
10
|
+
|
|
11
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
12
|
+
|
|
13
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
14
|
+
|
|
15
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
16
|
+
|
|
17
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
18
|
+
|
|
19
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
20
|
+
|
|
21
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
22
|
+
|
|
23
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
24
|
+
|
|
25
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
26
|
+
|
|
27
|
+
2. Grant of Copyright License.
|
|
28
|
+
|
|
29
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
30
|
+
|
|
31
|
+
3. Grant of Patent License.
|
|
32
|
+
|
|
33
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
34
|
+
|
|
35
|
+
4. Redistribution.
|
|
36
|
+
|
|
37
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
38
|
+
|
|
39
|
+
You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
40
|
+
|
|
41
|
+
5. Submission of Contributions.
|
|
42
|
+
|
|
43
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
44
|
+
|
|
45
|
+
6. Trademarks.
|
|
46
|
+
|
|
47
|
+
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
+
|
|
49
|
+
7. Disclaimer of Warranty.
|
|
50
|
+
|
|
51
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
52
|
+
|
|
53
|
+
8. Limitation of Liability.
|
|
54
|
+
|
|
55
|
+
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
56
|
+
|
|
57
|
+
9. Accepting Warranty or Additional Liability.
|
|
58
|
+
|
|
59
|
+
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
60
|
+
|
|
61
|
+
END OF TERMS AND CONDITIONS
|
|
62
|
+
|
|
63
|
+
APPENDIX: How to apply the Apache License to your work
|
|
64
|
+
|
|
65
|
+
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
|
66
|
+
|
|
67
|
+
Copyright [yyyy] [name of copyright owner]
|
|
68
|
+
|
|
69
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
70
|
+
|
|
71
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
72
|
+
|
|
73
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DataCaptureContext } from "@scandit/web-datacapture-core";
|
|
2
|
+
import { AamvaBarcodeVerificationResult } from "./AamvaBarcodeVerifierResult";
|
|
3
|
+
import type { CapturedId } from "./captured-id/CapturedId";
|
|
4
|
+
export declare class AamvaBarcodeVerifier {
|
|
5
|
+
private _context;
|
|
6
|
+
private constructor();
|
|
7
|
+
static create(context: DataCaptureContext): Promise<AamvaBarcodeVerifier>;
|
|
8
|
+
verify(capturedId: CapturedId): Promise<AamvaBarcodeVerificationResult>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CameraSettings, Color } from "@scandit/web-datacapture-core";
|
|
2
|
+
import type { CameraSettingsDefaultsJSON } from "@scandit/web-datacapture-core/build/js/Defaults";
|
|
3
|
+
export interface Defaults {
|
|
4
|
+
IdCapture: {
|
|
5
|
+
RecommendedCameraSettings: CameraSettings;
|
|
6
|
+
IdCaptureOverlayDefaults: IdCaptureOverlayDefaults;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface DefaultsJSON {
|
|
10
|
+
IdCapture: {
|
|
11
|
+
RecommendedCameraSettings: CameraSettingsDefaultsJSON;
|
|
12
|
+
IdCaptureOverlayDefaults: IdCaptureOverlayDefaultsJSON;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface IdCaptureOverlayDefaultsJSON {
|
|
16
|
+
defaultCapturedBrush: {
|
|
17
|
+
fillColor: string;
|
|
18
|
+
strokeColor: string;
|
|
19
|
+
strokeWidth: number;
|
|
20
|
+
};
|
|
21
|
+
defaultLocalizedBrush: {
|
|
22
|
+
fillColor: string;
|
|
23
|
+
strokeColor: string;
|
|
24
|
+
strokeWidth: number;
|
|
25
|
+
};
|
|
26
|
+
defaultRejectedBrush: {
|
|
27
|
+
fillColor: string;
|
|
28
|
+
strokeColor: string;
|
|
29
|
+
strokeWidth: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface IdCaptureOverlayDefaults {
|
|
33
|
+
defaultCapturedBrush: {
|
|
34
|
+
fillColor: Color;
|
|
35
|
+
strokeColor: Color;
|
|
36
|
+
strokeWidth: number;
|
|
37
|
+
};
|
|
38
|
+
defaultLocalizedBrush: {
|
|
39
|
+
fillColor: Color;
|
|
40
|
+
strokeColor: Color;
|
|
41
|
+
strokeWidth: number;
|
|
42
|
+
};
|
|
43
|
+
defaultRejectedBrush: {
|
|
44
|
+
fillColor: Color;
|
|
45
|
+
strokeColor: Color;
|
|
46
|
+
strokeWidth: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare const defaultsFromJSON: (json: DefaultsJSON) => Defaults;
|
|
50
|
+
export declare let defaultValues: Defaults;
|
|
51
|
+
export declare function setDefaults(newDefaults: Defaults): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare enum CapturedResultType {
|
|
2
|
+
BarcodeResult = "barcodeResult",
|
|
3
|
+
MRZResult = "mrzResult",
|
|
4
|
+
VIZResult = "vizResult"
|
|
5
|
+
}
|
|
6
|
+
export declare enum IdDocumentType {
|
|
7
|
+
AAMVABarcode = "aamvaBarcode",
|
|
8
|
+
ApecBusinessTravelCardMRZ = "apecBusinessTravelCardMrz",
|
|
9
|
+
ArgentinaIdBarcode = "argentinaIdBarcode",
|
|
10
|
+
ChinaMainlandTravelPermitMRZ = "chinaMainlandTravelPermitMrz",
|
|
11
|
+
ChinaExitEntryPermitMRZ = "chinaExitEntryPermitMrz",
|
|
12
|
+
ChinaOneWayPermitFrontMRZ = "chinaOneWayPermitFrontMrz",
|
|
13
|
+
ChinaOneWayPermitBackMRZ = "chinaOneWayPermitBackMrz",
|
|
14
|
+
ColombiaDlBarcode = "colombiaDlBarcode",
|
|
15
|
+
ColombiaIdBarcode = "colombiaIdBarcode",
|
|
16
|
+
CommonAccessCardBarcode = "commonAccessCardBarcode",
|
|
17
|
+
DLVIZ = "dlViz",
|
|
18
|
+
HealthInsuranceCardVIZ = "healthInsuranceCardViz",
|
|
19
|
+
IdCardMRZ = "idCardMrz",
|
|
20
|
+
IdCardVIZ = "idCardViz",
|
|
21
|
+
PassportMRZ = "passportMrz",
|
|
22
|
+
PassportVIZ = "passportViz",
|
|
23
|
+
SouthAfricaDlBarcode = "southAfricaDlBarcode",
|
|
24
|
+
SouthAfricaIdBarcode = "southAfricaIdBarcode",
|
|
25
|
+
SwissDLMRZ = "swissDlMrz",
|
|
26
|
+
USUSIdBarcode = "usUsIdBarcode",
|
|
27
|
+
VisaMRZ = "visaMrz"
|
|
28
|
+
}
|
|
29
|
+
export declare enum SupportedSides {
|
|
30
|
+
FrontOnly = "frontOnly",
|
|
31
|
+
FrontAndBack = "frontAndBack"
|
|
32
|
+
}
|
|
33
|
+
export declare enum IdImageType {
|
|
34
|
+
Face = "face",
|
|
35
|
+
CroppedDocument = "croppedDocument",
|
|
36
|
+
Frame = "frame"
|
|
37
|
+
}
|
|
38
|
+
export declare enum IdSide {
|
|
39
|
+
Front = "front",
|
|
40
|
+
Back = "back"
|
|
41
|
+
}
|
|
42
|
+
export declare enum IdAnonymizationMode {
|
|
43
|
+
None = "none",
|
|
44
|
+
FieldsOnly = "fieldsOnly",
|
|
45
|
+
ImagesOnly = "imagesOnly",
|
|
46
|
+
FieldsAndImages = "fieldsAndImages"
|
|
47
|
+
}
|
|
48
|
+
export declare enum IdCaptureTrigger {
|
|
49
|
+
Auto = "auto",
|
|
50
|
+
ButtonTap = "buttonTap"
|
|
51
|
+
}
|
|
52
|
+
export declare enum IdLayoutStyle {
|
|
53
|
+
Rounded = "rounded",
|
|
54
|
+
Square = "square"
|
|
55
|
+
}
|
|
56
|
+
export declare enum IdLayoutLineStyle {
|
|
57
|
+
Light = "light",
|
|
58
|
+
Bold = "bold"
|
|
59
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { DataCaptureContext, DataCaptureMode, DataCaptureModeJSON } from "@scandit/web-datacapture-core";
|
|
2
|
+
import { CameraSettings } from "@scandit/web-datacapture-core";
|
|
3
|
+
import type { Serializable } from "@scandit/web-datacapture-core/build/js/private/Serializable";
|
|
4
|
+
import { IdCaptureFeedback } from "./IdCaptureFeedback";
|
|
5
|
+
import type { IdCaptureSettings, IdCaptureSettingsJSON } from "./IdCaptureSettings";
|
|
6
|
+
import type { Listener } from "./Listener";
|
|
7
|
+
import { CapturedId } from "./captured-id/CapturedId";
|
|
8
|
+
import type { CentaurusLoader } from "scandit-web-datacapture-id-private";
|
|
9
|
+
type IdCaptureJSON = DataCaptureModeJSON<IdCaptureSettingsJSON & {
|
|
10
|
+
licensee: string;
|
|
11
|
+
licenseKey: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const STATE: {
|
|
14
|
+
readonly Available: "Available";
|
|
15
|
+
readonly ProcessingFrame: "ProcessingFrame";
|
|
16
|
+
readonly ProcessingQueue: "ProcessingQueue";
|
|
17
|
+
};
|
|
18
|
+
export declare class IdCapture implements DataCaptureMode, Serializable<IdCaptureJSON> {
|
|
19
|
+
private static _centaurusLoader?;
|
|
20
|
+
private readonly type;
|
|
21
|
+
private state;
|
|
22
|
+
private _isEnabled;
|
|
23
|
+
private settings;
|
|
24
|
+
private _context;
|
|
25
|
+
private listeners;
|
|
26
|
+
private overlayListeners;
|
|
27
|
+
private _centaurusConnector?;
|
|
28
|
+
private _endOfCycleTasks;
|
|
29
|
+
private _feedback;
|
|
30
|
+
private readonly _onProcessFrameListener;
|
|
31
|
+
private readonly workerMessageListener;
|
|
32
|
+
private constructor();
|
|
33
|
+
static get recommendedCameraSettings(): CameraSettings;
|
|
34
|
+
get context(): DataCaptureContext | null;
|
|
35
|
+
get feedback(): IdCaptureFeedback;
|
|
36
|
+
private get privateContext();
|
|
37
|
+
static setCentaurusLoader(loader: CentaurusLoader): void;
|
|
38
|
+
static forContext(context: DataCaptureContext | null, settings: IdCaptureSettings): Promise<IdCapture>;
|
|
39
|
+
setFeedback(feedback: IdCaptureFeedback): Promise<void>;
|
|
40
|
+
addListener(listener: Listener): void;
|
|
41
|
+
removeListener(listener: Listener): void;
|
|
42
|
+
isEnabled(): boolean;
|
|
43
|
+
setEnabled(enabled: boolean): Promise<void>;
|
|
44
|
+
reset(): Promise<void>;
|
|
45
|
+
applySettings(settings: IdCaptureSettings): Promise<void>;
|
|
46
|
+
parse(code: string): Promise<CapturedId | null>;
|
|
47
|
+
toJSONObject(): IdCaptureJSON;
|
|
48
|
+
private moveToState;
|
|
49
|
+
private doReset;
|
|
50
|
+
private doApplySettings;
|
|
51
|
+
private addOverlayListener;
|
|
52
|
+
private removeOverlayListener;
|
|
53
|
+
/**
|
|
54
|
+
* If settings include VIZ document but the SDK was not configured with "VIZEnabled: true", we throw.
|
|
55
|
+
*/
|
|
56
|
+
private checkCaptureSettingsAgainstSDKConfiguration;
|
|
57
|
+
/**
|
|
58
|
+
* Called many times by the DataCaptureContext when it receives a frame to process.
|
|
59
|
+
*
|
|
60
|
+
* To avoid any synchronization issue between Centaurus and SDC, we only process one frame at a time and don't allow
|
|
61
|
+
* any other asynchronous operation (like reset()) while a frame is being processed both by Centaurus and SDC.
|
|
62
|
+
* Any incoming async operation should be performed after the frame was processed, or before we process the next
|
|
63
|
+
* frame.
|
|
64
|
+
* The end of the frame processing is notified by the DataCaptureContext through the "onFrameProcessingFinished"
|
|
65
|
+
* event.
|
|
66
|
+
* @param frame FrameCapture
|
|
67
|
+
* @returns A promise informing the Context on the next steps to undertake.
|
|
68
|
+
*/
|
|
69
|
+
private onProcessFrame;
|
|
70
|
+
private doProcessFrame;
|
|
71
|
+
private onAfterProcessFrame;
|
|
72
|
+
private logPerformance;
|
|
73
|
+
private enqueueTask;
|
|
74
|
+
private processQueue;
|
|
75
|
+
private settingsIncludeVIZDocuments;
|
|
76
|
+
private attachedToContext;
|
|
77
|
+
private detachedFromContext;
|
|
78
|
+
private dispose;
|
|
79
|
+
private didChange;
|
|
80
|
+
private onWorkerMessage;
|
|
81
|
+
private processFrameWithCentaurus;
|
|
82
|
+
private uint8ArrayImageToBase64;
|
|
83
|
+
private convertRawImagesToBase64;
|
|
84
|
+
private triggerListenersForResult;
|
|
85
|
+
private notifyRecoveryAfterCrash;
|
|
86
|
+
private triggerErrorListener;
|
|
87
|
+
/**
|
|
88
|
+
* Send the last result to the worker so that the SDC engine can get it.
|
|
89
|
+
*/
|
|
90
|
+
private reportLastResult;
|
|
91
|
+
/**
|
|
92
|
+
* Send the last error to the worker so that the SDC engine can get it.
|
|
93
|
+
*/
|
|
94
|
+
private reportLastError;
|
|
95
|
+
/**
|
|
96
|
+
* Send the last localized ID to the worker so that the SDC engine can get it.
|
|
97
|
+
*/
|
|
98
|
+
private reportLastLocalizedId;
|
|
99
|
+
/**
|
|
100
|
+
* Send the last detection issue to the worker so that the SDC engine can get it.
|
|
101
|
+
*/
|
|
102
|
+
private reportLastDetectionIssue;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum IdCaptureErrorCode {
|
|
2
|
+
Undefined = "Undefined",
|
|
3
|
+
RecoveredAfterFailure = "RecoveredAfterFailure",
|
|
4
|
+
InvalidLicenseKeyForVIZProcessing = "InvalidLicenseKeyForVIZProcessing",
|
|
5
|
+
InvalidSettingsForVIZProcessing = "InvalidSettingsForVIZProcessing",
|
|
6
|
+
InvalidLicenseKeyForParser = "InvalidLicenseKeyForParser"
|
|
7
|
+
}
|
|
8
|
+
export declare class IdCaptureError extends Error {
|
|
9
|
+
private _type;
|
|
10
|
+
private _message;
|
|
11
|
+
get type(): IdCaptureErrorCode;
|
|
12
|
+
get message(): string;
|
|
13
|
+
private static create;
|
|
14
|
+
private static fromJSON;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FeedbackJSON } from "@scandit/web-datacapture-core";
|
|
2
|
+
import { Feedback, Sound } from "@scandit/web-datacapture-core";
|
|
3
|
+
import type { Serializable } from "@scandit/web-datacapture-core/build/js/private/Serializable";
|
|
4
|
+
export interface IdCaptureFeedbackJSON {
|
|
5
|
+
idCaptured: FeedbackJSON;
|
|
6
|
+
idRejected: FeedbackJSON;
|
|
7
|
+
}
|
|
8
|
+
export declare class IdCaptureFeedback implements Serializable<IdCaptureFeedbackJSON> {
|
|
9
|
+
idCaptured: Feedback;
|
|
10
|
+
idRejected: Feedback;
|
|
11
|
+
static get defaultFeedback(): IdCaptureFeedback;
|
|
12
|
+
static get defaultSuccessSound(): Sound;
|
|
13
|
+
static get defaultFailureSound(): Sound;
|
|
14
|
+
toJSONObject(): IdCaptureFeedbackJSON;
|
|
15
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { BrushJSON, DataCaptureOverlay, DataCaptureView } from "@scandit/web-datacapture-core";
|
|
2
|
+
import { Brush } from "@scandit/web-datacapture-core";
|
|
3
|
+
import type { Serializable } from "@scandit/web-datacapture-core/build/js/private/Serializable";
|
|
4
|
+
import { IdLayoutLineStyle, IdLayoutStyle } from "./Enums";
|
|
5
|
+
import type { IdCapture } from "./IdCapture";
|
|
6
|
+
export interface IdCaptureOverlayJSON {
|
|
7
|
+
type: "idCapture";
|
|
8
|
+
idLayoutStyle: IdLayoutStyle;
|
|
9
|
+
idLayoutLineStyle: IdLayoutLineStyle;
|
|
10
|
+
showTextHints: boolean;
|
|
11
|
+
capturedBrush: BrushJSON;
|
|
12
|
+
localizedBrush: BrushJSON;
|
|
13
|
+
rejectedBrush: BrushJSON;
|
|
14
|
+
frontSideTextHint: string;
|
|
15
|
+
backSideTextHint: string;
|
|
16
|
+
moveCloserTextHint: string;
|
|
17
|
+
moveFurtherAwayTextHint: string;
|
|
18
|
+
tapShutterToScanTextHint: string;
|
|
19
|
+
lookingForDocumentTextHint: string;
|
|
20
|
+
holdStillTextHint: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class IdCaptureOverlay implements DataCaptureOverlay, Serializable<IdCaptureOverlayJSON> {
|
|
23
|
+
private readonly type;
|
|
24
|
+
private idCapture;
|
|
25
|
+
private view?;
|
|
26
|
+
private _idLayoutStyle;
|
|
27
|
+
private readonly _defaultCapturedBrush;
|
|
28
|
+
private readonly _defaultLocalizedBrush;
|
|
29
|
+
private readonly _defaultRejectedBrush;
|
|
30
|
+
private _capturedBrush;
|
|
31
|
+
private _localizedBrush;
|
|
32
|
+
private _rejectedBrush;
|
|
33
|
+
private _idLayoutLineStyle;
|
|
34
|
+
private _showTextHints;
|
|
35
|
+
private _frontSideTextHint;
|
|
36
|
+
private _backSideTextHint;
|
|
37
|
+
private _moveCloserTextHint;
|
|
38
|
+
private _moveFurtherAwayTextHint;
|
|
39
|
+
private _tapShutterToScanTextHint;
|
|
40
|
+
private _lookingForDocumentTextHint;
|
|
41
|
+
private _holdStillTextHint;
|
|
42
|
+
private shutterWidget;
|
|
43
|
+
private onShutterPositionUpdateListener;
|
|
44
|
+
private onShutterButtonStateChangedListener;
|
|
45
|
+
private readonly onContextUpdatedListener;
|
|
46
|
+
private readonly overlayListener;
|
|
47
|
+
get idLayoutStyle(): IdLayoutStyle;
|
|
48
|
+
set idLayoutStyle(style: IdLayoutStyle);
|
|
49
|
+
get idLayoutLineStyle(): IdLayoutLineStyle;
|
|
50
|
+
set idLayoutLineStyle(lineStyle: IdLayoutLineStyle);
|
|
51
|
+
get showTextHints(): boolean;
|
|
52
|
+
set showTextHints(showTextHints: boolean);
|
|
53
|
+
get defaultCapturedBrush(): Brush;
|
|
54
|
+
get defaultLocalizedBrush(): Brush;
|
|
55
|
+
get defaultRejectedBrush(): Brush;
|
|
56
|
+
static withIdCapture(idCapture: IdCapture): Promise<IdCaptureOverlay>;
|
|
57
|
+
static withIdCaptureForView(idCapture: IdCapture, view: DataCaptureView | null): Promise<IdCaptureOverlay>;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated 6.21.0
|
|
60
|
+
*/
|
|
61
|
+
setFrontSideTextHint(hint: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated 6.21.0
|
|
64
|
+
*/
|
|
65
|
+
setBackSideTextHint(hint: string): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated 6.21.0
|
|
68
|
+
*/
|
|
69
|
+
setMoveCloserTextHint(hint: string): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated 6.21.0
|
|
72
|
+
*/
|
|
73
|
+
setMoveFurtherAwayTextHint(hint: string): Promise<void>;
|
|
74
|
+
getCapturedBrush(): Brush;
|
|
75
|
+
setCapturedBrush(brush: Brush): Promise<void>;
|
|
76
|
+
getLocalizedBrush(): Brush;
|
|
77
|
+
setLocalizedBrush(brush: Brush): Promise<void>;
|
|
78
|
+
getRejectedBrush(): Brush;
|
|
79
|
+
setRejectedBrush(brush: Brush): Promise<void>;
|
|
80
|
+
toJSONObject(): IdCaptureOverlayJSON;
|
|
81
|
+
private installShutterButton;
|
|
82
|
+
private onContextUpdated;
|
|
83
|
+
private onShutterPositionUpdate;
|
|
84
|
+
private onShutterButtonStateChanged;
|
|
85
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { JSONType } from "@scandit/web-datacapture-core";
|
|
2
|
+
import type { Serializable } from "@scandit/web-datacapture-core/build/js/private/Serializable";
|
|
3
|
+
import { IdAnonymizationMode, IdCaptureTrigger, IdImageType } from "./Enums";
|
|
4
|
+
import type { IdCaptureDocument, IdCaptureDocumentJSON } from "./document/IdCaptureDocument";
|
|
5
|
+
import type { ScannerJSON, IdCaptureScanner } from "./scanner/Scanner";
|
|
6
|
+
export interface IdCaptureSettingsJSON {
|
|
7
|
+
acceptedDocuments: IdCaptureDocumentJSON[];
|
|
8
|
+
rejectedDocuments: IdCaptureDocumentJSON[];
|
|
9
|
+
scannerType: ScannerJSON;
|
|
10
|
+
imageToResult: Record<IdImageType, boolean>;
|
|
11
|
+
anonymizationMode: IdAnonymizationMode;
|
|
12
|
+
captureTrigger: IdCaptureTrigger;
|
|
13
|
+
rejectVoidedIds: boolean;
|
|
14
|
+
decodeBackOfEuropeanDrivingLicense: boolean;
|
|
15
|
+
properties: JSONType;
|
|
16
|
+
}
|
|
17
|
+
export declare class IdCaptureSettings implements Serializable<IdCaptureSettingsJSON> {
|
|
18
|
+
acceptedDocuments: IdCaptureDocument[];
|
|
19
|
+
rejectedDocuments: IdCaptureDocument[];
|
|
20
|
+
scannerType: IdCaptureScanner;
|
|
21
|
+
anonymizationMode: IdAnonymizationMode;
|
|
22
|
+
captureTrigger: IdCaptureTrigger;
|
|
23
|
+
rejectVoidedIds: boolean;
|
|
24
|
+
decodeBackOfEuropeanDrivingLicense: boolean;
|
|
25
|
+
private properties;
|
|
26
|
+
private imageToResult;
|
|
27
|
+
constructor();
|
|
28
|
+
setProperty(name: string, value: any): void;
|
|
29
|
+
getProperty(name: string): any;
|
|
30
|
+
setShouldPassImageTypeToResult(type: IdImageType, shouldPass: boolean): void;
|
|
31
|
+
getShouldPassImageTypeToResult(type: IdImageType): boolean;
|
|
32
|
+
toJSONObject(): IdCaptureSettingsJSON;
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IdCapture } from "./IdCapture";
|
|
2
|
+
import type { IdCaptureError } from "./IdCaptureError";
|
|
3
|
+
import type { RejectionReason } from "./RejectionReason";
|
|
4
|
+
import type { CapturedId } from "./captured-id/CapturedId";
|
|
5
|
+
export interface Listener {
|
|
6
|
+
didCaptureId?: (capturedId: CapturedId) => Promise<void> | void;
|
|
7
|
+
didRejectId?: (capturedId: CapturedId, reason: RejectionReason) => Promise<void> | void;
|
|
8
|
+
didFailWithError?: (idCapture: IdCapture, error: IdCaptureError) => void;
|
|
9
|
+
}
|