idmission-web-sdk 2.1.93 → 2.1.95

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.
@@ -15,25 +15,30 @@ import { SelfieCaptureLoadingOverlayMode } from '../selfie_capture/SelfieCapture
15
15
  import { IdCaptureLoadingOverlayMode } from '../id_capture/IdCaptureLoadingOverlay';
16
16
  import { IdCaptureThresholds } from '../id_capture/IdCaptureModelsProvider';
17
17
  import { IdCaptureGuideImages } from '../guide_images';
18
+ import { VideoIdWizardAssets, VideoIdWizardClassNames, VideoIdWizardColors, VideoIdWizardProps, VideoIdWizardVerbiage } from '../video_id/IdVideoCaptureWizard';
18
19
  export type CustomerEnrollmentAssets = {
19
20
  idCapture?: IdCaptureWizardAssets;
20
21
  faceLiveness?: FaceLivenessAssets;
22
+ videoIdCapture?: VideoIdWizardAssets;
21
23
  };
22
24
  export type CustomerEnrollmentClassNames = {
23
25
  idCapture?: IdCaptureWizardClassNames;
24
26
  faceLiveness?: FaceLivenessClassNames;
25
27
  additionalDocumentCapture?: AdditionalDocumentCaptureWizardClassNames;
26
28
  signatureCapture?: SignatureCaptureClassNames;
29
+ videoIdCapture?: VideoIdWizardClassNames;
27
30
  videoSignatureCapture?: VideoSignatureClassNames;
28
31
  };
29
32
  export type CustomerEnrollmentColors = {
30
33
  idCapture?: IdCaptureWizardColors;
31
34
  faceLiveness?: FaceLivenessColors;
35
+ videoIdCapture?: VideoIdWizardColors;
32
36
  videoSignatureCapture?: VideoSignatureColors;
33
37
  };
