@regulaforensics/vp-frontend-document-components 1.2.0 → 2.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/README.md +660 -81
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +41 -0
- package/esm/main.js +2 -0
- package/esm/main.js.LICENSE.txt +41 -0
- package/lib/common/BackCameraIcon.d.ts +6 -0
- package/lib/common/Button.d.ts +7 -0
- package/lib/common/CameraChangeIcon.d.ts +6 -0
- package/lib/common/CameraIcon.d.ts +6 -0
- package/lib/common/CheckIcon.d.ts +6 -0
- package/lib/common/CrossIcon.d.ts +6 -0
- package/lib/common/DocReaderCameraDisabled.d.ts +5 -0
- package/lib/common/DocReaderCameraPreparing.d.ts +5 -0
- package/lib/common/DocReaderFlip.d.ts +5 -0
- package/lib/common/DocReaderProcessing.d.ts +5 -0
- package/lib/common/DocReaderProcessingError.d.ts +5 -0
- package/lib/common/DocReaderProcessingFinished.d.ts +6 -0
- package/lib/common/DocReaderSearch.d.ts +5 -0
- package/lib/common/ErrorIcon.d.ts +6 -0
- package/lib/common/FromCameraIcon.d.ts +5 -0
- package/lib/common/FromGalleryIcon.d.ts +5 -0
- package/lib/common/FrontCameraIcon.d.ts +6 -0
- package/lib/common/FullscreenExitIcon.d.ts +6 -0
- package/lib/common/FullscreenIcon.d.ts +6 -0
- package/lib/common/Icon.d.ts +7 -0
- package/lib/common/InstructionIconFaceDetection.d.ts +5 -0
- package/lib/common/InstructionIconFaceLiveness.d.ts +5 -0
- package/lib/common/Message.d.ts +7 -0
- package/lib/common/NoGlareIcon.d.ts +5 -0
- package/lib/common/NoSmilingIcon.d.ts +5 -0
- package/lib/common/RegulaLogo.d.ts +6 -0
- package/lib/common/SnapshotIcon.d.ts +6 -0
- package/lib/common/Spinner.d.ts +3 -0
- package/lib/common/SquareIcon.d.ts +6 -0
- package/lib/common/StopIcon.d.ts +6 -0
- package/lib/common/VerifiedIcon.d.ts +6 -0
- package/lib/components/CameraCapture.d.ts +9 -0
- package/lib/components/CameraSnapshot.d.ts +2 -0
- package/lib/components/CameraSnapshotFileCapture.d.ts +10 -0
- package/lib/components/DocumentCapture.d.ts +10 -0
- package/lib/components/DocumentFullScreenOverlay.d.ts +11 -0
- package/lib/components/DocumentReader.d.ts +2 -0
- package/lib/components/DocumentReaderFileCapture.d.ts +12 -0
- package/lib/components/DocumentReaderLayout.d.ts +22 -0
- package/lib/components/DocumentReaderStartScreen.d.ts +10 -0
- package/lib/components/ErrorBoundary.d.ts +18 -0
- package/lib/components/FaceCapture.d.ts +15 -0
- package/lib/components/FaceDetection.d.ts +2 -0
- package/lib/components/FaceFullScreenOverlay.d.ts +11 -0
- package/lib/components/FaceLayout.d.ts +18 -0
- package/lib/components/FaceLiveness.d.ts +2 -0
- package/lib/components/InfoScreen.d.ts +10 -0
- package/lib/components/InstructionScreen.d.ts +9 -0
- package/lib/components/ProcessScreen.d.ts +6 -0
- package/lib/components/RetryScreen.d.ts +7 -0
- package/lib/components/WebCamera.d.ts +19 -0
- package/lib/constants.d.ts +568 -0
- package/lib/contexts/DocumentAttributesContext.d.ts +24 -0
- package/lib/contexts/DocumentSDKContext.d.ts +6 -0
- package/lib/contexts/FaceAttributesContext.d.ts +21 -0
- package/lib/hoc/withDocumentAttributesContext.d.ts +4 -0
- package/lib/hoc/withDocumentSDKContext.d.ts +3 -0
- package/lib/hoc/withFaceAttributesContext.d.ts +4 -0
- package/lib/hoc/withLocalize.d.ts +7 -0
- package/lib/hooks/useDocumentReaderSeries.d.ts +25 -0
- package/lib/hooks/useDocumentReaderSingle.d.ts +15 -0
- package/lib/hooks/useFaceLiveness.d.ts +30 -0
- package/lib/hooks/useImageInputParam.d.ts +9 -0
- package/lib/hooks/useOrientationChange.d.ts +10 -0
- package/lib/hooks/useStream.d.ts +10 -0
- package/lib/hooks/useUserAgent.d.ts +3 -0
- package/lib/hooks/useWindowBlur.d.ts +2 -0
- package/lib/i18n/dictionaries/_dictionaries.d.ts +2115 -0
- package/lib/index-document.d.ts +5 -0
- package/lib/models/CameraModel.d.ts +9 -0
- package/lib/models/CustomError.d.ts +7 -0
- package/lib/models/ImageModel.d.ts +7 -0
- package/lib/services/DebugService.d.ts +13 -0
- package/lib/services/DocumentReaderProcessor.d.ts +53 -0
- package/lib/services/DocumentReaderService.d.ts +44 -0
- package/lib/services/EventEmitter.d.ts +9 -0
- package/lib/services/FaceLivenessService.d.ts +43 -0
- package/lib/services/FaceService.d.ts +12 -0
- package/lib/types.d.ts +323 -0
- package/lib/utils.d.ts +27 -0
- package/lib/web-components/CameraSnapshot.d.ts +11 -0
- package/lib/web-components/DocumentReader.d.ts +11 -0
- package/lib/web-components/FaceDetection.d.ts +11 -0
- package/lib/web-components/FaceLiveness.d.ts +14 -0
- package/lib/web-components/FullScreenContainer.d.ts +4 -0
- package/package.json +63 -69
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-dom.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @license React
|
|
15
|
+
* react.production.min.js
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @license React
|
|
25
|
+
* scheduler.production.min.js
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
@license @nocompile
|
|
35
|
+
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
36
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
37
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
38
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
39
|
+
Code distributed by Google as part of the polymer project is also
|
|
40
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
41
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DocumentCompletionStatus } from '../constants';
|
|
3
|
+
import { CaptureType } from '../types';
|
|
4
|
+
declare type CameraCaptureProps = {
|
|
5
|
+
onStatusChange: (completionStatus: DocumentCompletionStatus) => void;
|
|
6
|
+
onCapture: (capture: CaptureType) => void;
|
|
7
|
+
};
|
|
8
|
+
declare function CameraCapture({ onStatusChange, onCapture }: CameraCaptureProps): JSX.Element;
|
|
9
|
+
export default CameraCapture;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DocumentCompletionStatus } from '../constants';
|
|
3
|
+
import { CaptureType } from '../types';
|
|
4
|
+
declare type DocumentReaderFileCaptureProps = {
|
|
5
|
+
onStatusChange: (completionStatus: DocumentCompletionStatus) => void;
|
|
6
|
+
onCapture: (capture: CaptureType) => void;
|
|
7
|
+
images: FileList | null;
|
|
8
|
+
};
|
|
9
|
+
declare function CameraSnapshotFileCapture({ onStatusChange, onCapture, images }: DocumentReaderFileCaptureProps): JSX.Element;
|
|
10
|
+
export default CameraSnapshotFileCapture;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DocumentCompletionStatus } from '../constants';
|
|
3
|
+
import { Response as DocumentReaderResponseType } from '@regulaforensics/document-reader-webclient/src/ext/process-response';
|
|
4
|
+
declare type DocumentCaptureProps = {
|
|
5
|
+
onResponse: (res: DocumentReaderResponseType) => void;
|
|
6
|
+
onStatusChange: (statusData: DocumentCompletionStatus) => void;
|
|
7
|
+
};
|
|
8
|
+
declare function DocumentCapture({ onResponse, onStatusChange }: DocumentCaptureProps): JSX.Element;
|
|
9
|
+
declare const _default: React.MemoExoticComponent<typeof DocumentCapture>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DirectionType, DocumentCompletionStatus } from '../constants';
|
|
3
|
+
declare type DocumentFullScreenOverlayProps = {
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
children: JSX.Element;
|
|
6
|
+
completionStatus?: DocumentCompletionStatus;
|
|
7
|
+
copyright?: boolean;
|
|
8
|
+
direction: DirectionType;
|
|
9
|
+
};
|
|
10
|
+
declare function DocumentFullScreenOverlay({ onClose, children, completionStatus, copyright, direction, }: DocumentFullScreenOverlayProps): JSX.Element;
|
|
11
|
+
export default DocumentFullScreenOverlay;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DocumentCompletionStatus } from '../constants';
|
|
3
|
+
import { Response as DocumentReaderResponseType } from '@regulaforensics/document-reader-webclient/src/ext/process-response';
|
|
4
|
+
declare type DocumentReaderFileCaptureProps = {
|
|
5
|
+
onStatusChange: (completionStatus: DocumentCompletionStatus) => void;
|
|
6
|
+
onResponse: (response: DocumentReaderResponseType) => void;
|
|
7
|
+
images: FileList | null;
|
|
8
|
+
scenario?: string;
|
|
9
|
+
license?: string;
|
|
10
|
+
};
|
|
11
|
+
declare function DocumentReaderFileCapture({ onStatusChange, onResponse, images, scenario, license, }: DocumentReaderFileCaptureProps): JSX.Element;
|
|
12
|
+
export default DocumentReaderFileCapture;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DocumentCaptureStatus, StreamStatus } from '../constants';
|
|
3
|
+
import { FrameParamsType, VideoParamsType } from '../types';
|
|
4
|
+
declare type DocumentReaderLayoutProps = {
|
|
5
|
+
status: DocumentCaptureStatus;
|
|
6
|
+
videoStatus: StreamStatus;
|
|
7
|
+
isServiceInitialized: boolean;
|
|
8
|
+
children: JSX.Element | null;
|
|
9
|
+
mirroring: boolean;
|
|
10
|
+
onChangeMirroring: () => void;
|
|
11
|
+
onChangeCamera: () => void;
|
|
12
|
+
isChangeCameraAvailable: boolean;
|
|
13
|
+
facingMode?: string;
|
|
14
|
+
onCameraSnapshot?: () => void;
|
|
15
|
+
onSkip?: () => void;
|
|
16
|
+
frameParams?: FrameParamsType;
|
|
17
|
+
videoElementParams?: VideoParamsType;
|
|
18
|
+
showChangeCameraButton?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare function DocumentReaderLayout({ status, videoStatus, isServiceInitialized, children, mirroring, onChangeMirroring, onChangeCamera, isChangeCameraAvailable, facingMode, onCameraSnapshot, onSkip, frameParams, videoElementParams, showChangeCameraButton, }: DocumentReaderLayoutProps): JSX.Element;
|
|
21
|
+
declare const _default: React.MemoExoticComponent<typeof DocumentReaderLayout>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type DocumentReaderStartScreenProps = {
|
|
3
|
+
onStart: () => void;
|
|
4
|
+
onFileImageSet: (images: FileList | null) => void;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle: string;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function DocumentReaderStartScreen({ onStart, onFileImageSet, title, subtitle, multiple, }: DocumentReaderStartScreenProps): JSX.Element;
|
|
10
|
+
export default DocumentReaderStartScreen;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ErrorTypes } from '../constants';
|
|
3
|
+
import { SupportedBrowserVersionsByOsType } from '../types';
|
|
4
|
+
import CustomError from '../models/CustomError';
|
|
5
|
+
declare type PropsType = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
onError: (error: ErrorTypes) => void;
|
|
8
|
+
supportedBrowserVersions?: SupportedBrowserVersionsByOsType;
|
|
9
|
+
};
|
|
10
|
+
declare class ErrorBoundary extends React.Component<PropsType> {
|
|
11
|
+
onError: (error: ErrorTypes) => void;
|
|
12
|
+
supportedBrowserVersions?: SupportedBrowserVersionsByOsType;
|
|
13
|
+
constructor(props: PropsType);
|
|
14
|
+
componentDidCatch(error: Error | CustomError): void;
|
|
15
|
+
componentDidMount(): void;
|
|
16
|
+
render(): React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FaceCompletionStatus } from '../constants';
|
|
3
|
+
declare type FaceCaptureProps = {
|
|
4
|
+
onStatusChange: (completionStatus: FaceCompletionStatus) => void;
|
|
5
|
+
onImagesCapture: (images: Array<string>) => void;
|
|
6
|
+
onReset: () => void;
|
|
7
|
+
uuid?: string;
|
|
8
|
+
tryCount?: number;
|
|
9
|
+
onRequestChange?: (request: Uint8Array | null) => void;
|
|
10
|
+
faceSnapshot?: boolean;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
showChangeCameraButton?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare function FaceCapture({ onStatusChange, onImagesCapture, onReset, tryCount, uuid, onRequestChange, faceSnapshot, debug, showChangeCameraButton, }: FaceCaptureProps): JSX.Element;
|
|
15
|
+
export default FaceCapture;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DirectionType, FaceCompletionStatus } from '../constants';
|
|
3
|
+
declare type FaceFullScreenOverlayProps = {
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
children: JSX.Element;
|
|
6
|
+
completionStatus: FaceCompletionStatus;
|
|
7
|
+
copyright?: boolean;
|
|
8
|
+
direction: DirectionType;
|
|
9
|
+
};
|
|
10
|
+
declare function FaceFullScreenOverlay({ onClose, children, completionStatus, copyright, direction, }: FaceFullScreenOverlayProps): JSX.Element;
|
|
11
|
+
export default FaceFullScreenOverlay;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FaceMessage, StreamStatus } from '../constants';
|
|
3
|
+
import { FrameObject } from '../types';
|
|
4
|
+
declare type FaceLayoutProps = {
|
|
5
|
+
children: JSX.Element | null;
|
|
6
|
+
captureFrame: FrameObject;
|
|
7
|
+
videoStatus: StreamStatus;
|
|
8
|
+
message: FaceMessage;
|
|
9
|
+
prepared: boolean;
|
|
10
|
+
onChangeCamera: () => void;
|
|
11
|
+
isChangeCameraAvailable: boolean;
|
|
12
|
+
readiness: number;
|
|
13
|
+
breakpoint?: string;
|
|
14
|
+
showChangeCameraButton?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare function FaceLayout({ children, videoStatus, captureFrame, message, prepared, onChangeCamera, isChangeCameraAvailable, readiness, showChangeCameraButton, }: FaceLayoutProps): JSX.Element;
|
|
17
|
+
declare const _default: React.MemoExoticComponent<typeof FaceLayout>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type InfoScreenProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
type: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
onReset?: () => void;
|
|
7
|
+
size?: number;
|
|
8
|
+
};
|
|
9
|
+
declare function InfoScreen({ title, type, subtitle, onReset, size }: InfoScreenProps): JSX.Element;
|
|
10
|
+
export default InfoScreen;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type InstructionScreenProps = {
|
|
3
|
+
onStart: () => void;
|
|
4
|
+
icon: string;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle: string;
|
|
7
|
+
};
|
|
8
|
+
declare function InstructionScreen({ onStart, icon, title, subtitle }: InstructionScreenProps): JSX.Element;
|
|
9
|
+
export default InstructionScreen;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CameraFacingMode, ObjectFit, ErrorTypes } from '../constants';
|
|
3
|
+
import { VideoParamsType, VideoStatusParamsType } from '../types';
|
|
4
|
+
declare type WebCameraVideoProps = {
|
|
5
|
+
onVideoStatusChange: (status: VideoStatusParamsType) => void;
|
|
6
|
+
objectFit?: ObjectFit;
|
|
7
|
+
onVideoSizeChange?: (params: VideoParamsType) => void;
|
|
8
|
+
mode?: CameraFacingMode;
|
|
9
|
+
resolution?: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
mirroring?: boolean;
|
|
14
|
+
onFailStatus?: (reason: ErrorTypes) => void;
|
|
15
|
+
cameraId?: string;
|
|
16
|
+
};
|
|
17
|
+
declare function WebCamera({ onVideoStatusChange, objectFit, onVideoSizeChange, mode, resolution, mirroring, onFailStatus, cameraId, }: WebCameraVideoProps): JSX.Element;
|
|
18
|
+
declare const _default: React.MemoExoticComponent<typeof WebCamera>;
|
|
19
|
+
export default _default;
|