idmission-web-sdk 2.1.94 → 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.
@@ -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;