34
38
  export type CustomerEnrollmentVerbiage = {
35
39
  idCapture?: IdCaptureWizardVerbiage;
36
40
  faceLiveness?: FaceLivenessVerbiage;
41
+ videoIdCapture?: VideoIdWizardVerbiage;
37
42
  additionalDocumentCapture?: AdditionalDocumentCaptureWizardVerbiage;
38
43
  signatureCapture?: SignatureCaptureVerbiage;
39
44
  videoSignatureCapture?: VideoSignatureVerbiage;
@@ -161,6 +166,10 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
161
166
  captureSignatureVideo?: boolean | (() => Promise<boolean>);
162
167
  /** Array of additional documents to be captured. Each element includes a name and description. */
163
168
  captureAdditionalDocuments?: AdditionalDocument[];
169
+ /** Boolean or async function indicating whether the user should be prompted to capture a video of themselves holding their ID. Defaults to `false`. */
170
+ captureVideoId?: boolean | (() => Promise<boolean>);
171
+ /** Object containing overrides for VideoIdCapture. */
172
+ captureVideoIdProps?: VideoIdWizardProps;
164
173
  /** Name of an included theme or object containing theme properties. **/
165
174
  theme?: ThemeInput;
166
175
  /** Object containing any asset overrides. */
@@ -24,10 +24,9 @@ export type FaceLivenessCaptureProps = {
24
24
  silentFallback?: boolean;
25
25
  guidesComponent?: ComponentType<FaceCaptureGuideOverlayProps>;
26
26
  disableCapturePreview?: boolean;
27
- requireVerticalFaceCentering?: boolean;
28
27
  classNames?: FaceLivenessCaptureClassNames;
29
28
  colors?: FaceLivenessCaptureColors;
30
29
  verbiage?: FaceLivenessCaptureVerbiage;
31
30
  debugMode?: boolean;
32
31
  };
33
- export declare const FaceLivenessCapture: ({ onCapture, onSuccess, onTimeout, onExit, timeoutDurationMs, silentFallback, guidesComponent, disableCapturePreview, requireVerticalFaceCentering, classNames, colors, verbiage: rawVerbiage, debugMode, }: FaceLivenessCaptureProps) => ReactElement;
32
+ export declare const FaceLivenessCapture: ({ onCapture, onSuccess, onTimeout, onExit, timeoutDurationMs, silentFallback, guidesComponent, disableCapturePreview, classNames, colors, verbiage: rawVerbiage, debugMode, }: FaceLivenessCaptureProps) => ReactElement;
@@ -45,11 +45,10 @@ export type FaceLivenessWizardProps = {
45
45
  silentFallback?: boolean;
46
46
  guidesComponent?: ComponentType<FaceCaptureGuideOverlayProps>;
47
47
  disableCapturePreview?: boolean;
48
- requireVerticalFaceCentering?: boolean;
49
48
  assets?: FaceLivenessAssets;
50
49
  classNames?: FaceLivenessClassNames;
51
50
  colors?: FaceLivenessColors;
52
51
  verbiage?: FaceLivenessVerbiage;
53
52
  debugMode?: boolean;
54
53
  };
55
- export declare const FaceLivenessWizard: ({ onComplete, onSuccess, onTimeout, onExitCapture, onExitAfterFailure, onUserCancel, loadingOverlayMode, customOverlayContent, onCustomOverlayDismissed, timeoutDurationMs, maxRetries, skipSuccessScreen, renderCameraFeed, releaseCameraAccessOnExit, silentFallback, guidesComponent, disableCapturePreview, requireVerticalFaceCentering, assets, classNames, colors, verbiage, debugMode, }: FaceLivenessWizardProps) => ReactElement;
54
+ export declare const FaceLivenessWizard: ({ onComplete, onSuccess, onTimeout, onExitCapture, onExitAfterFailure, onUserCancel, loadingOverlayMode, customOverlayContent, onCustomOverlayDismissed, timeoutDurationMs, maxRetries, skipSuccessScreen, renderCameraFeed, releaseCameraAccessOnExit, silentFallback, guidesComponent, disableCapturePreview, assets, classNames, colors, verbiage, debugMode, }: FaceLivenessWizardProps) => ReactElement;
@@ -27,6 +27,7 @@ export type SelfieCaptureVerbiage = {
27
27
  guidanceMoveForwardText?: CustomerSuppliedVerbiage;
28
28
  guidanceMoveToCenterText?: CustomerSuppliedVerbiage;
29
29
  guidanceNoFaceDetectedText?: CustomerSuppliedVerbiage;
30
+ guidanceNotStableText?: CustomerSuppliedVerbiage;
30
31
  };
31
32
  export type SelfieCaptureProps = {
32
33
  onGuidanceSatisfied?: () => void;
@@ -46,4 +47,4 @@ export type SelfieCaptureProps = {
46
47
  verbiage?: SelfieCaptureVerbiage;
47
48
  debugMode?: boolean;
48
49
  };
49
- export declare const SelfieCapture: ({ onGuidanceSatisfied, onGuidanceNotSatisfied, onSelfieCaptureStarted, onSelfieCaptured, onTimeout, onExit, timeoutDurationMs, guidanceMessage, guidanceSatisfied, guidesComponent, requireVerticalFaceCentering, shouldCapture, classNames, colors, verbiage: rawVerbiage, debugMode, }: SelfieCaptureProps) => ReactElement;
50
+ export declare const SelfieCapture: ({ onGuidanceSatisfied, onGuidanceNotSatisfied, onSelfieCaptureStarted, onSelfieCaptured, onTimeout, onExit, timeoutDurationMs, guidanceMessage, guidanceSatisfied, guidesComponent, shouldCapture, classNames, colors, verbiage: rawVerbiage, debugMode, }: SelfieCaptureProps) => ReactElement;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { MutableRefObject, ReactElement, ReactNode } from 'react';
3
- import { Face } from '../../lib/models/FaceDetection';
4
- export type SelfieGuidancePredictionHandler = (prediction: Face[]) => Promise<void> | void;
3
+ import { FaceDetectionPrediction } from '../../lib/models/FaceDetection';
4
+ export type SelfieGuidancePredictionHandler = (prediction: FaceDetectionPrediction) => Promise<void> | void;
5
5
  type SelfieGuidanceModelsState = {
6
6
  start: () => void;
7
7
  stop: () => void;
@@ -18,6 +18,7 @@ export type SelfieGuidanceModelsProviderProps = {
18
18
  throttleMs?: number;
19
19
  onModelError?: (error: Error) => void;
20
20
  modelLoadTimeoutMs?: number;
21
+ requireVerticalFaceCentering?: boolean;
21
22
  };
22
- export declare function SelfieGuidanceModelsProvider({ autoStart, children, throttleMs, onModelError, modelLoadTimeoutMs, }: SelfieGuidanceModelsProviderProps): ReactElement;
23
+ export declare function SelfieGuidanceModelsProvider({ autoStart, children, throttleMs, onModelError, modelLoadTimeoutMs, requireVerticalFaceCentering, }: SelfieGuidanceModelsProviderProps): ReactElement;
23
24
  export {};
@@ -19,6 +19,17 @@ export type Face = {
19
19
  height: number;
20
20
  };
21
21
  };
22
+ export type FaceDetectionPrediction = {
23
+ face: Face | null;
24
+ faceNotDetected: boolean;
25
+ faceNotCentered: boolean;
26
+ faceLookingAway: boolean;
27
+ faceTooClose: boolean;
28
+ faceTooFar: boolean;
29
+ faceReady: boolean;
30
+ faceReadyAt: Date | null;
31
+ faceIsStable: boolean;
32
+ };
22
33
  export declare function loadFaceDetector(): Promise<FaceDetector>;
23
34
  export declare function useLoadFaceDetector({ onModelError, modelLoadTimeoutMs, }: {
24
35
  onModelError?: (error: Error) => void;
@@ -29,6 +40,16 @@ export declare function useLoadFaceDetector({ onModelError, modelLoadTimeoutMs,
29
40
  modelDownloadProgress: number;
30
41
  modelError: Error | null;
31
42
  };
43
+ export declare let lastFaceDetectionAt: number;
44
+ export declare let lastFaceDetectionTime: number;
45
+ export declare function setLastFaceDetectionAt(time: number): void;
32
46
  export declare function makeFaceDetectorPrediction(model: FaceDetector, imageData: Frame): FaceDetectorResult & {
33
47
  faces: Face[];
34
48
  };
49
+ export declare function processFaceDetectorPrediction({ faces, videoWidth, videoHeight, requireVerticalFaceCentering, stabilityThreshold, }: {
50
+ faces: Face[];
51
+ videoWidth: number;
52
+ videoHeight: number;
53
+ requireVerticalFaceCentering?: boolean;
54
+ stabilityThreshold?: number;
55
+ }): FaceDetectionPrediction;
@@ -1,5 +1,6 @@
1
1
  import { BoundingBox } from '@mediapipe/tasks-vision';
2
2
  import { MutableRefObject } from 'react';
3
+ import { DetectedObjectBox } from './DocumentDetection';
3
4
  export declare function convertBoundingBox(box?: BoundingBox): {
4
5
  xMin: number;
5
6
  xMax: number;
@@ -9,3 +10,6 @@ export declare function convertBoundingBox(box?: BoundingBox): {
9
10
  height: number;
10
11
  };
11
12
  export declare function waitForVideoReady(videoRef: MutableRefObject<HTMLVideoElement | null>, checkEveryMs?: number): Promise<void>;
13
+ export declare function createPairs<T>(arr: T[], maxPairs?: number): [T, T][];
14
+ export declare function calculateIoU(boxA: DetectedObjectBox, boxB: DetectedObjectBox): number;
15
+ export declare function average(arr: number[]): number;