idmission-web-sdk 1.0.138 → 1.0.139

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.
@@ -1,4 +1,4 @@
1
- import React, { ReactElement } from 'react';
1
+ import React, { ReactElement, ReactNode } from 'react';
2
2
  import { DetectedObject } from '../../lib/models/DocumentDetection';
3
3
  import { Face, FaceKeypoint } from '../selfie_capture/HighPerformanceSelfieGuidanceModelsProvider';
4
4
  export declare const DebugStatsPane: import("styled-components").IStyledComponent<"web", {
@@ -273,7 +273,7 @@ export declare const DebugStatsPane: import("styled-components").IStyledComponen
273
273
  onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
274
274
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
275
275
  }>;
276
- export declare const ObjectDetectionDebugOverlay: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
276
+ export declare const ObjectDetectionDebugOverlayDiv: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
277
277
  $flipX?: boolean | undefined;
278
278
  }>>;
279
279
  export declare const ObjectDetectionDebugBox: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
@@ -302,13 +302,18 @@ export declare function useDebugScalingDetails({ enabled, pageWidth, pageHeight,
302
302
  videoWidth: number;
303
303
  videoHeight: number;
304
304
  }): DebugScalingDetails;
305
+ export declare const DebugBoundingBoxOverlay: ({ scaling, $flipX, children, }: {
306
+ scaling?: DebugScalingDetails | undefined;
307
+ $flipX?: boolean | undefined;
308
+ children: ReactNode;
309
+ }) => React.JSX.Element;
305
310
  export type DetectedObjectDebugBoxProps = {
306
311
  obj: DetectedObject;
307
312
  scaling: DebugScalingDetails;
308
313
  flipX?: boolean;
309
314
  color?: string;
310
315
  };
