@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.
Files changed (147) hide show
  1. package/README.md +10 -0
  2. package/dist/idvc.js +1 -1
  3. package/dist/index.html +26 -21
  4. package/dist/js/environment/documentTypes.ts +2 -2
  5. package/dist/js/environment/langs.js +1 -1
  6. package/dist/types/assets/images/barcode.d.ts +2 -0
  7. package/dist/types/assets/images/face.d.ts +2 -0
  8. package/dist/types/assets/images/front.d.ts +2 -0
  9. package/dist/types/assets/images/mrz.d.ts +2 -0
  10. package/dist/types/assets/images/pdf.d.ts +2 -0
  11. package/dist/types/bl.d.ts +15 -0
  12. package/dist/types/constatnts/camera.d.ts +11 -0
  13. package/dist/types/constatnts/imageProcessing.d.ts +3 -0
  14. package/dist/types/constatnts/pdf.d.ts +1 -0
  15. package/dist/types/context.d.ts +127 -0
  16. package/dist/types/controllers/LoggerController.d.ts +13 -0
  17. package/dist/types/controllers/ModuleController.d.ts +11 -0
  18. package/dist/types/defaultConfig.d.ts +60 -0
  19. package/dist/types/environment/designations.d.ts +5 -0
  20. package/dist/types/environment/documentTypes.d.ts +26 -0
  21. package/dist/types/environment/langs.d.ts +89 -0
  22. package/dist/types/environment/loopResult.d.ts +8 -0
  23. package/dist/types/environment/modalPosition.d.ts +19 -0
  24. package/dist/types/environment/realFaceModes.d.ts +22 -0
  25. package/dist/types/environment/stepsDescription.d.ts +62 -0
  26. package/dist/types/environment/triangulation.d.ts +18 -0
  27. package/dist/types/eventListeners/eventListeners.d.ts +15 -0
  28. package/dist/types/eventListeners/selectDocumentType/selectHandler.d.ts +5 -0
  29. package/dist/types/helpers/apiSupport.d.ts +1 -0
  30. package/dist/types/helpers/canvas.d.ts +41 -0
  31. package/dist/types/helpers/color.d.ts +14 -0
  32. package/dist/types/helpers/dataManipulation.d.ts +27 -0
  33. package/dist/types/helpers/detectLanguage.d.ts +3 -0
  34. package/dist/types/helpers/geometry.d.ts +35 -0
  35. package/dist/types/helpers/html.d.ts +26 -0
  36. package/dist/types/helpers/image.d.ts +36 -0
  37. package/dist/types/helpers/imageprocessing.d.ts +11 -0
  38. package/dist/types/helpers/licenceKeyError.d.ts +6 -0
  39. package/dist/types/helpers/manualUpload.d.ts +7 -0
  40. package/dist/types/helpers/math.d.ts +35 -0
  41. package/dist/types/helpers/mobileChecker.d.ts +13 -0
  42. package/dist/types/helpers/numbers.d.ts +2 -0
  43. package/dist/types/helpers/step-background.d.ts +2 -0
  44. package/dist/types/helpers/strings.d.ts +9 -0
  45. package/dist/types/helpers/time.d.ts +11 -0
  46. package/dist/types/helpers/ts/common.d.ts +17 -0
  47. package/dist/types/helpers/updateSelecetTypes.d.ts +3 -0
  48. package/dist/types/helpers/validators.d.ts +44 -0
  49. package/dist/types/idvc.d.ts +18 -0
  50. package/dist/types/initialize.d.ts +12 -0
  51. package/dist/types/loader/asyncLoader.d.ts +1 -0
  52. package/dist/types/loader/loadAnglesModel.d.ts +3 -0
  53. package/dist/types/loader/loadFrontModels.d.ts +3 -0
  54. package/dist/types/loader/loaderBlur.d.ts +2 -0
  55. package/dist/types/loader/loaderClassLocal.d.ts +3 -0
  56. package/dist/types/loader/loaderFace.d.ts +3 -0
  57. package/dist/types/loader/loaderMRZ.d.ts +5 -0
  58. package/dist/types/loader/loaderMeshFace.d.ts +4 -0
  59. package/dist/types/loader/loaderPDF.d.ts +3 -0
  60. package/dist/types/loader/loaderUploadMode.d.ts +1 -0
  61. package/dist/types/loader/loaderZXing.d.ts +2 -0
  62. package/dist/types/loop.d.ts +15 -0
  63. package/dist/types/loopControl.d.ts +10 -0
  64. package/dist/types/modules/BarcodeModule.d.ts +28 -0
  65. package/dist/types/modules/Config.d.ts +140 -0
  66. package/dist/types/modules/FrontProcessing.d.ts +16 -0
  67. package/dist/types/modules/Logger.d.ts +20 -0
  68. package/dist/types/modules/MetaData.d.ts +10 -0
  69. package/dist/types/modules/MrzModule.d.ts +75 -0
  70. package/dist/types/modules/PdfModule.d.ts +80 -0
  71. package/dist/types/modules/Step.d.ts +70 -0
  72. package/dist/types/modules/blurModule.d.ts +6 -0
  73. package/dist/types/modules/browwserCompatibilities.d.ts +7 -0
  74. package/dist/types/modules/camera/camera.d.ts +14 -0
  75. package/dist/types/modules/camera/cameraManager.d.ts +9 -0
  76. package/dist/types/modules/face/Face.d.ts +63 -0
  77. package/dist/types/modules/face/MeshFace.d.ts +48 -0
  78. package/dist/types/modules/face/SimpleFace.d.ts +24 -0
  79. package/dist/types/modules/feature-detect/simd.d.ts +2 -0
  80. package/dist/types/modules/frameQuality.d.ts +10 -0
  81. package/dist/types/modules/heic.d.ts +11 -0
  82. package/dist/types/modules/image.d.ts +13 -0
  83. package/dist/types/modules/initErrorHandler.d.ts +10 -0
  84. package/dist/types/modules/licenseKeyChecker.d.ts +1 -0
  85. package/dist/types/modules/manualUpload.d.ts +7 -0
  86. package/dist/types/modules/manualUploadProcessing.d.ts +27 -0
  87. package/dist/types/modules/mediaDevices.d.ts +2 -0
  88. package/dist/types/modules/moduleInitializer.d.ts +8 -0
  89. package/dist/types/modules/step-functions/back.d.ts +2 -0
  90. package/dist/types/modules/step-functions/face.d.ts +2 -0
  91. package/dist/types/modules/step-functions/pdf.d.ts +20 -0
  92. package/dist/types/modules/step-result-processing/back.d.ts +2 -0
  93. package/dist/types/modules/step-result-processing/barcode.d.ts +2 -0
  94. package/dist/types/modules/step-result-processing/common.d.ts +1 -0
  95. package/dist/types/modules/step-result-processing/mrz.d.ts +2 -0
  96. package/dist/types/modules/step-result-processing/pdf.d.ts +2 -0
  97. package/dist/types/modules/step-result-processing/simpleFace.d.ts +2 -0
  98. package/dist/types/modules/step-result-processing/volumeFace.d.ts +7 -0
  99. package/dist/types/modules/stepFunctions.d.ts +5 -0
  100. package/dist/types/modules/stepResultProcessing.d.ts +10 -0
  101. package/dist/types/modules/supaBaseClient.d.ts +2 -0
  102. package/dist/types/modules/ui/Flashlight.d.ts +17 -0
  103. package/dist/types/modules/ui/MaskCapture.d.ts +52 -0
  104. package/dist/types/modules/ui/MessageBox.d.ts +20 -0
  105. package/dist/types/modules/ui/Modal.d.ts +20 -0
  106. package/dist/types/modules/ui/SelectDocumentType.d.ts +37 -0
  107. package/dist/types/modules/ui/canvas.d.ts +48 -0
  108. package/dist/types/modules/ui/forceCaptruringBtn.d.ts +12 -0
  109. package/dist/types/modules/ui/hints.d.ts +17 -0
  110. package/dist/types/modules/ui/limitations.d.ts +2 -0
  111. package/dist/types/modules/ui/manualSwitchBtn.d.ts +30 -0
  112. package/dist/types/modules/ui/selectDocumentType/documentSelectedEvent.d.ts +7 -0
  113. package/dist/types/modules/ui/spinner.d.ts +13 -0
  114. package/dist/types/modules/ui/swiper.d.ts +3 -0
  115. package/dist/types/modules/uploader.d.ts +58 -0
  116. package/dist/types/modules/validation/ValidateBool.d.ts +5 -0
  117. package/dist/types/modules/validation/ValidateDocumentTypes.d.ts +20 -0
  118. package/dist/types/modules/validation/ValidateElement.d.ts +5 -0
  119. package/dist/types/modules/validation/ValidateFunction.d.ts +5 -0
  120. package/dist/types/modules/validation/ValidateNumber.d.ts +5 -0
  121. package/dist/types/modules/validation/ValidateString.d.ts +5 -0
  122. package/dist/types/modules/validation/ValidateStringInArray.d.ts +12 -0
  123. package/dist/types/modules/validation/showValidationError.d.ts +2 -0
  124. package/dist/types/modules/validation/validatorFactory.d.ts +10 -0
  125. package/dist/types/modules/validator.d.ts +12 -0
  126. package/dist/types/neural models/Provider.d.ts +4 -0
  127. package/dist/types/neural models/anglesModel.d.ts +14 -0
  128. package/dist/types/neural models/blazeFaceModel.d.ts +27 -0
  129. package/dist/types/neural models/classLocal/exits.d.ts +4 -0
  130. package/dist/types/neural models/classLocalModel.d.ts +28 -0
  131. package/dist/types/neural models/meshFaceModel.d.ts +17 -0
  132. package/dist/types/neural models/mrzModel.d.ts +20 -0
  133. package/dist/types/neural models/neuralModel.d.ts +21 -0
  134. package/dist/types/neural models/preload.d.ts +7 -0
  135. package/dist/types/stepProcessing.d.ts +27 -0
  136. package/dist/types/types/enums/realFace.d.ts +4 -0
  137. package/dist/types/types/modules/camera.enum.d.ts +20 -0
  138. package/dist/types/ui.d.ts +90 -0
  139. package/dist/types/util.d.ts +35 -0
  140. package/dist/types/workers/blurWorker.d.ts +1 -0
  141. package/dist/types/workers/bubbleWorker.d.ts +1 -0
  142. package/dist/types/workers/loadNetworksWorker.d.ts +0 -0
  143. package/dist/types/workers/mrzWorker.d.ts +1 -0
  144. package/package.json +7 -3
  145. /package/dist/networks/{ClassLocal-1182-chunk.js → ClassLocal-835d-chunk.js} +0 -0
  146. /package/dist/networks/{Face-769a-chunk.js → Face-e2da-chunk.js} +0 -0
  147. /package/dist/networks/{MRZ-3fce-chunk.js → MRZ-6b1d-chunk.js} +0 -0
