@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,89 @@
|
|
|
1
|
+
import { CameraNotSupportedReason } from '../types/modules/camera.enum';
|
|
2
|
+
type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'camera' | 'general' | 'uploaderDescription' | 'documentsTypes' | 'spinnerText';
|
|
3
|
+
type AllTypes = IErrorCodes | IHintTexts | KeyError | ICameraLabels | IGeneral | IDocumentsTypes | IUploaderDescription | ISpinnerText;
|
|
4
|
+
type Label = Record<LabelGroup, AllTypes>;
|
|
5
|
+
type KeyError = string[];
|
|
6
|
+
type GetTranslation = {
|
|
7
|
+
(): Label;
|
|
8
|
+
(groupName: 'errorCodes'): IErrorCodes;
|
|
9
|
+
(groupName: 'hintTexts'): IHintTexts;
|
|
10
|
+
(groupName: 'keyErrors'): KeyError;
|
|
11
|
+
(groupName: 'camera'): ICameraLabels;
|
|
12
|
+
(groupName: 'general'): IGeneral;
|
|
13
|
+
(groupName: 'spinnerText'): ISpinnerText;
|
|
14
|
+
(groupName: LabelGroup): AllTypes;
|
|
15
|
+
};
|
|
16
|
+
export type ErrorCodeNames = 'mrzNotFound' | 'mrzNotRecognized' | 'barcodeNotFound' | 'barcodeNotRecognized' | 'heic' | 'fileType' | 'fileTypeHeic' | 'faceNotFound' | 'disableStepFileUpload' | 'notAllowedDocument' | 'documentSideLowPerimeter' | 'frontSideNotDetected' | 'backSideNotDetected' | 'default' | 'lowImageResolution' | 'imageIsBlurred' | 'faceLowArea' | keyof typeof CameraNotSupportedReason;
|
|
17
|
+
export type SupportedLanguage = typeof supportedLanguages[number];
|
|
18
|
+
type IErrorCodes = Record<ErrorCodeNames, string>;
|
|
19
|
+
interface IHintTexts {
|
|
20
|
+
front: string;
|
|
21
|
+
frontMRZ: string;
|
|
22
|
+
mrz: string;
|
|
23
|
+
capturing: string;
|
|
24
|
+
pdf: string;
|
|
25
|
+
back: string;
|
|
26
|
+
barcode: string;
|
|
27
|
+
hold: string;
|
|
28
|
+
dontSee: string;
|
|
29
|
+
dontMove: string;
|
|
30
|
+
turnFaceLeft: string;
|
|
31
|
+
turnFaceRight: string;
|
|
32
|
+
turnFaceUp: string;
|
|
33
|
+
turnFaceDown: string;
|
|
34
|
+
faceCam: string;
|
|
35
|
+
camAway: string;
|
|
36
|
+
moveCenter: string;
|
|
37
|
+
comeCloser: string;
|
|
38
|
+
documentCloser: string;
|
|
39
|
+
holdCamera: string;
|
|
40
|
+
}
|
|
41
|
+
interface ICameraLabels {
|
|
42
|
+
loading: string;
|
|
43
|
+
awaiting: string;
|
|
44
|
+
}
|
|
45
|
+
interface IGeneral {
|
|
46
|
+
documentType: string;
|
|
47
|
+
selectDocumentTypeText: string;
|
|
48
|
+
changeBtn: string;
|
|
49
|
+
correctBtn: string;
|
|
50
|
+
cancelBtn: string;
|
|
51
|
+
doneBtn: string;
|
|
52
|
+
closeBtn: string;
|
|
53
|
+
retakeBtn: string;
|
|
54
|
+
continueBtn: string;
|
|
55
|
+
submitBtn: string;
|
|
56
|
+
resetAllStepsBtn: string;
|
|
57
|
+
btnUploader: string;
|
|
58
|
+
btnCamera: string;
|
|
59
|
+
pressToUpdateText: string;
|
|
60
|
+
pressToUpdateTextSuccess: string;
|
|
61
|
+
}
|
|
62
|
+
interface IDocumentsTypes {
|
|
63
|
+
ID: string;
|
|
64
|
+
Passport: string;
|
|
65
|
+
PassportCard: string;
|
|
66
|
+
GreenCard: string;
|
|
67
|
+
InternationalId: string;
|
|
68
|
+
}
|
|
69
|
+
interface IUploaderDescription {
|
|
70
|
+
textFront: string;
|
|
71
|
+
textBack: string;
|
|
72
|
+
textFace: string;
|
|
73
|
+
textPdf: string;
|
|
74
|
+
textMrz: string;
|
|
75
|
+
textFrontBack: string;
|
|
76
|
+
textPass: string;
|
|
77
|
+
textFacePosition: string;
|
|
78
|
+
}
|
|
79
|
+
interface ISpinnerText {
|
|
80
|
+
warmup: {
|
|
81
|
+
top: string;
|
|
82
|
+
bottom: string;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export type CameraLabels = keyof ICameraLabels;
|
|
86
|
+
export declare const supportedLanguages: readonly ["en", "es"];
|
|
87
|
+
export declare const setTranslation: (translationLang?: SupportedLanguage) => void;
|
|
88
|
+
export declare const getTranslation: GetTranslation;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ModalPositionKeys = keyof typeof modalPositions;
|
|
2
|
+
export declare const modalPositions: {
|
|
3
|
+
center: {
|
|
4
|
+
description: string;
|
|
5
|
+
};
|
|
6
|
+
bottom: {
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
top: {
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
'sticky-top': {
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
'sticky-bottom': {
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const modalPositionClasses: Record<ModalPositionKeys, string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type RealFaceMode = keyof typeof realFaceModes;
|
|
2
|
+
declare const realFaceModes: {
|
|
3
|
+
/**
|
|
4
|
+
* enable "realFaceMode" only for iphone.
|
|
5
|
+
*/
|
|
6
|
+
readonly auto: {
|
|
7
|
+
readonly description: "enable \"realFaceMode\" only for iphone.";
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* disable this option.
|
|
11
|
+
*/
|
|
12
|
+
readonly none: {
|
|
13
|
+
readonly description: "disable this option.";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* enable "realFaceMode" for all devices.
|
|
17
|
+
*/
|
|
18
|
+
readonly all: {
|
|
19
|
+
readonly description: "enable \"realFaceMode\" for all devices.";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default realFaceModes;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type StepType = 'mrz' | 'front' | 'pdf' | 'face' | 'barcode' | 'photo' | 'back';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
mrz: {
|
|
4
|
+
id: number;
|
|
5
|
+
camera: string;
|
|
6
|
+
name: string;
|
|
7
|
+
time: number;
|
|
8
|
+
core: string[];
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
front: {
|
|
12
|
+
id: number;
|
|
13
|
+
camera: string;
|
|
14
|
+
name: string;
|
|
15
|
+
time: number;
|
|
16
|
+
max: number;
|
|
17
|
+
core: string[];
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
pdf: {
|
|
21
|
+
id: number;
|
|
22
|
+
camera: string;
|
|
23
|
+
name: string;
|
|
24
|
+
time: number;
|
|
25
|
+
core: string[];
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
face: {
|
|
29
|
+
id: number;
|
|
30
|
+
camera: string;
|
|
31
|
+
name: string;
|
|
32
|
+
time: number;
|
|
33
|
+
max: number;
|
|
34
|
+
core: string[];
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
barcode: {
|
|
38
|
+
id: number;
|
|
39
|
+
camera: string;
|
|
40
|
+
name: string;
|
|
41
|
+
time: number;
|
|
42
|
+
core: string[];
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
photo: {
|
|
46
|
+
id: number;
|
|
47
|
+
camera: string;
|
|
48
|
+
name: string;
|
|
49
|
+
time: number;
|
|
50
|
+
core: any[];
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
back: {
|
|
54
|
+
id: number;
|
|
55
|
+
camera: string;
|
|
56
|
+
name: string;
|
|
57
|
+
time: number;
|
|
58
|
+
core: string[];
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC. All Rights Reserved.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
* =============================================================================
|
|
16
|
+
*/
|
|
17
|
+
export declare const TRIANGULATION: number[];
|
|
18
|
+
export default TRIANGULATION;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IConfig } from '../modules/Config';
|
|
2
|
+
type BLTemp2 = {
|
|
3
|
+
postInit: () => Promise<void>;
|
|
4
|
+
mount: (() => Promise<void>) | (() => void);
|
|
5
|
+
start: (() => Promise<void>) | (() => void);
|
|
6
|
+
changeDocumentType: () => void;
|
|
7
|
+
resetAllSteps: () => Promise<void>;
|
|
8
|
+
loadModules?: () => Promise<void>;
|
|
9
|
+
hereGoes?: () => Promise<void>;
|
|
10
|
+
reloadComponent: (config: Partial<IConfig>) => Promise<void>;
|
|
11
|
+
showSpinner: (val: boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const addEventListeners: (bl: BLTemp2) => void;
|
|
14
|
+
export declare const clearIsListenersSet: () => void;
|
|
15
|
+
export default addEventListeners;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const webpSupport: () => boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ISize } from './image';
|
|
2
|
+
import { ICrop, IOffset } from './ts/common';
|
|
3
|
+
import { Bbox } from '../types/geometry';
|
|
4
|
+
type GetIDataFromCenter = (offsetVertical: number, offsetHorizontal: number) => ImageData;
|
|
5
|
+
export declare const getOrigData: () => ImageData;
|
|
6
|
+
export declare const getResizedData: () => ImageData;
|
|
7
|
+
export declare const getFaceOrigData: () => Promise<ImageData>;
|
|
8
|
+
/**
|
|
9
|
+
* returns ImageData of image offsets from center
|
|
10
|
+
* @param {number} offsetVertical
|
|
11
|
+
* @param {number} offsetHorizontal
|
|
12
|
+
* @return ImageData
|
|
13
|
+
*/
|
|
14
|
+
export declare const getIDataFromCenter: GetIDataFromCenter;
|
|
15
|
+
export declare const getBase64Data: () => string;
|
|
16
|
+
export declare const getDataURL: (canvas: HTMLCanvasElement, format?: string, quality?: number) => Promise<string>;
|
|
17
|
+
export declare const getBlob: (canvas: HTMLCanvasElement, format?: string, quality?: number) => Promise<Blob>;
|
|
18
|
+
export declare const cutBboxFromImageData: (imageData: any, bbox: any) => ImageData;
|
|
19
|
+
export declare const drawImageOnTestCanvas: (idata: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, elId?: string) => {
|
|
20
|
+
canvas: HTMLCanvasElement;
|
|
21
|
+
ctx: CanvasRenderingContext2D;
|
|
22
|
+
};
|
|
23
|
+
export declare const drawCropOnCanvas: (idata: ImageData, bbox: Bbox, ctx: CanvasRenderingContext2D) => void;
|
|
24
|
+
export declare const resize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement, offsets?: IOffset, cropSizes?: ISize) => ImageData;
|
|
25
|
+
export declare const cropAndResize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement) => {
|
|
26
|
+
crop: ICrop;
|
|
27
|
+
resized: ImageData;
|
|
28
|
+
};
|
|
29
|
+
export declare const createCanvas: (id: string, size: ISize) => HTMLCanvasElement;
|
|
30
|
+
export declare const createCanvasFromImage: (id: string, image: HTMLImageElement) => HTMLCanvasElement;
|
|
31
|
+
export declare const createCanvasFromImageData: (id: string, imageData: ImageData) => HTMLCanvasElement;
|
|
32
|
+
declare const _default: {
|
|
33
|
+
getOrigData: () => ImageData;
|
|
34
|
+
getResizedData: () => ImageData;
|
|
35
|
+
getBase64Data: () => string;
|
|
36
|
+
cropAndResize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement) => {
|
|
37
|
+
crop: ICrop;
|
|
38
|
+
resized: ImageData;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Color {
|
|
2
|
+
rgbaToGrayscale(pixels: Uint8Array | number[], rgba: number[], nrows: number, ncols: number): void;
|
|
3
|
+
}
|
|
4
|
+
type TypedArray = Uint8Array | Uint8ClampedArray | Float32Array;
|
|
5
|
+
export declare enum Normalization {
|
|
6
|
+
STANDART = 255,
|
|
7
|
+
HALF = 127.5,
|
|
8
|
+
WITHOUT = 1
|
|
9
|
+
}
|
|
10
|
+
export declare const rgbaToGrayscale: (pixels: Uint8Array | number[], rgba: number[], nrows: number, ncols: number) => void;
|
|
11
|
+
export declare const normalize: <T extends TypedArray>(arr: T, normalization?: Normalization) => T;
|
|
12
|
+
export declare const rgbaToRgb: (rgba: ImageData, normalization?: Normalization) => Float32Array;
|
|
13
|
+
declare const _default: Color;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface Entity {
|
|
2
|
+
value: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: 'valid' | 'invalid';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* convert mrz parsed data to html represent
|
|
8
|
+
* @param {Array} data - mrz parsed data
|
|
9
|
+
*/
|
|
10
|
+
export declare const mrzToHtml: (data: Entity[]) => HTMLElement;
|
|
11
|
+
/**
|
|
12
|
+
* convert pdf parsed data to html represent
|
|
13
|
+
* @param {Array} data - pdf parsed data
|
|
14
|
+
*/
|
|
15
|
+
export declare const pdfToHtml: (data: Entity[]) => HTMLElement;
|
|
16
|
+
/**
|
|
17
|
+
* convert barcode parsed data to html represent
|
|
18
|
+
* @param {String} data - barcode parsed data
|
|
19
|
+
*/
|
|
20
|
+
export declare const barcodeToHtml: (data: string) => HTMLElement;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param {*} data - data to represent in HTML
|
|
24
|
+
* @param {String} type - type of parsed data maybe mrz|pdf|barcode
|
|
25
|
+
*/
|
|
26
|
+
declare const jsonToHtml: (data: string | Entity[], type: 'mrz' | 'pdf' | 'barcode') => false | HTMLElement;
|
|
27
|
+
export default jsonToHtml;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type Point = [number, number];
|
|
2
|
+
export interface ICoord {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Geometry {
|
|
7
|
+
distanceBetweenPoints(p1: Point, p2: Point): number;
|
|
8
|
+
distanceBetweenPointsX(p1: Point, p2: Point): number;
|
|
9
|
+
distanceBetweenPointsXoR(p1: Point, p2: Point): number;
|
|
10
|
+
sizeByTwoPoints(p1: Point, p2: Point): number;
|
|
11
|
+
rectCenter(start: Point, end: Point): Point;
|
|
12
|
+
angleBetweenTwoVectors(vector1: number[], vector2: number[]): number;
|
|
13
|
+
triangleArea(a: number, b: number, c: number): number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* calculates distance between two points
|
|
17
|
+
* @param {Number[]} p1 - first coord [x1, y1]
|
|
18
|
+
* @param {Number[]} p2 - second coord [x2, y2]
|
|
19
|
+
* @return {number}
|
|
20
|
+
*/
|
|
21
|
+
export declare const distanceBetweenPoints: (p1: Point, p2: Point) => number;
|
|
22
|
+
/**
|
|
23
|
+
* calculates distance between two points
|
|
24
|
+
* @param {Number[]} p1 - first coord [x1, y1]
|
|
25
|
+
* @param {Number[]} p2 - second coord [x2, y2]
|
|
26
|
+
* @return {number}
|
|
27
|
+
*/
|
|
28
|
+
export declare const distanceBetweenPointsX: (p1: Point, p2: Point) => number;
|
|
29
|
+
export declare const sizeByTwoPoints: (p1: Point, p2: Point) => number;
|
|
30
|
+
export declare const rectCenter: (start: Point, end: Point) => Point;
|
|
31
|
+
export declare const angleBetweenTwoVectors: (vector1: number[], vector2: number[]) => number;
|
|
32
|
+
export declare const distanceBetweenPointsXoR: (p1: Point, p2: Point) => number;
|
|
33
|
+
export declare const triangleArea: (a: number, b: number, c: number) => number;
|
|
34
|
+
declare const geometry: Geometry;
|
|
35
|
+
export default geometry;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface AttributeCollection {
|
|
2
|
+
[name: string]: string | boolean;
|
|
3
|
+
}
|
|
4
|
+
type CreateElement = (tagName?: string, params?: AttributeCollection | null, classNames?: string[], parent?: HTMLElement | null, children?: HTMLElement[]) => HTMLElement;
|
|
5
|
+
/**
|
|
6
|
+
* create and return HTMLElement
|
|
7
|
+
* @param { String } tagName - default 'div'
|
|
8
|
+
* @param { AttributeCollection | null } params
|
|
9
|
+
* @param { Array<String> } classNames - array of class names
|
|
10
|
+
* @param { HTMLElement } parent - element to which needs append created element
|
|
11
|
+
* @param { Array<HTMLElement> } children - elements which will appended to created element
|
|
12
|
+
* @returns { HTMLElement } - created element
|
|
13
|
+
*/
|
|
14
|
+
export declare const createElement: CreateElement;
|
|
15
|
+
/**
|
|
16
|
+
* creates a script tag
|
|
17
|
+
* @param {string} scriptUrl - url to remote script
|
|
18
|
+
* @param {'module'} type - create script as module
|
|
19
|
+
* @return {Promise<unknown>}
|
|
20
|
+
*/
|
|
21
|
+
export declare const loadScript: (scriptUrl: string) => Promise<unknown>;
|
|
22
|
+
declare const _default: {
|
|
23
|
+
createElement: CreateElement;
|
|
24
|
+
loadScript: (scriptUrl: string) => Promise<unknown>;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ICrop } from './ts/common';
|
|
2
|
+
export type Base64Image = string;
|
|
3
|
+
export type RGBAColor = string;
|
|
4
|
+
export type RGBColor8 = Uint8ClampedArray;
|
|
5
|
+
export type RGBColor32 = Float32Array;
|
|
6
|
+
type PixelPosition = number;
|
|
7
|
+
type Segmentize = (binarizedImg: Uint8ClampedArray, width: number) => Set<PixelPosition>[];
|
|
8
|
+
type Binarize = (img: ImageData, threshold?: number) => Uint8ClampedArray;
|
|
9
|
+
type GetResizedSizes = (size: number, baseSize: IBaseSize) => ISize;
|
|
10
|
+
export interface IOffset {
|
|
11
|
+
top: number;
|
|
12
|
+
left: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* { width: number, height: number }
|
|
16
|
+
*/
|
|
17
|
+
export interface ISize {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}
|
|
21
|
+
interface IBaseSize {
|
|
22
|
+
baseWidth: number;
|
|
23
|
+
baseHeight: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const generateFaceColorFromAngle: (angle: number) => RGBAColor;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param {ImageData} iData
|
|
29
|
+
* @param {number} threshold
|
|
30
|
+
* @return number[] - black and whited array;
|
|
31
|
+
*/
|
|
32
|
+
export declare const binarize: Binarize;
|
|
33
|
+
export declare const segmentize2: Segmentize;
|
|
34
|
+
export declare const getResizedSizes: GetResizedSizes;
|
|
35
|
+
export declare const getCrop: (src: ISize, dst: ISize) => ICrop;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ILoopResult } from '../environment/loopResult';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
processImage4: () => {
|
|
4
|
+
status: boolean;
|
|
5
|
+
cancel: boolean;
|
|
6
|
+
touch: boolean;
|
|
7
|
+
image: ImageData;
|
|
8
|
+
};
|
|
9
|
+
processImage5: (sideDetect?: boolean) => Promise<ILoopResult>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const resizeImageForStepProcessing: (data: any) => Promise<ImageData>;
|
|
2
|
+
declare const _default: {
|
|
3
|
+
getSmallImage: (data: string) => Promise<ImageData>;
|
|
4
|
+
setCurrentImage: (data: any) => Promise<void>;
|
|
5
|
+
fixOrientation: (image: HTMLImageElement) => Promise<ImageData>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the mean value of values or a list with values.
|
|
3
|
+
* @param {number[]|number} args - (a, b, c) or []
|
|
4
|
+
* @returns {number}
|
|
5
|
+
*/
|
|
6
|
+
export declare const mean: (...args: number[] | [number[]]) => number;
|
|
7
|
+
type NormalizationFunctionNames = 'unbiased' | 'biased' | 'uncorrected';
|
|
8
|
+
export declare const normalizationFunction: {
|
|
9
|
+
unbiased: (arr: number[]) => number;
|
|
10
|
+
biased: (arr: number[]) => number;
|
|
11
|
+
uncorrected: (arr: number[]) => number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* calculate standard deviation or return -1
|
|
15
|
+
* @param {Number[]} vals
|
|
16
|
+
* @param {'unbiased'|'biased'|'uncorrected'} normalization - 'unbiased' - divide by n - 1,
|
|
17
|
+
* 'uncorrected' - divide by n,
|
|
18
|
+
* 'biased' - divide by n + 1. default 'unbiased'.
|
|
19
|
+
* @param {number} fixed - how many digits after the decimal.
|
|
20
|
+
* @return number -1 if input values are wrong
|
|
21
|
+
*/
|
|
22
|
+
export declare const STD: (vals: number[], normalization?: NormalizationFunctionNames, fixed?: number) => number;
|
|
23
|
+
/**
|
|
24
|
+
* get random integer number from range, included min and max
|
|
25
|
+
* @param {number} min
|
|
26
|
+
* @param {number} max
|
|
27
|
+
* @return {number}
|
|
28
|
+
*/
|
|
29
|
+
export declare const randomIntFromInterval: (min: number, max: number) => number;
|
|
30
|
+
declare const _default: {
|
|
31
|
+
randomIntFromInterval: (min: number, max: number) => number;
|
|
32
|
+
mean: (...args: number[] | [number[]]) => number;
|
|
33
|
+
STD: (vals: number[], normalization?: NormalizationFunctionNames, fixed?: number) => number;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const isiOS: () => boolean;
|
|
2
|
+
export declare const checkTouchPoints: () => boolean;
|
|
3
|
+
export declare const detectTouchscreen: () => boolean;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {Number} maxWidth - preferable max width device
|
|
7
|
+
*/
|
|
8
|
+
export declare const collectMobileDetectingData: () => Record<string, any>;
|
|
9
|
+
declare const checkIfMobile: () => {
|
|
10
|
+
isMobile: boolean;
|
|
11
|
+
logsObject: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
export default checkIfMobile;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Base64Image } from './image';
|
|
2
|
+
export declare const encodeMeta: (metadata: any) => string;
|
|
3
|
+
export declare const decodeMeta: (str: string) => any;
|
|
4
|
+
export declare const base64ToArrayBuffer: (base64: string) => Uint8Array;
|
|
5
|
+
export declare const getDataFromBase64Img: (imgString: Base64Image) => string;
|
|
6
|
+
export declare const splitWordByUpperLetters: (word: string) => string[];
|
|
7
|
+
export declare const normalizeCamelCase: (word: string) => string;
|
|
8
|
+
export declare const removeHtmlEntities: (str: string) => string;
|
|
9
|
+
export declare const normalizeString: (str: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} ms
|
|
4
|
+
* @returns {Promise<>}
|
|
5
|
+
*/
|
|
6
|
+
export declare const timeout: (ms: number) => Promise<unknown>;
|
|
7
|
+
export declare const nextFrame: (fn?: () => Promise<any> | void) => Promise<unknown>;
|
|
8
|
+
declare const _default: {
|
|
9
|
+
timeout: (ms: number) => Promise<unknown>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type PartialRecord<T extends string, U> = {
|
|
2
|
+
[V in T]?: U;
|
|
3
|
+
};
|
|
4
|
+
export interface IPosition {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
export interface IOffset {
|
|
9
|
+
left: number;
|
|
10
|
+
top: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ISize {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ICrop extends ISize, IPosition {
|
|
17
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* check value to be boolean
|
|
3
|
+
* @param val
|
|
4
|
+
* @return {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export declare const isValidBool: (val: any) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* check value to be object
|
|
9
|
+
* @param val
|
|
10
|
+
* @return {boolean}
|
|
11
|
+
*/
|
|
12
|
+
export declare const isValidObject: (val: any) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* check value to be function
|
|
15
|
+
* @param val
|
|
16
|
+
* @return {boolean}
|
|
17
|
+
*/
|
|
18
|
+
export declare const isValidFunction: (val: any) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* check value to be string
|
|
21
|
+
* @param val
|
|
22
|
+
* @return {boolean}
|
|
23
|
+
*/
|
|
24
|
+
export declare const isValidString: (val: any) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* check value to be finite number
|
|
27
|
+
* @param val
|
|
28
|
+
* @return {boolean}
|
|
29
|
+
*/
|
|
30
|
+
export declare const isValidNumber: (val: any) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* validates string in given array and set its value
|
|
33
|
+
* @param {String[]} availableValues - array of available values
|
|
34
|
+
* @param {String} valueToSet - value that should be set
|
|
35
|
+
*/
|
|
36
|
+
export declare const isValidDistinctStringInArray: (availableValues: string[], valueToSet: string) => boolean;
|
|
37
|
+
declare const _default: {
|
|
38
|
+
isValidBool: (val: any) => boolean;
|
|
39
|
+
isValidFunction: (val: any) => boolean;
|
|
40
|
+
isValidString: (val: any) => boolean;
|
|
41
|
+
isValidNumber: (val: any) => boolean;
|
|
42
|
+
isValidDistinctStringInArray: (availableValues: string[], valueToSet: string) => boolean;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './assets/scss/index.scss';
|
|
2
|
+
import { IConfig } from './modules/Config';
|
|
3
|
+
import { SupportedLanguage } from './environment/langs';
|
|
4
|
+
import { IDocumentTypeConfig } from './modules/validator';
|
|
5
|
+
export default class VideoCapturing {
|
|
6
|
+
constructor(config: IConfig);
|
|
7
|
+
private init;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param language
|
|
11
|
+
*/
|
|
12
|
+
changeLanguage(language: SupportedLanguage): void;
|
|
13
|
+
get version(): string;
|
|
14
|
+
resetAllSteps(): void;
|
|
15
|
+
reloadComponent(newConfig: Partial<IConfig>): void;
|
|
16
|
+
updateDocumentTypes(documentTypes: IDocumentTypeConfig): void;
|
|
17
|
+
showSpinner(val: any): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const typesInit: () => void;
|
|
2
|
+
declare const _default: {
|
|
3
|
+
typesInit: () => void;
|
|
4
|
+
checkCompatibility: () => void;
|
|
5
|
+
start: () => void;
|
|
6
|
+
isCameraRequired: () => any;
|
|
7
|
+
isUploaderRequired: () => any;
|
|
8
|
+
isCameraNeeded: () => any;
|
|
9
|
+
detectAndSetBrowser: () => void;
|
|
10
|
+
detectAndSetRealFaceMode: () => void;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const asyncLoader: () => Promise<void>;
|