311
- export declare function IdCaptureDetectedObjectDebugBox({ obj, flipX, color, scaling: { horizontal, pageWidth, pageHeight, scaledWidth, scaledHeight, xOffset, yOffset, }, }: DetectedObjectDebugBoxProps): ReactElement;
316
+ export declare function IdCaptureDetectedObjectDebugBox({ obj, flipX, color, scaling: { horizontal, pageWidth, videoWidth, pageHeight, videoHeight }, }: DetectedObjectDebugBoxProps): ReactElement;
312
317
  export type SelfieCaptureFaceDebugBoxProps = {
313
318
  face: Face;
314
319
  scaling: DebugScalingDetails;
@@ -3,7 +3,7 @@ import { ThemeInput } from '../../themes';
3
3
  import { LangOption } from '../../lib/locales';
4
4
  import { SubmissionRequest } from '../../contexts/SubmissionContext';
5
5
  import { DocumentCaptureWizardClassNames } from '../document_capture/DocumentCaptureWizard';
6
- import { CameraFeedMode } from '../document_capture/DocumentCaptureScreen';
6
+ import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
7
7
  export type DocumentCaptureClassNames = DocumentCaptureWizardClassNames;
8
8
  export interface DocumentCaptureProps extends PropsWithChildren {
9
9
  /** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
@@ -9,6 +9,7 @@ import { VideoSignatureClassNames, VideoSignatureColors, VideoSignatureVerbiage
9
9
  import { ThemeInput } from '../../themes';
10
10
  import { IdCaptureRequirementOption } from '../id_capture/IdCaptureRequirementOption';
11
11
  import { CapturedDocuments } from '../id_capture/CapturedDocuments';
12
+ import { IdCaptureGuideType } from '../id_capture/IdCapture';
12
13
  export type IdValidationAssets = IdCaptureWizardAssets;
13
14
  export type IdValidationClassNames = IdCaptureWizardClassNames & {
14
15
  additionalDocumentCapture?: AdditionalDocumentCaptureWizardClassNames;
@@ -76,6 +77,8 @@ export interface IdValidationProps extends PropsWithChildren {
76
77
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
77
78
  /** React element or string to render on the instructions screen. */
78
79
  instructions?: ReactNode;
80
+ /** String to indicate what type of guides to use during capture. Using `fit` is highly recommended in order to capture the best quality image. Valid values: `fit`, `overlay`. Defaults to `fit`. */
81
+ guideType?: IdCaptureGuideType;
79
82
  /** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack , `passport`.*/
80
83
  precapturedDocuments?: CapturedDocuments;
81
84
  /** Callback function that fires immediately prior to submission, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The submission request is passed in as a parameter and a promise resolving to the updated request should be returned. */
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- export type CameraFeedMode = 'snapToGuides' | 'fullscreen';
2
+ import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
3
3
  export type DocumentCaptureScreenClassNames = {
4
4
  container?: string;
5
5
  cameraFeed?: string;
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { CameraFeedMode, DocumentCaptureScreenClassNames } from './DocumentCaptureScreen';
2
+ import { DocumentCaptureScreenClassNames } from './DocumentCaptureScreen';
3
+ import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
3
4
  export type DocumentCaptureWizardClassNames = DocumentCaptureScreenClassNames;
4
5
  export type DocumentCaptureWizardProps = {
5
6
  onSuccess?: () => void;
@@ -1,18 +1,19 @@
1
1
  import React from 'react';
2
- import { IdCaptureGuideOverlayClassNames } from './IdCaptureGuideOverlay';
3
2
  import { PDF417DetectionResult } from '../../lib/barcode/Native';
4
3
  import { CaptureAttemptMetadata } from '../../contexts/SubmissionContext';
5
4
  import { IdCapturePrediction } from './IdCaptureModelsProvider';
6
5
  import { IdCaptureImagePreviewClassNames } from '../common/SelfieProgressPreview';
7
6
  import { CustomerSuppliedVerbiage } from '../../lib/locales';
8
7
  import { CapturedDocumentType } from './CapturedDocuments';
8
+ import { IdCaptureFitGuideClassNames } from './IdCaptureFitGuide';
9
+ export type IdCaptureGuideType = 'fit' | 'overlay';
9
10
  export type IdCaptureAssets = {
10
11
  portraitGuidesImageUrl?: string;
11
12
  landscapeGuidesImageUrl?: string;
12
13
  };
13
14
  export type IdCaptureClassNames = {
14
15
  container?: string;
15
- guides?: IdCaptureGuideOverlayClassNames;
16
+ guides?: IdCaptureFitGuideClassNames;
16
17
  guidanceMessageContainer?: string;
17
18
  guidanceMessage?: string;
18
19
  imagePreview?: IdCaptureImagePreviewClassNames;
@@ -48,6 +49,7 @@ export type IdCaptureProps = {
48
49
  barcodeScanningEnabled?: boolean;
49
50
  maxBarcodeScanAttempts?: number;
50
51
  focusScoreThreshold?: number;
52
+ guideType?: IdCaptureGuideType;
51
53
  guidanceMessage?: string;
52
54
  guidanceSatisfied?: boolean;
53
55
  onPrediction?: (prediction: IdCapturePrediction) => void;
@@ -62,4 +64,4 @@ export type IdCaptureProps = {
62
64
  verbiage?: IdCaptureVerbiage;
63
65
  debugMode?: boolean;
64
66
  };
65
- export declare const IdCapture: ({ requiredDocumentType, autoCaptureEnabled, autoCaptureScoreThreshold, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, mrzDetectionScoreThreshold, passportPageDetectionThreshold, pdf417DetectionThreshold, focusScoreThreshold, barcodeScanningEnabled, maxBarcodeScanAttempts, guidanceMessage, guidanceSatisfied, onPrediction, onBarcodeScanned, onCapture, onExit, processingScreen, processingDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdCaptureProps) => React.ReactElement;
67
+ export declare const IdCapture: ({ requiredDocumentType, autoCaptureEnabled, autoCaptureScoreThreshold, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, mrzDetectionScoreThreshold, passportPageDetectionThreshold, pdf417DetectionThreshold, focusScoreThreshold, barcodeScanningEnabled, maxBarcodeScanAttempts, guideType, guidanceMessage, guidanceSatisfied, onPrediction, onBarcodeScanned, onCapture, onExit, processingScreen, processingDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdCaptureProps) => React.ReactElement;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { IdCaptureGuideOverlayClassNames } from './IdCaptureGuideOverlay';
3
+ export type IdCaptureFitGuideClassNames = IdCaptureGuideOverlayClassNames & {
4
+ canvasWrapper?: string;
5
+ canvas?: string;
6
+ };
7
+ export type IdCaptureFitGuideProps = {
8
+ aspectRatio?: number;
9
+ maskColor?: string;
10
+ borderRadius?: number;
11
+ borderColor?: string;
12
+ borderWidth?: number;
13
+ padding?: number;
14
+ imageUrl?: string;
15
+ isMirrored?: boolean;
16
+ instruction?: string;
17
+ classNames?: IdCaptureFitGuideClassNames;
18
+ };
19
+ export declare const IdCaptureFitGuide: ({ aspectRatio, maskColor, borderRadius, borderColor, borderWidth, padding, imageUrl, isMirrored, instruction, classNames, }: IdCaptureFitGuideProps) => React.JSX.Element;
@@ -546,6 +546,7 @@ export declare const GuideCenterRow: import("styled-components").IStyledComponen
546
546
  export declare const GuideRegion: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
547
547
  $minWidth?: number | undefined;
548
548
  $minHeight?: number | undefined;
549
+ $maskColor?: string | undefined;
549
550
  }>>;
550
551
  export declare const GuideCenterRegion: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
551
552
  $isMirrored?: boolean | undefined;
@@ -853,10 +854,11 @@ export type IdCaptureGuideOverlayProps = {
853
854
  imagePadding?: number;
854
855
  borderWidth?: number;
855
856
  borderColor?: string;
857
+ maskColor?: string;
856
858
  isMirrored?: boolean;
857
859
  instruction?: string;
858
860
  portraitGuidesImageUrl?: string;
859
861
  landscapeGuidesImageUrl?: string;
860
862
  onClick?: () => void;
861
863
  };
862
- export declare const IdCaptureGuideOverlay: ({ classNames, width, height, padding: userSuppliedPadding, imagePadding: userSuppliedImagePadding, borderWidth, borderColor, isMirrored, instruction, portraitGuidesImageUrl, landscapeGuidesImageUrl, onClick, }: IdCaptureGuideOverlayProps) => ReactElement;
864
+ export declare const IdCaptureGuideOverlay: ({ classNames, width, height, padding: userSuppliedPadding, imagePadding: userSuppliedImagePadding, borderWidth, borderColor, maskColor, isMirrored, instruction, portraitGuidesImageUrl, landscapeGuidesImageUrl, onClick, }: IdCaptureGuideOverlayProps) => ReactElement;
@@ -0,0 +1,39 @@
1
+ import React, { Dispatch, ReactNode } from 'react';
2
+ export type IdCaptureState = {
3
+ initialDrawComplete: boolean;
4
+ redrawing: boolean;
5
+ guideRectX: number;
6
+ guideRectY: number;
7
+ guideRectWidth: number;
8
+ guideRectHeight: number;
9
+ guideRectOffsetTop: number;
10
+ guideImageWidth: number;
11
+ guideImageHeight: number;
12
+ };
13
+ export type IdCaptureAction = {
14
+ type: 'redrawRequested';
15
+ } | {
16
+ type: 'redrawInProgress';
17
+ } | {
18
+ type: 'redrawCompleted';
19
+ payload: {
20
+ guideRectX: number;
21
+ guideRectY: number;
22
+ guideRectWidth: number;
23
+ guideRectHeight: number;
24
+ guideRectOffsetTop: number;
25
+ };
26
+ } | {
27
+ type: 'guideImageLoaded';
28
+ payload: {
29
+ width: number;
30
+ height: number;
31
+ };
32
+ };
33
+ export type IdCaptureDispatch = Dispatch<IdCaptureAction>;
34
+ export declare const IdCaptureStateContext: React.Context<IdCaptureState>;
35
+ export declare const IdCaptureDispatchContext: React.Context<IdCaptureDispatch>;
36
+ export declare const IdCaptureStateProvider: ({ children, }: {
37
+ children: ReactNode;
38
+ }) => React.JSX.Element;
39
+ export declare const useIdCaptureState: () => [IdCaptureState, IdCaptureDispatch];
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
- import { IdCaptureAssets, IdCaptureClassNames, IdCaptureColors, IdCaptureVerbiage } from './IdCapture';
2
+ import { IdCaptureAssets, IdCaptureClassNames, IdCaptureColors, IdCaptureGuideType, IdCaptureVerbiage } from './IdCapture';
3
3
  import { IdCaptureLoadingOverlayAssets, IdCaptureLoadingOverlayClassNames, IdCaptureLoadingOverlayColors, IdCaptureLoadingOverlayVerbiage } from './IdCaptureLoadingOverlay';
4
4
  import { FlipIdPromptAssets, FlipIdPromptClassNames, FlipIdPromptVerbiage } from './FlipIdPrompt';
5
5
  import { CapturedDocuments } from './CapturedDocuments';
@@ -61,10 +61,11 @@ export type IdCaptureWizardProps = {
61
61
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
62
62
  instructions?: ReactNode;
63
63
  releaseCameraAccessOnExit?: boolean;
64
+ guideType?: IdCaptureGuideType;
64
65
  assets?: IdCaptureWizardAssets;
65
66
  classNames?: IdCaptureWizardClassNames;
66
67
  colors?: IdCaptureWizardColors;
67
68
  verbiage?: IdCaptureWizardVerbiage;
68
69
  debugMode?: boolean;
69
70
  };
70
- export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, precapturedDocuments, captureRequirement, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, instructions, releaseCameraAccessOnExit, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
71
+ export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, precapturedDocuments, captureRequirement, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, instructions, releaseCameraAccessOnExit, guideType, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export type CameraFeedMode = 'snapToGuides' | 'fullscreen';
3
+ export declare const CameraFeedWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
+ $mode: CameraFeedMode;
5
+ $x: number;
6
+ $y: number;
7
+ $w: number;
8
+ $h: number;
9
+ }>>;
@@ -0,0 +1,2 @@
1
+ export declare function setCanvasDimensions(canvas: HTMLCanvasElement, width: number, height: number): void;
2
+ export declare function resetCanvasDimensions(canvas: HTMLCanvasElement): void;