@idscan/idvc2 2.7.0 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/idvc.js +1 -1
- package/dist/types/types/core/LicenseVerificationWasmCore.d.ts +3 -0
- package/dist/types/types/geometry.d.ts +13 -0
- package/dist/types/types/helpers/numbers.d.ts +4 -0
- package/dist/types/types/image.d.ts +5 -0
- package/dist/types/types/index.d.ts +8 -0
- package/dist/types/types/loop.d.ts +15 -0
- package/dist/types/types/modules/camera.d.ts +22 -0
- package/dist/types/types/modules/realFace.d.ts +22 -0
- package/dist/types/types/modules/ui/swiper.d.ts +2 -0
- package/dist/types/types/mrz.d.ts +43 -0
- package/dist/types/types/neural models/blazeFace.d.ts +19 -0
- package/dist/types/types/neural models/meshFace.d.ts +5 -0
- package/dist/types/types/workers/BubbleWorkerMessage.d.ts +22 -0
- package/dist/types/types/workers/blurWorker.d.ts +4 -0
- package/dist/types/types/workers/mrzWorker.d.ts +11 -0
- package/package.json +1 -1
|
@@ -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,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,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,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
|
+
}
|