idmission-web-sdk 1.0.388 → 1.0.390

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.
Files changed (60) hide show
  1. package/README.md +9 -0
  2. package/dist/components/CompositeWizard.d.ts +3 -1
  3. package/dist/components/camera/CameraProvider.d.ts +3 -1
  4. package/dist/components/common/debug.d.ts +3 -6
  5. package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +2 -0
  6. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +4 -2
  7. package/dist/components/customer_flows/CustomerIdentification.d.ts +2 -0
  8. package/dist/components/customer_flows/CustomerVerification.d.ts +2 -0
  9. package/dist/components/customer_flows/DocumentCapture.d.ts +2 -0
  10. package/dist/components/customer_flows/FaceValidation.d.ts +2 -0
  11. package/dist/components/customer_flows/IdAndFaceValidation.d.ts +4 -2
  12. package/dist/components/customer_flows/IdValidation.d.ts +2 -2
  13. package/dist/components/customer_flows/SignatureKYC.d.ts +2 -0
  14. package/dist/components/customer_flows/VideoIdValidation.d.ts +4 -0
  15. package/dist/components/id_capture/CapturedDocuments.d.ts +3 -5
  16. package/dist/components/id_capture/HighPerformanceObjectDetectionModelsProvider.d.ts +36 -0
  17. package/dist/components/id_capture/IdCapture.d.ts +6 -6
  18. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +35 -21
  19. package/dist/components/id_capture/IdCaptureStateProvider.d.ts +3 -7
  20. package/dist/components/id_capture/IdCaptureWizard.d.ts +2 -1
  21. package/dist/components/selfie_capture/HighPerformanceSelfieGuidanceModelsProvider.d.ts +42 -0
  22. package/dist/components/selfie_capture/SelfieCapture.d.ts +1 -1
  23. package/dist/components/selfie_capture/SelfieGuidanceModelsProvider.d.ts +3 -21
  24. package/dist/components/video_id/IdVideoCaptureWizard.d.ts +3 -1
  25. package/dist/contexts/SelfieGuidanceModelsContext.d.ts +15 -0
  26. package/dist/contexts/SubmissionContext.d.ts +1 -2
  27. package/dist/lib/barcode/Scan.d.ts +1 -2
  28. package/dist/lib/models/DocumentDetection.d.ts +25 -69
  29. package/dist/lib/models/FaceDetection.d.ts +4 -33
  30. package/dist/lib/models/Focus.d.ts +9 -33
  31. package/dist/lib/models/preloadModels.d.ts +2 -9
  32. package/dist/lib/utils/cropping.d.ts +2 -3
  33. package/dist/lib/utils/logger.d.ts +0 -2
  34. package/dist/sdk2.cjs.development.js +8399 -2062
  35. package/dist/sdk2.cjs.development.js.map +1 -1
  36. package/dist/sdk2.cjs.production.js +1 -1
  37. package/dist/sdk2.cjs.production.js.map +1 -1
  38. package/dist/sdk2.esm.js +8399 -2063
  39. package/dist/sdk2.esm.js.map +1 -1
  40. package/dist/sdk2.umd.development.js +8397 -2059
  41. package/dist/sdk2.umd.development.js.map +1 -1
  42. package/dist/sdk2.umd.production.js +1 -1
  43. package/dist/sdk2.umd.production.js.map +1 -1
  44. package/dist/stories/Components/HighPerformanceFaceDetection/Minimal.stories.d.ts +12 -12
  45. package/dist/stories/Components/HighPerformanceFaceDetection/Original.stories.d.ts +8 -0
  46. package/dist/stories/CustomerFlows/IdAndFaceValidation.stories.d.ts +0 -1
  47. package/dist/stories/CustomerFlows/IdValidation.stories.d.ts +0 -6
  48. package/dist/stories/Experiments/BarcodeReader.stories.d.ts +7 -0
  49. package/dist/stories/Experiments/VideoCapture.stories.d.ts +1 -1
  50. package/dist/stories/{Experiments/SpeedTest.stories.d.ts → models/DocumentDetection.stories.d.ts} +2 -2
  51. package/dist/stories/models/FocusModel.stories.d.ts +1 -1
  52. package/dist/version.d.ts +1 -1
  53. package/package.json +1 -1
  54. package/dist/components/id_capture/DocumentDetectionModelProvider.d.ts +0 -29
  55. package/dist/components/id_capture/FocusModelProvider.d.ts +0 -22
  56. package/dist/lib/models/CapabilityProbing.d.ts +0 -14
  57. package/dist/lib/models/FrameLoop.d.ts +0 -7
  58. package/dist/lib/models/VisionRuntime.d.ts +0 -2
  59. package/dist/lib/models/helpers.d.ts +0 -9
  60. package/dist/lib/utils/isMobile.d.ts +0 -1
package/README.md CHANGED
@@ -79,6 +79,7 @@ Render a fullscreen ID capture component that instructs the user to photograph b
79
79
  <tr><td><code>onDenied</code> (optional)</td><td>callback function that fires when the user completes the IDValidation flow with an invalid ID. Arguments: same as onComplete.</td></tr>
