idmission-web-sdk 0.0.1
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/LICENSE +21 -0
- package/README.md +398 -0
- package/dist/components/CompositeWizard.d.ts +27 -0
- package/dist/components/Example.d.ts +2 -0
- package/dist/components/GuideOrientationProvider.d.ts +4 -0
- package/dist/components/additional_document_capture/AdditionalDocumentCapture.d.ts +17 -0
- package/dist/components/additional_document_capture/AdditionalDocumentCaptureWizard.d.ts +16 -0
- package/dist/components/additional_document_capture/CapturedDocuments.d.ts +8 -0
- package/dist/components/camera/CameraAccessDeniedOverlay.d.ts +4 -0
- package/dist/components/camera/CameraProvider.d.ts +9 -0
- package/dist/components/camera/CameraVideoTag.d.ts +5 -0
- package/dist/components/common/Page.d.ts +12 -0
- package/dist/components/common/cdn.d.ts +1 -0
- package/dist/components/common/overlay.d.ts +790 -0
- package/dist/components/common/spinner.d.ts +261 -0
- package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +29 -0
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +37 -0
- package/dist/components/customer_flows/CustomerIdentification.d.ts +23 -0
- package/dist/components/customer_flows/CustomerVerification.d.ts +22 -0
- package/dist/components/customer_flows/FaceValidation.d.ts +21 -0
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +36 -0
- package/dist/components/customer_flows/IdValidation.d.ts +33 -0
- package/dist/components/customer_flows/SignatureKYC.d.ts +14 -0
- package/dist/components/customer_identification/CustomerIdentificationCapture.d.ts +13 -0
- package/dist/components/customer_identification/CustomerIdentificationFailure.d.ts +11 -0
- package/dist/components/customer_identification/CustomerIdentificationSuccess.d.ts +10 -0
- package/dist/components/customer_identification/CustomerIdentificationWizard.d.ts +33 -0
- package/dist/components/customer_verification/CustomerVerificationCapture.d.ts +13 -0
- package/dist/components/customer_verification/CustomerVerificationFailure.d.ts +11 -0
- package/dist/components/customer_verification/CustomerVerificationSuccess.d.ts +10 -0
- package/dist/components/customer_verification/CustomerVerificationWizard.d.ts +33 -0
- package/dist/components/face_liveness/FaceCaptureGuideOverlay.d.ts +6 -0
- package/dist/components/face_liveness/FaceLivenessCapture.d.ts +16 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts +11 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +10 -0
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts +33 -0
- package/dist/components/id_capture/DocumentCaptureGuideOverlay.d.ts +14 -0
- package/dist/components/id_capture/FlipIdPrompt.d.ts +9 -0
- package/dist/components/id_capture/IdCapture.d.ts +46 -0
- package/dist/components/id_capture/IdCaptureLoadingOverlay.d.ts +13 -0
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +7 -0
- package/dist/components/id_capture/IdCaptureSubmitBtn.d.ts +7 -0
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +18 -0
- package/dist/components/id_capture/IdCaptureWizard.d.ts +56 -0
- package/dist/components/selfie_capture/HighPerformanceSelfieGuidanceModelsProvider.d.ts +34 -0
- package/dist/components/selfie_capture/SelfieCapture.d.ts +20 -0
- package/dist/components/selfie_capture/SelfieCaptureLoadingOverlay.d.ts +12 -0
- package/dist/components/selfie_capture/SelfieGuidanceModelsProvider.d.ts +5 -0
- package/dist/components/signature_capture/SignatureCapture.d.ts +18 -0
- package/dist/components/signature_capture/VideoSignatureCapture.d.ts +9 -0
- package/dist/components/signature_capture/data.d.ts +9 -0
- package/dist/components/signature_kyc/SignatureKYCLoadingOverlay.d.ts +12 -0
- package/dist/components/signature_kyc/SignatureKYCWizard.d.ts +5 -0
- package/dist/components/submission/GeolocationAccessDeniedOverlay.d.ts +5 -0
- package/dist/components/submission/SubmissionProvider.d.ts +16 -0
- package/dist/components/submission/SubmissionSuccess.d.ts +2 -0
- package/dist/contexts/CameraStateContext.d.ts +18 -0
- package/dist/contexts/GuideOrientationContext.d.ts +15 -0
- package/dist/contexts/IdCaptureModelsContext.d.ts +11 -0
- package/dist/contexts/SelfieGuidanceModelsContext.d.ts +14 -0
- package/dist/contexts/SubmissionContext.d.ts +156 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +7 -0
- package/dist/lib/barcode/Native.d.ts +1 -0
- package/dist/lib/barcode/Parse.d.ts +53 -0
- package/dist/lib/barcode/Scan.d.ts +3 -0
- package/dist/lib/barcode/ZXing.d.ts +1 -0
- package/dist/lib/camera/Camera.d.ts +59 -0
- package/dist/lib/camera/hooks.d.ts +9 -0
- package/dist/lib/camera/useVideoRecorder.d.ts +7 -0
- package/dist/lib/locales/en/translation.d.ts +2 -0
- package/dist/lib/locales/es/translation.d.ts +50 -0
- package/dist/lib/locales/index.d.ts +60 -0
- package/dist/lib/models/DocumentDetection.d.ts +27 -0
- package/dist/lib/models/FaceDetection.d.ts +5 -0
- package/dist/lib/models/Focus.d.ts +7 -0
- package/dist/lib/models/preloadModels.d.ts +5 -0
- package/dist/lib/tfworker/Actions.d.ts +29 -0
- package/dist/lib/tfworker/Client.d.ts +14 -0
- package/dist/lib/tfworker/TfWorker.d.ts +8 -0
- package/dist/lib/utils/OffscreenCanvasPolyfill.d.ts +0 -0
- package/dist/lib/utils/cropToShoulders.d.ts +2 -0
- package/dist/lib/utils/dataUrlToBase64.d.ts +3 -0
- package/dist/lib/utils/deviceDetection.d.ts +2 -0
- package/dist/lib/utils/getBlobDimensions.d.ts +1 -0
- package/dist/sdk2.cjs.development.js +13219 -0
- package/dist/sdk2.cjs.development.js.map +1 -0
- package/dist/sdk2.cjs.production.js +2 -0
- package/dist/sdk2.cjs.production.js.map +1 -0
- package/dist/sdk2.esm.js +13167 -0
- package/dist/sdk2.esm.js.map +1 -0
- package/dist/sdk2.umd.development.js +17456 -0
- package/dist/sdk2.umd.development.js.map +1 -0
- package/dist/sdk2.umd.production.js +2 -0
- package/dist/sdk2.umd.production.js.map +1 -0
- package/dist/stories/AdditionalDocumentCapture/AdditionalDocumentCapture.stories.d.ts +18 -0
- package/dist/stories/BarcodeReader.stories.d.ts +7 -0
- package/dist/stories/Camera.stories.d.ts +7 -0
- package/dist/stories/CompositeWizard/FaceLivenessAndIdCapture.stories.d.ts +24 -0
- package/dist/stories/CompositeWizard/IdCaptureAndFaceLiveness.stories.d.ts +24 -0
- package/dist/stories/CustomerFlows/CustomerBiometricsEnrollment.stories.d.ts +30 -0
- package/dist/stories/CustomerFlows/CustomerIdAndBiometricsEnrollment.stories.d.ts +29 -0
- package/dist/stories/CustomerFlows/CustomerIdentification.stories.d.ts +28 -0
- package/dist/stories/CustomerFlows/CustomerVerification.stories.d.ts +29 -0
- package/dist/stories/CustomerFlows/FaceValidation.stories.d.ts +29 -0
- package/dist/stories/CustomerFlows/IdAndFaceValidation.stories.d.ts +28 -0
- package/dist/stories/CustomerFlows/IdValidation.stories.d.ts +30 -0
- package/dist/stories/CustomerFlows/SignatureKYC.stories.d.ts +28 -0
- package/dist/stories/DocumentCaptureGuideOverlay/LicenseBack.stories.d.ts +14 -0
- package/dist/stories/DocumentCaptureGuideOverlay/LicenseFront.stories.d.ts +15 -0
- package/dist/stories/DocumentCaptureGuideOverlay/Passport.stories.d.ts +15 -0
- package/dist/stories/FaceLiveness/Capture.stories.d.ts +21 -0
- package/dist/stories/FaceLiveness/Wizard.stories.d.ts +23 -0
- package/dist/stories/FlipIdPrompt.stories.d.ts +15 -0
- package/dist/stories/FrameLoop.stories.d.ts +7 -0
- package/dist/stories/IdCapture/LicenseBackCapture.stories.d.ts +65 -0
- package/dist/stories/IdCapture/LicenseFrontCapture.stories.d.ts +65 -0
- package/dist/stories/IdCapture/PassportCapture.stories.d.ts +65 -0
- package/dist/stories/IdCapture/Wizard.stories.d.ts +89 -0
- package/dist/stories/MultiCamera.stories.d.ts +7 -0
- package/dist/stories/SignatureCapture/SignatureCapture.stories.d.ts +7 -0
- package/dist/stories/SignatureCapture/VideoSignatureCapture.stories.d.ts +7 -0
- package/dist/stories/TokenGeneration.stories.d.ts +7 -0
- package/dist/stories/VideoCapture.stories.d.ts +7 -0
- package/dist/stories/WebSdkExample.stories.d.ts +7 -0
- package/dist/stories/WebWorker.stories.d.ts +7 -0
- package/dist/stories/models/DocumentDetection.stories.d.ts +7 -0
- package/dist/stories/models/FaceDetection.stories.d.ts +9 -0
- package/dist/stories/models/FocusModel.stories.d.ts +7 -0
- package/dist/stories/models/HighPerformanceFaceDetectionMinimal.stories.d.ts +12 -0
- package/dist/stories/models/HighPerformanceFaceDetectionOriginal.stories.d.ts +7 -0
- package/dist/stories/utils/cdnUrl.d.ts +1 -0
- package/dist/stories/utils/getToken.d.ts +8 -0
- package/dist/stories/utils/makeRandomString.d.ts +1 -0
- package/package.json +130 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
|
+
import { SelfieCaptureVerbiage } from '../selfie_capture/SelfieCapture';
|
|
4
|
+
export type CustomerVerificationAssets = {
|
|
5
|
+
instructionImageUrl?: string;
|
|
6
|
+
failureImageUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
export type CustomerVerificationVerbiage = SelfieCaptureVerbiage & {
|
|
9
|
+
loadingOverlayHeadingText?: string;
|
|
10
|
+
loadingOverlayRemoveEyeCoveringsText?: string;
|
|
11
|
+
loadingOverlayAvoidExcessiveBacklightingText?: string;
|
|
12
|
+
loadingOverlayContinueText?: string;
|
|
13
|
+
loadingOverlayCameraInitializingText?: string;
|
|
14
|
+
loadingOverlayModelsWarmingUpText?: string;
|
|
15
|
+
successHeadingText?: string;
|
|
16
|
+
successRetryBtnText?: string;
|
|
17
|
+
successDoneBtnText?: string;
|
|
18
|
+
failureHeadingText?: string;
|
|
19
|
+
failureRetryBtnText?: string;
|
|
20
|
+
failureExitBtnText?: string;
|
|
21
|
+
};
|
|
22
|
+
export type CustomerVerificationWizardProps = {
|
|
23
|
+
onComplete?: (response: SubmissionResponse) => void;
|
|
24
|
+
onCustomerMatched?: (response: SubmissionResponse) => void;
|
|
25
|
+
onCustomerNotMatched?: (response: SubmissionResponse) => void;
|
|
26
|
+
onExitAfterFailure?: () => void;
|
|
27
|
+
onCaptureGuidanceTimeout?: () => void;
|
|
28
|
+
captureGuidanceTimeoutDurationMs?: number;
|
|
29
|
+
assets?: CustomerVerificationAssets;
|
|
30
|
+
verbiage?: CustomerVerificationVerbiage;
|
|
31
|
+
debugMode?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare const CustomerVerificationWizard: ({ onComplete, onCustomerMatched, onCustomerNotMatched, onExitAfterFailure, onCaptureGuidanceTimeout, captureGuidanceTimeoutDurationMs, assets, verbiage, debugMode, }: CustomerVerificationWizardProps) => ReactElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SelfieCaptureVerbiage } from '../selfie_capture/SelfieCapture';
|
|
3
|
+
export type FaceLivenessCaptureVerbiage = SelfieCaptureVerbiage & {
|
|
4
|
+
guidanceRemoveEyeCoveringsText?: string;
|
|
5
|
+
guidanceRemoveHeadCoveringsText?: string;
|
|
6
|
+
guidanceRemoveMaskText?: string;
|
|
7
|
+
};
|
|
8
|
+
export type FaceLivenessCaptureProps = {
|
|
9
|
+
onCapture?: () => void;
|
|
10
|
+
onSuccess?: (faceCropImageUrl: string) => void;
|
|
11
|
+
onTimeout?: () => void;
|
|
12
|
+
timeoutDurationMs?: number;
|
|
13
|
+
verbiage?: FaceLivenessCaptureVerbiage;
|
|
14
|
+
debugMode?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const FaceLivenessCapture: ({ onCapture, onSuccess, onTimeout, timeoutDurationMs, verbiage, debugMode, }: FaceLivenessCaptureProps) => ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type FaceLivenessFailureProps = {
|
|
3
|
+
headingText?: string;
|
|
4
|
+
retryBtnText?: string;
|
|
5
|
+
exitBtnText?: string;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
canRetry?: boolean;
|
|
8
|
+
onRetryClick?: () => void;
|
|
9
|
+
onExitClick?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const FaceLivenessFailure: ({ headingText, retryBtnText, exitBtnText, imageUrl, canRetry, onRetryClick, onExitClick, }: FaceLivenessFailureProps) => ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type FaceLivenessSuccessProps = {
|
|
3
|
+
headingText?: string;
|
|
4
|
+
retryBtnText?: string;
|
|
5
|
+
doneBtnText?: string;
|
|
6
|
+
imageUrl: string;
|
|
7
|
+
onDoneClick?: () => void;
|
|
8
|
+
onRetryClick?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const FaceLivenessSuccess: ({ headingText, retryBtnText, doneBtnText, imageUrl, onDoneClick, onRetryClick, }: FaceLivenessSuccessProps) => ReactElement;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FaceLivenessCaptureVerbiage } from './FaceLivenessCapture';
|
|
3
|
+
import { SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
4
|
+
export type FaceLivenessAssets = {
|
|
5
|
+
instructionImageUrl?: string;
|
|
6
|
+
failureImageUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
export type FaceLivenessVerbiage = FaceLivenessCaptureVerbiage & {
|
|
9
|
+
loadingOverlayHeadingText?: string;
|
|
10
|
+
loadingOverlayRemoveEyeCoveringsText?: string;
|
|
11
|
+
loadingOverlayAvoidExcessiveBacklightingText?: string;
|
|
12
|
+
loadingOverlayContinueText?: string;
|
|
13
|
+
loadingOverlayCameraInitializingText?: string;
|
|
14
|
+
loadingOverlayModelsWarmingUpText?: string;
|
|
15
|
+
successHeadingText?: string;
|
|
16
|
+
successRetryBtnText?: string;
|
|
17
|
+
successDoneBtnText?: string;
|
|
18
|
+
failureHeadingText?: string;
|
|
19
|
+
failureRetryBtnText?: string;
|
|
20
|
+
failureExitBtnText?: string;
|
|
21
|
+
};
|
|
22
|
+
export type FaceLivenessWizardProps = {
|
|
23
|
+
onComplete?: (submissionResponse: SubmissionResponse | null) => void;
|
|
24
|
+
onSuccess?: (submissionResponse: SubmissionResponse | null) => void;
|
|
25
|
+
onTimeout?: (submissionResponse: SubmissionResponse | null) => void;
|
|
26
|
+
onExitAfterFailure?: (submissionResponse: SubmissionResponse | null) => void;
|
|
27
|
+
timeoutDurationMs?: number;
|
|
28
|
+
maxRetries?: number;
|
|
29
|
+
assets?: FaceLivenessAssets;
|
|
30
|
+
verbiage?: FaceLivenessVerbiage;
|
|
31
|
+
debugMode?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare const FaceLivenessWizard: ({ onComplete, onSuccess, onTimeout, onExitAfterFailure, timeoutDurationMs, maxRetries, debugMode, verbiage, assets, }: FaceLivenessWizardProps) => ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type DocumentCaptureGuideOverlayProps = {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
padding?: number;
|
|
6
|
+
borderWidth?: number;
|
|
7
|
+
borderColor?: string;
|
|
8
|
+
isMirrored?: boolean;
|
|
9
|
+
instruction?: string;
|
|
10
|
+
portraitGuidesImageUrl?: string;
|
|
11
|
+
landscapeGuidesImageUrl?: string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const DocumentCaptureGuideOverlay: ({ width, height, padding, borderWidth, borderColor, isMirrored, instruction, portraitGuidesImageUrl, landscapeGuidesImageUrl, onClick, }: DocumentCaptureGuideOverlayProps) => ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type FlipIdPromptProps = {
|
|
3
|
+
instructionText?: string;
|
|
4
|
+
frontPortraitGuidesImage?: string;
|
|
5
|
+
frontLandscapeGuidesImage?: string;
|
|
6
|
+
backPortraitGuidesImage?: string;
|
|
7
|
+
backLandscapeGuidesImage?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const FlipIdPrompt: ({ instructionText, frontPortraitGuidesImage, frontLandscapeGuidesImage, backPortraitGuidesImage, backLandscapeGuidesImage, }: FlipIdPromptProps) => ReactElement;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../../lib/utils/OffscreenCanvasPolyfill';
|
|
3
|
+
import { DocumentType } from '../../lib/models/DocumentDetection';
|
|
4
|
+
import { PDF417DetectionResult } from '../../lib/barcode/Native';
|
|
5
|
+
import { CaptureAttemptMetadata } from '../../contexts/SubmissionContext';
|
|
6
|
+
export type IdDocumentPrediction = {
|
|
7
|
+
documentDetected: boolean;
|
|
8
|
+
documentType: DocumentType;
|
|
9
|
+
documentScore: number;
|
|
10
|
+
mrzDetected: boolean;
|
|
11
|
+
mrzScore: number;
|
|
12
|
+
focusThresholdMet: boolean;
|
|
13
|
+
focusScore: number;
|
|
14
|
+
};
|
|
15
|
+
export type IdCaptureAssets = {
|
|
16
|
+
portraitGuidesImageUrl?: string;
|
|
17
|
+
landscapeGuidesImageUrl?: string;
|
|
18
|
+
};
|
|
19
|
+
export type IdCaptureVerbiage = {
|
|
20
|
+
instructionText?: string;
|
|
21
|
+
capturingText?: string;
|
|
22
|
+
captureFailedText?: string;
|
|
23
|
+
};
|
|
24
|
+
export type IdCaptureProps = {
|
|
25
|
+
documentDetectionNonMaxSuppressionEnabled: boolean;
|
|
26
|
+
requiredDocumentType?: DocumentType;
|
|
27
|
+
autoCaptureEnabled?: boolean;
|
|
28
|
+
autoCaptureScoreThreshold?: number;
|
|
29
|
+
autoCaptureGoodFramesRequired?: number;
|
|
30
|
+
autoCaptureBarcodeRequired?: boolean | 'mobile';
|
|
31
|
+
mrzDetectionScoreThreshold?: number;
|
|
32
|
+
passportPageDetectionThreshold?: number;
|
|
33
|
+
pdf417DetectionThreshold?: number;
|
|
34
|
+
barcodeScanningEnabled?: boolean;
|
|
35
|
+
maxBarcodeScanAttempts?: number;
|
|
36
|
+
focusScoreThreshold?: number;
|
|
37
|
+
onPrediction?: (prediction: IdDocumentPrediction) => void;
|
|
38
|
+
onBarcodeScanned?: (result: PDF417DetectionResult) => void;
|
|
39
|
+
onCapture?: (frame: string, width: number, height: number, metadata: CaptureAttemptMetadata) => void;
|
|
40
|
+
processingScreen?: React.ReactElement;
|
|
41
|
+
processingDelay?: number;
|
|
42
|
+
assets?: IdCaptureAssets;
|
|
43
|
+
verbiage?: IdCaptureVerbiage;
|
|
44
|
+
debugMode?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare const IdCapture: ({ documentDetectionNonMaxSuppressionEnabled, requiredDocumentType, autoCaptureEnabled, autoCaptureScoreThreshold, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, mrzDetectionScoreThreshold, passportPageDetectionThreshold, pdf417DetectionThreshold, focusScoreThreshold, barcodeScanningEnabled, maxBarcodeScanAttempts, onPrediction, onBarcodeScanned, onCapture, processingScreen, processingDelay, assets, verbiage, debugMode, }: IdCaptureProps) => React.ReactElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type IdCaptureLoadingOverlayProps = {
|
|
3
|
+
headingText?: string;
|
|
4
|
+
useContinuityCameraText?: string;
|
|
5
|
+
modelsWarmingUpText?: string;
|
|
6
|
+
cameraInitializingText?: string;
|
|
7
|
+
cameraAccessBlockedText?: string;
|
|
8
|
+
continueText?: string;
|
|
9
|
+
instructionImageUrl?: string;
|
|
10
|
+
accessBlockedImageUrl?: string;
|
|
11
|
+
onDismissed?: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const IdCaptureLoadingOverlay: ({ headingText, useContinuityCameraText, modelsWarmingUpText, cameraInitializingText, cameraAccessBlockedText, continueText, instructionImageUrl, accessBlockedImageUrl, onDismissed, }: IdCaptureLoadingOverlayProps) => ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export type IdCaptureModelsProviderProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
documentDetectionModelUrl?: string | undefined;
|
|
5
|
+
focusModelUrl?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const IdCaptureModelsProvider: ({ children, documentDetectionModelUrl, focusModelUrl, }: IdCaptureModelsProviderProps) => ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export type IdCaptureSubmitBtnProps = {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const IdCaptureSubmitBtn: ({ disabled, onClick, children, }: IdCaptureSubmitBtnProps) => ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { CapturedDocuments } from '../additional_document_capture/CapturedDocuments';
|
|
3
|
+
import { PDF417DetectionResult } from '../../lib/barcode/Native';
|
|
4
|
+
export type IdCaptureSuccessProps = {
|
|
5
|
+
capturedDocuments: CapturedDocuments;
|
|
6
|
+
barcodeResult?: PDF417DetectionResult | null;
|
|
7
|
+
onSubmitClick?: () => void;
|
|
8
|
+
onRetryClick?: () => void;
|
|
9
|
+
headingText?: string;
|
|
10
|
+
idCardFrontText?: string;
|
|
11
|
+
idCardBackText?: string;
|
|
12
|
+
passportText?: string;
|
|
13
|
+
instructionText?: string;
|
|
14
|
+
retryText?: string;
|
|
15
|
+
submittingText?: string;
|
|
16
|
+
submitText?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const IdCaptureSuccess: ({ capturedDocuments, onSubmitClick, onRetryClick, headingText, idCardFrontText, idCardBackText, passportText, instructionText, retryText, submittingText, submitText, }: IdCaptureSuccessProps) => ReactElement;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type IdCaptureAssets = {
|
|
3
|
+
documentDetectionModelUrl?: string;
|
|
4
|
+
focusModelUrl?: string;
|
|
5
|
+
loadingOverlayInstructionImageUrl?: string;
|
|
6
|
+
idCardFrontPortraitGuidesImageUrl?: string;
|
|
7
|
+
idCardFrontLandscapeGuidesImageUrl?: string;
|
|
8
|
+
idCardBackPortraitGuidesImageUrl?: string;
|
|
9
|
+
idCardBackLandscapeGuidesImageUrl?: string;
|
|
10
|
+
passportPortraitGuidesImageUrl?: string;
|
|
11
|
+
passportLandscapeGuidesImageUrl?: string;
|
|
12
|
+
};
|
|
13
|
+
export type IdCaptureVerbiage = {
|
|
14
|
+
loadingOverlayHeadingText?: string;
|
|
15
|
+
loadingOverlayUseContinuityCameraText?: string;
|
|
16
|
+
loadingOverlayModelsWarmingUpText?: string;
|
|
17
|
+
loadingOverlayCameraInitializingText?: string;
|
|
18
|
+
loadingOverlayCameraAccessBlockedText?: string;
|
|
19
|
+
loadingOverlayContinueText?: string;
|
|
20
|
+
idCardFrontInstructionText?: string;
|
|
21
|
+
idCardBackInstructionText?: string;
|
|
22
|
+
passportInstructionText?: string;
|
|
23
|
+
flipIdInstructionText?: string;
|
|
24
|
+
capturingText?: string;
|
|
25
|
+
captureFailedText?: string;
|
|
26
|
+
successHeadingText?: string;
|
|
27
|
+
successIdCardFrontText?: string;
|
|
28
|
+
successIdCardBackText?: string;
|
|
29
|
+
successPassportText?: string;
|
|
30
|
+
successInstructionText?: string;
|
|
31
|
+
successRetryText?: string;
|
|
32
|
+
successSubmittingText?: string;
|
|
33
|
+
successSubmitText?: string;
|
|
34
|
+
};
|
|
35
|
+
export type IdCaptureSubmission = {
|
|
36
|
+
idFrontImage: string | null;
|
|
37
|
+
idBackImage: string | null;
|
|
38
|
+
passportImage: string | null;
|
|
39
|
+
};
|
|
40
|
+
export type IdCaptureWizardProps = {
|
|
41
|
+
onSuccess?: (submission: IdCaptureSubmission) => void;
|
|
42
|
+
documentDetectionNonMaxSuppressionEnabled?: boolean;
|
|
43
|
+
autoCaptureEnabled?: boolean;
|
|
44
|
+
autoCaptureGoodFramesRequired?: number;
|
|
45
|
+
autoCaptureBarcodeRequired?: 'mobile' | boolean;
|
|
46
|
+
barcodeScanningEnabled?: boolean;
|
|
47
|
+
idCardAutoCaptureScoreThreshold?: number;
|
|
48
|
+
passportAutoCaptureScoreThreshold?: number;
|
|
49
|
+
mrzDetectionScoreThreshold?: number;
|
|
50
|
+
idCardFocusScoreThreshold?: number;
|
|
51
|
+
passportFocusScoreThreshold?: number;
|
|
52
|
+
verbiage?: IdCaptureVerbiage;
|
|
53
|
+
assets?: IdCaptureAssets;
|
|
54
|
+
debugMode?: boolean;
|
|
55
|
+
};
|
|
56
|
+
export declare const IdCaptureWizard: ({ onSuccess, documentDetectionNonMaxSuppressionEnabled, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, assets, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { FaceDetector } from '@mediapipe/tasks-vision';
|
|
4
|
+
export type Face = {
|
|
5
|
+
keypoints: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
name: string;
|
|
9
|
+
}[];
|
|
10
|
+
box: {
|
|
11
|
+
xMin: number;
|
|
12
|
+
xMax: number;
|
|
13
|
+
yMin: number;
|
|
14
|
+
yMax: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare function loadHighPerformanceFaceDetector(): Promise<FaceDetector>;
|
|
20
|
+
type PredictionHandler = (prediction: Face[]) => void;
|
|
21
|
+
type HighPerformanceSelfieGuidanceModelsState = {
|
|
22
|
+
start: () => void;
|
|
23
|
+
stop: () => void;
|
|
24
|
+
onPredictionMade: (handler: PredictionHandler) => void;
|
|
25
|
+
canvasRef: MutableRefObject<HTMLCanvasElement | null>;
|
|
26
|
+
ready: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare const HighPerformanceSelfieGuidanceModelsContext: React.Context<HighPerformanceSelfieGuidanceModelsState>;
|
|
29
|
+
export declare const HighPerformanceSelfieGuidanceModelsProvider: ({ autoStart, children, throttleMs, }: {
|
|
30
|
+
autoStart?: boolean | undefined;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
throttleMs?: number | undefined;
|
|
33
|
+
}) => ReactElement;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Face } from './HighPerformanceSelfieGuidanceModelsProvider';
|
|
3
|
+
export type SelfieCaptureVerbiage = {
|
|
4
|
+
guidanceHoldStillText?: string;
|
|
5
|
+
guidanceLookStraightText?: string;
|
|
6
|
+
guidanceMoveBackText?: string;
|
|
7
|
+
guidanceMoveForwardText?: string;
|
|
8
|
+
guidanceMoveToCenterText?: string;
|
|
9
|
+
};
|
|
10
|
+
export type SelfieCaptureProps = {
|
|
11
|
+
onGuidanceSatisfied?: () => void;
|
|
12
|
+
onGuidanceNotSatisfied?: () => void;
|
|
13
|
+
onSelfieCaptured?: (frame: ImageBitmap, face: Face) => void;
|
|
14
|
+
onTimeout?: () => void;
|
|
15
|
+
timeoutDurationMs?: number;
|
|
16
|
+
guidanceMessage?: string;
|
|
17
|
+
verbiage?: SelfieCaptureVerbiage;
|
|
18
|
+
debugMode?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const SelfieCapture: ({ onGuidanceSatisfied, onGuidanceNotSatisfied, onSelfieCaptured, onTimeout, timeoutDurationMs, guidanceMessage, verbiage, debugMode, }: SelfieCaptureProps) => ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type SelfieCaptureLoadingOverlayProps = {
|
|
3
|
+
headingText?: string;
|
|
4
|
+
removeEyeCoveringsText?: string;
|
|
5
|
+
avoidExcessiveBacklightingText?: string;
|
|
6
|
+
continueText?: string;
|
|
7
|
+
cameraInitializingText?: string;
|
|
8
|
+
modelsWarmingUpText?: string;
|
|
9
|
+
instructionImageUrl?: string;
|
|
10
|
+
onDismissed?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const SelfieCaptureLoadingOverlay: ({ headingText, removeEyeCoveringsText, avoidExcessiveBacklightingText, continueText, cameraInitializingText, modelsWarmingUpText, instructionImageUrl, onDismissed, }: SelfieCaptureLoadingOverlayProps) => ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SignatureData } from './data';
|
|
3
|
+
export type NamespacedSignatureCaptureVerbiage = {
|
|
4
|
+
signatureCaptureHeadingText?: string;
|
|
5
|
+
signatureCaptureAcceptBtnText?: string;
|
|
6
|
+
signatureCaptureClearBtnText?: string;
|
|
7
|
+
};
|
|
8
|
+
export type SignatureCaptureVerbiage = {
|
|
9
|
+
headingText?: string;
|
|
10
|
+
acceptBtnText?: string;
|
|
11
|
+
clearBtnText?: string;
|
|
12
|
+
};
|
|
13
|
+
export type SignatureCaptureProps = {
|
|
14
|
+
onAccept?: (signatureData: SignatureData, imageData: string) => void;
|
|
15
|
+
background?: string;
|
|
16
|
+
verbiage?: SignatureCaptureVerbiage;
|
|
17
|
+
};
|
|
18
|
+
export declare const SignatureCapture: ({ onAccept, background, verbiage, }: SignatureCaptureProps) => React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SignatureData } from './data';
|
|
3
|
+
import { SignatureCaptureVerbiage } from './SignatureCapture';
|
|
4
|
+
export type VideoSignatureCaptureProps = {
|
|
5
|
+
onComplete?: (signatureData: SignatureData, imageData: string) => void;
|
|
6
|
+
onFaceNotDetected?: () => void;
|
|
7
|
+
verbiage?: SignatureCaptureVerbiage;
|
|
8
|
+
};
|
|
9
|
+
export declare const VideoSignatureCapture: ({ onComplete, onFaceNotDetected, verbiage, }: VideoSignatureCaptureProps) => React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ReactSignatureCanvas from 'react-signature-canvas';
|
|
2
|
+
export type SignatureData = {
|
|
3
|
+
clickX_simple: number[][];
|
|
4
|
+
clickY_simple: number[][];
|
|
5
|
+
time_simple: string[][];
|
|
6
|
+
pressure: string;
|
|
7
|
+
fileContent: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function signatureDataToIdmissionFormat(signatureCanvas: ReactSignatureCanvas): SignatureData;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export type SignatureKYCLoadingOverlayProps = {
|
|
3
|
+
headingText?: string;
|
|
4
|
+
removeEyeCoveringsText?: string;
|
|
5
|
+
avoidExcessiveBacklightingText?: string;
|
|
6
|
+
continueText?: string;
|
|
7
|
+
cameraInitializingText?: string;
|
|
8
|
+
modelsWarmingUpText?: string;
|
|
9
|
+
instructionImageUrl?: string;
|
|
10
|
+
onDismissed?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const SignatureKYCLoadingOverlay: ({ headingText, removeEyeCoveringsText, avoidExcessiveBacklightingText, continueText, cameraInitializingText, modelsWarmingUpText, instructionImageUrl, onDismissed, }: SignatureKYCLoadingOverlayProps) => ReactElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SubmissionAction, SubmissionEnvironment, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
|
+
export type SubmissionProviderProps = {
|
|
4
|
+
action: SubmissionAction;
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
token: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
environment?: SubmissionEnvironment;
|
|
9
|
+
enrollmentId?: string;
|
|
10
|
+
geolocationEnabled?: boolean;
|
|
11
|
+
geolocationRequired?: boolean;
|
|
12
|
+
onBeforeSubmit?: (request: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
13
|
+
onResponseReceived?: (response: SubmissionResponse) => void;
|
|
14
|
+
onRequestFailure?: (err: Error) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const SubmissionProvider: ({ action, children, url, environment, token, enrollmentId, geolocationEnabled, geolocationRequired, onBeforeSubmit, onResponseReceived, onRequestFailure, }: SubmissionProviderProps) => ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Camera } from '../lib/camera/Camera';
|
|
3
|
+
export type CameraState = {
|
|
4
|
+
videoRef: MutableRefObject<HTMLVideoElement | null>;
|
|
5
|
+
videoLoaded: boolean;
|
|
6
|
+
setVideoLoaded: (value: boolean) => void;
|
|
7
|
+
cameraRef: MutableRefObject<Camera | null>;
|
|
8
|
+
cameraReady: boolean;
|
|
9
|
+
cameraAccessDenied: boolean;
|
|
10
|
+
retryCameraAccess: () => void;
|
|
11
|
+
releaseCameraAccess: () => void;
|
|
12
|
+
iphoneContinuityCameraAvailable: boolean;
|
|
13
|
+
iphoneContinuityCameraAllowed: boolean;
|
|
14
|
+
setIphoneContinuityCameraAllowed: (value: boolean) => void;
|
|
15
|
+
grabFrame: () => Promise<ImageBitmap | null>;
|
|
16
|
+
takePhoto: () => Promise<Blob | null>;
|
|
17
|
+
};
|
|
18
|
+
export declare const CameraStateContext: import("react").Context<CameraState>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RefCallback, SyntheticEvent } from 'react';
|
|
2
|
+
export type GuideOrientationState = {
|
|
3
|
+
orientation: 'portrait' | 'landscape';
|
|
4
|
+
wrapperWidth: number;
|
|
5
|
+
wrapperHeight: number;
|
|
6
|
+
wrapperAspectRatio: number;
|
|
7
|
+
imageAspectRatio: number;
|
|
8
|
+
wrapperRef: RefCallback<HTMLDivElement>;
|
|
9
|
+
setDimensions: (dimensions: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}) => void;
|
|
13
|
+
onImageLoaded: (e: SyntheticEvent) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const GuideOrientationContext: import("react").Context<GuideOrientationState>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Prediction } from '../lib/tfworker/Actions';
|
|
3
|
+
export type IdCaptureModelsState = {
|
|
4
|
+
ready: boolean;
|
|
5
|
+
working: MutableRefObject<boolean>;
|
|
6
|
+
makePrediction: (frame: ImageBitmap | Blob | HTMLVideoElement | HTMLImageElement) => void;
|
|
7
|
+
onPredictionMade: (handler: (prediction: Prediction) => void) => void;
|
|
8
|
+
documentDetectionPredictionTime: number;
|
|
9
|
+
focusPredictionTime: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const IdCaptureModelsContext: import("react").Context<IdCaptureModelsState>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Face } from '@tensorflow-models/face-detection';
|
|
3
|
+
export type FacesPrediction = {
|
|
4
|
+
image: ImageBitmap;
|
|
5
|
+
faces: Face[];
|
|
6
|
+
};
|
|
7
|
+
export type SelfieGuidanceModelsState = {
|
|
8
|
+
ready: boolean;
|
|
9
|
+
working: MutableRefObject<boolean>;
|
|
10
|
+
makePrediction: (frame: ImageBitmap | Blob | HTMLVideoElement | HTMLImageElement) => void;
|
|
11
|
+
onPredictionMade: (handler: (prediction: FacesPrediction) => void) => void;
|
|
12
|
+
faceDetectionTime: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const SelfieGuidanceModelsContext: import("react").Context<SelfieGuidanceModelsState>;
|