@idscan/idvc2 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/idvc.js +1 -1
- package/dist/index.html +26 -21
- package/dist/js/environment/documentTypes.ts +2 -2
- package/dist/js/environment/langs.js +1 -1
- package/dist/types/assets/images/barcode.d.ts +2 -0
- package/dist/types/assets/images/face.d.ts +2 -0
- package/dist/types/assets/images/front.d.ts +2 -0
- package/dist/types/assets/images/mrz.d.ts +2 -0
- package/dist/types/assets/images/pdf.d.ts +2 -0
- package/dist/types/bl.d.ts +15 -0
- package/dist/types/constatnts/camera.d.ts +11 -0
- package/dist/types/constatnts/imageProcessing.d.ts +3 -0
- package/dist/types/constatnts/pdf.d.ts +1 -0
- package/dist/types/context.d.ts +127 -0
- package/dist/types/controllers/LoggerController.d.ts +13 -0
- package/dist/types/controllers/ModuleController.d.ts +11 -0
- package/dist/types/defaultConfig.d.ts +60 -0
- package/dist/types/environment/designations.d.ts +5 -0
- package/dist/types/environment/documentTypes.d.ts +26 -0
- package/dist/types/environment/langs.d.ts +89 -0
- package/dist/types/environment/loopResult.d.ts +8 -0
- package/dist/types/environment/modalPosition.d.ts +19 -0
- package/dist/types/environment/realFaceModes.d.ts +22 -0
- package/dist/types/environment/stepsDescription.d.ts +62 -0
- package/dist/types/environment/triangulation.d.ts +18 -0
- package/dist/types/eventListeners/eventListeners.d.ts +15 -0
- package/dist/types/eventListeners/selectDocumentType/selectHandler.d.ts +5 -0
- package/dist/types/helpers/apiSupport.d.ts +1 -0
- package/dist/types/helpers/canvas.d.ts +41 -0
- package/dist/types/helpers/color.d.ts +14 -0
- package/dist/types/helpers/dataManipulation.d.ts +27 -0
- package/dist/types/helpers/detectLanguage.d.ts +3 -0
- package/dist/types/helpers/geometry.d.ts +35 -0
- package/dist/types/helpers/html.d.ts +26 -0
- package/dist/types/helpers/image.d.ts +36 -0
- package/dist/types/helpers/imageprocessing.d.ts +11 -0
- package/dist/types/helpers/licenceKeyError.d.ts +6 -0
- package/dist/types/helpers/manualUpload.d.ts +7 -0
- package/dist/types/helpers/math.d.ts +35 -0
- package/dist/types/helpers/mobileChecker.d.ts +13 -0
- package/dist/types/helpers/numbers.d.ts +2 -0
- package/dist/types/helpers/step-background.d.ts +2 -0
- package/dist/types/helpers/strings.d.ts +9 -0
- package/dist/types/helpers/time.d.ts +11 -0
- package/dist/types/helpers/ts/common.d.ts +17 -0
- package/dist/types/helpers/updateSelecetTypes.d.ts +3 -0
- package/dist/types/helpers/validators.d.ts +44 -0
- package/dist/types/idvc.d.ts +18 -0
- package/dist/types/initialize.d.ts +12 -0
- package/dist/types/loader/asyncLoader.d.ts +1 -0
- package/dist/types/loader/loadAnglesModel.d.ts +3 -0
- package/dist/types/loader/loadFrontModels.d.ts +3 -0
- package/dist/types/loader/loaderBlur.d.ts +2 -0
- package/dist/types/loader/loaderClassLocal.d.ts +3 -0
- package/dist/types/loader/loaderFace.d.ts +3 -0
- package/dist/types/loader/loaderMRZ.d.ts +5 -0
- package/dist/types/loader/loaderMeshFace.d.ts +4 -0
- package/dist/types/loader/loaderPDF.d.ts +3 -0
- package/dist/types/loader/loaderUploadMode.d.ts +1 -0
- package/dist/types/loader/loaderZXing.d.ts +2 -0
- package/dist/types/loop.d.ts +15 -0
- package/dist/types/loopControl.d.ts +10 -0
- package/dist/types/modules/BarcodeModule.d.ts +28 -0
- package/dist/types/modules/Config.d.ts +140 -0
- package/dist/types/modules/FrontProcessing.d.ts +16 -0
- package/dist/types/modules/Logger.d.ts +20 -0
- package/dist/types/modules/MetaData.d.ts +10 -0
- package/dist/types/modules/MrzModule.d.ts +75 -0
- package/dist/types/modules/PdfModule.d.ts +80 -0
- package/dist/types/modules/Step.d.ts +70 -0
- package/dist/types/modules/blurModule.d.ts +6 -0
- package/dist/types/modules/browwserCompatibilities.d.ts +7 -0
- package/dist/types/modules/camera/camera.d.ts +14 -0
- package/dist/types/modules/camera/cameraManager.d.ts +9 -0
- package/dist/types/modules/face/Face.d.ts +63 -0
- package/dist/types/modules/face/MeshFace.d.ts +48 -0
- package/dist/types/modules/face/SimpleFace.d.ts +24 -0
- package/dist/types/modules/feature-detect/simd.d.ts +2 -0
- package/dist/types/modules/frameQuality.d.ts +10 -0
- package/dist/types/modules/heic.d.ts +11 -0
- package/dist/types/modules/image.d.ts +13 -0
- package/dist/types/modules/initErrorHandler.d.ts +10 -0
- package/dist/types/modules/licenseKeyChecker.d.ts +1 -0
- package/dist/types/modules/manualUpload.d.ts +7 -0
- package/dist/types/modules/manualUploadProcessing.d.ts +27 -0
- package/dist/types/modules/mediaDevices.d.ts +2 -0
- package/dist/types/modules/moduleInitializer.d.ts +8 -0
- package/dist/types/modules/step-functions/back.d.ts +2 -0
- package/dist/types/modules/step-functions/face.d.ts +2 -0
- package/dist/types/modules/step-functions/pdf.d.ts +20 -0
- package/dist/types/modules/step-result-processing/back.d.ts +2 -0
- package/dist/types/modules/step-result-processing/barcode.d.ts +2 -0
- package/dist/types/modules/step-result-processing/common.d.ts +1 -0
- package/dist/types/modules/step-result-processing/mrz.d.ts +2 -0
- package/dist/types/modules/step-result-processing/pdf.d.ts +2 -0
- package/dist/types/modules/step-result-processing/simpleFace.d.ts +2 -0
- package/dist/types/modules/step-result-processing/volumeFace.d.ts +7 -0
- package/dist/types/modules/stepFunctions.d.ts +5 -0
- package/dist/types/modules/stepResultProcessing.d.ts +10 -0
- package/dist/types/modules/supaBaseClient.d.ts +2 -0
- package/dist/types/modules/ui/Flashlight.d.ts +17 -0
- package/dist/types/modules/ui/MaskCapture.d.ts +52 -0
- package/dist/types/modules/ui/MessageBox.d.ts +20 -0
- package/dist/types/modules/ui/Modal.d.ts +20 -0
- package/dist/types/modules/ui/SelectDocumentType.d.ts +37 -0
- package/dist/types/modules/ui/canvas.d.ts +48 -0
- package/dist/types/modules/ui/forceCaptruringBtn.d.ts +12 -0
- package/dist/types/modules/ui/hints.d.ts +17 -0
- package/dist/types/modules/ui/limitations.d.ts +2 -0
- package/dist/types/modules/ui/manualSwitchBtn.d.ts +30 -0
- package/dist/types/modules/ui/selectDocumentType/documentSelectedEvent.d.ts +7 -0
- package/dist/types/modules/ui/spinner.d.ts +13 -0
- package/dist/types/modules/ui/swiper.d.ts +3 -0
- package/dist/types/modules/uploader.d.ts +58 -0
- package/dist/types/modules/validation/ValidateBool.d.ts +5 -0
- package/dist/types/modules/validation/ValidateDocumentTypes.d.ts +20 -0
- package/dist/types/modules/validation/ValidateElement.d.ts +5 -0
- package/dist/types/modules/validation/ValidateFunction.d.ts +5 -0
- package/dist/types/modules/validation/ValidateNumber.d.ts +5 -0
- package/dist/types/modules/validation/ValidateString.d.ts +5 -0
- package/dist/types/modules/validation/ValidateStringInArray.d.ts +12 -0
- package/dist/types/modules/validation/showValidationError.d.ts +2 -0
- package/dist/types/modules/validation/validatorFactory.d.ts +10 -0
- package/dist/types/modules/validator.d.ts +12 -0
- package/dist/types/neural models/Provider.d.ts +4 -0
- package/dist/types/neural models/anglesModel.d.ts +14 -0
- package/dist/types/neural models/blazeFaceModel.d.ts +27 -0
- package/dist/types/neural models/classLocal/exits.d.ts +4 -0
- package/dist/types/neural models/classLocalModel.d.ts +28 -0
- package/dist/types/neural models/meshFaceModel.d.ts +17 -0
- package/dist/types/neural models/mrzModel.d.ts +20 -0
- package/dist/types/neural models/neuralModel.d.ts +21 -0
- package/dist/types/neural models/preload.d.ts +7 -0
- package/dist/types/stepProcessing.d.ts +27 -0
- package/dist/types/types/enums/realFace.d.ts +4 -0
- package/dist/types/types/modules/camera.enum.d.ts +20 -0
- package/dist/types/ui.d.ts +90 -0
- package/dist/types/util.d.ts +35 -0
- package/dist/types/workers/blurWorker.d.ts +1 -0
- package/dist/types/workers/bubbleWorker.d.ts +1 -0
- package/dist/types/workers/loadNetworksWorker.d.ts +0 -0
- package/dist/types/workers/mrzWorker.d.ts +1 -0
- package/package.json +7 -3
- /package/dist/networks/{ClassLocal-1182-chunk.js → ClassLocal-835d-chunk.js} +0 -0
- /package/dist/networks/{Face-769a-chunk.js → Face-e2da-chunk.js} +0 -0
- /package/dist/networks/{MRZ-3fce-chunk.js → MRZ-6b1d-chunk.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadNetworksUploadMode: () => Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IMRZLocation } from './modules/manualUploadProcessing';
|
|
2
|
+
import { Cancel } from './types/loop';
|
|
3
|
+
export interface IMrzCoords {
|
|
4
|
+
locations: IMRZLocation;
|
|
5
|
+
color: 'green' | 'yellow';
|
|
6
|
+
}
|
|
7
|
+
export declare const unmountIDVC: () => void;
|
|
8
|
+
export declare const loop: () => Promise<false>;
|
|
9
|
+
declare const _default: {
|
|
10
|
+
loop: () => Promise<false>;
|
|
11
|
+
stopProccesing: () => void;
|
|
12
|
+
cancel: Cancel;
|
|
13
|
+
unmountIDVC: () => void;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const setIsStarted: (val: boolean) => void;
|
|
2
|
+
export declare const stop: () => void;
|
|
3
|
+
export declare const setVisibleVideo: () => Promise<void>;
|
|
4
|
+
export declare const start: () => Promise<void>;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
start: () => Promise<void>;
|
|
7
|
+
stop: () => void;
|
|
8
|
+
setIsStarted: (val: boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare class BarcodeModule {
|
|
2
|
+
private module;
|
|
3
|
+
private isAllocate;
|
|
4
|
+
private buffer;
|
|
5
|
+
private readonly res;
|
|
6
|
+
private stringLib;
|
|
7
|
+
constructor(core: any);
|
|
8
|
+
init(stringLib: any): void;
|
|
9
|
+
allocate(buffer: any): void;
|
|
10
|
+
free(): void;
|
|
11
|
+
result(status?: boolean, image?: any, touch?: boolean, text?: string): {
|
|
12
|
+
status: boolean;
|
|
13
|
+
image: any;
|
|
14
|
+
touch: boolean;
|
|
15
|
+
text: string;
|
|
16
|
+
cancel: boolean;
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
19
|
+
process(data: any, origData: any): {
|
|
20
|
+
status: boolean;
|
|
21
|
+
image: any;
|
|
22
|
+
touch: boolean;
|
|
23
|
+
text: string;
|
|
24
|
+
cancel: boolean;
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export default BarcodeModule;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { IStepConfig, ValidationFn } from '../defaultConfig';
|
|
2
|
+
import { RealFaceMode } from '../environment/realFaceModes';
|
|
3
|
+
import { SupportedLanguage } from '../environment/langs';
|
|
4
|
+
import { StepType } from '../environment/stepsDescription';
|
|
5
|
+
import { DocumentTypeName } from '../environment/documentTypes';
|
|
6
|
+
import { IDocumentTypeConfig } from './validator';
|
|
7
|
+
import { IStepCallback } from './Step';
|
|
8
|
+
import { IDataForSubmit } from '../util';
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} el,
|
|
11
|
+
* @param {string} licenseKey,
|
|
12
|
+
* @param {RealFaceMode} realFaceMode,
|
|
13
|
+
* @param {IDocumentTypeConfig | null} documentTypes,
|
|
14
|
+
* @param {boolean} autoContinue?,
|
|
15
|
+
* @param {number} resizeUploadedImage?,
|
|
16
|
+
* @param {boolean} fixFrontOrientAfterUpload?,
|
|
17
|
+
* @param {boolean} useCDN?,
|
|
18
|
+
* @param {string} networkUrl?,
|
|
19
|
+
*/
|
|
20
|
+
export interface IConfig {
|
|
21
|
+
/** this is the id of the html tag on the page where the web library will be displayed. Default: videoCapturingEl */
|
|
22
|
+
el: string;
|
|
23
|
+
/** license key for the web library provided for you by Idscan.net */
|
|
24
|
+
licenseKey: string;
|
|
25
|
+
/**
|
|
26
|
+
* an option that enables advanced image capturing with volumetric face detection. Available values: 'auto', 'all', 'none'
|
|
27
|
+
* - Auto - enable "realFaceMode" only for iPhone
|
|
28
|
+
* - All - enable "realFaceMode" for all devices
|
|
29
|
+
* - None - disable this option
|
|
30
|
+
*/
|
|
31
|
+
realFaceMode: RealFaceMode;
|
|
32
|
+
/**
|
|
33
|
+
* the array contains an object per document type that is configured. Each object has the document type listed in the type field and then in its steps array you can configure what steps you want the user to complete and what capture modes you will allow (i.e. uploader and/or video)
|
|
34
|
+
*
|
|
35
|
+
* Available Document Types
|
|
36
|
+
*
|
|
37
|
+
* - ID (1) – USA driver license and USA ID (non-driver license), Canadian driver licenses
|
|
38
|
+
* - Passport (2) – with 2 lines MRZ
|
|
39
|
+
* - PassportCard (3) – with 3 lines MRZ (most European IDs, USA passports/cards)
|
|
40
|
+
* - GreenCard (6) – USA Permanent Resident Cards (only MRZ)
|
|
41
|
+
* - InternationalId (7) – Internationally approved U.S. IDs with 3 lines MRZ
|
|
42
|
+
* - VIN (8) – Vehicle Identification Numbers
|
|
43
|
+
* - Barcode (9) – 1-D and 2-D barcodes
|
|
44
|
+
*
|
|
45
|
+
* Available Step Types
|
|
46
|
+
*
|
|
47
|
+
* - front – capturing the front side of a document
|
|
48
|
+
* - mrz – detection and capturing of the MRZ of a document
|
|
49
|
+
* - pdf – detection and capturing of pdf417 of a document
|
|
50
|
+
* - face – detection and capturing of the end user's face using the front camera
|
|
51
|
+
* - barcode – detection and capturing of 1 dimensional (barcodes) or 2 dimensional (qr codes)
|
|
52
|
+
* - photo – capturing of a vehicle identification number
|
|
53
|
+
*
|
|
54
|
+
* Available Capture Mode
|
|
55
|
+
*
|
|
56
|
+
* - uploader - uploading an image from the file system
|
|
57
|
+
* - video - capturing an image using the auto capture feature
|
|
58
|
+
*/
|
|
59
|
+
documentTypes: IDocumentTypeConfig | null;
|
|
60
|
+
/** the setting that enables the automatic transition from one step to the next step. Default */
|
|
61
|
+
autoContinue?: boolean;
|
|
62
|
+
/** sets the maximum size in pixels (of the largest of the height or width) for a manually uploaded picture */
|
|
63
|
+
resizeUploadedImage?: number;
|
|
64
|
+
/** this setting will change the orientation of a front step's image if it is not horizontal when it is uploaded */
|
|
65
|
+
fixFrontOrientAfterUpload?: boolean;
|
|
66
|
+
/** set to true if you prefer to load neural networks from a content delivery network instead of from your web server */
|
|
67
|
+
useCDN?: boolean;
|
|
68
|
+
/** Path to the folder with neural networks. Specify the path on the server if you need to remove the folder to another location */
|
|
69
|
+
networkUrl?: string;
|
|
70
|
+
/** the web library supports two languages, english and spanish. English uses en and Spanish uses es */
|
|
71
|
+
language?: SupportedLanguage;
|
|
72
|
+
/**
|
|
73
|
+
* Path to the folder with chunks. Specify the path on the server if you need to remove the folder to another location.
|
|
74
|
+
*/
|
|
75
|
+
chunkPublicPath?: string;
|
|
76
|
+
/**
|
|
77
|
+
* switches on/off the button to show guide lines
|
|
78
|
+
*/
|
|
79
|
+
isShowGuidelinesButton?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* if this setting is set to false the document type dialog will not be displayed to the end user
|
|
82
|
+
*/
|
|
83
|
+
isShowDocumentTypeSelect?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* option to show the button 'submit' after capturing all the images. If the button is turned off, an event will automatically fire that triggers the submit event handler
|
|
86
|
+
*/
|
|
87
|
+
showSubmitBtn?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* This option switches on/off the HEIC image processing (HEIC is Apple’s proprietary version of the Image File format). It’s possible to upload an image of this type only using a Mac/MacBook
|
|
90
|
+
*/
|
|
91
|
+
useHeic?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* This option switches image format, that used for image processing. Available values: 'jpeg', 'png', 'webp'
|
|
94
|
+
*/
|
|
95
|
+
processingImageFormat?: string;
|
|
96
|
+
/**
|
|
97
|
+
* This option switches on/off the displaying document titles
|
|
98
|
+
*/
|
|
99
|
+
hideDocumentTitle?: boolean;
|
|
100
|
+
/** callback-function which will be called after guidelines button. */
|
|
101
|
+
clickGuidlines?: () => void;
|
|
102
|
+
/** function which will be called after each step completes */
|
|
103
|
+
onChange?: (data: IStepCallback) => void;
|
|
104
|
+
/**
|
|
105
|
+
* function which will be called after the retake button is clicked
|
|
106
|
+
* @param data - Step object of current step
|
|
107
|
+
*/
|
|
108
|
+
onRetakeHook?: (data: IStepCallback) => void;
|
|
109
|
+
/** the function that will be called on the component mounted. */
|
|
110
|
+
onMounted?: () => void;
|
|
111
|
+
/**
|
|
112
|
+
* function which will be called after reset all the steps button is clicked
|
|
113
|
+
* @param data - Step objects of current pipeline
|
|
114
|
+
*/
|
|
115
|
+
onReset?: (data: IDataForSubmit) => void;
|
|
116
|
+
/** function which will be called in case the camera is not available */
|
|
117
|
+
onCameraError?: (data: Error) => void;
|
|
118
|
+
/** function which will be called after clicking the submit button */
|
|
119
|
+
submit?: (data: IDataForSubmit) => void;
|
|
120
|
+
}
|
|
121
|
+
declare class Config implements IConfig {
|
|
122
|
+
el: string;
|
|
123
|
+
commonStepTypes: Set<StepType>;
|
|
124
|
+
types: DocumentTypeName[];
|
|
125
|
+
steps: IStepConfig[];
|
|
126
|
+
documentTypes: IDocumentTypeConfig | null;
|
|
127
|
+
licenseKey: string;
|
|
128
|
+
autoContinue: boolean;
|
|
129
|
+
resizeUploadedImage: number;
|
|
130
|
+
fixFrontOrientAfterUpload: boolean;
|
|
131
|
+
useCDN: boolean;
|
|
132
|
+
networkUrl: string;
|
|
133
|
+
realFaceMode: "all" | "auto" | "none";
|
|
134
|
+
language: any;
|
|
135
|
+
constructor(configObject: IConfig);
|
|
136
|
+
getFunction(validationFn: ValidationFn): false | import("./validation/ValidateElement").default | import("./validation/ValidateBool").default | import("./validation/ValidateStringInArray").default | import("./validation/ValidateDocumentTypes").default | import("./validation/ValidateFunction").default | import("./validation/ValidateNumber").default | import("./validation/ValidateString").default;
|
|
137
|
+
validate(configObject: IConfig): void;
|
|
138
|
+
normalize(configObject: IConfig): void;
|
|
139
|
+
}
|
|
140
|
+
export default Config;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ClassLocalExitType } from '../neural models/classLocal/exits';
|
|
2
|
+
export type Status = 'PENDING' | 'FULFILLED';
|
|
3
|
+
interface ProcessUploadedImageResult {
|
|
4
|
+
side: ClassLocalExitType;
|
|
5
|
+
perimeter: 'low' | 'ok';
|
|
6
|
+
}
|
|
7
|
+
interface FillingQueueResult {
|
|
8
|
+
promise: Promise<ClassLocalExitType>;
|
|
9
|
+
status: Status;
|
|
10
|
+
}
|
|
11
|
+
export declare const clearQueue: () => void;
|
|
12
|
+
export declare const processUploadedImage: (smallImage: ImageData) => Promise<ProcessUploadedImageResult>;
|
|
13
|
+
export declare const fillingQueue: (smallImage?: ImageData) => Promise<FillingQueueResult>;
|
|
14
|
+
export declare const getBestFrame: () => ImageData;
|
|
15
|
+
export declare const dropPromise: () => void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StepType } from '../environment/stepsDescription';
|
|
2
|
+
interface IStepLog {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
}
|
|
7
|
+
export default class Logger {
|
|
8
|
+
data: {
|
|
9
|
+
steps: Record<StepType, IStepLog>;
|
|
10
|
+
} | Record<string, any>;
|
|
11
|
+
currentStep: string;
|
|
12
|
+
constructor();
|
|
13
|
+
set step(step: string);
|
|
14
|
+
get step(): string;
|
|
15
|
+
get stepData(): any;
|
|
16
|
+
get steps(): {};
|
|
17
|
+
start(): void;
|
|
18
|
+
end(): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class MetaData {
|
|
2
|
+
userAgent: string;
|
|
3
|
+
capturedMethod: string;
|
|
4
|
+
version: string;
|
|
5
|
+
logs: Record<string, any>;
|
|
6
|
+
constructor(version?: string);
|
|
7
|
+
captureMethod(steps: any): void;
|
|
8
|
+
getMetaData(steps: any): {};
|
|
9
|
+
prepareMetaDataForSubmit(steps: any): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { IMRZLocation } from './manualUploadProcessing';
|
|
2
|
+
import { IMrzScanRes } from '../types/mrz';
|
|
3
|
+
import { IMrzCoords } from '../loop';
|
|
4
|
+
import { StepFunctionResult } from '../types/loop';
|
|
5
|
+
import MrzModel, { PredictionList } from '../neural models/mrzModel';
|
|
6
|
+
interface IMrzStepResult extends StepFunctionResult {
|
|
7
|
+
coords?: IMrzCoords;
|
|
8
|
+
needToCut?: boolean;
|
|
9
|
+
results?: {
|
|
10
|
+
mrzText: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface ILicenceError {
|
|
14
|
+
errorType: string;
|
|
15
|
+
error: boolean;
|
|
16
|
+
errorVal: string;
|
|
17
|
+
}
|
|
18
|
+
interface IDetectRes {
|
|
19
|
+
status: boolean;
|
|
20
|
+
results?: {
|
|
21
|
+
mrzText: string;
|
|
22
|
+
} | null;
|
|
23
|
+
locations?: IMRZLocation;
|
|
24
|
+
error?: ILicenceError;
|
|
25
|
+
isNotMRZ: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class MrzModule {
|
|
28
|
+
w: number;
|
|
29
|
+
h: number;
|
|
30
|
+
successCount: number;
|
|
31
|
+
worker: Worker;
|
|
32
|
+
model: MrzModel;
|
|
33
|
+
isInitialized: boolean;
|
|
34
|
+
isProcessing: boolean;
|
|
35
|
+
MIN_MRZ_FRAMES: number;
|
|
36
|
+
constructor(worker: any, key: string, networkUrl: string);
|
|
37
|
+
getErrorVal(errorId: number): any;
|
|
38
|
+
/**
|
|
39
|
+
* returns error Object
|
|
40
|
+
* @return {ILicenceError}
|
|
41
|
+
*/
|
|
42
|
+
licenseError(errorId: number): ILicenceError;
|
|
43
|
+
yComparator(point1: any, point2: any): any[];
|
|
44
|
+
allocate(): void;
|
|
45
|
+
prepareMRZlocation(locations: any): IMRZLocation;
|
|
46
|
+
writeResults(mrzResults: IMrzScanRes): {
|
|
47
|
+
mrzText: string;
|
|
48
|
+
};
|
|
49
|
+
predict(batchArr: Float32Array, batchSize: any): Promise<PredictionList[]>;
|
|
50
|
+
scan(iData: ImageData): Promise<IMrzScanRes>;
|
|
51
|
+
/**
|
|
52
|
+
* process frame for MRZ
|
|
53
|
+
* @param data
|
|
54
|
+
*/
|
|
55
|
+
processMRZ(data: any): Promise<IMrzStepResult | {
|
|
56
|
+
error: ILicenceError;
|
|
57
|
+
status: {
|
|
58
|
+
value: number;
|
|
59
|
+
};
|
|
60
|
+
fields: import("../types/mrz").MrzFields;
|
|
61
|
+
count: number;
|
|
62
|
+
location: import("../types/mrz").IMRZLocation;
|
|
63
|
+
errorStatus?: string;
|
|
64
|
+
symbolsConf: number;
|
|
65
|
+
errorId: number;
|
|
66
|
+
}>;
|
|
67
|
+
estimateResults(data: any): number;
|
|
68
|
+
/**
|
|
69
|
+
* detects MRZ on ImageData
|
|
70
|
+
* @param {ImageData} imageData
|
|
71
|
+
* @return {Promise<>}
|
|
72
|
+
*/
|
|
73
|
+
detectMrz(imageData: ImageData): Promise<IDetectRes>;
|
|
74
|
+
}
|
|
75
|
+
export default MrzModule;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ISize } from '../helpers/image';
|
|
2
|
+
interface Coord {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class PdfModule {
|
|
7
|
+
module: any;
|
|
8
|
+
reader: any;
|
|
9
|
+
handle: any;
|
|
10
|
+
bw: number;
|
|
11
|
+
bh: number;
|
|
12
|
+
src: any;
|
|
13
|
+
out: any;
|
|
14
|
+
isAllocate: boolean;
|
|
15
|
+
successCount: number;
|
|
16
|
+
_errorId: number;
|
|
17
|
+
edgMem: any;
|
|
18
|
+
src2: any;
|
|
19
|
+
outLen: any;
|
|
20
|
+
locations: any;
|
|
21
|
+
pdfCount: number;
|
|
22
|
+
geometry: {
|
|
23
|
+
angleBetweenTwoVectors: any;
|
|
24
|
+
};
|
|
25
|
+
minPDFframes: number;
|
|
26
|
+
cropSizes: ISize;
|
|
27
|
+
canvasSizes: ISize;
|
|
28
|
+
constructor(core: any, processor: any);
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param geometry
|
|
32
|
+
* @param {number} minPDFframes - c.config.minPDFframes
|
|
33
|
+
* @param {{width: number, height: number}} cropSize - c.config.cropSize
|
|
34
|
+
* @param {{width: number, height: number}} canvasSizes - ui.borderCanvas
|
|
35
|
+
*/
|
|
36
|
+
init(geometry: any, minPDFframes: any, cropSize: any, canvasSizes: any): void;
|
|
37
|
+
set errorId(id: number);
|
|
38
|
+
get errorId(): number;
|
|
39
|
+
get errorVal(): any;
|
|
40
|
+
/**
|
|
41
|
+
* returns error Object
|
|
42
|
+
* @return {{errorType: string, error: boolean, errorVal: string}}
|
|
43
|
+
*/
|
|
44
|
+
licenseError(): {
|
|
45
|
+
error: boolean;
|
|
46
|
+
errorType: string;
|
|
47
|
+
errorVal: any;
|
|
48
|
+
};
|
|
49
|
+
getLocations(): void;
|
|
50
|
+
setResizedData(data: any): void;
|
|
51
|
+
initReader(key: any): void;
|
|
52
|
+
destroyReader(): void;
|
|
53
|
+
setPdfData(data: any): void;
|
|
54
|
+
readPdf(): any;
|
|
55
|
+
releasePdf(): void;
|
|
56
|
+
create(): void;
|
|
57
|
+
free(): void;
|
|
58
|
+
setSizes(bw: any, bh: any): void;
|
|
59
|
+
getSizes(): {
|
|
60
|
+
bw: number;
|
|
61
|
+
bh: number;
|
|
62
|
+
};
|
|
63
|
+
allocate(): void;
|
|
64
|
+
readPDF(data: any): any;
|
|
65
|
+
drawCords(locations: Record<string, number>): Coord[];
|
|
66
|
+
proccessPDF(data: ImageData): {
|
|
67
|
+
status: boolean;
|
|
68
|
+
predict: boolean;
|
|
69
|
+
touch: boolean;
|
|
70
|
+
image: any;
|
|
71
|
+
type: string;
|
|
72
|
+
error: any;
|
|
73
|
+
coords: any[];
|
|
74
|
+
trackString: string;
|
|
75
|
+
pdfSuccessCount: number;
|
|
76
|
+
pdfCount: number;
|
|
77
|
+
isSuccessProcess: boolean;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export default PdfModule;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Base64Image } from '../helpers/image';
|
|
2
|
+
import { StepType } from '../environment/stepsDescription';
|
|
3
|
+
import { IStepMode } from '../defaultConfig';
|
|
4
|
+
export interface IStepConfigMode {
|
|
5
|
+
name: 'mode';
|
|
6
|
+
value: IStepMode;
|
|
7
|
+
}
|
|
8
|
+
export type StepConfig = IStepConfigMode;
|
|
9
|
+
export type StepConfigNames = StepConfig['name'];
|
|
10
|
+
export type StepConfigValues = StepConfig['value'];
|
|
11
|
+
export interface IStepObj {
|
|
12
|
+
name: string;
|
|
13
|
+
type: StepType;
|
|
14
|
+
camera: VideoFacingModeEnum;
|
|
15
|
+
img: Base64Image | null;
|
|
16
|
+
err?: string | null;
|
|
17
|
+
text?: string;
|
|
18
|
+
time?: number;
|
|
19
|
+
configs?: StepConfig[];
|
|
20
|
+
}
|
|
21
|
+
export interface IStepCallback {
|
|
22
|
+
/** base64 encoded step image */
|
|
23
|
+
img: Base64Image | null;
|
|
24
|
+
/** blob step image */
|
|
25
|
+
blob: Blob | null;
|
|
26
|
+
/** step type */
|
|
27
|
+
type: StepType;
|
|
28
|
+
/** is it autocaptured from camera */
|
|
29
|
+
isAuto?: boolean;
|
|
30
|
+
/** image source */
|
|
31
|
+
source?: 'video' | 'file' | '';
|
|
32
|
+
/** step index */
|
|
33
|
+
index?: number;
|
|
34
|
+
/** trackstring from mrz or pdf */
|
|
35
|
+
trackString?: string;
|
|
36
|
+
/** mrz recognized text */
|
|
37
|
+
mrzText?: string;
|
|
38
|
+
/** cropped base64 encoded mrz image */
|
|
39
|
+
mrzImg?: Base64Image | null;
|
|
40
|
+
/** cropped blob mrz image */
|
|
41
|
+
mrzBlob?: Blob | null;
|
|
42
|
+
/** recognized text */
|
|
43
|
+
text?: string;
|
|
44
|
+
}
|
|
45
|
+
export default class Step implements IStepCallback, IStepObj {
|
|
46
|
+
blob: Blob | null;
|
|
47
|
+
errorCode: string | null | undefined;
|
|
48
|
+
mrzText?: string;
|
|
49
|
+
mrzImg?: Base64Image | null;
|
|
50
|
+
mrzBlob?: Blob | null;
|
|
51
|
+
trackString?: string;
|
|
52
|
+
err?: string | null;
|
|
53
|
+
text?: string;
|
|
54
|
+
isAuto?: boolean;
|
|
55
|
+
source?: 'video' | 'file';
|
|
56
|
+
configs: StepConfig[];
|
|
57
|
+
name: string;
|
|
58
|
+
type: StepType;
|
|
59
|
+
camera: VideoFacingModeEnum;
|
|
60
|
+
img: Base64Image | null;
|
|
61
|
+
cameraInfo: Record<string, any>;
|
|
62
|
+
constructor(nameOrObj: string | IStepObj, type?: StepType, camera?: VideoFacingModeEnum, time?: number, img?: Base64Image | null);
|
|
63
|
+
setConfig(configName: StepConfigNames, configValue: StepConfigValues): void;
|
|
64
|
+
hasConfig(configName: StepConfigNames): StepConfig | undefined;
|
|
65
|
+
getConfig(configName: StepConfigNames): StepConfigValues | null;
|
|
66
|
+
get isShowManualSwitchButton(): boolean;
|
|
67
|
+
get capturingMode(): IStepMode;
|
|
68
|
+
prepareStepForCallback(index: number): IStepCallback;
|
|
69
|
+
static createStep(stepObj: IStepObj): Step;
|
|
70
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ISize } from '../../helpers/image';
|
|
2
|
+
export declare const stopTrack: () => void;
|
|
3
|
+
export declare const cameraErrorHandling: (err: Error) => Promise<never>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
initUploader: () => Promise<void>;
|
|
6
|
+
stopTrack: () => void;
|
|
7
|
+
init: () => Promise<void>;
|
|
8
|
+
start: (mode: VideoFacingModeEnum) => Promise<void>;
|
|
9
|
+
setCapture: (val: boolean) => void;
|
|
10
|
+
checkFlashAvailable: (mode?: VideoFacingModeEnum) => void;
|
|
11
|
+
getResolution: (mode: VideoFacingModeEnum) => Promise<ISize>;
|
|
12
|
+
dropResolutions: () => void;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CameraObjects, IAdditionalConstrains, StartCamera, VideoDevice } from '../../types/modules/camera';
|
|
2
|
+
import { CameraError } from '../initErrorHandler';
|
|
3
|
+
/**
|
|
4
|
+
* all available cameras
|
|
5
|
+
*/
|
|
6
|
+
export declare const cameraObjects: CameraObjects;
|
|
7
|
+
export declare const stopTrack: (mediaStream: MediaStream) => void;
|
|
8
|
+
export declare const fillVideoDevices: (additionalConstrains: IAdditionalConstrains) => Promise<VideoDevice[] | CameraError>;
|
|
9
|
+
export declare const startCamera: StartCamera;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Geometry } from '../../helpers/geometry';
|
|
2
|
+
import { Color } from '../../helpers/color';
|
|
3
|
+
declare class Face {
|
|
4
|
+
module: any;
|
|
5
|
+
protected isAllocate: boolean;
|
|
6
|
+
private n;
|
|
7
|
+
protected w: number;
|
|
8
|
+
protected h: number;
|
|
9
|
+
prcsq: number | null;
|
|
10
|
+
rcsq: Float32Array | null;
|
|
11
|
+
maxndetections: number;
|
|
12
|
+
ppixels: number | null;
|
|
13
|
+
faceSuccessCount: number;
|
|
14
|
+
faceFailCount: number;
|
|
15
|
+
faceNotRecognizedCount: number;
|
|
16
|
+
private memory;
|
|
17
|
+
pixels: Uint8Array;
|
|
18
|
+
res: {
|
|
19
|
+
cancel: boolean;
|
|
20
|
+
image: null;
|
|
21
|
+
touch: boolean;
|
|
22
|
+
type: string;
|
|
23
|
+
status: boolean;
|
|
24
|
+
};
|
|
25
|
+
private color;
|
|
26
|
+
protected geometry: Geometry | null;
|
|
27
|
+
protected edgesColor: string;
|
|
28
|
+
constructor(core: any);
|
|
29
|
+
init(geometry: Geometry, color: Color): void;
|
|
30
|
+
initMemory(): void;
|
|
31
|
+
updateMemory(dets: number[][]): any[];
|
|
32
|
+
allocate(w: number, h: number): void;
|
|
33
|
+
findFace(data: number[]): {
|
|
34
|
+
tresh: number;
|
|
35
|
+
face: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
radius: number;
|
|
39
|
+
};
|
|
40
|
+
thresh?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
thresh: number;
|
|
43
|
+
face: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
radius: number;
|
|
47
|
+
};
|
|
48
|
+
tresh?: undefined;
|
|
49
|
+
};
|
|
50
|
+
setColorFromAngle(angle: number): void;
|
|
51
|
+
result(status?: boolean, image?: any, touch?: boolean): {
|
|
52
|
+
status: boolean;
|
|
53
|
+
image: any;
|
|
54
|
+
faceSuccessCount: number;
|
|
55
|
+
faceFailCount: number;
|
|
56
|
+
faceNotRecognizedCount: number;
|
|
57
|
+
touch: boolean;
|
|
58
|
+
cancel: boolean;
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
processFace(): void;
|
|
62
|
+
}
|
|
63
|
+
export default Face;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Geometry } from '../../helpers/geometry';
|
|
2
|
+
import { FacePrediction, RealFaceResultObject } from '../../types/modules/realFace';
|
|
3
|
+
import { RealFaceTurnSide } from '../../types/enums/realFace';
|
|
4
|
+
export declare class MeshFace {
|
|
5
|
+
private realFace;
|
|
6
|
+
private moveToCenter;
|
|
7
|
+
private noFace;
|
|
8
|
+
private perimeter;
|
|
9
|
+
private distance;
|
|
10
|
+
private baseSizes;
|
|
11
|
+
private lowFacePerimeterPercent;
|
|
12
|
+
private readonly lowFacePerimeterPercentDefault;
|
|
13
|
+
private correctDirection;
|
|
14
|
+
private direction;
|
|
15
|
+
private turnDistances;
|
|
16
|
+
private prediction;
|
|
17
|
+
private faceFailCount;
|
|
18
|
+
private faceSuccessCount;
|
|
19
|
+
private readonly res;
|
|
20
|
+
private geometry;
|
|
21
|
+
constructor();
|
|
22
|
+
init(geometry: Geometry): void;
|
|
23
|
+
result(status?: boolean): RealFaceResultObject;
|
|
24
|
+
noPredictions(): RealFaceResultObject;
|
|
25
|
+
processFace(prediction: FacePrediction, resizedSize: HTMLCanvasElement | HTMLVideoElement): RealFaceResultObject;
|
|
26
|
+
dropSuccess(): void;
|
|
27
|
+
getDirection(): RealFaceTurnSide;
|
|
28
|
+
setDirection(value: any): void;
|
|
29
|
+
getMf(center: any): number[];
|
|
30
|
+
processBadPerimeter(perimeter: any): void;
|
|
31
|
+
main(perimeter: any, mf: any): void;
|
|
32
|
+
processRealFace(): void;
|
|
33
|
+
calculateFace(): {
|
|
34
|
+
perimeter: number;
|
|
35
|
+
mf: number[];
|
|
36
|
+
};
|
|
37
|
+
processPrediction(): void;
|
|
38
|
+
processDistance(): void;
|
|
39
|
+
/**
|
|
40
|
+
* calculates head turn in degrees
|
|
41
|
+
* @param {number} firstDistance
|
|
42
|
+
* @param {number} secondDistance
|
|
43
|
+
* @returns {number}
|
|
44
|
+
*/
|
|
45
|
+
calculateTurn(firstDistance: any, secondDistance: any): number;
|
|
46
|
+
calculateDistance(): void;
|
|
47
|
+
}
|
|
48
|
+
export default MeshFace;
|