@idscan/idvc2 2.5.7 → 2.5.8

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 +4 -0
  2. package/dist/css/idvc.css +1 -0
  3. package/dist/idvc.js +1684 -0
  4. package/dist/index.html +114 -0
  5. package/dist/js/defaultConfig.ts +303 -0
  6. package/dist/js/environment/capturingModes.json +4 -0
  7. package/dist/js/environment/cssVariables.json +191 -0
  8. package/dist/js/environment/designations.ts +23 -0
  9. package/dist/js/environment/documentTypes.ts +151 -0
  10. package/dist/js/environment/langs.js +1 -0
  11. package/dist/js/environment/loadModes.json +11 -0
  12. package/dist/js/environment/loopResult.ts +14 -0
  13. package/dist/js/environment/modalPosition.ts +27 -0
  14. package/dist/js/environment/networkNames.json +9 -0
  15. package/dist/js/environment/realFaceModes.ts +24 -0
  16. package/dist/js/environment/stepsDescription.ts +64 -0
  17. package/dist/js/environment/triangulation.ts +188 -0
  18. package/dist/networks/156-2c44-chunk.js +1 -0
  19. package/dist/networks/190-00d9-chunk.js +1 -0
  20. package/dist/networks/77-705c-chunk.js +1 -0
  21. package/dist/networks/Face-5c85-chunk.js +1 -0
  22. package/dist/networks/MRZ-70ee-chunk.js +1 -0
  23. package/dist/networks/PDF-4ee2-chunk.js +1 -0
  24. package/dist/networks/ZXing-f54a-chunk.js +1 -0
  25. package/dist/networks/angle03032023.onnx +0 -0
  26. package/dist/networks/classLocal03032023.onnx +0 -0
  27. package/dist/networks/faceDetection03032023.onnx +0 -0
  28. package/dist/networks/faceLandmark03032023.onnx +0 -0
  29. package/dist/networks/mrz03032023.onnx +0 -0
  30. package/dist/networks/ort-wasm-simd-threaded.wasm +0 -0
  31. package/dist/networks/ort-wasm-simd.wasm +0 -0
  32. package/dist/networks/ort-wasm-threaded.wasm +0 -0
  33. package/dist/networks/ort-wasm.wasm +0 -0
  34. package/package.json +45 -45
  35. package/dist/types/assets/images/barcode.d.ts +0 -2
  36. package/dist/types/assets/images/face.d.ts +0 -2
  37. package/dist/types/assets/images/front.d.ts +0 -2
  38. package/dist/types/assets/images/mrz.d.ts +0 -2
  39. package/dist/types/assets/images/pdf.d.ts +0 -2
  40. package/dist/types/bl.d.ts +0 -15
  41. package/dist/types/constatnts/camera.d.ts +0 -11
  42. package/dist/types/constatnts/imageProcessing.d.ts +0 -3
  43. package/dist/types/constatnts/pdf.d.ts +0 -1
  44. package/dist/types/context.d.ts +0 -118
  45. package/dist/types/defaultConfig.d.ts +0 -57
  46. package/dist/types/environment/designations.d.ts +0 -5
  47. package/dist/types/environment/documentTypes.d.ts +0 -26
  48. package/dist/types/environment/langs.d.ts +0 -89
  49. package/dist/types/environment/loopResult.d.ts +0 -8
  50. package/dist/types/environment/modalPosition.d.ts +0 -19
  51. package/dist/types/environment/realFaceModes.d.ts +0 -22
  52. package/dist/types/environment/stepsDescription.d.ts +0 -54
  53. package/dist/types/environment/triangulation.d.ts +0 -18
  54. package/dist/types/eventListeners/eventListeners.d.ts +0 -15
  55. package/dist/types/eventListeners/selectDocumentType/selectHandler.d.ts +0 -5
  56. package/dist/types/helpers/apiSupport.d.ts +0 -1
  57. package/dist/types/helpers/canvas.d.ts +0 -34
  58. package/dist/types/helpers/color.d.ts +0 -14
  59. package/dist/types/helpers/dataManipulation.d.ts +0 -27
  60. package/dist/types/helpers/detectLanguage.d.ts +0 -3
  61. package/dist/types/helpers/geometry.d.ts +0 -35
  62. package/dist/types/helpers/html.d.ts +0 -26
  63. package/dist/types/helpers/image.d.ts +0 -36
  64. package/dist/types/helpers/imageprocessing.d.ts +0 -11
  65. package/dist/types/helpers/licenceKeyError.d.ts +0 -6
  66. package/dist/types/helpers/manualUpload.d.ts +0 -7
  67. package/dist/types/helpers/math.d.ts +0 -35
  68. package/dist/types/helpers/mobileChecker.d.ts +0 -15
  69. package/dist/types/helpers/numbers.d.ts +0 -2
  70. package/dist/types/helpers/step-background.d.ts +0 -2
  71. package/dist/types/helpers/strings.d.ts +0 -9
  72. package/dist/types/helpers/time.d.ts +0 -11
  73. package/dist/types/helpers/ts/common.d.ts +0 -17
  74. package/dist/types/helpers/updateSelecetTypes.d.ts +0 -3
  75. package/dist/types/helpers/validators.d.ts +0 -44
  76. package/dist/types/idvc.d.ts +0 -19
  77. package/dist/types/initialize.d.ts +0 -12
  78. package/dist/types/loader/asyncLoader.d.ts +0 -1
  79. package/dist/types/loader/loadAnglesModel.d.ts +0 -2
  80. package/dist/types/loader/loadFrontModels.d.ts +0 -2
  81. package/dist/types/loader/loaderClassLocal.d.ts +0 -2
  82. package/dist/types/loader/loaderFace.d.ts +0 -2
  83. package/dist/types/loader/loaderMRZ.d.ts +0 -4
  84. package/dist/types/loader/loaderMeshFace.d.ts +0 -3
  85. package/dist/types/loader/loaderPDF.d.ts +0 -3
  86. package/dist/types/loader/loaderUploadMode.d.ts +0 -1
  87. package/dist/types/loader/loaderZXing.d.ts +0 -2
  88. package/dist/types/loop.d.ts +0 -13
  89. package/dist/types/loopControl.d.ts +0 -10
  90. package/dist/types/modules/BarcodeModule.d.ts +0 -28
  91. package/dist/types/modules/Config.d.ts +0 -131
  92. package/dist/types/modules/FrontProcessing.d.ts +0 -11
  93. package/dist/types/modules/MetaData.d.ts +0 -10
  94. package/dist/types/modules/MrzModule.d.ts +0 -73
  95. package/dist/types/modules/PdfModule.d.ts +0 -79
  96. package/dist/types/modules/Step.d.ts +0 -69
  97. package/dist/types/modules/blur.d.ts +0 -4
  98. package/dist/types/modules/browwserCompatibilities.d.ts +0 -7
  99. package/dist/types/modules/camera/camera.d.ts +0 -14
  100. package/dist/types/modules/camera/cameraManager.d.ts +0 -9
  101. package/dist/types/modules/face/Face.d.ts +0 -63
  102. package/dist/types/modules/face/MeshFace.d.ts +0 -48
  103. package/dist/types/modules/face/SimpleFace.d.ts +0 -23
  104. package/dist/types/modules/feature-detect/simd.d.ts +0 -2
  105. package/dist/types/modules/frameQuality.d.ts +0 -10
  106. package/dist/types/modules/heic.d.ts +0 -11
  107. package/dist/types/modules/image.d.ts +0 -13
  108. package/dist/types/modules/initErrorHandler.d.ts +0 -10
  109. package/dist/types/modules/licenseKeyChecker.d.ts +0 -1
  110. package/dist/types/modules/manualUpload.d.ts +0 -7
  111. package/dist/types/modules/manualUploadProcessing.d.ts +0 -30
  112. package/dist/types/modules/mediaDevices.d.ts +0 -2
  113. package/dist/types/modules/moduleInitializer.d.ts +0 -8
  114. package/dist/types/modules/step-functions/face.d.ts +0 -2
  115. package/dist/types/modules/step-functions/pdf.d.ts +0 -13
  116. package/dist/types/modules/step-result-processing/barcode.d.ts +0 -2
  117. package/dist/types/modules/step-result-processing/common.d.ts +0 -1
  118. package/dist/types/modules/step-result-processing/mrz.d.ts +0 -2
  119. package/dist/types/modules/step-result-processing/pdf.d.ts +0 -2
  120. package/dist/types/modules/step-result-processing/simpleFace.d.ts +0 -2
  121. package/dist/types/modules/step-result-processing/volumeFace.d.ts +0 -7
  122. package/dist/types/modules/stepFunctions.d.ts +0 -5
  123. package/dist/types/modules/stepResultProcessing.d.ts +0 -9
  124. package/dist/types/modules/ui/Flashlight.d.ts +0 -17
  125. package/dist/types/modules/ui/MaskCapture.d.ts +0 -52
  126. package/dist/types/modules/ui/MessageBox.d.ts +0 -19
  127. package/dist/types/modules/ui/Modal.d.ts +0 -20
  128. package/dist/types/modules/ui/SelectDocumentType.d.ts +0 -37
  129. package/dist/types/modules/ui/canvas.d.ts +0 -48
  130. package/dist/types/modules/ui/forceCaptruringBtn.d.ts +0 -12
  131. package/dist/types/modules/ui/hints.d.ts +0 -17
  132. package/dist/types/modules/ui/limitations.d.ts +0 -2
  133. package/dist/types/modules/ui/manualSwitchBtn.d.ts +0 -30
  134. package/dist/types/modules/ui/selectDocumentType/documentSelectedEvent.d.ts +0 -7
  135. package/dist/types/modules/ui/spinner.d.ts +0 -13
  136. package/dist/types/modules/ui/swiper.d.ts +0 -3
  137. package/dist/types/modules/uploader.d.ts +0 -58
  138. package/dist/types/modules/validation/ValidateBool.d.ts +0 -5
  139. package/dist/types/modules/validation/ValidateDocumentTypes.d.ts +0 -20
  140. package/dist/types/modules/validation/ValidateElement.d.ts +0 -5
  141. package/dist/types/modules/validation/ValidateFunction.d.ts +0 -5
  142. package/dist/types/modules/validation/ValidateNumber.d.ts +0 -5
  143. package/dist/types/modules/validation/ValidateString.d.ts +0 -5
  144. package/dist/types/modules/validation/ValidateStringInArray.d.ts +0 -12
  145. package/dist/types/modules/validation/showValidationError.d.ts +0 -2
  146. package/dist/types/modules/validation/validatorFactory.d.ts +0 -10
  147. package/dist/types/modules/validator.d.ts +0 -12
  148. package/dist/types/neural models/Provider.d.ts +0 -4
  149. package/dist/types/neural models/anglesModel.d.ts +0 -15
  150. package/dist/types/neural models/blazeFaceModel.d.ts +0 -27
  151. package/dist/types/neural models/classLocal/exits.d.ts +0 -3
  152. package/dist/types/neural models/classLocalModel.d.ts +0 -29
  153. package/dist/types/neural models/meshFaceModel.d.ts +0 -17
  154. package/dist/types/neural models/mrzModel.d.ts +0 -20
  155. package/dist/types/neural models/neuralModel.d.ts +0 -18
  156. package/dist/types/neural models/preload.d.ts +0 -7
  157. package/dist/types/stepProcessing.d.ts +0 -27
  158. package/dist/types/types/enums/realFace.d.ts +0 -4
  159. package/dist/types/types/modules/camera.enum.d.ts +0 -18
  160. package/dist/types/ui.d.ts +0 -89
  161. package/dist/types/util.d.ts +0 -34
  162. package/dist/types/workers/blurWorker.d.ts +0 -1
  163. package/dist/types/workers/bubbleWorker.d.ts +0 -1
  164. package/dist/types/workers/loadNetworksWorker.d.ts +0 -0
  165. package/dist/types/workers/mrzWorker.d.ts +0 -1
