@idscan/idvc2 2.7.1 → 2.7.3

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.
@@ -1 +1 @@
1
- var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var o in a)__webpack_require__.o(a,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var __webpack_exports__={};__webpack_require__.d(__webpack_exports__,{J3:()=>supportedLanguages,_2:()=>setTranslation,i0:()=>getTranslation});var supportedLanguages=["en","es"],labels={es:{errorCodes:{mrzNotFound:"Advertencia: <br/>No se ha encontrado MRZ.",mrzNotRecognized:"Advertencia: <br/>No se han podido leer los datos MRZ.<br/>Intente tomar una imagen de mayor calidad.",barcodeNotFound:"Warning: <br/>C\xf3digo de barras no encontrado.",barcodeNotRecognized:"Advertencia: <br/>No se pudieron leer los datos del c\xf3digo de barras.<br/>Intente tomar una imagen de mayor calidad.",heic:"El archivo HEIC est\xe1 da\xf1ado",fileTypeHeic:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg, png y heic.",fileType:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg y png.",disableStepFileUpload:"Se debe utilizar un dispositivo con una c\xe1mara para capturar esta imagen",notAllowedDocument:"Este tipo de documento no est\xe1 permitido",documentSideLowPerimeter:"Advertencia: <br/>El documento de la foto es demasiado peque\xf1o, ac\xe9rcalo m\xe1s",frontSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el anverso del tipo de documento elegido",backSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el reverso del tipo de documento elegido",faceNotFound:"Advertencia: <br/>No se ha encontrado la cara de una persona en la imagen capturada",default:"Lo sentimos, <br/>pero hubo un problema al capturar y enviar las im\xe1genes de su documento. Por favor, int\xe9ntelo de nuevo.",CameraNotFound:"No se encontr\xf3 ninguna c\xe1mara en su dispositivo",CameraNotFoundInVerification:"No se ha encontrado ninguna c\xe1mara en su dispositivo.<br/> Por favor, utilice otro dispositivo o permitir el acceso a la c\xe1mara para la verificaci\xf3n",CameraNotAllowed:"Has denegado el acceso a la c\xe1mara de tu dispositivo",CameraNotAvailable:"La c\xe1mara no est\xe1 disponible en este momento",CameraInUse:"La c\xe1mara ya est\xe1 en uso",MediaDevicesNotSupported:"Tu navegador no es compatible",lowImageResolution:"La resoluci\xf3n de la imagen cargada es demasiado baja",imageIsBlurred:"La imagen es demasiado borrosa para ser utilizada",faceLowArea:"El \xe1rea de la cara en la foto ocupa muy poco espacio"},hintTexts:{front:"Coloque el anverso del documento",frontMRZ:"Haga zoom para capturar el c\xf3digo en la parte inferior",mrz:"Haga zoom para capturar el c\xf3digo en la parte posterior",capturing:"Coloque el anverso del documento",pdf:"Coloque el c\xf3digo de barras dentro del marco",back:"Da la vuelta a tu documento",barcode:"Coloque el c\xf3digo de barras dentro del marco",hold:"Sostener el **placeholder** lado del documento <br> dentro de la caja",dontSee:"No te veo",dontMove:"No te muevas",turnFaceLeft:"Gira la cara a la izquierda",turnFaceRight:"Gira la cara a la derecha",turnFaceUp:"Levanta tu cara",turnFaceDown:"Bajar la cara",faceCam:"Enfr\xe9ntate a la c\xe1mara",camAway:"Mover la c\xe1mara m\xe1s lejos",moveCenter:"Mover al centro",comeCloser:"Ac\xe9rcate",documentCloser:"Acerque el documento",holdCamera:"Mant\xe9ngase firme, analizando el documento <br>"},keyErrors:["La clave de licencia ha caducado","Clave de licencia no v\xe1lida"],camera:{loading:"Carga",awaiting:"A la espera de la respuesta de la c\xe1mara"},general:{documentType:"Su Tipo de Documento es",selectDocumentTypeText:"Seleccionar Tipo de Documento",changeBtn:"Cambiar",correctBtn:"Corregir",cancelBtn:"Cancelar",doneBtn:"Hecho",closeBtn:"Cerrar",retakeBtn:"VOLVER",continueBtn:"CONTINUAR",submitBtn:"ENVIAR",resetAllStepsBtn:"Restablecer todos los pasos",btnUploader:"Cambiar a cargador manual",btnCamera:"Cambiar al modo de c\xe1mara",pressToUpdateText:"Pulse para actualizar",pressToUpdateTextSuccess:"Pulse para actualizar"},uploaderDescription:{textFront:"Haga clic aqu\xed para cargar el frente de su identificaci\xf3n",textBack:"Haga clic aqu\xed para cargar el reverso de una identificaci\xf3n",textFace:"Haga clic aqu\xed para cargar una foto de su rostro",textPdf:"Haga clic aqu\xed para cargar el reverso de una identificaci\xf3n",textMrz:"Haga clic aqu\xed para cargar una foto de su documento'",textFrontBack:"Aseg\xfarese de que su identificaci\xf3n llene toda la pantalla de la c\xe1mara con poco o ning\xfan fondo.",textPass:"Aseg\xfarese de que su identificaci\xf3n llene toda la pantalla de la c\xe1mara <br> con poco o ning\xfan fondo, y que se incluya el c\xf3digo MRZ completo",textFacePosition:"Coloque su rostro para ocupar toda la pantalla de la c\xe1mara con poco o ning\xfan fondo."},documentsTypes:{ID:"Licencia de Conducir",Passport:"Pasaporte",PassportCard:"Tarjeta de Pasaporte",GreenCard:"Tarjeta Verde o Autorizaci\xf3n de Empleo",InternationalId:"Identificaci\xf3n Internacional"},spinnerText:{warmup:{top:"La red neuronal se est\xe1 calentando",bottom:"La captura de documentos estar\xe1 lista para su uso en breve"}}},en:{errorCodes:{mrzNotFound:"Warning: <br/>MRZ was not found.",mrzNotRecognized:"Warning: <br/>MRZ data could not be read.<br/>Try taking a higher quality image.",barcodeNotFound:"Warning: <br/>Barcode not found.",barcodeNotRecognized:"Warning: <br/>Barcode data could not be read.<br/>Try taking a higher quality image.",heic:"HEIC file incorrupted",fileType:"File Type Error: Only jpeg and png images are supported.",fileTypeHeic:"File Type Error: Only jpeg, png and heic images are supported.",disableStepFileUpload:"A device with a camera must be used to capture this image",notAllowedDocument:"This document type is not allowed",documentSideLowPerimeter:"Warning: <br/>The document in the photo is too small, bring it closer",frontSideNotDetected:"Warning: <br/>The image isn't recognized as the front side of the chosen document type",backSideNotDetected:"Warning: <br/>The document's side isn't recognized as the back side of the chosen document type",faceNotFound:"Warning: <br/>A person's face was not found in captured image",default:"We're sorry, <br/>but there was an issue capturing and submitting the images of your document. Please try again",CameraNotFound:"No camera was found on your device",CameraNotFoundInVerification:"No camera found on your device. <br/>Please use other device or allow access to the camera for verification",CameraNotAllowed:"You have denied access to your device's camera",CameraNotAvailable:"Camera is not available at the moment",CameraInUse:"Camera is already in use",MediaDevicesNotSupported:"Your browser is not supported",lowImageResolution:"The resolution of the uploaded image is too low",imageIsBlurred:"The image is too blurry to be used",faceLowArea:"Face area in the photo takes up too little space"},hintTexts:{front:"Position the front of the document",frontMRZ:"Zoom in to capture code at bottom",mrz:"Zoom in to capture code on back side",capturing:"Position the front of the document",pdf:"Position the barcode inside the frame",back:"Turn around your document",barcode:"Position the barcode inside the frame",hold:"Hold the **placeholder** side of the document <br> inside the box",dontSee:"I don't see you",dontMove:"Don't move",turnFaceLeft:"Turn your face left",turnFaceRight:"Turn your face right",turnFaceUp:"Turn your face up",turnFaceDown:"Turn your face down",faceCam:"Face the camera",camAway:"Move camera further away",moveCenter:"Move to the center",comeCloser:"Come closer",documentCloser:"Bring the document closer",holdCamera:"Hold steady, analyzing document <br>"},keyErrors:["License Key has expired","Invalid License Key"],camera:{loading:"Loading",awaiting:"Awaiting camera response"},general:{documentType:"Your document type is",selectDocumentTypeText:"Select Document Type",changeBtn:"Change",correctBtn:"Correct",cancelBtn:"Cancel",doneBtn:"Done",closeBtn:"CLOSE",retakeBtn:"Retake",continueBtn:"CONTINUE",submitBtn:"SUBMIT",resetAllStepsBtn:"Reset all steps",btnUploader:"Switch to manual uploader",btnCamera:"Switch to camera mode",pressToUpdateText:"Press to update",pressToUpdateTextSuccess:"Press to update"},documentsTypes:{ID:"Driver's License or State Identification Card",Passport:"Passport",PassportCard:"Passport Card",GreenCard:"Green Card or Employment Authorization",InternationalId:"International ID"},uploaderDescription:{textFront:"Click here to upload the front of your ID",textBack:"Click here to upload the back of your ID",textFace:"Click here to upload a photo of your face",textPdf:"Click here to upload the back of a ID",textMrz:"Click here to upload a photo of your document",textFrontBack:"Please make sure your ID fills up the entire <br> camera screen with little to no background.",textPass:"Please make sure your ID fills up the entire camera screen <br> with little to no background, and the full MRZ code is included.",textFacePosition:"Please position your face to take up <br> the full camera screen with little to no background."},spinnerText:{warmup:{top:"Neural network is warming up",bottom:"Document capture will be ready to use shortly"}}}},translation=labels.en,setTranslation=function(e){if(e){var a=e.toLowerCase(),o=Object.keys(labels).includes(a)?a:"en";translation=labels[o]}else translation=labels.en},getTranslation=function(e){return e?translation[e]:translation},__webpack_exports__getTranslation=__webpack_exports__.i0,__webpack_exports__setTranslation=__webpack_exports__._2,__webpack_exports__supportedLanguages=__webpack_exports__.J3;export{__webpack_exports__getTranslation as getTranslation,__webpack_exports__setTranslation as setTranslation,__webpack_exports__supportedLanguages as supportedLanguages};
1
+ var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var o in a)__webpack_require__.o(a,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var __webpack_exports__={};__webpack_require__.d(__webpack_exports__,{J3:()=>supportedLanguages,_2:()=>setTranslation,i0:()=>getTranslation});var supportedLanguages=["en","es"],labels={es:{errorCodes:{mrzNotFound:"Advertencia: <br/>No se ha encontrado MRZ.",mrzNotRecognized:"Advertencia: <br/>No se han podido leer los datos MRZ.<br/>Intente tomar una imagen de mayor calidad.",barcodeNotFound:"Warning: <br/>C\xf3digo de barras no encontrado.",barcodeNotRecognized:"Advertencia: <br/>No se pudieron leer los datos del c\xf3digo de barras.<br/>Intente tomar una imagen de mayor calidad.",heic:"El archivo HEIC est\xe1 da\xf1ado",fileTypeHeic:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg, png y heic.",fileType:"Error de tipo de archivo: S\xf3lo se admiten im\xe1genes jpeg y png.",disableStepFileUpload:"Se debe utilizar un dispositivo con una c\xe1mara para capturar esta imagen",notAllowedDocument:"Este tipo de documento no est\xe1 permitido",documentSideLowPerimeter:"Advertencia: <br/>El documento de la foto es demasiado peque\xf1o, ac\xe9rcalo m\xe1s",frontSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el anverso del tipo de documento elegido",backSideNotDetected:"Advertencia: <br/>La imagen no se reconoce como el reverso del tipo de documento elegido",faceNotFound:"Advertencia: <br/>No se ha encontrado la cara de una persona en la imagen capturada",default:"Lo sentimos, <br/>pero hubo un problema al capturar y enviar las im\xe1genes de su documento. Por favor, int\xe9ntelo de nuevo.",CameraNotFound:"No se encontr\xf3 ninguna c\xe1mara en su dispositivo",CameraNotFoundInVerification:"No se ha encontrado ninguna c\xe1mara en su dispositivo.<br/> Por favor, utilice un dispositivo diferente o permitir el acceso a la c\xe1mara para la verificaci\xf3n",CameraNotAllowed:"Has denegado el acceso a la c\xe1mara de tu dispositivo",CameraNotAvailable:"La c\xe1mara no est\xe1 disponible en este momento",CameraInUse:"La c\xe1mara ya est\xe1 en uso",MediaDevicesNotSupported:"Tu navegador no es compatible",lowImageResolution:"La resoluci\xf3n de la imagen cargada es demasiado baja",imageIsBlurred:"La imagen es demasiado borrosa para ser utilizada",faceLowArea:"El \xe1rea de la cara en la foto ocupa muy poco espacio"},hintTexts:{front:"Coloque el anverso del documento",frontMRZ:"Haga zoom para capturar el c\xf3digo en la parte inferior",mrz:"Haga zoom para capturar el c\xf3digo en la parte posterior",capturing:"Coloque el anverso del documento",pdf:"Coloque el c\xf3digo de barras dentro del marco",back:"Da la vuelta a tu documento",barcode:"Coloque el c\xf3digo de barras dentro del marco",hold:"Sostener el **placeholder** lado del documento <br> dentro de la caja",dontSee:"No te veo",dontMove:"No te muevas",turnFaceLeft:"Gira la cara a la izquierda",turnFaceRight:"Gira la cara a la derecha",turnFaceUp:"Levanta tu cara",turnFaceDown:"Bajar la cara",faceCam:"Enfr\xe9ntate a la c\xe1mara",camAway:"Mover la c\xe1mara m\xe1s lejos",moveCenter:"Mover al centro",comeCloser:"Ac\xe9rcate",documentCloser:"Acerque el documento",holdCamera:"Mant\xe9ngase firme, analizando el documento <br>"},keyErrors:["La clave de licencia ha caducado","Clave de licencia no v\xe1lida"],camera:{loading:"Carga",awaiting:"A la espera de la respuesta de la c\xe1mara"},general:{documentType:"Su Tipo de Documento es",selectDocumentTypeText:"Seleccionar Tipo de Documento",changeBtn:"Cambiar",correctBtn:"Corregir",cancelBtn:"Cancelar",doneBtn:"Hecho",closeBtn:"Cerrar",retakeBtn:"VOLVER",continueBtn:"CONTINUAR",submitBtn:"ENVIAR",resetAllStepsBtn:"Restablecer todos los pasos",btnUploader:"Cambiar a cargador manual",btnCamera:"Cambiar al modo de c\xe1mara",pressToUpdateText:"Pulse para actualizar",pressToUpdateTextSuccess:"Pulse para actualizar"},uploaderDescription:{textFront:"Haga clic aqu\xed para cargar el frente de su identificaci\xf3n",textBack:"Haga clic aqu\xed para cargar el reverso de una identificaci\xf3n",textFace:"Haga clic aqu\xed para cargar una foto de su rostro",textPdf:"Haga clic aqu\xed para cargar el reverso de una identificaci\xf3n",textMrz:"Haga clic aqu\xed para cargar una foto de su documento'",textFrontBack:"Aseg\xfarese de que su identificaci\xf3n llene toda la pantalla de la c\xe1mara con poco o ning\xfan fondo.",textPass:"Aseg\xfarese de que su identificaci\xf3n llene toda la pantalla de la c\xe1mara <br> con poco o ning\xfan fondo, y que se incluya el c\xf3digo MRZ completo",textFacePosition:"Coloque su rostro para ocupar toda la pantalla de la c\xe1mara con poco o ning\xfan fondo."},documentsTypes:{ID:"Licencia de Conducir",Passport:"Pasaporte",PassportCard:"Tarjeta de Pasaporte",GreenCard:"Tarjeta Verde o Autorizaci\xf3n de Empleo",InternationalId:"Identificaci\xf3n Internacional"},spinnerText:{warmup:{top:"La red neuronal se est\xe1 calentando",bottom:"La captura de documentos estar\xe1 lista para su uso en breve"}}},en:{errorCodes:{mrzNotFound:"Warning: <br/>MRZ was not found.",mrzNotRecognized:"Warning: <br/>MRZ data could not be read.<br/>Try taking a higher quality image.",barcodeNotFound:"Warning: <br/>Barcode not found.",barcodeNotRecognized:"Warning: <br/>Barcode data could not be read.<br/>Try taking a higher quality image.",heic:"HEIC file incorrupted",fileType:"File Type Error: Only jpeg and png images are supported.",fileTypeHeic:"File Type Error: Only jpeg, png and heic images are supported.",disableStepFileUpload:"A device with a camera must be used to capture this image",notAllowedDocument:"This document type is not allowed",documentSideLowPerimeter:"Warning: <br/>The document in the photo is too small, bring it closer",frontSideNotDetected:"Warning: <br/>The image isn't recognized as the front side of the chosen document type",backSideNotDetected:"Warning: <br/>The document's side isn't recognized as the back side of the chosen document type",faceNotFound:"Warning: <br/>A person's face was not found in captured image",default:"We're sorry, <br/>but there was an issue capturing and submitting the images of your document. Please try again",CameraNotFound:"No camera was found on your device",CameraNotFoundInVerification:"No camera was found on your device. <br/>Please use a different device or allow access to the camera for verification",CameraNotAllowed:"You have denied access to your device's camera",CameraNotAvailable:"Camera is not available at the moment",CameraInUse:"Camera is already in use",MediaDevicesNotSupported:"Your browser is not supported",lowImageResolution:"The resolution of the uploaded image is too low",imageIsBlurred:"The image is too blurry to be used",faceLowArea:"Face area in the photo takes up too little space"},hintTexts:{front:"Position the front of the document",frontMRZ:"Zoom in to capture code at bottom",mrz:"Zoom in to capture code on back side",capturing:"Position the front of the document",pdf:"Position the barcode inside the frame",back:"Turn around your document",barcode:"Position the barcode inside the frame",hold:"Hold the **placeholder** side of the document <br> inside the box",dontSee:"I don't see you",dontMove:"Don't move",turnFaceLeft:"Turn your face left",turnFaceRight:"Turn your face right",turnFaceUp:"Turn your face up",turnFaceDown:"Turn your face down",faceCam:"Face the camera",camAway:"Move camera further away",moveCenter:"Move to the center",comeCloser:"Come closer",documentCloser:"Bring the document closer",holdCamera:"Hold steady, analyzing document <br>"},keyErrors:["License Key has expired","Invalid License Key"],camera:{loading:"Loading",awaiting:"Awaiting camera response"},general:{documentType:"Your document type is",selectDocumentTypeText:"Select Document Type",changeBtn:"Change",correctBtn:"Correct",cancelBtn:"Cancel",doneBtn:"Done",closeBtn:"CLOSE",retakeBtn:"Retake",continueBtn:"CONTINUE",submitBtn:"SUBMIT",resetAllStepsBtn:"Reset all steps",btnUploader:"Switch to manual uploader",btnCamera:"Switch to camera mode",pressToUpdateText:"Press to update",pressToUpdateTextSuccess:"Press to update"},documentsTypes:{ID:"Driver's License or State Identification Card",Passport:"Passport",PassportCard:"Passport Card",GreenCard:"Green Card or Employment Authorization",InternationalId:"International ID"},uploaderDescription:{textFront:"Click here to upload the front of your ID",textBack:"Click here to upload the back of your ID",textFace:"Click here to upload a photo of your face",textPdf:"Click here to upload the back of a ID",textMrz:"Click here to upload a photo of your document",textFrontBack:"Please make sure your ID fills up the entire <br> camera screen with little to no background.",textPass:"Please make sure your ID fills up the entire camera screen <br> with little to no background, and the full MRZ code is included.",textFacePosition:"Please position your face to take up <br> the full camera screen with little to no background."},spinnerText:{warmup:{top:"Neural network is warming up",bottom:"Document capture will be ready to use shortly"}}}},translation=labels.en,setTranslation=function(e){if(e){var a=e.toLowerCase(),o=Object.keys(labels).includes(a)?a:"en";translation=labels[o]}else translation=labels.en},getTranslation=function(e){return e?translation[e]:translation},__webpack_exports__getTranslation=__webpack_exports__.i0,__webpack_exports__setTranslation=__webpack_exports__._2,__webpack_exports__supportedLanguages=__webpack_exports__.J3;export{__webpack_exports__getTranslation as getTranslation,__webpack_exports__setTranslation as setTranslation,__webpack_exports__supportedLanguages as supportedLanguages};
@@ -1,4 +1,4 @@
1
- import { IDocumentType } from '../../defaultConfig';
1
+ import { DefaultConfigName, IDocumentType } from '../../defaultConfig';
2
2
  import { DocumentTypeName } from '../../environment/documentTypes';
3
3
  import { StepType } from '../../environment/stepsDescription';
4
4
  import { IDocumentTypeConfig, IValidator } from '../validator';
@@ -7,7 +7,7 @@ declare class ValidateDocumentTypes implements IValidator<IDocumentType[]> {
7
7
  steps: any[];
8
8
  commonStepTypes: Set<StepType>;
9
9
  documentTypes: IDocumentTypeConfig;
10
- validate(val: IDocumentType[], fallback: IDocumentType[], configName: 'documentTypes'): {
10
+ validate(val: IDocumentType[], fallback: IDocumentType[], configName: DefaultConfigName): {
11
11
  types: any[];
12
12
  steps: any[];
13
13
  commonStepTypes: Set<StepType>;
@@ -0,0 +1,3 @@
1
+ export interface LicenseVerificationWasmCore {
2
+ Verify: (val: string) => boolean;
3
+ }
@@ -0,0 +1,13 @@
1
+ import { IPosition } from '../helpers/ts/common';
2
+ /**
3
+ * x: number,
4
+ * y: number,
5
+ */
6
+ export interface ICoord {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface Bbox {
11
+ topLeft: IPosition;
12
+ bottomRight: IPosition;
13
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * returns random number between min and max inclusively
3
+ */
4
+ export type GetRandomNumber = (min: number, max: number) => number;
@@ -0,0 +1,5 @@
1
+ export interface IPredictLabelData {
2
+ img: ImageData;
3
+ blurConfidence: number;
4
+ frameQuality: number;
5
+ }
@@ -0,0 +1,8 @@
1
+ export {};
2
+ declare global {
3
+ interface Window {
4
+ BlurDetector: any;
5
+ PDF417: any;
6
+ faceLandmarksDetection: any;
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ import { StepType } from '../environment/stepsDescription';
2
+ export interface StepResultError {
3
+ errorType: string;
4
+ errorVal: 0 | 1;
5
+ }
6
+ export interface StepFunctionResult {
7
+ type: StepType | 'VolumeFace';
8
+ cancel: boolean;
9
+ image: null | ImageData;
10
+ touch: boolean;
11
+ status: boolean;
12
+ error?: StepResultError;
13
+ isSuccessProcess?: boolean;
14
+ }
15
+ export type Cancel = (topImage: ImageData, cancelPredict?: boolean, byTouch?: boolean) => Promise<void>;
@@ -0,0 +1,22 @@
1
+ import { CameraType } from './camera.enum';
2
+ import { CameraError } from '../../modules/initErrorHandler';
3
+ export interface IAdditionalConstrains {
4
+ isVerification: boolean;
5
+ }
6
+ export interface VideoDevice extends MediaDeviceInfo {
7
+ cameraType: CameraType;
8
+ }
9
+ interface StartCameraParams {
10
+ cameraType: CameraType;
11
+ readonly defaultConstraints: MediaStreamConstraints;
12
+ readonly additionalConstrains: IAdditionalConstrains;
13
+ }
14
+ export type CameraObjects = VideoDevice[];
15
+ /**
16
+ * @param cameraLabel - label returned from mediaDevices.enumerateDevices
17
+ * @returns true if label contains back camera keywords
18
+ */
19
+ export type IsBackCameraLabel = (cameraLabel: string) => boolean;
20
+ export type SelectCamera = (cameraType: CameraType, additionalConstrains: IAdditionalConstrains) => Promise<MediaDeviceInfo | false>;
21
+ export type StartCamera = (params: StartCameraParams) => Promise<MediaStream | CameraError>;
22
+ export {};
@@ -0,0 +1,22 @@
1
+ import { StepFunctionResult } from '../loop';
2
+ import { BlazeFaceResultModel, KeyPointList } from '../neural models/blazeFace';
3
+ import { FaceMeshPrediction } from '../neural models/meshFace';
4
+ export interface TurnDistance {
5
+ leftRightPercents: number;
6
+ isLeft: boolean;
7
+ }
8
+ export interface FacePrediction extends BlazeFaceResultModel, FaceMeshPrediction {
9
+ }
10
+ export interface RealFaceResultObject extends StepFunctionResult {
11
+ prediction: FacePrediction;
12
+ realFace: boolean;
13
+ moveToCenter: boolean;
14
+ noFace: boolean;
15
+ faceFailCount: number;
16
+ faceSuccessCount: number;
17
+ perimeter: number;
18
+ distance: number;
19
+ drawPoints: KeyPointList;
20
+ isCorrectDirection: boolean;
21
+ image: ImageData | null;
22
+ }
@@ -0,0 +1,2 @@
1
+ export type SwiperCallbackType = 'prev' | 'next';
2
+ export type SwiperCallback = (type: SwiperCallbackType) => void;
@@ -0,0 +1,43 @@
1
+ import { ICoord } from '../helpers/geometry';
2
+ export interface IMRZResults {
3
+ mrzText: string;
4
+ }
5
+ interface IDocumentData {
6
+ fields: any;
7
+ location: IMRZLocation;
8
+ mrzType: {
9
+ value: number;
10
+ };
11
+ }
12
+ export interface IDecodeResult {
13
+ data: IDocumentData;
14
+ errorDesc: string;
15
+ status: {
16
+ value: number;
17
+ };
18
+ }
19
+ interface IDecodedField {
20
+ name: string;
21
+ value: string;
22
+ status: DecodedFieldStatus;
23
+ }
24
+ export interface IMrzScanRes {
25
+ status: {
26
+ value: number;
27
+ };
28
+ fields: MrzFields;
29
+ count: number;
30
+ location: IMRZLocation;
31
+ errorStatus?: string;
32
+ symbolsConf: number;
33
+ errorId: number;
34
+ }
35
+ export interface IMRZLocation {
36
+ leftTop: ICoord;
37
+ rightTop: ICoord;
38
+ rightBottom: ICoord;
39
+ leftBottom: ICoord;
40
+ }
41
+ export type MrzFields = IDecodedField[];
42
+ export type DecodedFieldStatus = 'valid' | 'invalidCS';
43
+ export {};
@@ -0,0 +1,19 @@
1
+ export interface IBoundingBbox {
2
+ classId: number;
3
+ label: string;
4
+ score: number;
5
+ x: number;
6
+ y: number;
7
+ w: number;
8
+ h: number;
9
+ }
10
+ export interface BlazeFaceResultModel {
11
+ bbox: IBoundingBbox;
12
+ keyPoints: KeyPointList;
13
+ face: BlazeFacePoints;
14
+ }
15
+ export type Keypoint = [number, number];
16
+ export type KeyPointList = Keypoint[];
17
+ export type KeypointNames = 'leftEye' | 'rightEye' | 'nose' | 'mouth' | 'leftEar' | 'rightEar';
18
+ export type BlazeFacePoints = Record<KeypointNames, Keypoint>;
19
+ export type BlazeFaceResult = Promise<BlazeFaceResultModel | false>;
@@ -0,0 +1,5 @@
1
+ import { KeyPointList } from './blazeFace';
2
+ export interface FaceMeshPrediction {
3
+ score: number;
4
+ keypointList: KeyPointList;
5
+ }
@@ -0,0 +1,22 @@
1
+ export interface BubbleWorkerMessage {
2
+ iData?: ImageData;
3
+ resizedToBorderScaleWidth: number;
4
+ resizedToBorderScaleHeight: number;
5
+ }
6
+ export type PointsProcess = (iData: ImageData, resizedToBorderScaleWidth: number, resizedToBorderScaleHeight: number) => Segment[];
7
+ export type PixelPosition = number;
8
+ export interface Segment {
9
+ y1: number;
10
+ x1: number;
11
+ y2: number;
12
+ x2: number;
13
+ perimeter: number;
14
+ }
15
+ interface CoordinateSegmentParams {
16
+ segments: Set<PixelPosition>[];
17
+ width: number;
18
+ scaleWidth: number;
19
+ scaleHeight: number;
20
+ }
21
+ export type CoordinateSegment = (params: CoordinateSegmentParams) => Segment[];
22
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface BlurWorkerMessage {
2
+ fn: 'process' | 'drop' | 'init';
3
+ iData?: ImageData;
4
+ }
@@ -0,0 +1,11 @@
1
+ import { PredictionList } from '../../neural models/mrzModel';
2
+ export interface IInitData {
3
+ key: string;
4
+ networkUrl: string;
5
+ }
6
+ export interface MrzWorkerMessage {
7
+ fn: 'init' | 'process' | 'prepare';
8
+ iData?: ImageData;
9
+ initData?: IInitData;
10
+ predictions?: PredictionList[];
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",