@idscan/idvc2 3.9.0 → 3.9.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/idvc.js.gzip +0 -0
- package/dist/index.html +37 -41
- package/dist/js/defaultConfig.ts +4 -2
- package/dist/networks/Face-chunk.js +1 -1
- package/dist/types/defaultConfig.d.ts +4 -2
- package/dist/types/helpers/cancelableTimeout.d.ts +4 -0
- package/dist/types/helpers/validators.d.ts +2 -0
- package/dist/types/loop.d.ts +0 -2
- package/dist/types/modules/Step.d.ts +3 -0
- package/dist/types/modules/ui/VideoWrapper/CanvasWrapper.d.ts +9 -2
- package/dist/types/modules/ui/VideoWrapper/CaptureButton.d.ts +2 -2
- package/dist/types/modules/ui/VideoWrapper/MultiImagesRecorderService.d.ts +3 -1
- package/dist/types/types/core/MessageAfterDelay.d.ts +4 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { DocumentTypeName } from './environment/documentTypes';
|
|
|
3
3
|
import { StepType } from './environment/stepsDescription';
|
|
4
4
|
import { AllLabels, supportedLanguages } from './environment/langs';
|
|
5
5
|
import { ModalPositionKeys } from './environment/modalPosition';
|
|
6
|
+
import { MessageAfterDelay } from './types/core/MessageAfterDelay';
|
|
6
7
|
import { DeepPartial } from './types/helpers/DeepPartial';
|
|
7
8
|
export type ValidationFn = 'validateElement' | 'validateString' | 'validateDocumentTypes' | 'validateDistinctStringInArray' | 'validateNumber' | 'validateFunction' | 'ValidateDictionaryLangMatch' | 'validateBool' | 'validateAllowCameraSelection';
|
|
8
9
|
type DefaultValueFunction = () => boolean;
|
|
@@ -25,6 +26,7 @@ export type StepConfig = {
|
|
|
25
26
|
enableFourCornerCapture?: boolean;
|
|
26
27
|
shouldRecordMultiImages?: boolean;
|
|
27
28
|
delayUntilCaptureButtonVisible?: number;
|
|
29
|
+
messageAfterDelay?: MessageAfterDelay;
|
|
28
30
|
};
|
|
29
31
|
export type DocumentType = {
|
|
30
32
|
type: DocumentTypeName;
|
|
@@ -39,7 +41,7 @@ export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language'
|
|
|
39
41
|
* @param {string} name,
|
|
40
42
|
* @param {'String' | 'Array' | 'Number' | 'Boolean' | 'Function' | 'Object'} type,
|
|
41
43
|
* @param {string} description,
|
|
42
|
-
* @param {string | boolean | DefaultValueFunction | number | DocumentType[]} defaultValue,
|
|
44
|
+
* @param {string | boolean | DefaultValueFunction | number | DocumentType[] | MessageAfterDelay} defaultValue,
|
|
43
45
|
* @param {ValidationFn} validationFn,
|
|
44
46
|
* @parma {boolean} hidden?,
|
|
45
47
|
* @param {RealFaceMode[]} values?,
|
|
@@ -50,7 +52,7 @@ export interface IDefaultConfig {
|
|
|
50
52
|
name: DefaultConfigName;
|
|
51
53
|
type: 'String' | 'Array' | 'Number' | 'Boolean' | 'Function' | 'Object';
|
|
52
54
|
description: string;
|
|
53
|
-
defaultValue: StepMode | string | boolean | DefaultValueFunction | number | DocumentType[];
|
|
55
|
+
defaultValue: StepMode | string | boolean | DefaultValueFunction | number | DocumentType[] | MessageAfterDelay;
|
|
54
56
|
validationFn: ValidationFn;
|
|
55
57
|
hidden?: boolean;
|
|
56
58
|
values?: ModalPositionKeys[] | RealFaceMode[] | typeof supportedLanguages[number][] | ImageURI[] | DeepPartial<AllLabels>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MessageAfterDelay } from '../types/core/MessageAfterDelay';
|
|
1
2
|
/**
|
|
2
3
|
* check value to be boolean
|
|
3
4
|
* @param val
|
|
@@ -42,6 +43,7 @@ type ValidationResult = {
|
|
|
42
43
|
invalidPathsWithReason: Record<string, string>;
|
|
43
44
|
};
|
|
44
45
|
export declare const isValidDeepPartial: <T extends Record<string, unknown>>(original: T, candidate: unknown) => ValidationResult;
|
|
46
|
+
export declare const validateMessageAfterDelay: (value: unknown, name: string, type: string) => MessageAfterDelay | undefined;
|
|
45
47
|
declare const _default: {
|
|
46
48
|
isValidBool: (val: any) => boolean;
|
|
47
49
|
isValidFunction: (val: any) => boolean;
|
package/dist/types/loop.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ export interface IMrzCoords {
|
|
|
3
3
|
locations: MRZLocation;
|
|
4
4
|
color: 'green' | 'yellow';
|
|
5
5
|
}
|
|
6
|
-
export declare const loopTimeout: (ms: number) => Promise<void>;
|
|
7
|
-
export declare const demandCapturingTimeout: (ms: number) => Promise<void>;
|
|
8
6
|
export declare const unmountIDVC: () => void;
|
|
9
7
|
export declare const loop: () => Promise<false>;
|
|
10
8
|
declare const _default: {
|
|
@@ -3,6 +3,7 @@ import { StepMode } from '../defaultConfig';
|
|
|
3
3
|
import { ErrorCodes } from '../environment/langs';
|
|
4
4
|
import { DocumentTypeName } from '../environment/documentTypes';
|
|
5
5
|
import { Base64 } from '../helpers/base64';
|
|
6
|
+
import { MessageAfterDelay } from '../types/core/MessageAfterDelay';
|
|
6
7
|
export interface IStepConfigMode {
|
|
7
8
|
name: 'mode';
|
|
8
9
|
value: StepMode;
|
|
@@ -22,6 +23,7 @@ export interface IStepObj {
|
|
|
22
23
|
stepTypeImageName: StepTypeImageName;
|
|
23
24
|
shouldRecordMultiImages?: boolean;
|
|
24
25
|
delayUntilCaptureButtonVisible?: number;
|
|
26
|
+
messageAfterDelay?: MessageAfterDelay;
|
|
25
27
|
}
|
|
26
28
|
export interface IStepCallback {
|
|
27
29
|
/** base64 encoded step image */
|
|
@@ -70,6 +72,7 @@ export default class Step implements IStepCallback, IStepObj {
|
|
|
70
72
|
stepTypeImageName: StepTypeImageName;
|
|
71
73
|
shouldRecordMultiImages: boolean;
|
|
72
74
|
delayUntilCaptureButtonVisible?: number;
|
|
75
|
+
messageAfterDelay?: MessageAfterDelay;
|
|
73
76
|
constructor(nameOrObj: string | IStepObj);
|
|
74
77
|
get isShowManualSwitchButton(): boolean;
|
|
75
78
|
get capturingMode(): StepMode;
|
|
@@ -13,6 +13,7 @@ export declare class CanvasWrapper {
|
|
|
13
13
|
generalTypeCanvas: HTMLCanvasElement;
|
|
14
14
|
blazeFaceCanvas: HTMLCanvasElement;
|
|
15
15
|
meshFaceCanvas: HTMLCanvasElement;
|
|
16
|
+
multiImagesSourceCanvas: HTMLCanvasElement;
|
|
16
17
|
mrzCtx: CanvasRenderingContext2D;
|
|
17
18
|
scaledCtx: CanvasRenderingContext2D;
|
|
18
19
|
videoCtx: CanvasRenderingContext2D;
|
|
@@ -21,8 +22,10 @@ export declare class CanvasWrapper {
|
|
|
21
22
|
faceCtx: CanvasRenderingContext2D;
|
|
22
23
|
blazeFaceCtx: CanvasRenderingContext2D;
|
|
23
24
|
meshFaceCtx: CanvasRenderingContext2D;
|
|
25
|
+
multiImagesSourceCtx: CanvasRenderingContext2D;
|
|
26
|
+
isStartedRecord: boolean;
|
|
24
27
|
private readonly video;
|
|
25
|
-
private readonly
|
|
28
|
+
private readonly faceCrop;
|
|
26
29
|
private readonly canvasNames;
|
|
27
30
|
private readonly canvasCtxNames;
|
|
28
31
|
private multiImagesRecorder;
|
|
@@ -31,6 +34,10 @@ export declare class CanvasWrapper {
|
|
|
31
34
|
restoreCanvas(): void;
|
|
32
35
|
toggleBorderCanvas(currentStepType: StepType, isStarted: boolean): void;
|
|
33
36
|
toggleRecordMultiImages(currentStepObj: Step, isStarted: boolean): void;
|
|
37
|
+
private getCenteredSquareCrop;
|
|
38
|
+
private getCenteredCropForRatio;
|
|
39
|
+
private getMultiImageDrawParams;
|
|
40
|
+
private prepareMultiImageSourceCanvas;
|
|
34
41
|
clearBorderCtx(): void;
|
|
35
42
|
setVideoCanvasSizes({ width, height }: Size): void;
|
|
36
43
|
getBaseSizes(coefficient?: number): {
|
|
@@ -42,7 +49,7 @@ export declare class CanvasWrapper {
|
|
|
42
49
|
prepareFaceCanvas(width: number, height: number): void;
|
|
43
50
|
drawVideo(): void;
|
|
44
51
|
recreateWorkingCanvas(browser: BrowserInfo, browserMajorVersion: number): void;
|
|
45
|
-
drawResizedVideo(currentStepType: StepType, isRealFaceAvailable: boolean): void;
|
|
52
|
+
drawResizedVideo(currentStepType: StepType, isRealFaceAvailable: boolean, sizeK: number): void;
|
|
46
53
|
private drawResized;
|
|
47
54
|
private drawFace;
|
|
48
55
|
private recreateCanvas;
|
|
@@ -7,8 +7,8 @@ export declare class CaptureButton implements ICaptureButton {
|
|
|
7
7
|
private controlButton;
|
|
8
8
|
private readonly checkIsCameraErrorVisible;
|
|
9
9
|
constructor(element: HTMLElement, onClick: ControlButtonEvents, checkIsCameraErrorVisible: () => boolean);
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private captureButtonTimeout;
|
|
11
|
+
private showCaptureButton;
|
|
12
12
|
private setVisible;
|
|
13
13
|
setStart: () => void;
|
|
14
14
|
setStop: () => void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare class MultiImagesRecorderService {
|
|
2
|
+
private canvas;
|
|
2
3
|
private mediaRecorder;
|
|
3
4
|
private recordedBlobs;
|
|
4
5
|
private multiImagesType;
|
|
5
|
-
|
|
6
|
+
constructor(canvas: HTMLCanvasElement);
|
|
7
|
+
startRecording(): void;
|
|
6
8
|
stopRecording(): void;
|
|
7
9
|
private handleDataAvailable;
|
|
8
10
|
private handleStop;
|