@idscan/idvc2 2.5.6 → 2.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +3 -0
  2. package/dist/types/assets/images/barcode.d.ts +2 -0
  3. package/dist/types/assets/images/face.d.ts +2 -0
  4. package/dist/types/assets/images/front.d.ts +2 -0
  5. package/dist/types/assets/images/mrz.d.ts +2 -0
  6. package/dist/types/assets/images/pdf.d.ts +2 -0
  7. package/dist/types/bl.d.ts +15 -0
  8. package/dist/types/constatnts/camera.d.ts +11 -0
  9. package/dist/types/constatnts/imageProcessing.d.ts +3 -0
  10. package/dist/types/constatnts/pdf.d.ts +1 -0
  11. package/dist/types/context.d.ts +118 -0
  12. package/dist/types/defaultConfig.d.ts +57 -0
  13. package/dist/types/environment/designations.d.ts +5 -0
  14. package/dist/types/environment/documentTypes.d.ts +26 -0
  15. package/dist/types/environment/langs.d.ts +89 -0
  16. package/dist/types/environment/loopResult.d.ts +8 -0
  17. package/dist/types/environment/modalPosition.d.ts +19 -0
  18. package/dist/types/environment/realFaceModes.d.ts +22 -0
  19. package/dist/types/environment/stepsDescription.d.ts +54 -0
  20. package/dist/types/environment/triangulation.d.ts +18 -0
  21. package/dist/types/eventListeners/eventListeners.d.ts +15 -0
  22. package/dist/types/eventListeners/selectDocumentType/selectHandler.d.ts +5 -0
  23. package/dist/types/helpers/apiSupport.d.ts +1 -0
  24. package/dist/types/helpers/canvas.d.ts +34 -0
  25. package/dist/types/helpers/color.d.ts +14 -0
  26. package/dist/types/helpers/dataManipulation.d.ts +27 -0
  27. package/dist/types/helpers/detectLanguage.d.ts +3 -0
  28. package/dist/types/helpers/geometry.d.ts +35 -0
  29. package/dist/types/helpers/html.d.ts +26 -0
  30. package/dist/types/helpers/image.d.ts +36 -0
  31. package/dist/types/helpers/imageprocessing.d.ts +11 -0
  32. package/dist/types/helpers/licenceKeyError.d.ts +6 -0
  33. package/dist/types/helpers/manualUpload.d.ts +7 -0
  34. package/dist/types/helpers/math.d.ts +35 -0
  35. package/dist/types/helpers/mobileChecker.d.ts +15 -0
  36. package/dist/types/helpers/numbers.d.ts +2 -0
  37. package/dist/types/helpers/step-background.d.ts +2 -0
  38. package/dist/types/helpers/strings.d.ts +9 -0
  39. package/dist/types/helpers/time.d.ts +11 -0
  40. package/dist/types/helpers/ts/common.d.ts +17 -0
  41. package/dist/types/helpers/updateSelecetTypes.d.ts +3 -0
  42. package/dist/types/helpers/validators.d.ts +44 -0
  43. package/dist/types/idvc.d.ts +19 -0
  44. package/dist/types/initialize.d.ts +12 -0
  45. package/dist/types/loader/asyncLoader.d.ts +1 -0
  46. package/dist/types/loader/loadAnglesModel.d.ts +2 -0
  47. package/dist/types/loader/loadFrontModels.d.ts +2 -0
  48. package/dist/types/loader/loaderClassLocal.d.ts +2 -0
  49. package/dist/types/loader/loaderFace.d.ts +2 -0
  50. package/dist/types/loader/loaderMRZ.d.ts +4 -0
  51. package/dist/types/loader/loaderMeshFace.d.ts +3 -0
  52. package/dist/types/loader/loaderPDF.d.ts +3 -0
  53. package/dist/types/loader/loaderUploadMode.d.ts +1 -0
  54. package/dist/types/loader/loaderZXing.d.ts +2 -0
  55. package/dist/types/loop.d.ts +13 -0
  56. package/dist/types/loopControl.d.ts +10 -0
  57. package/dist/types/modules/BarcodeModule.d.ts +28 -0
  58. package/dist/types/modules/Config.d.ts +131 -0
  59. package/dist/types/modules/FrontProcessing.d.ts +11 -0
  60. package/dist/types/modules/MetaData.d.ts +10 -0
  61. package/dist/types/modules/MrzModule.d.ts +73 -0
  62. package/dist/types/modules/PdfModule.d.ts +79 -0
  63. package/dist/types/modules/Step.d.ts +69 -0
  64. package/dist/types/modules/blur.d.ts +4 -0
  65. package/dist/types/modules/browwserCompatibilities.d.ts +7 -0
  66. package/dist/types/modules/camera/camera.d.ts +14 -0
  67. package/dist/types/modules/camera/cameraManager.d.ts +9 -0
  68. package/dist/types/modules/face/Face.d.ts +63 -0
  69. package/dist/types/modules/face/MeshFace.d.ts +48 -0
  70. package/dist/types/modules/face/SimpleFace.d.ts +23 -0
  71. package/dist/types/modules/feature-detect/simd.d.ts +2 -0
  72. package/dist/types/modules/frameQuality.d.ts +10 -0
  73. package/dist/types/modules/heic.d.ts +11 -0
  74. package/dist/types/modules/image.d.ts +13 -0
  75. package/dist/types/modules/initErrorHandler.d.ts +10 -0
  76. package/dist/types/modules/licenseKeyChecker.d.ts +1 -0
  77. package/dist/types/modules/manualUpload.d.ts +7 -0
  78. package/dist/types/modules/manualUploadProcessing.d.ts +30 -0
  79. package/dist/types/modules/mediaDevices.d.ts +2 -0
  80. package/dist/types/modules/moduleInitializer.d.ts +8 -0
  81. package/dist/types/modules/step-functions/face.d.ts +2 -0
  82. package/dist/types/modules/step-functions/pdf.d.ts +13 -0
  83. package/dist/types/modules/step-result-processing/barcode.d.ts +2 -0
  84. package/dist/types/modules/step-result-processing/common.d.ts +1 -0
  85. package/dist/types/modules/step-result-processing/mrz.d.ts +2 -0
  86. package/dist/types/modules/step-result-processing/pdf.d.ts +2 -0
  87. package/dist/types/modules/step-result-processing/simpleFace.d.ts +2 -0
  88. package/dist/types/modules/step-result-processing/volumeFace.d.ts +7 -0
  89. package/dist/types/modules/stepFunctions.d.ts +5 -0
  90. package/dist/types/modules/stepResultProcessing.d.ts +9 -0
  91. package/dist/types/modules/ui/Flashlight.d.ts +17 -0
  92. package/dist/types/modules/ui/MaskCapture.d.ts +52 -0
  93. package/dist/types/modules/ui/MessageBox.d.ts +19 -0
  94. package/dist/types/modules/ui/Modal.d.ts +20 -0
  95. package/dist/types/modules/ui/SelectDocumentType.d.ts +37 -0
  96. package/dist/types/modules/ui/canvas.d.ts +48 -0
  97. package/dist/types/modules/ui/forceCaptruringBtn.d.ts +12 -0
  98. package/dist/types/modules/ui/hints.d.ts +17 -0
  99. package/dist/types/modules/ui/limitations.d.ts +2 -0
  100. package/dist/types/modules/ui/manualSwitchBtn.d.ts +30 -0
  101. package/dist/types/modules/ui/selectDocumentType/documentSelectedEvent.d.ts +7 -0
  102. package/dist/types/modules/ui/spinner.d.ts +13 -0
  103. package/dist/types/modules/ui/swiper.d.ts +3 -0
  104. package/dist/types/modules/uploader.d.ts +58 -0
  105. package/dist/types/modules/validation/ValidateBool.d.ts +5 -0
  106. package/dist/types/modules/validation/ValidateDocumentTypes.d.ts +20 -0
  107. package/dist/types/modules/validation/ValidateElement.d.ts +5 -0
  108. package/dist/types/modules/validation/ValidateFunction.d.ts +5 -0
  109. package/dist/types/modules/validation/ValidateNumber.d.ts +5 -0
  110. package/dist/types/modules/validation/ValidateString.d.ts +5 -0
  111. package/dist/types/modules/validation/ValidateStringInArray.d.ts +12 -0
  112. package/dist/types/modules/validation/showValidationError.d.ts +2 -0
  113. package/dist/types/modules/validation/validatorFactory.d.ts +10 -0
  114. package/dist/types/modules/validator.d.ts +12 -0
  115. package/dist/types/neural models/Provider.d.ts +4 -0
  116. package/dist/types/neural models/anglesModel.d.ts +15 -0
  117. package/dist/types/neural models/blazeFaceModel.d.ts +27 -0
  118. package/dist/types/neural models/classLocal/exits.d.ts +3 -0
  119. package/dist/types/neural models/classLocalModel.d.ts +29 -0
  120. package/dist/types/neural models/meshFaceModel.d.ts +17 -0
  121. package/dist/types/neural models/mrzModel.d.ts +20 -0
  122. package/dist/types/neural models/neuralModel.d.ts +18 -0
  123. package/dist/types/neural models/preload.d.ts +7 -0
  124. package/dist/types/stepProcessing.d.ts +27 -0
  125. package/dist/types/types/enums/realFace.d.ts +4 -0
  126. package/dist/types/types/modules/camera.enum.d.ts +18 -0
  127. package/dist/types/ui.d.ts +89 -0
  128. package/dist/types/util.d.ts +34 -0
  129. package/dist/types/workers/blurWorker.d.ts +1 -0
  130. package/dist/types/workers/bubbleWorker.d.ts +1 -0
  131. package/dist/types/workers/loadNetworksWorker.d.ts +0 -0
  132. package/dist/types/workers/mrzWorker.d.ts +1 -0
  133. package/package.json +1 -1
  134. package/dist/css/idvc.css +0 -1
  135. package/dist/idvc.js +0 -1684
  136. package/dist/index.html +0 -114
  137. package/dist/js/defaultConfig.ts +0 -303
  138. package/dist/js/environment/capturingModes.json +0 -4
  139. package/dist/js/environment/cssVariables.json +0 -191
  140. package/dist/js/environment/designations.ts +0 -23
  141. package/dist/js/environment/documentTypes.ts +0 -151
  142. package/dist/js/environment/langs.js +0 -1
  143. package/dist/js/environment/loadModes.json +0 -11
  144. package/dist/js/environment/loopResult.ts +0 -14
  145. package/dist/js/environment/modalPosition.ts +0 -27
  146. package/dist/js/environment/networkNames.json +0 -9
  147. package/dist/js/environment/realFaceModes.ts +0 -24
  148. package/dist/js/environment/stepsDescription.ts +0 -64
  149. package/dist/js/environment/triangulation.ts +0 -188
  150. package/dist/networks/156-9239-chunk.js +0 -1
  151. package/dist/networks/190-77ed-chunk.js +0 -1
  152. package/dist/networks/77-9e2f-chunk.js +0 -1
  153. package/dist/networks/Face-a2b7-chunk.js +0 -1
  154. package/dist/networks/MRZ-7d62-chunk.js +0 -1
  155. package/dist/networks/PDF-78d2-chunk.js +0 -1
  156. package/dist/networks/ZXing-5410-chunk.js +0 -1
  157. package/dist/networks/angle03032023.onnx +0 -0
  158. package/dist/networks/classLocal03032023.onnx +0 -0
  159. package/dist/networks/faceDetection03032023.onnx +0 -0
  160. package/dist/networks/faceLandmark03032023.onnx +0 -0
  161. package/dist/networks/mrz03032023.onnx +0 -0
  162. package/dist/networks/ort-wasm-simd-threaded.wasm +0 -0
  163. package/dist/networks/ort-wasm-simd.wasm +0 -0
  164. package/dist/networks/ort-wasm-threaded.wasm +0 -0
  165. package/dist/networks/ort-wasm.wasm +0 -0