80
80
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
81
81
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
82
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
82
83
  <tr><td><code>lang</code> (optional)</td><td>language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto.</td></tr>
83
84
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
84
85
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
@@ -225,6 +226,7 @@ Render a fullscreen capture component that analyzes frames from the user's front
225
226
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
226
227
  <tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after completing the FaceValidation flow and failing the realness check.</td></tr>
227
228
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
229
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
228
230
  <tr><td><code>lang</code> (optional)</td><td>language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto.</td></tr>
229
231
  <tr><td><code>timeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user may try to pass the realness check. Defaults to 15000 (15 seconds).</td></tr>
230
232
  <tr><td><code>skipSuccessScreen</code> (optional)</td><td>boolean to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to false.</td></tr>
@@ -338,6 +340,7 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
338
340
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
339
341
  <tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after completing the IDValidation flow and failing the realness check.</td></tr>
340
342
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
343
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
341
344
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
342
345
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
343
346
  <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
@@ -411,6 +414,7 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
411
414
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
412
415
  <tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after completing the IDValidation flow and failing the realness check.</td></tr>
413
416
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
417
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
414
418
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
415
419
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
416
420
  <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
@@ -482,6 +486,7 @@ Render a fullscreen capture component that performs FaceValidation, and then sto
482
486
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
483
487
  <tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after completing the IDValidation flow and failing the realness check.</td></tr>
484
488
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
489
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
485
490
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
486
491
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
487
492
  <tr><td><code>captureAdditionalDocuments</code> (optional)</td><td>array of additional documents to be captured. Each element includes a name and description.</td></tr>
@@ -535,6 +540,7 @@ Render a fullscreen capture component that analyzes frames from the user's front
535
540
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
536
541
  <tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after failing the realness check.</td></tr>
537
542
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
543
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
538
544
  <tr><td><code>lang</code> (optional)</td><td>language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto.</td></tr>
539
545
  <tr><td><code>timeoutDurationMs</code> (optional)</td><td>the duration of time in milliseconds that the user may try to pass the realness check. Defaults to 15000 (15 seconds).</td></tr>
540
546
  <tr><td><code>skipSuccessScreen</code> (optional)</td><td>boolean to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to false.</td></tr>
@@ -578,6 +584,7 @@ Render a fullscreen capture component that analyzes frames from the user's front
578
584
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
579
585
  <tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after failing the realness check.</td></tr>
580
586
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
587
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
581
588
  <tr><td><code>skipSuccessScreen</code> (optional)</td><td>boolean to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to false.</td></tr>
582
589
  <tr><td><code>lang</code> (optional)</td><td>language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto.</td></tr>
583
590
  <tr><td><code>companyId</code> (optional)</td><td>company identifier to include with submission.</td></tr>
@@ -675,6 +682,8 @@ Render a fullscreen capture component that performs IDValidation and FaceValidat
675
682
  <tr><td><code>onExitCapture</code> (optional)</td><td>callback function that fires when the user clicks the X button during capture.</td></tr>
676
683
  <tr><td><code>onExitAfterFailure</code> (optional)</td><td>callback function that fires when the user clicks the exit button after failing the realness check.</td></tr>
677
684
  <tr><td><code>onUserCancel</code> (optional)</td><td>callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay.</td></tr>
685
+ <tr><td><code>onCameraAccessDenied</code> (optional)</td><td>callback function that fires when camera access is denied or lost.</td></tr>
686
+ <tr><td><code>onMicrophoneAccessDenied</code> (optional)</td><td>callback function that fires when microphone access is denied or lost.</td></tr>
678
687
  <tr><td><code>lang</code> (optional)</td><td>language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto.</td></tr>
679
688
  <tr><td><code>captureSignature</code> (optional)</td><td>boolean indicating whether the user should be prompted to sign the screen before submission. Defaults to false.</td></tr>
680
689
  <tr><td><code>captureSignatureVideo</code> (optional)</td><td>boolean indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to false.</td></tr>
@@ -17,6 +17,8 @@ export type CompositeWizardComponentProps = {
17
17
  videoIdCaptureProps?: VideoIdWizardProps;
18
18
  captureSignature?: boolean | (() => Promise<boolean>);
19
19
  captureSignatureVideo?: boolean | (() => Promise<boolean>);
20
+ onCameraAccessDenied?: () => void;
21
+ onMicrophoneAccessDenied?: () => void;
20
22
  debugMode?: boolean;
21
23
  };