@@ -0,0 +1,24 @@
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): void;
10
+ rgbaToGrayScale(rgba: any, width: any, height: any): Uint8Array;
11
+ findFaces({ height, width }: ImageData): void;
12
+ detect(faceData: ImageData, isUploader?: boolean): {
13
+ status: boolean;
14
+ image: any;
15
+ faceSuccessCount: number;
16
+ faceFailCount: number;
17
+ faceNotRecognizedCount: number;
18
+ touch: boolean;
19
+ cancel: boolean;
20
+ type: string;
21
+ };
22
+ dropResults(): void;
23
+ }
24
+ 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,27 @@
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
+ export declare const faceProcess: (smallImage: ImageData) => Promise<boolean>;
26
+ export declare const backProcess: (smallImage: ImageData) => Promise<boolean>;
27
+ export {};
@@ -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: (data: ImageData) => Promise<any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export declare const uploadFace: (data: ImageData) => Promise<boolean>;
2
+ export declare const videoFace: () => Promise<any>;
@@ -0,0 +1,20 @@
1
+ import { Status } from '../FrontProcessing';
2
+ import { ClassLocalExitType } from '../../neural models/classLocal/exits';
3
+ interface ClassLocalResult {
4
+ type: ClassLocalExitType;
5
+ status: Status;
6
+ }
7
+ export declare const dropRes: () => void;
8
+ declare const _default: (data: ImageData, result?: ClassLocalResult) => Promise<{
9
+ status: boolean;
10
+ predict: boolean;
11
+ touch: boolean;
12
+ image: ImageData;
13
+ type: string;
14
+ error: any;
15
+ coords: any[];
16
+ trackString: string;
17
+ pdfSuccessCount: number;
18
+ pdfCount: number;
19
+ }>;
20
+ 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 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' | 'back';
3
+ declare const stepFunctionWrapper: (functionName: FunctionNames, ...args: any[]) => any;
4
+ export declare const isStepFunctionExist: (functionName: FunctionNames) => boolean;
5
+ export default stepFunctionWrapper;
@@ -0,0 +1,10 @@
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
+ back: (resultObject: any) => void;
9
+ };
10
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare function InitClient(): import("@supabase/supabase-js").SupabaseClient<any, "public", any>;
2
+ export { InitClient };
@@ -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,20 @@
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
+ changeMessageBoxVisible(visibility: boolean): void;
19
+ }
20
+ export default MessageBox;
@@ -0,0 +1,20 @@
1
+ interface DestructedOptions {
2
+ isMobile: boolean;
3
+ background: HTMLDivElement;
4
+ containerId: string;
5
+ mainId?: string;
6
+ doneBtnId: string;
7
+ cancelBtnId: string;
8
+ }
9
+ declare class Modal {
10
+ private background;
11
+ container: HTMLDivElement;
12
+ doneBtn: HTMLButtonElement;
13
+ cancelBtn: HTMLButtonElement;
14
+ constructor(opts: DestructedOptions);
15
+ addDoneHandler(handler: (e?: Event) => void): void;
16
+ addCancelHandler(handler: (e?: Event) => void): void;
17
+ hide(): void;
18
+ show(): void;
19
+ }
20
+ export default Modal;
@@ -0,0 +1,37 @@
1
+ import Modal from './Modal';
2
+ import { DocumentRecord, DocumentTypeIndex, DocumentTypeName, HumanName } from '../../environment/documentTypes';
3
+ import { ModalPositionKeys } from '../../environment/modalPosition';
4
+ interface DocumentTypeElement {
5
+ name: DocumentTypeName;
6
+ element: HTMLLabelElement;
7
+ id: DocumentTypeIndex;
8
+ nName?: string;
9
+ }
10
+ interface ISpinner {
11
+ addSpinnerState: () => void;
12
+ showSpinner: () => void;
13
+ removeSpinnerState: () => void;
14
+ clearState: () => void;
15
+ hideSpinner: () => void;
16
+ }
17
+ declare class SelectDocumentType extends Modal {
18
+ private list;
19
+ elementsList: DocumentTypeElement[];
20
+ private cancelButtonContainer;
21
+ private doneButtonContainer;
22
+ private spinner;
23
+ constructor(isMobile: boolean, background: HTMLDivElement, spinner: ISpinner, modalPositionClass: ModalPositionKeys);
24
+ show(): void;
25
+ hide(): void;
26
+ showCancelButton(): void;
27
+ hideCancelButton(): void;
28
+ addDoneHandler(handler: (e?: Event) => void): void;
29
+ addCancelHandler(handler: (e?: Event) => void): void;
30
+ createElement: (docType: DocumentTypeName, humanName: HumanName) => HTMLLabelElement;
31
+ hasElement(docType: DocumentTypeName): boolean;
32
+ addElement(docType: DocumentTypeName, element: HTMLLabelElement, id: DocumentTypeIndex): void;
33
+ clearList(): void;
34
+ addType({ name: docType, humanName, id }: DocumentRecord): void;
35
+ render(): void;
36
+ }
37
+ export default SelectDocumentType;
@@ -0,0 +1,48 @@
1
+ import { IOffset, ISize } from '../../helpers/image';
2
+ import { Bbox } from '../../types/geometry';
3
+ export default class CanvasUi {
4
+ canvasNames: Set<string>;
5
+ canvasCtxNames: Set<string>;
6
+ videoCanvas: HTMLCanvasElement;
7
+ resizedCanvas: HTMLCanvasElement;
8
+ mrzCanvas: HTMLCanvasElement;
9
+ borderCanvas: HTMLCanvasElement;
10
+ faceCanvas: HTMLCanvasElement;
11
+ classLocalCanvas: HTMLCanvasElement;
12
+ blazeFaceCanvas: HTMLCanvasElement;
13
+ meshFaceCanvas: HTMLCanvasElement;
14
+ mrzCtx: CanvasRenderingContext2D;
15
+ videoCtx: CanvasRenderingContext2D;
16
+ resizedCtx: CanvasRenderingContext2D;
17
+ borderCtx: CanvasRenderingContext2D;
18
+ faceCtx: CanvasRenderingContext2D;
19
+ classLocalCtx: CanvasRenderingContext2D;
20
+ blazeFaceCtx: CanvasRenderingContext2D;
21
+ meshFaceCtx: CanvasRenderingContext2D;
22
+ video: HTMLVideoElement;
23
+ faceOffset: IOffset;
24
+ constructor(video: HTMLVideoElement);
25
+ saveCanvas(): void;
26
+ restoreCanvas(): void;
27
+ toggleBorderCanvas(): void;
28
+ clearBorderCtx(): void;
29
+ setVideoCanvasSizes({ width, height }: ISize): void;
30
+ getBaseSizes(coefficient?: number): {
31
+ baseHeight: number;
32
+ baseWidth: number;
33
+ };
34
+ setResizedCanvas(): void;
35
+ setBorderCanvas(width: number, height: number): void;
36
+ recreateCanvas(canvas: HTMLCanvasElement): {
37
+ canvas: HTMLCanvasElement;
38
+ ctx: CanvasRenderingContext2D;
39
+ };
40
+ rectreateDistinctCanvas(canvasName: string): void;
41
+ prepareFaceCanvas(width: number, height: number): void;
42
+ drawVideo(): void;
43
+ drawResized(): void;
44
+ drawFace(): void;
45
+ recreateWorkingCanvas(): void;
46
+ drawResizedVideo(): void;
47
+ drawBbox(bbox: Bbox): void;
48
+ }
@@ -0,0 +1,12 @@
1
+ type EventCallback = (e?: Event) => void;
2
+ declare class ForceCapturingButton {
3
+ private isShowing;
4
+ private el;
5
+ private callback;
6
+ constructor();
7
+ get state(): boolean;
8
+ set state(val: boolean);
9
+ addClickCallback(cbl: EventCallback): void;
10
+ setAvailable(status: boolean): void;
11
+ }
12
+ export default ForceCapturingButton;
@@ -0,0 +1,17 @@
1
+ import { RealFaceTurnSide } from '../../types/enums/realFace';
2
+ declare class UiHints {
3
+ static holdText: HTMLSpanElement;
4
+ static arrowUpHintContainer: HTMLDivElement;
5
+ static arrowLeftHintContainer: HTMLDivElement;
6
+ static arrowRightHintContainer: HTMLDivElement;
7
+ static arrowLeftFaceTheCameraContainer: HTMLDivElement;
8
+ static arrowRightFaceTheCameraContainer: HTMLDivElement;
9
+ static currentArrowContainer: HTMLDivElement | null;
10
+ static init(): void;
11
+ static showFaceTheCameraArrows(): void;
12
+ static hideFaceTheCameraArrows(): void;
13
+ static showArrow(arrowNumber: RealFaceTurnSide, data: any, isCorrectDirection: any): void;
14
+ static hideArrows(): void;
15
+ static updateHoldText(data?: number, isCorrectDirection?: boolean): string;
16
+ }
17
+ export default UiHints;
@@ -0,0 +1,2 @@
1
+ export declare const showLimitations: (errorText: any) => void;
2
+ export declare const hideLimitations: () => void;
@@ -0,0 +1,30 @@
1
+ import { IStepModeKeys } from '../../defaultConfig';
2
+ type EventCallback = (e?: Event) => void;
3
+ export interface IManualSwitchBtn {
4
+ el: HTMLButtonElement | null;
5
+ loadingEl: HTMLDivElement | null;
6
+ containerEl: HTMLDivElement | null;
7
+ state: IStepModeKeys | null;
8
+ callback: EventCallback | null;
9
+ setLoading(status: boolean): void;
10
+ setEnabled(status: boolean): void;
11
+ setAvailable(status: boolean): void;
12
+ setState(state: IStepModeKeys): void;
13
+ addClickCallback(cbl: EventCallback): void;
14
+ setText(): void;
15
+ }
16
+ declare class ManualSwitchBtn implements IManualSwitchBtn {
17
+ el: any;
18
+ loadingEl: any;
19
+ containerEl: any;
20
+ state: any;
21
+ callback: any;
22
+ constructor(cameraSupported: boolean);
23
+ setLoading(status: boolean): void;
24
+ setEnabled(status: boolean): void;
25
+ setAvailable(status: boolean): void;
26
+ setText(): void;
27
+ setState(state: IStepModeKeys): void;
28
+ addClickCallback(cbl: EventCallback): void;
29
+ }
30
+ export default ManualSwitchBtn;
@@ -0,0 +1,7 @@
1
+ import { DocumentTypeIndex, DocumentTypeName } from '../../../environment/documentTypes';
2
+ export interface DocumentSelectEvent {
3
+ docType: DocumentTypeName;
4
+ id: 0 | DocumentTypeIndex;
5
+ }
6
+ declare const _default: ({ docType, id }: DocumentSelectEvent) => CustomEvent<DocumentSelectEvent>;
7
+ export default _default;
@@ -0,0 +1,13 @@
1
+ export declare const addSpinnerState: (bottomText?: string, topText?: string) => void;
2
+ export declare const removeSpinnerState: () => void;
3
+ export declare const clearState: () => void;
4
+ export declare const showSpinner: () => void;
5
+ export declare const hideSpinner: () => void;
6
+ declare const _default: {
7
+ addSpinnerState: (bottomText?: string, topText?: string) => void;
8
+ removeSpinnerState: () => void;
9
+ clearState: () => void;
10
+ showSpinner: () => void;
11
+ hideSpinner: () => void;
12
+ };
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { SwiperCallback } from '../../types/modules/ui/swiper';
2
+ declare const init: (el: HTMLElement, cbk: SwiperCallback) => void;
3
+ export default init;
@@ -0,0 +1,58 @@
1
+ import { StepType } from '../environment/stepsDescription';
2
+ import { Base64Image } from '../helpers/image';
3
+ type SubmitHandler = (base64Obj: Base64Object) => Promise<void>;
4
+ interface Base64Object {
5
+ data: ImageData | Base64Image | null;
6
+ err: boolean;
7
+ }
8
+ interface ISmallStep {
9
+ type: StepType;
10
+ img: Base64Image | null;
11
+ name?: string;
12
+ errorCode?: string | null | undefined;
13
+ }
14
+ declare class Uploader {
15
+ private onsubmit;
16
+ private onHandle;
17
+ private states;
18
+ private readonly types;
19
+ private dropArea;
20
+ private dropAreaBackground;
21
+ private fileInput;
22
+ private stepName;
23
+ private errorTextEl;
24
+ private pressToUpdate;
25
+ private readonly translation;
26
+ protected textFront: HTMLElement;
27
+ protected textBack: HTMLElement;
28
+ protected textFace: HTMLElement;
29
+ protected textPdf: HTMLElement;
30
+ protected textMrz: HTMLElement;
31
+ protected textFrontBack: HTMLElement;
32
+ protected textPass: HTMLElement;
33
+ protected textFacePosition: HTMLElement;
34
+ private moduleController;
35
+ private addedFileTypes;
36
+ constructor(uploaderId: string, type: ISmallStep, onsubmit: SubmitHandler, onHandle: () => void, moduleController: any, addedFileTypes: string[]);
37
+ checkType(typeForCheck: string): string | false;
38
+ handleFiles(data: {
39
+ target: {
40
+ files: FileList;
41
+ };
42
+ } | Event): void;
43
+ setText(): void;
44
+ /**
45
+ *
46
+ * @param {string} errorCode
47
+ */
48
+ showError(errorCode: string): void;
49
+ clearStates(): void;
50
+ resetInput(): void;
51
+ highlight(): void;
52
+ unhighlight(): void;
53
+ handleDrop(e: DragEvent): void;
54
+ changeType(step: ISmallStep): void;
55
+ transition(): void;
56
+ setDisabled(val: boolean): void;
57
+ }
58
+ export default Uploader;
@@ -0,0 +1,5 @@
1
+ import { IValidator } from '../validator';
2
+ declare class ValidateBool implements IValidator<boolean> {
3
+ validate(val: any, fallback: boolean, configName: string): boolean;
4
+ }
5
+ export default ValidateBool;
@@ -0,0 +1,20 @@
1
+ import { IDocumentType } from '../../defaultConfig';
2
+ import { DocumentTypeName } from '../../environment/documentTypes';
3
+ import { StepType } from '../../environment/stepsDescription';
4
+ import { IDocumentTypeConfig, IValidator } from '../validator';
5
+ declare class ValidateDocumentTypes implements IValidator<IDocumentType[]> {
6
+ types: any[];
7
+ steps: any[];
8
+ commonStepTypes: Set<StepType>;
9
+ documentTypes: IDocumentTypeConfig;
10
+ validate(val: IDocumentType[], fallback: IDocumentType[], configName: 'documentTypes'): {
11
+ types: any[];
12
+ steps: any[];
13
+ commonStepTypes: Set<StepType>;
14
+ documentTypes: IDocumentTypeConfig;
15
+ };
16
+ validateTypes(types: string[]): DocumentTypeName[];
17
+ transformDocType({ type, steps }: IDocumentType): void;
18
+ setCommonStepTypes(): void;
19
+ }
20
+ export default ValidateDocumentTypes;
@@ -0,0 +1,5 @@
1
+ import { IValidator } from '../validator';
2
+ declare class ValidateElement implements IValidator<string> {
3
+ validate(elId: string, defaultValue: string): string;
4
+ }
5
+ export default ValidateElement;
@@ -0,0 +1,5 @@
1
+ import { IValidator } from '../validator';
2
+ declare class ValidateFunction implements IValidator<(arg?: undefined) => boolean> {
3
+ validate(val: any, fallback: (arg?: undefined) => boolean, configName: string): any;
4
+ }
5
+ export default ValidateFunction;
@@ -0,0 +1,5 @@
1
+ import { IValidator } from '../validator';
2
+ declare class ValidateNumber implements IValidator<number> {
3
+ validate(val: number, fallback: number, configName: string): number;
4
+ }
5
+ export default ValidateNumber;
@@ -0,0 +1,5 @@
1
+ import { IValidator } from '../validator';
2
+ declare class ValidateString implements IValidator<string> {
3
+ validate(val: string, fallback: string, configName: string): string;
4
+ }
5
+ export default ValidateString;
@@ -0,0 +1,12 @@
1
+ import { IValidator } from '../validator';
2
+ declare class ValidateDistinctStringInArray implements IValidator<string> {
3
+ /**
4
+ * validates string in given array and set its value
5
+ * @param {String} valueToSet - value that should be set
6
+ * @param {String} defaultValue - fallback if value is not in given array
7
+ * @param {String} configName - name of config
8
+ * @param {String[]} availableValues - array of available values
9
+ */
10
+ validate(valueToSet: string, defaultValue: string, configName: string, availableValues: string[]): string;
11
+ }
12
+ export default ValidateDistinctStringInArray;
@@ -0,0 +1,2 @@
1
+ declare const showError: (configName: string, fallback: any) => void;
2
+ export default showError;