@@ -0,0 +1,73 @@
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
+ }
26
+ export declare class MrzModule {
27
+ w: number;
28
+ h: number;
29
+ successCount: number;
30
+ worker: Worker;
31
+ model: MrzModel;
32
+ isInitialized: boolean;
33
+ isProcessing: boolean;
34
+ constructor(worker: any, key: string, networkUrl: string);
35
+ getErrorVal(errorId: number): any;
36
+ /**
37
+ * returns error Object
38
+ * @return {ILicenceError}
39
+ */
40
+ licenseError(errorId: number): ILicenceError;
41
+ yComparator(point1: any, point2: any): any[];
42
+ allocate(): void;
43
+ prepareMRZlocation(locations: any): IMRZLocation;
44
+ writeResults(mrzResults: IMrzScanRes): {
45
+ mrzText: string;
46
+ };
47
+ predict(batchArr: Float32Array, batchSize: any): Promise<PredictionList[]>;
48
+ scan(iData: ImageData): Promise<IMrzScanRes>;
49
+ /**
50
+ * process frame for MRZ
51
+ * @param data
52
+ */
53
+ processMRZ(data: any): Promise<IMrzStepResult | {
54
+ error: ILicenceError;
55
+ status: {
56
+ value: number;
57
+ };
58
+ fields: import("../types/mrz").MrzFields;
59
+ count: number;
60
+ location: import("../types/mrz").IMRZLocation;
61
+ errorStatus?: string;
62
+ symbolsConf: number;
63
+ errorId: number;
64
+ }>;
65
+ estimateResults(data: any): number;
66
+ /**
67
+ * detects MRZ on ImageData
68
+ * @param {ImageData} imageData
69
+ * @return {Promise<>}
70
+ */
71
+ detectMrz(imageData: ImageData): Promise<IDetectRes>;
72
+ }
73
+ export default MrzModule;
@@ -0,0 +1,79 @@
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
+ };
78
+ }
79
+ export default PdfModule;
@@ -0,0 +1,69 @@
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
+ constructor(nameOrObj: string | IStepObj, type?: StepType, camera?: VideoFacingModeEnum, time?: number, img?: Base64Image | null);
62
+ setConfig(configName: StepConfigNames, configValue: StepConfigValues): void;
63
+ hasConfig(configName: StepConfigNames): StepConfig | undefined;
64
+ getConfig(configName: StepConfigNames): StepConfigValues | null;
65
+ get isShowManualSwitchButton(): boolean;
66
+ get capturingMode(): IStepMode;
67
+ prepareStepForCallback(index: number): IStepCallback;
68
+ static createStep(stepObj: IStepObj): Step;
69
+ }
@@ -0,0 +1,4 @@
1
+ declare const _default: (core: any) => {
2
+ analyze: (iData: ImageData) => any;
3
+ };
4
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export declare const browserCompatibilities: {
2
+ simdSupport: boolean;
3
+ wasmSupport: boolean;
4
+ mediaSupport: boolean;
5
+ secureConnection: boolean;
6
+ };
7
+ export declare const detectBrowserCompatibilities: () => void;
@@ -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, StartCamera } 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: () => Promise<CameraError | CameraObjects>;
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;
@@ -0,0 +1,23 @@
1
+ import Face from './Face';
2
+ export declare class SimpleFace extends Face {
3
+ private initialized;
4
+ private readonly shiftFactor;
5
+ private readonly minSize;
6
+ private readonly maxSize;
7
+ private readonly scaleFactor;
8
+ constructor(core: any);
9
+ initPico(data: ImageData): Promise<void>;
10
+ rgbaToGrayScale(rgba: any, width: any, height: any): Uint8Array;
11
+ detect(faceData: ImageData): {
12
+ status: boolean;
13
+ image: any;
14
+ faceSuccessCount: number;
15
+ faceFailCount: number;
16
+ faceNotRecognizedCount: number;
17
+ touch: boolean;
18
+ cancel: boolean;
19
+ type: string;
20
+ };
21
+ dropResults(): void;
22
+ }
23
+ export default SimpleFace;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => boolean;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * detect frame quality based on comparing pixels intesivity.
3
+ */
4
+ interface IData {
5
+ data: Uint8ClampedArray;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export declare const getFrameQuality: ({ data, width, height }: IData) => number;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ export declare class HeicModule {
2
+ private core;
3
+ constructor(core?: any);
4
+ processSingleImage(image: any): Promise<unknown>;
5
+ private heifDecode;
6
+ convert(e: any): Promise<{
7
+ imageDataArr: any[];
8
+ error: string;
9
+ }>;
10
+ }
11
+ export default HeicModule;
@@ -0,0 +1,13 @@
1
+ import { BrowserInfo } from 'detect-browser';
2
+ export type Angle = 0 | 90 | 180 | 270;
3
+ export declare function dataURItoBlob(dataURL: string): Blob;
4
+ export declare const rotateImageByAngle: (src: string, angle: Angle) => Promise<unknown>;
5
+ export declare const rotateImageByExif: (src: string, browser: BrowserInfo) => Promise<string>;
6
+ /**
7
+ *
8
+ * @param src - string
9
+ * @param maxSize - integer
10
+ * @param browser - object
11
+ * @returns {Promise<DataURL>}
12
+ */
13
+ export declare const resizeImage: (src: string, maxSize: number | 'none', browser: BrowserInfo) => Promise<string>;
@@ -0,0 +1,10 @@
1
+ import { CameraNotSupportedReason } from '../types/modules/camera.enum';
2
+ /**
3
+ * The error object thrown when VideoRecognizer fails to open the camera feed.
4
+ */
5
+ export declare class CameraError extends Error {
6
+ /** The reason why opening the camera failed. */
7
+ readonly reason: CameraNotSupportedReason;
8
+ constructor(reason: CameraNotSupportedReason, ...params: any[]);
9
+ }
10
+ export declare const CameraErrorHandler: (error: CameraError) => void;
@@ -0,0 +1 @@
1
+ export declare const checkCommonKey: (key: string) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ import { Base64Image } from '../helpers/image';
2
+ interface Base64Object {
3
+ data: ImageData | Base64Image | null;
4
+ err: boolean;
5
+ }
6
+ declare const dropFile: (base64Obj: Base64Object) => Promise<void>;
7
+ export default dropFile;
@@ -0,0 +1,30 @@
1
+ import { Base64Image } from '../helpers/image';
2
+ interface ICoord {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ export interface IMRZLocation {
7
+ leftTop: ICoord;
8
+ rightTop: ICoord;
9
+ rightBottom: ICoord;
10
+ leftBottom: ICoord;
11
+ }
12
+ /**
13
+ * process manually uploaded image for MRZ
14
+ * @param {ImageData} smallImage - resized image data
15
+ * @return {Promise<boolean>}
16
+ */
17
+ export declare const mrzProcess: (smallImage: ImageData) => Promise<boolean>;
18
+ export declare const pdfProcess: (smallImage: ImageData) => boolean;
19
+ /**
20
+ *
21
+ * @param {Base64Image} data - base64 image
22
+ */
23
+ export declare const barCodeProcess: (data: Base64Image) => Promise<boolean>;
24
+ export declare const frontProcess: (smallImage: ImageData) => Promise<boolean>;
25
+ declare const _default: {
26
+ mrzProcess: (smallImage: ImageData) => Promise<boolean>;
27
+ pdfProcess: (smallImage: ImageData) => boolean;
28
+ barCodeProcess: (data: string) => Promise<boolean>;
29
+ };
30
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (isiOS: boolean) => Promise<string>;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ hasModule: (name: any) => boolean;
3
+ pdf: (module: any) => any;
4
+ face: (module: any) => any;
5
+ docDetector: (module: any) => any;
6
+ barcode: (module: any) => any;
7
+ };
8
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<any>;
2
+ export default _default;
@@ -0,0 +1,13 @@
1
+ declare const _default: (data: ImageData) => Promise<{
2
+ status: boolean;
3
+ predict: boolean;
4
+ touch: boolean;
5
+ image: ImageData;
6
+ type: string;
7
+ error: any;
8
+ coords: any[];
9
+ trackString: string;
10
+ pdfSuccessCount: number;
11
+ pdfCount: number;
12
+ }>;
13
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const barcode: (resultObject: any) => void;
2
+ export default barcode;
@@ -0,0 +1 @@
1
+ export declare const setDetectFace: (val: any) => void;
@@ -0,0 +1,2 @@
1
+ declare const _default: (resultObject: any) => void;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (resultObject: any) => void;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (resultObject: any) => void;
2
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { RealFaceResultObject } from '../../types/modules/realFace';
2
+ import { Point } from '../../helpers/geometry';
3
+ type DrawPath = (region: Path2D, points: Point[], closePath: boolean) => void;
4
+ export declare const drawPath: DrawPath;
5
+ export declare const drawFacePoints: (keypointList: any, color: string) => void;
6
+ declare const _default: (resultObject: RealFaceResultObject) => void;
7
+ export default _default;
@@ -0,0 +1,5 @@
1
+ type ModuleNames = 'mrz' | 'pdf' | 'face' | 'front' | 'barcode';
2
+ type FunctionNames = ModuleNames | 'photo';
3
+ declare const stepFunctionWrapper: (functionName: FunctionNames, ...args: any[]) => any;
4
+ export declare const isStepFunctionExist: (functionName: FunctionNames) => boolean;
5
+ export default stepFunctionWrapper;
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ hasFn: (fnName: string) => boolean;
3
+ pdf: (resultObject: any) => void;
4
+ mrz: (resultObject: any) => void;
5
+ SimpleFace: (resultObject: any) => void;
6
+ VolumeFace: (resultObject: import("../types/modules/realFace").RealFaceResultObject) => void;
7
+ barcode: (resultObject: any) => void;
8
+ };
9
+ export default _default;
@@ -0,0 +1,17 @@
1
+ declare class Flashlight {
2
+ private icon;
3
+ private onIcon;
4
+ private offIcon;
5
+ private isEnableFlashLight;
6
+ constructor();
7
+ /**
8
+ * switches visible of lightning icon
9
+ * @param {boolean} val
10
+ */
11
+ show(val: boolean): void;
12
+ turnOff(): void;
13
+ turnOn(): void;
14
+ get isTurnedOn(): boolean;
15
+ addClickEventListener(fn?: () => void): void;
16
+ }
17
+ export default Flashlight;
@@ -0,0 +1,52 @@
1
+ declare class MaskCapture {
2
+ #private;
3
+ private svg;
4
+ private strokeMask;
5
+ private successMask;
6
+ private type;
7
+ private cssVarContainer;
8
+ private borders;
9
+ private cssVars;
10
+ _mainContainerSizes: {
11
+ width: string;
12
+ height: string;
13
+ };
14
+ constructor(cssVarContainer: any);
15
+ /**
16
+ * get computed width and height of element
17
+ * @param {HTMLElement} el
18
+ * @return {{width: string, height: string}}
19
+ */
20
+ getSizes: (el: any) => {
21
+ width: string;
22
+ height: string;
23
+ };
24
+ get svgSizes(): {
25
+ width: string;
26
+ height: string;
27
+ };
28
+ get strokeSizes(): {
29
+ width: number;
30
+ height: number;
31
+ };
32
+ get strokeLength(): number;
33
+ set sizes({ width, height }: {
34
+ width: any;
35
+ height: any;
36
+ });
37
+ set fillPercentage(percentage: any);
38
+ /**
39
+ * sets the type of capturing mask and it position on screen
40
+ * @param {VideoFacingModeEnum} type - 'environment', 'user'
41
+ */
42
+ set maskType(type: any);
43
+ /**
44
+ * resizes frame based on width and height of main container
45
+ * @param {{width: number, height: number}} param - width and height of main container
46
+ */
47
+ set mainContainerSizes({ width, height }: {
48
+ width: any;
49
+ height: any;
50
+ });
51
+ }
52
+ export default MaskCapture;
@@ -0,0 +1,19 @@
1
+ type MessageBoxType = 'error' | 'primary' | null;
2
+ type CallbackHandler = (event: Event) => void;
3
+ declare class MessageBox {
4
+ #private;
5
+ constructor();
6
+ private setClass;
7
+ get type(): MessageBoxType;
8
+ /**
9
+ * sets the message in message-box
10
+ * @param {string} text - text to set in message-box
11
+ * @param {'error', 'primary'} type - type of message. Default: primary
12
+ */
13
+ message(text?: string, type?: string): void;
14
+ updateByTypesCount(typesCount?: number): void;
15
+ addChangeDocumentTypeListener(handler: CallbackHandler): void;
16
+ removeAllChangeDocumentTypeListener(): void;
17
+ setCaretVisible(val: boolean): void;
18
+ }
19
+ export default MessageBox;