22
24
  export type CompositeWizardProps = CompositeWizardComponentProps & {
@@ -27,4 +29,4 @@ export type CompositeWizardProps = CompositeWizardComponentProps & {
27
29
  onComplete?: (submissionResponse: SubmissionResponse) => void;
28
30
  };
29
31
  export declare const CompositeWizard: (props: CompositeWizardProps) => ReactElement;
30
- export declare const CompositeWizardComponent: ({ checks: userChecks, idCaptureProps, faceLivenessProps, additionalDocumentCaptureProps, signatureCaptureProps, videoSignatureCaptureProps, videoIdCaptureProps, captureSignature, captureSignatureVideo, debugMode, }: CompositeWizardComponentProps) => ReactElement;
32
+ export declare const CompositeWizardComponent: ({ checks: userChecks, idCaptureProps, faceLivenessProps, additionalDocumentCaptureProps, signatureCaptureProps, videoSignatureCaptureProps, videoIdCaptureProps, captureSignature, captureSignatureVideo, onCameraAccessDenied, onMicrophoneAccessDenied, debugMode, }: CompositeWizardComponentProps) => ReactElement;
@@ -9,6 +9,8 @@ export type CameraProviderProps = {
9
9
  requireMicrophoneAccess?: boolean;
10
10
  maxVideoWidth?: number;
11
11
  maxFps?: number;
12
+ onCameraAccessDenied?: () => void;
13
+ onMicrophoneAccessDenied?: () => void;
12
14
  debugMode?: boolean;
13
15
  };
14
- export declare const CameraProvider: ({ children, requestAccessAutomatically, preferFrontFacingCamera, preferContinuityCamera, requireMicrophoneAccess, maxVideoWidth, maxFps, debugMode, }: CameraProviderProps) => ReactElement;
16
+ export declare const CameraProvider: ({ children, requestAccessAutomatically, preferFrontFacingCamera, preferContinuityCamera, requireMicrophoneAccess, maxVideoWidth, maxFps, onCameraAccessDenied, onMicrophoneAccessDenied, debugMode, }: CameraProviderProps) => ReactElement;
@@ -1,10 +1,7 @@
1
1
  import React, { ReactElement, ReactNode } from 'react';
2
2
  import { DetectedObject } from '../../lib/models/DocumentDetection';
3
- import { Face, FaceKeypoint } from '../../lib/models/FaceDetection';
4
- export declare function DebugStatsPane({ children }: {
5
- children: ReactNode;
6
- }): React.JSX.Element;
7
- export declare const DebugStatsPaneDiv: import("styled-components").IStyledComponent<"web", {
3
+ import { Face, FaceKeypoint } from '../selfie_capture/HighPerformanceSelfieGuidanceModelsProvider';
4
+ export declare const DebugStatsPane: import("styled-components").IStyledComponent<"web", {
8
5
  ref?: React.LegacyRef<HTMLSpanElement> | undefined;
9
6
  key?: React.Key | null | undefined;
10
7
  defaultChecked?: boolean | undefined;
@@ -316,7 +313,7 @@ export type DetectedObjectDebugBoxProps = {
316
313
  flipX?: boolean;
317
314
  color?: string;
318
315
  };
319
- export declare function IdCaptureDetectedObjectDebugBox({ obj, flipX, color, scaling, }: DetectedObjectDebugBoxProps): ReactElement;
316
+ export declare function IdCaptureDetectedObjectDebugBox({ obj, flipX, color, }: DetectedObjectDebugBoxProps): ReactElement;
320
317
  export type SelfieCaptureFaceDebugBoxProps = {
321
318
  face: Face;
322
319
  scaling: DebugScalingDetails;
@@ -80,6 +80,8 @@ export interface CustomerBiometricsEnrollmentProps extends PropsWithChildren {
80
80
  onUserCancel?: () => void;
81
81
  /** Callback function that fires when the selfie capture models fail to load or fail during runtime. */
82
82
  onModelError?: (error: Error) => void;
83
+ /** Callback function that fires when the camera access is denied. */
84
+ onCameraAccessDenied?: () => void;
83
85
  /** Boolean or async function indicating whether the user should be prompted to sign the screen before submission. Defaults to `false`. */
84
86
  captureSignature?: boolean | (() => Promise<boolean>);
85
87
  /** Boolean or async function indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to `false`. */
@@ -88,10 +88,10 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
88
88
  idAutoCaptureEnabled?: boolean;
89
89
  /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for ID cards. Defaults to 0.8. */
90
90
  idCardAutoCaptureScoreThreshold?: number;
91
- /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
92
- passportAutoCaptureScoreThreshold?: number;
93
91
  /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
94
92
  mrzDetectionScoreThreshold?: number;
93
+ /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
94
+ passportAutoCaptureScoreThreshold?: number;
95
95
  /** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. */
96
96
  idCardFocusScoreThreshold?: number;
97
97
  /** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
@@ -134,6 +134,8 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
134
134
  onIdCaptureModelError?: (error: Error) => void;
135
135
  /** Callback function that fires when the selfie capture models fail to load or fail during runtime. */
136
136
  onSelfieCaptureModelError?: (error: Error) => void;
137
+ /** Callback function that fires when the camera access is denied. */
138
+ onCameraAccessDenied?: () => void;
137
139
  /** Boolean or async function indicating whether the user should be prompted to sign the screen before submission. Defaults to `false`. */
138
140
  captureSignature?: boolean | (() => Promise<boolean>);
139
141
  /** Boolean or async function indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to `false`. */
@@ -54,6 +54,8 @@ export interface CustomerIdentificationProps extends PropsWithChildren {
54
54
  onUserCancel?: () => void;
55
55
  /** Callback function that fires when the selfie capture models fail to load or fail during runtime. */
56
56
  onModelError?: (error: Error) => void;
57
+ /** Callback function that fires when the camera access is denied. */
58
+ onCameraAccessDenied?: () => void;
57
59
  /** Name of an included theme or object containing theme properties. **/
58
60
  theme?: ThemeInput;
59
61
  /** Object containing any asset overrides. */
@@ -63,6 +63,8 @@ export interface CustomerVerificationProps extends PropsWithChildren {
63
63
  onUserCancel?: () => void;
64
64
  /** Callback function that fires when the selfie capture models fail to load or fail during runtime. */
65
65
  onModelError?: (error: Error) => void;
66
+ /** Callback function that fires when the camera access is denied. */
67
+ onCameraAccessDenied?: () => void;
66
68
  /** Boolean flag to indicate whether users should be prompted to share their location. Default is `true`. */
67
69
  geolocationEnabled?: boolean;
68
70
  /** Boolean flag to indicate whether users should be blocked from proceeding if they block location access. Default is `false`. */
@@ -23,6 +23,8 @@ export interface DocumentCaptureProps extends PropsWithChildren {
23
23
  onExitCapture?: () => void;
24
24
  /** Callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay. */
25
25
  onUserCancel?: () => void;
26
+ /** Callback function that fires when the camera access is denied. */
27
+ onCameraAccessDenied?: () => void;
26
28
  documents?: CapturedDocument[];
27
29
  aspectRatio?: number;
28
30
  cameraFeedMode?: CameraFeedMode;
@@ -53,6 +53,8 @@ export interface FaceValidationProps extends PropsWithChildren {
53
53
  onUserCancel?: () => void;
54
54
  /** Callback function that fires when the selfie capture models fail to load or fail during runtime. */
55
55
  onModelError?: (error: Error) => void;
56
+ /** Callback function that fires when the camera access is denied. */
57
+ onCameraAccessDenied?: () => void;
56
58
  /** Name of an included theme or object containing theme properties. **/
57
59
  theme?: ThemeInput;
58
60
  /** Object containing any asset overrides. */
@@ -85,10 +85,10 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
85
85
  idAutoCaptureEnabled?: boolean;
86
86
  /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for ID cards. Defaults to 0.8. */
87
87
  idCardAutoCaptureScoreThreshold?: number;
88
- /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
89
- passportAutoCaptureScoreThreshold?: number;
90
88
  /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
91
89
  mrzDetectionScoreThreshold?: number;
90
+ /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
91
+ passportAutoCaptureScoreThreshold?: number;
92
92
  /** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. */
93
93
  idCardFocusScoreThreshold?: number;
94
94
  /** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
@@ -133,6 +133,8 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
133
133
  onIdCaptureModelError?: (error: Error) => void;
134
134
  /** Callback function that fires when the selfie capture models fail to load or fail during runtime. */
135
135
  onSelfieCaptureModelError?: (error: Error) => void;
136
+ /** Callback function that fires when the camera access is denied. */
137
+ onCameraAccessDenied?: () => void;
136
138
  /** Boolean or async function indicating whether the user should be prompted to sign the screen before submission. Defaults to `false`. */
137
139
  captureSignature?: boolean | (() => Promise<boolean>);
138
140
  /** Boolean or async function indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to `false`. */
@@ -72,8 +72,6 @@ export interface IdValidationProps extends PropsWithChildren {
72
72
  idCardAutoCaptureScoreThreshold?: number;
73
73
  /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
74
74
  passportAutoCaptureScoreThreshold?: number;
75
- /** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
76
- mrzDetectionScoreThreshold?: number;
77
75
  /** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. */
78
76
  idCardFocusScoreThreshold?: number;
79
77
  /** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
@@ -108,6 +106,8 @@ export interface IdValidationProps extends PropsWithChildren {
108
106
  onUserCancel?: () => void;
109
107
  /** Callback function that fires when the ID capture models fail to load or fail during runtime. */
110
108
  onModelError?: (error: Error) => void;
109
+ /** Callback function that fires when the camera access is denied. */
110
+ onCameraAccessDenied?: () => void;
111
111
  /** Boolean or async function indicating whether the user should be prompted to sign the screen before submission. Defaults to `false`. */
112
112
  captureSignature?: boolean | (() => Promise<boolean>);
113
113
  /** Boolean or async function indicating whether the user should be prompted to record themselves signing the screen before submission. Defaults to `false`. */
@@ -21,6 +21,8 @@ export interface SignatureKYCProps extends PropsWithChildren {
21
21
  onUserCancel?: () => void;
22
22
  /** Callback function that fires when the selfie capture models fail to load or fail during runtime. */
23
23
  onModelError?: (error: Error) => void;
24
+ /** Callback function that fires when the camera access is denied. */
25
+ onCameraAccessDenied?: () => void;
24
26
  /** String indicating which loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
25
27
  loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
26
28
  /** Boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to `false`. */
@@ -75,6 +75,10 @@ export interface VideoIdValidationProps extends PropsWithChildren {
75
75
  onExitAfterFailure?: (resp: SubmissionResponse | null, req: LivenessCheckRequest | null) => void;
76
76
  /** Callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay. */
77
77
  onUserCancel?: () => void;
78
+ /** Callback function that fires when the camera access is denied. */
79
+ onCameraAccessDenied?: () => void;
80
+ /** Callback function that fires when the microphone access is denied. */
81
+ onMicrophoneAccessDenied?: () => void;
78
82
  /** Object containing any overrides for IDValidation. */
79
83
  idCaptureProps?: IdCaptureWizardProps;
80
84
  /** Object containing any overrides for FaceLiveness. */
@@ -1,13 +1,11 @@
1
- import { DetectedObjectBox } from '../../lib/models/DocumentDetection';
2
- export declare const CapturedDocumentTypeValues: readonly ["idCardFront", "idCardBack", "passport", "selfie"];
3
- export type CapturedDocumentType = (typeof CapturedDocumentTypeValues)[number];
4
1
  export type CapturedDocument = {
5
2
  imageData: string;
6
3
  width: number;
7
4
  height: number;
8
- boundingBox?: DetectedObjectBox;
9
- documentType: CapturedDocumentType;
5
+ boundingBox?: number[];
10
6
  };
7
+ export declare const CapturedDocumentTypeValues: readonly ["idCardFront", "idCardBack", "passport", "selfie"];
8
+ export type CapturedDocumentType = (typeof CapturedDocumentTypeValues)[number];
11
9
  export type CapturedDocuments = {
12
10
  [k in CapturedDocumentType]?: CapturedDocument;
13
11
  };
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import { MutableRefObject, ReactElement, ReactNode } from 'react';
3
+ import { ObjectDetector } from '@mediapipe/tasks-vision';
4
+ export declare const visionTasksBasePath = "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm";
5
+ export declare const objectDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240517/model_fp16.tflite";
6
+ export type DetectedObject = {
7
+ box: {
8
+ xMin: number;
9
+ xMax: number;
10
+ yMin: number;
11
+ yMax: number;
12
+ width: number;
13
+ height: number;
14
+ };
15
+ };
16
+ export declare function loadHighPerformanceObjectDetector(modelAssetPath: string, delegate?: 'CPU' | 'GPU', scoreThreshold?: number): Promise<ObjectDetector>;
17
+ type PredictionHandler = (prediction: DetectedObject[]) => void;
18
+ type HighPerformanceSelfieGuidanceModelsState = {
19
+ start: () => void;
20
+ stop: () => void;
21
+ onPredictionMade: (handler: PredictionHandler) => void;
22
+ canvasRef: MutableRefObject<HTMLCanvasElement | null>;
23
+ ready: boolean;
24
+ error: Error | null;
25
+ modelDownloadProgress: number;
26
+ };
27
+ export declare const HighPerformanceObjectDetectionModelsContext: React.Context<HighPerformanceSelfieGuidanceModelsState>;
28
+ export declare const HighPerformanceObjectDetectionModelsProvider: ({ autoStart, children, throttleMs, modelAssetPath, delegate, scoreThreshold, }: {
29
+ autoStart?: boolean | undefined;
30
+ children: ReactNode;
31
+ throttleMs?: number | undefined;
32
+ modelAssetPath?: string | undefined;
33
+ delegate?: "CPU" | "GPU" | undefined;
34
+ scoreThreshold?: number | undefined;
35
+ }) => ReactElement;
36
+ export {};
@@ -40,24 +40,24 @@ export type IdCaptureVerbiage = {
40
40
  export type IdCaptureProps = {
41
41
  requiredDocumentType?: CapturedDocumentType;
42
42
  autoCaptureEnabled?: boolean;
43
- idCardDetectionThreshold?: number;
44
- passportDetectionThreshold?: number;
43
+ autoCaptureScoreThreshold?: number;
44
+ autoCaptureGoodFramesRequired?: number;
45
45
  autoCaptureBarcodeRequired?: boolean | 'mobile';
46
46
  mrzDetectionScoreThreshold?: number;
47
+ passportPageDetectionThreshold?: number;
47
48
  pdf417DetectionThreshold?: number;
48
49
  barcodeScanningEnabled?: boolean;
49
50
  maxBarcodeScanAttempts?: number;
50
- idCardFocusScoreThreshold?: number;
51
- passportFocusScoreThreshold?: number;
51
+ focusScoreThreshold?: number;
52
52
  guidanceMessage?: string;
53
53
  guidanceSatisfied?: boolean;
54
54
  onPrediction?: (prediction: IdCapturePrediction) => void;
55
55
  onBarcodeScanned?: (result: PDF417DetectionResult) => void;
56
- onCapture?: (frame: string, width: number, height: number, documentType: CapturedDocumentType, metadata: CaptureAttemptMetadata) => void;
56
+ onCapture?: (frame: string, width: number, height: number, metadata: CaptureAttemptMetadata) => void;
57
57
  assets?: IdCaptureAssets;
58
58
  classNames?: IdCaptureClassNames;
59
59
  colors?: IdCaptureColors;
60
60
  verbiage?: IdCaptureVerbiage;
61
61
  debugMode?: boolean;
62
62
  };
63
- export declare const IdCapture: ({ requiredDocumentType, autoCaptureEnabled, autoCaptureBarcodeRequired, idCardDetectionThreshold, passportDetectionThreshold, mrzDetectionScoreThreshold, pdf417DetectionThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, barcodeScanningEnabled, maxBarcodeScanAttempts, guidanceMessage, guidanceSatisfied, onPrediction, onCapture, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdCaptureProps) => React.ReactElement;
63
+ export declare const IdCapture: ({ requiredDocumentType, autoCaptureEnabled, autoCaptureScoreThreshold, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, mrzDetectionScoreThreshold, passportPageDetectionThreshold, pdf417DetectionThreshold, focusScoreThreshold, barcodeScanningEnabled, maxBarcodeScanAttempts, guidanceMessage, guidanceSatisfied, onPrediction, onBarcodeScanned, onCapture, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdCaptureProps) => React.ReactElement;
@@ -1,8 +1,7 @@
1
- import React, { ReactElement, ReactNode } from 'react';
2
- import { DetectedObject, DetectedObjectBox, DocumentDetectionThresholds, DocumentType } from '../../lib/models/DocumentDetection';
3
- import { DocumentDetectionModelProviderProps } from './DocumentDetectionModelProvider';
4
- import { FocusModelProviderProps } from './FocusModelProvider';
5
- import { FocusThresholds } from '../../lib/models/Focus';
1
+ import React, { MutableRefObject, ReactElement, ReactNode } from 'react';
2
+ import { DetectedObject, DocumentType } from '../../lib/models/DocumentDetection';
3
+ import { FocusPrediction } from '../../lib/models/Focus';
4
+ import { Frame } from '../../lib/utils/getFrameDimensions';
6
5
  export type IdCapturePrediction = {
7
6
  detectedObjects: DetectedObject[];
8
7
  detectionTime: number;
@@ -15,7 +14,7 @@ export type IdCapturePrediction = {
15
14
  mrzDetectionThresholdMet: boolean;
16
15
  pdf417DetectionScore: number;
17
16
  pdf417DetectionThresholdMet: boolean;
18
- bestDocument: DetectedObject | undefined;
17
+ bestDocumentOrPassport: DetectedObject | undefined;
19
18
  bestMrz: DetectedObject | undefined;
20
19
  bestPdf417: DetectedObject | undefined;
21
20
  documentInBounds: boolean;
@@ -27,40 +26,55 @@ export type IdCapturePrediction = {
27
26
  frameHeight: number;
28
27
  allZero: boolean;
29
28
  };
30
- export type IdCaptureThresholds = DocumentDetectionThresholds & {
31
- focus?: FocusThresholds;
29
+ export type IdCaptureThresholds = {
30
+ document?: number;
31
+ passport?: number;
32
+ mrz?: number;
33
+ pdf417?: number;
34
+ focus?: {
35
+ desktop?: number;
36
+ mobile?: number;
37
+ };
32
38
  };
33
- export type BestFrameDetails = {
34
- boundingBox?: DetectedObjectBox;
35
- documentType: DocumentType;
39
+ export type BestFrame = {
40
+ canvas: HTMLCanvasElement;
41
+ boundingBox?: number[];
36
42
  detectionScore: number;
37
43
  focusScore: number;
38
44
  };
39
- export type BestFrame = BestFrameDetails & {
40
- canvas: HTMLCanvasElement;
41
- };
42
45
  export type IdCaptureModelsState = {
43
46
  ready: boolean;
44
- start: () => void;
45
- stop: () => void;
46
47
  modelDownloadProgress: number;
47
- modelError: Error | null;
48
+ working: MutableRefObject<boolean>;
49
+ idModelError: Error | null;
48
50
  thresholds: IdCaptureThresholds;
49
51
  setThresholds: (value: IdCaptureThresholds) => void;
52
+ makePrediction: (frame: Frame) => void;
50
53
  onPredictionMade: (handler: (prediction: IdCapturePrediction) => void) => void;
51
54
  detectionTime: number;
52
55
  focusPredictionTime: number;
53
- bestFrameDetails: BestFrameDetails | null;
54
- getBestFrame: () => BestFrame | null;
56
+ getBestFrame: () => Promise<BestFrame | null>;
55
57
  resetBestFrame: () => void;
58
+ bestFrameDetectionScore: number;
59
+ bestFrameFocusScore: number;
56
60
  };
57
61
  export declare const IdCaptureModelsContext: React.Context<IdCaptureModelsState>;
58
62
  export type IdCaptureModelsProviderProps = {
59
63
  children: ReactNode;
60
64
  documentDetectionModelUrl?: string | undefined;
61
65
  focusModelUrl?: string | undefined;
66
+ logPredictions?: boolean;
62
67
  onModelError?: (error: Error) => void;
63
68
  modelLoadTimeoutMs?: number;
64
69
  };
65
- export declare function IdCaptureModelsProviderInner({ children, onModelError, }: IdCaptureModelsProviderProps): ReactElement;
66
- export declare function IdCaptureModelsProvider({ children, ...props }: IdCaptureModelsProviderProps & DocumentDetectionModelProviderProps & FocusModelProviderProps): React.JSX.Element;
70
+ export declare const defaultDocumentDetectionModelUrl: string;
71
+ export declare const defaultFocusModelUrl: string;
72
+ export declare const defaultIdCaptureModelLoadTimeoutMs = 45000;
73
+ export declare const IdCaptureModelsProvider: ({ children, documentDetectionModelUrl, focusModelUrl, logPredictions, onModelError, modelLoadTimeoutMs, }: IdCaptureModelsProviderProps) => ReactElement;
74
+ type Canvases = {
75
+ lastPredictionCanvas: HTMLCanvasElement;
76
+ cropCanvas: HTMLCanvasElement;
77
+ rotateCanvas: HTMLCanvasElement;
78
+ };
79
+ export declare function makeFocusPrediction(imageData: Frame, canvases: Canvases, bbox?: number[], logPredictions?: boolean): Promise<[FocusPrediction, number]>;
80
+ export {};
@@ -51,6 +51,7 @@ export type IdCaptureState = {
51
51
  lastFrameCapturedAt: Date | null;
52
52
  frameCaptureRate: number;
53
53
  capturing: boolean;
54
+ captured: boolean;
54
55
  captureFailed: boolean;
55
56
  imageUrl: string | null;
56
57
  captureState: CaptureState;
@@ -59,8 +60,6 @@ export type IdCaptureState = {
59
60
  requestedDocumentType: CapturedDocumentType;
60
61
  detectedDocumentType: DocumentType;
61
62
  differentDocumentTypeDetections: number;
62
- operationStartedAt: Date | null;
63
- captureStartedAt: Date | null;
64
63
  };
65
64
  export type IdCaptureAction = {
66
65
  type: 'configureWizard';
@@ -71,13 +70,12 @@ export type IdCaptureAction = {
71
70
  } | {
72
71
  type: 'configureCapture';
73
72
  payload: {
73
+ requiredDocumentType?: CapturedDocumentType;
74
+ goodFramesThreshold: number;
74
75
  autoCaptureBarcodeRequired: boolean | 'mobile';
75
76
  barcodeScanningEnabled: boolean;
76
77
  maxBarcodeScanAttempts: number;
77
78
  };
78
- } | {
79
- type: 'setRequiredDocumentType';
80
- payload: CapturedDocumentType;
81
79
  } | {
82
80
  type: 'redrawRequested';
83
81
  } | {
@@ -103,8 +101,6 @@ export type IdCaptureAction = {
103
101
  width: number;
104
102
  height: number;
105
103
  };
106
- } | {
107
- type: 'captureStarted';
108
104
  } | {
109
105
  type: 'capturing';
110
106
  } | {
@@ -54,6 +54,7 @@ export type IdCaptureWizardProps = {
54
54
  precapturedDocuments?: CapturedDocuments;
55
55
  captureRequirement?: IdCaptureRequirementOption;
56
56
  autoCaptureEnabled?: boolean;
57
+ autoCaptureGoodFramesRequired?: number;
57
58
  autoCaptureBarcodeRequired?: 'mobile' | boolean;
58
59
  barcodeScanningEnabled?: boolean;
59
60
  idCardAutoCaptureScoreThreshold?: number;
@@ -74,4 +75,4 @@ export type IdCaptureWizardProps = {
74
75
  verbiage?: IdCaptureWizardVerbiage;
75
76
  debugMode?: boolean;
76
77
  };
77
- export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, loadingOverlayMode, precapturedDocuments, captureRequirement, autoCaptureEnabled, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, instructions, releaseCameraAccessOnExit, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, silentFallback, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
78
+ export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, loadingOverlayMode, precapturedDocuments, captureRequirement, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, instructions, releaseCameraAccessOnExit, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, silentFallback, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { MutableRefObject, ReactElement, ReactNode } from 'react';
3
+ import { FaceDetector } from '@mediapipe/tasks-vision';
4
+ export declare const visionTasksBasePath = "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.7/wasm";
5
+ export declare const faceDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/blazeface20240207/blaze_face_short_range.tflite";
6
+ export declare const defaultSelfieCaptureModelLoadTimeoutMs = 45000;
7
+ export type FaceKeypoint = {
8
+ x: number;
9
+ y: number;
10
+ name: string;
11
+ };
12
+ export type Face = {
13
+ keypoints: FaceKeypoint[];
14
+ box: {
15
+ xMin: number;
16
+ xMax: number;
17
+ yMin: number;
18
+ yMax: number;
19
+ width: number;
20
+ height: number;
21
+ };
22
+ };
23
+ export declare function loadHighPerformanceFaceDetector(): Promise<FaceDetector>;
24
+ type PredictionHandler = (prediction: Face[]) => void;
25
+ type HighPerformanceSelfieGuidanceModelsState = {
26
+ start: () => void;
27
+ stop: () => void;
28
+ onPredictionMade: (handler: PredictionHandler) => void;
29
+ canvasRef: MutableRefObject<HTMLCanvasElement | null>;
30
+ ready: boolean;
31
+ error: Error | null;
32
+ modelDownloadProgress: number;
33
+ };
34
+ export declare const HighPerformanceSelfieGuidanceModelsContext: React.Context<HighPerformanceSelfieGuidanceModelsState>;
35
+ export declare const HighPerformanceSelfieGuidanceModelsProvider: ({ autoStart, children, throttleMs, onModelError, modelLoadTimeoutMs, }: {
36
+ autoStart?: boolean | undefined;
37
+ children: ReactNode;
38
+ throttleMs?: number | undefined;
39
+ onModelError?: ((error: Error) => void) | undefined;
40
+ modelLoadTimeoutMs?: number | undefined;
41
+ }) => ReactElement;
42
+ export {};
@@ -1,8 +1,8 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { FaceCaptureGuideOverlayClassNames } from '../face_liveness/FaceCaptureGuideOverlay';
3
+ import { Face } from './HighPerformanceSelfieGuidanceModelsProvider';
3
4
  import { CustomerSuppliedVerbiage } from '../../lib/locales';
4
5
  import { SelfieCaptureFallbackClassNames } from '../fallback_flows/SelfieCapture';
5
- import { Face } from '../../lib/models/FaceDetection';
6
6
  export type SelfieCaptureClassNames = {
7
7
  container?: string;
8
8
  cameraFeed?: string;
@@ -1,23 +1,5 @@
1
- import * as React from 'react';
2
- import { MutableRefObject, ReactElement, ReactNode } from 'react';
3
- import { Face } from '../../lib/models/FaceDetection';
4
- type PredictionHandler = (prediction: Face[]) => void;
5
- type SelfieGuidanceModelsState = {
6
- start: () => void;
7
- stop: () => void;
8
- onPredictionMade: (handler: PredictionHandler) => void;
9
- canvasRef: MutableRefObject<HTMLCanvasElement | null>;
10
- ready: boolean;
11
- error: Error | null;
12
- modelDownloadProgress: number;
13
- };
14
- export declare const SelfieGuidanceModelsContext: React.Context<SelfieGuidanceModelsState>;
1
+ import { ReactElement } from 'react';
15
2
  export type SelfieGuidanceModelsProviderProps = {
16
- autoStart?: boolean;
17
- children: ReactNode;
18
- throttleMs?: number;
19
- onModelError?: (error: Error) => void;
20
- modelLoadTimeoutMs?: number;
3
+ children: ReactElement;
21
4
  };
22
- export declare function SelfieGuidanceModelsProvider({ autoStart, children, throttleMs, onModelError, modelLoadTimeoutMs, }: SelfieGuidanceModelsProviderProps): ReactElement;
23
- export {};
5
+ export declare const SelfieGuidanceModelsProvider: ({ children, }: SelfieGuidanceModelsProviderProps) => ReactElement;
@@ -39,6 +39,8 @@ export type VideoIdWizardProps = {
39
39
  onExitAfterFailure?: (resp: SubmissionResponse | null, req: LivenessCheckRequest | null) => void;
40
40
  onUserCancel?: () => void;
41
41
  onIdCaptureModelError?: (error: Error) => void;
42
+ onCameraAccessDenied?: () => void;
43
+ onMicrophoneAccessDenied?: () => void;
42
44
  idCaptureProps?: IdCaptureWizardProps;
43
45
  faceLivenessProps?: FaceLivenessWizardProps;
44
46
  idCaptureModelsEnabled?: boolean;
@@ -69,4 +71,4 @@ export type VideoIdWizardProps = {
69
71
  verbiage?: VideoIdWizardVerbiage;
70
72
  debugMode?: boolean;
71
73
  };
72
- export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, onIdCaptureModelError, idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardBackDetectionThreshold, idCardFrontFocusThreshold, idCardBackFocusThreshold, goodIdCardFrontFramesThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
74
+ export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, onIdCaptureModelError, onCameraAccessDenied, onMicrophoneAccessDenied, idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardBackDetectionThreshold, idCardFrontFocusThreshold, idCardBackFocusThreshold, goodIdCardFrontFramesThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
@@ -0,0 +1,15 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { Face } from '@tensorflow-models/face-detection';
3
+ import { Frame } from '../lib/utils/getFrameDimensions';
4
+ export type FacesPrediction = {
5
+ image: ImageBitmap;
6
+ faces: Face[];
7
+ };
8
+ export type SelfieGuidanceModelsState = {
9
+ ready: boolean;
10
+ working: MutableRefObject<boolean>;
11
+ makePrediction: (frame: Frame) => void;
12
+ onPredictionMade: (handler: (prediction: FacesPrediction) => void) => void;
13
+ faceDetectionTime: number;
14
+ };
15
+ export declare const SelfieGuidanceModelsContext: import("react").Context<SelfieGuidanceModelsState>;