@@ -1,13 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- declare const barcode: (resultObject: any) => void;
2
- export default barcode;
@@ -1 +0,0 @@
1
- export declare const setDetectFace: (val: any) => void;
@@ -1,2 +0,0 @@
1
- declare const _default: (resultObject: any) => void;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: (resultObject: any) => void;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: (resultObject: any) => void;
2
- export default _default;
@@ -1,7 +0,0 @@
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;
@@ -1,5 +0,0 @@
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;
@@ -1,9 +0,0 @@
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;
@@ -1,17 +0,0 @@
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;
@@ -1,52 +0,0 @@
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;
@@ -1,19 +0,0 @@
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;
@@ -1,20 +0,0 @@
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;
@@ -1,37 +0,0 @@
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;
@@ -1,48 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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;
@@ -1,17 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- export declare const showLimitations: (errorText: any) => void;
2
- export declare const hideLimitations: () => void;
@@ -1,30 +0,0 @@
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;
@@ -1,7 +0,0 @@
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;
@@ -1,13 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import { SwiperCallback } from '../../types/modules/ui/swiper';
2
- declare const init: (el: HTMLElement, cbk: SwiperCallback) => void;
3
- export default init;
@@ -1,58 +0,0 @@
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;
@@ -1,5 +0,0 @@
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;
@@ -1,20 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- import { IValidator } from '../validator';
2
- declare class ValidateElement implements IValidator<string> {
3
- validate(elId: string, defaultValue: string): string;
4
- }
5
- export default ValidateElement;
@@ -1,5 +0,0 @@
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;
@@ -1,5 +0,0 @@
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;
@@ -1,5 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- declare const showError: (configName: string, fallback: any) => void;
2
- export default showError;
@@ -1,10 +0,0 @@
1
- import { ValidationFn } from '../../defaultConfig';
2
- import ValidateElement from './ValidateElement';
3
- import ValidateBool from './ValidateBool';
4
- import ValidateDistinctStringInArray from './ValidateStringInArray';
5
- import ValidateDocumentTypes from './ValidateDocumentTypes';
6
- import ValidateFunction from './ValidateFunction';
7
- import ValidateNumber from './ValidateNumber';
8
- import ValidateString from './ValidateString';
9
- declare const validatorFactory: (name: ValidationFn) => false | ValidateElement | ValidateBool | ValidateDistinctStringInArray | ValidateDocumentTypes | ValidateFunction | ValidateNumber | ValidateString;
10
- export default validatorFactory;
@@ -1,12 +0,0 @@
1
- import { DocumentTypeName } from '../environment/documentTypes';
2
- import { DefaultConfigName, IStepConfig } from '../defaultConfig';
3
- export type IDocumentTypeConfig = {
4
- type: DocumentTypeName;
5
- steps: IStepConfig[];
6
- }[];
7
- type SimpleValidate<T> = (val: T, fallback: T, configName: DefaultConfigName) => any;
8
- type OneOfArray<T> = (valueToSet: T, defaultValue: T, configName: DefaultConfigName, availableValues: T[]) => any;
9
- export interface IValidator<T> {
10
- validate: SimpleValidate<T> | OneOfArray<T>;
11
- }
12
- export {};
@@ -1,4 +0,0 @@
1
- export declare enum Provider {
2
- WASM = "wasm",
3
- WEBGL = "webgl"
4
- }
@@ -1,15 +0,0 @@
1
- /// <reference types="onnxruntime-web" />
2
- import { Provider } from './Provider';
3
- import NeuralModel from './neuralModel';
4
- import { RGBColor32 } from '../helpers/image';
5
- interface Prediction {
6
- label: string;
7
- score: number;
8
- }
9
- export default class AnglesModel extends NeuralModel {
10
- constructor(url?: string, provider?: Provider, wasmPaths?: string);
11
- predict(rgb: RGBColor32): Promise<import("onnxruntime-web").InferenceSession.OnnxValueMapType>;
12
- predictFromImage(input: HTMLCanvasElement | HTMLImageElement, dstCanvas?: HTMLCanvasElement): Promise<Prediction[]>;
13
- interpret(data: Float32Array): Prediction[];
14
- }
15
- export {};
@@ -1,27 +0,0 @@
1
- import { Provider } from './Provider';
2
- import NeuralModel from './neuralModel';
3
- import { RGBColor32 } from '../helpers/image';
4
- import { BlazeFaceResult } from '../types/neural models/blazeFace';
5
- import { ICrop } from '../helpers/ts/common';
6
- export declare const ELEMENT_NUM_OF_ANCHOR = 16;
7
- export declare const ANCHOR_GRID_SIZE: readonly [readonly [16, 16], readonly [8, 8]];
8
- export declare const ANCHOR_NUM: readonly [2, 6];
9
- export default class BlazeFaceModel extends NeuralModel {
10
- private anchorList;
11
- private scoreList;
12
- private regressorList;
13
- private thresholdLogit;
14
- private bBoxList;
15
- private keyPoints;
16
- private origSize;
17
- constructor(url?: string, provider?: Provider, wasmPaths?: string);
18
- createAnchor(): void;
19
- processImage(crop: ICrop): BlazeFaceResult;
20
- predict(rgb: RGBColor32): Promise<void>;
21
- predictFromImage(input: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement, dstCanvas?: HTMLCanvasElement): Promise<BlazeFaceResult>;
22
- private getBoundingBoxes;
23
- private calculateIoU;
24
- private nms;
25
- private fixInScreen;
26
- private fillKeyPoints;
27
- }
@@ -1,3 +0,0 @@
1
- export type ClassLocalExitType = 'Back' | 'BackWithoutBarcode' | 'Front' | 'None';
2
- export declare const exits: ClassLocalExitType[];
3
- export default exits;
@@ -1,29 +0,0 @@
1
- /// <reference types="onnxruntime-web" />
2
- import NeuralModel from './neuralModel';
3
- import { Provider } from './Provider';
4
- import { RGBColor32 } from '../helpers/image';
5
- import { ClassLocalExitType } from './classLocal/exits';
6
- import { Bbox } from '../types/geometry';
7
- import { IOffset, ISize } from '../helpers/ts/common';
8
- /**
9
- * perimeterInPercents: document perimeter in percents
10
- */
11
- export interface InterpretClassLocalRes {
12
- side: ClassLocalExitType;
13
- bbox: Bbox;
14
- perimeterInPercents: ISize;
15
- }
16
- interface Prediction {
17
- label: ClassLocalExitType;
18
- score: number;
19
- }
20
- export type PredictionList = Prediction[];
21
- export default class ClassLocalModel extends NeuralModel {
22
- private canvasSize;
23
- constructor(url?: string, provider?: Provider, wasmPaths?: string);
24
- setSizes({ height, width }: ISize): void;
25
- predict(rgb: RGBColor32): Promise<import("onnxruntime-web").InferenceSession.OnnxValueMapType>;
26
- predictFromImage(input: HTMLCanvasElement | HTMLImageElement, dstCanvas?: HTMLCanvasElement, offsets?: IOffset, cropSizes?: ISize): Promise<any[] | InterpretClassLocalRes>;
27
- interpret(classifierData: Float32Array, bboxData: Float32Array): InterpretClassLocalRes;
28
- }
29
- export {};
@@ -1,17 +0,0 @@
1
- import NeuralModel from './neuralModel';
2
- import { Provider } from './Provider';
3
- import { RGBColor32 } from '../helpers/image';
4
- import { IBoundingBbox, KeyPointList } from '../types/neural models/blazeFace';
5
- import { FaceMeshPrediction } from '../types/neural models/meshFace';
6
- import { ICrop, ISize } from '../helpers/ts/common';
7
- export default class MeshFaceModel extends NeuralModel {
8
- origSize: ISize;
9
- crop: ICrop;
10
- landmarkList: Float32Array;
11
- keypointList: KeyPointList;
12
- constructor(url?: string, provider?: Provider, wasmPaths?: string);
13
- preProcess(bbox: IBoundingBbox): void;
14
- predict(rgb: RGBColor32): Promise<FaceMeshPrediction>;
15
- prepareMesh(src: HTMLCanvasElement, dst: HTMLCanvasElement): ImageData;
16
- predictFromImage(input: HTMLCanvasElement | HTMLImageElement, dstCanvas?: HTMLCanvasElement): Promise<FaceMeshPrediction>;
17
- }
@@ -1,20 +0,0 @@
1
- import { InferenceSession } from 'onnxruntime-web';
2
- import NeuralModel from './neuralModel';
3
- import { Provider } from './Provider';
4
- import { RGBColor32 } from '../helpers/image';
5
- interface Prediction {
6
- value: string;
7
- confidence: number;
8
- }
9
- export type PredictionList = Prediction[];
10
- export default class MrzModel extends NeuralModel {
11
- promiseList: Promise<InferenceSession.OnnxValueMapType>[];
12
- predictionList: PredictionList[];
13
- constructor(url?: string, provider?: Provider, wasmPaths?: string);
14
- predict(rgb: RGBColor32): Promise<InferenceSession.OnnxValueMapType>;
15
- predictFromArray(input: Float32Array, batchSize: number): Promise<PredictionList[]>;
16
- interpret(data: Float32Array): PredictionList;
17
- get isLoading(): boolean;
18
- predictFromImage(input: any, dstCanvas: any): void;
19
- }
20
- export {};