@regulaforensics/vp-frontend-face-components 1.3.0 → 1.4.0

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 (73) hide show
  1. package/README.md +292 -29
  2. package/dist/main.js +1 -1
  3. package/dist/main.js.LICENSE.txt +42 -0
  4. package/lib/common/BackCameraIcon.d.ts +6 -0
  5. package/lib/common/Button.d.ts +7 -0
  6. package/lib/common/CameraChangeIcon.d.ts +6 -0
  7. package/lib/common/CameraIcon.d.ts +6 -0
  8. package/lib/common/CheckIcon.d.ts +6 -0
  9. package/lib/common/CrossIcon.d.ts +6 -0
  10. package/lib/common/DocReaderCameraDisabled.d.ts +5 -0
  11. package/lib/common/DocReaderCameraPreparing.d.ts +5 -0
  12. package/lib/common/DocReaderFlip.d.ts +5 -0
  13. package/lib/common/DocReaderProcessing.d.ts +5 -0
  14. package/lib/common/DocReaderProcessingError.d.ts +5 -0
  15. package/lib/common/DocReaderProcessingFinished.d.ts +6 -0
  16. package/lib/common/DocReaderSearch.d.ts +5 -0
  17. package/lib/common/ErrorIcon.d.ts +6 -0
  18. package/lib/common/FromCameraIcon.d.ts +5 -0
  19. package/lib/common/FromGalleryIcon.d.ts +5 -0
  20. package/lib/common/FrontCameraIcon.d.ts +6 -0
  21. package/lib/common/FullscreenExitIcon.d.ts +6 -0
  22. package/lib/common/FullscreenIcon.d.ts +6 -0
  23. package/lib/common/Icon.d.ts +7 -0
  24. package/lib/common/InstructionIconFaceDetection.d.ts +5 -0
  25. package/lib/common/InstructionIconFaceLiveness.d.ts +5 -0
  26. package/lib/common/Message.d.ts +7 -0
  27. package/lib/common/NoGlareIcon.d.ts +5 -0
  28. package/lib/common/NoSmilingIcon.d.ts +5 -0
  29. package/lib/common/RegulaLogo.d.ts +6 -0
  30. package/lib/common/SnapshotIcon.d.ts +6 -0
  31. package/lib/common/Spinner.d.ts +3 -0
  32. package/lib/common/SquareIcon.d.ts +6 -0
  33. package/lib/common/StopIcon.d.ts +6 -0
  34. package/lib/common/VerifiedIcon.d.ts +6 -0
  35. package/lib/components/ErrorBoundary.d.ts +17 -0
  36. package/lib/components/FaceCapture.d.ts +17 -0
  37. package/lib/components/FaceDetection.d.ts +2 -0
  38. package/lib/components/FaceFullScreenOverlay.d.ts +11 -0
  39. package/lib/components/FaceLayout.d.ts +19 -0
  40. package/lib/components/FaceLiveness.d.ts +2 -0
  41. package/lib/components/InfoScreen.d.ts +10 -0
  42. package/lib/components/InstructionScreen.d.ts +9 -0
  43. package/lib/components/ProcessScreen.d.ts +6 -0
  44. package/lib/components/RetryScreen.d.ts +7 -0
  45. package/lib/components/WebCamera.d.ts +20 -0
  46. package/lib/constants.d.ts +366 -0
  47. package/lib/contexts/FaceAttributesContext.d.ts +24 -0
  48. package/lib/hoc/withFaceAttributesContext.d.ts +4 -0
  49. package/lib/hoc/withLocalize.d.ts +7 -0
  50. package/lib/hooks/useDebounce.d.ts +2 -0
  51. package/lib/hooks/useFaceLiveness.d.ts +33 -0
  52. package/lib/hooks/useInterval.d.ts +3 -0
  53. package/lib/hooks/useOrientationChange.d.ts +10 -0
  54. package/lib/hooks/useStream.d.ts +16 -0
  55. package/lib/hooks/useUserAgent.d.ts +3 -0
  56. package/lib/hooks/useWindowBlur.d.ts +2 -0
  57. package/lib/i18n/dictionaries/_dictionaries.d.ts +2051 -0
  58. package/lib/index-face.d.ts +1 -0
  59. package/lib/models/CameraModel.d.ts +9 -0
  60. package/lib/models/ImageModel.d.ts +7 -0
  61. package/lib/services/DebugService.d.ts +13 -0
  62. package/lib/services/DocumentReaderService.d.ts +39 -0
  63. package/lib/services/EventEmitter.d.ts +9 -0
  64. package/lib/services/FaceLivenessService.d.ts +46 -0
  65. package/lib/services/FaceService.d.ts +11 -0
  66. package/lib/services/WasmFeatureDetectService.d.ts +4 -0
  67. package/lib/types.d.ts +219 -0
  68. package/lib/utils.d.ts +65 -0
  69. package/lib/web-components/FaceDetection.d.ts +11 -0
  70. package/lib/web-components/FaceLiveness.d.ts +14 -0
  71. package/lib/web-components/FullScreenContainer.d.ts +4 -0
  72. package/lib/web-components.d.ts +47 -0
  73. package/package.json +30 -35
@@ -0,0 +1,42 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /**
8
+ @license @nocompile
9
+ Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
10
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
11
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
12
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
13
+ Code distributed by Google as part of the polymer project is also
14
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
15
+ */
16
+
17
+ /** @license React v0.20.2
18
+ * scheduler.production.min.js
19
+ *
20
+ * Copyright (c) Facebook, Inc. and its affiliates.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE file in the root directory of this source tree.
24
+ */
25
+
26
+ /** @license React v17.0.2
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */
34
+
35
+ /** @license React v17.0.2
36
+ * react.production.min.js
37
+ *
38
+ * Copyright (c) Facebook, Inc. and its affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function BackCameraIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default BackCameraIcon;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare type ButtonProps = {
3
+ children: React.ReactNode | string;
4
+ onClick: () => void;
5
+ };
6
+ declare function Button({ children, onClick, ...rest }: ButtonProps): JSX.Element;
7
+ export default Button;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function CameraChangeIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default CameraChangeIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function CameraIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default CameraIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function CheckIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default CheckIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function CrossIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default CrossIcon;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function DocReaderCameraDisabled({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default DocReaderCameraDisabled;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function DocReaderCameraPreparing({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default DocReaderCameraPreparing;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function DocReaderFlip({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default DocReaderFlip;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function DocReaderProcessing({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default DocReaderProcessing;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function DocReaderProcessingError({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default DocReaderProcessingError;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function DocReaderProcessingFinished({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default DocReaderProcessingFinished;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function DocReaderSearch({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default DocReaderSearch;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function ErrorIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default ErrorIcon;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function FromCameraIcon({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default FromCameraIcon;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function FromGalleryIcon({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default FromGalleryIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function FrontCameraIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default FrontCameraIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function FullscreenExitIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default FullscreenExitIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function FullscreenIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default FullscreenIcon;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare function Icon({ type, size, color }: {
3
+ type: string;
4
+ size?: number;
5
+ color?: string;
6
+ }): JSX.Element;
7
+ export default Icon;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function InstructionIconFaceDetection({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default InstructionIconFaceDetection;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function InstructionIconFaceLiveness({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default InstructionIconFaceLiveness;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare type MessageProps = {
3
+ children: React.ReactChildren | string;
4
+ };
5
+ declare function Message({ children }: MessageProps): JSX.Element;
6
+ declare const _default: React.MemoExoticComponent<typeof Message>;
7
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function NoGlareIcon({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default NoGlareIcon;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function NoSmilingIcon({ size }: {
3
+ size?: number;
4
+ }): JSX.Element;
5
+ export default NoSmilingIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function RegulaLogo({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default RegulaLogo;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function SnapshotIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default SnapshotIcon;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare function Spinner(): JSX.Element;
3
+ export default Spinner;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function SquareIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default SquareIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function StopIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default StopIcon;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function VerifiedIcon({ size, color }: {
3
+ size?: number;
4
+ color?: string;
5
+ }): JSX.Element;
6
+ export default VerifiedIcon;
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { WebComponentsError } from '../constants';
3
+ import { CustomErrorObjectType, SupportedBrowserVersionsByOsType } from '../types';
4
+ declare type PropsType = {
5
+ children: React.ReactNode;
6
+ onError: (error: WebComponentsError) => void;
7
+ supportedBrowserVersions?: SupportedBrowserVersionsByOsType;
8
+ };
9
+ declare class ErrorBoundary extends React.Component<PropsType> {
10
+ onError: (error: WebComponentsError) => void;
11
+ supportedBrowserVersions?: SupportedBrowserVersionsByOsType;
12
+ constructor(props: PropsType);
13
+ componentDidCatch(error: Error | CustomErrorObjectType): void;
14
+ componentDidMount(): void;
15
+ render(): React.ReactNode;
16
+ }
17
+ export default ErrorBoundary;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { faceCaptureComplitionStatus as appStatus, streamStatus } from '../constants';
3
+ declare type FaceCaptureProps = {
4
+ onStatusChange: (complitionStatus: appStatus) => void;
5
+ onImagesCapture: (images: Array<string>) => void;
6
+ onVideoStatusChange: (streamStatus: streamStatus) => void;
7
+ onReset: () => void;
8
+ videoStatus: streamStatus;
9
+ uuid?: string;
10
+ tryCount?: number;
11
+ onRequestChange?: (request: Uint8Array | null) => void;
12
+ faceSnapshot?: boolean;
13
+ debug?: boolean;
14
+ showChangeCameraButton?: boolean;
15
+ };
16
+ declare function FaceCapture({ onStatusChange, onImagesCapture, onVideoStatusChange, onReset, videoStatus, tryCount, uuid, onRequestChange, faceSnapshot, debug, showChangeCameraButton, }: FaceCaptureProps): JSX.Element;
17
+ export default FaceCapture;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { DirectionType, faceCaptureComplitionStatus } from '../constants';
3
+ declare type FaceFullScreenOverlayProps = {
4
+ onClose: () => void;
5
+ children: JSX.Element;
6
+ completionStatus: faceCaptureComplitionStatus;
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,19 @@
1
+ import * as React from 'react';
2
+ import { eFL_Message, eFL_MessageStyle, streamStatus } from '../constants';
3
+ import { FrameObject } from '../types';
4
+ declare type FaceLayoutProps = {
5
+ children: Array<JSX.Element | null>;
6
+ onFrameResize: (frameObj: FrameObject) => void;
7
+ scale: number;
8
+ videoStatus: streamStatus;
9
+ message: eFL_Message;
10
+ messageStyle: eFL_MessageStyle;
11
+ prepared: boolean;
12
+ onChangeCamera: () => void;
13
+ isChangeCameraAvailable: boolean;
14
+ breakpoint?: string;
15
+ showChangeCameraButton?: boolean;
16
+ };
17
+ declare function FaceLayout({ children, scale, videoStatus, onFrameResize, message, messageStyle, prepared, onChangeCamera, isChangeCameraAvailable, showChangeCameraButton, }: FaceLayoutProps): JSX.Element;
18
+ declare const _default: React.MemoExoticComponent<typeof FaceLayout>;
19
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ 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,6 @@
1
+ /// <reference types="react" />
2
+ declare type ProcessScreenProps = {
3
+ title: string;
4
+ };
5
+ declare function ProcessScreen({ title }: ProcessScreenProps): JSX.Element;
6
+ export default ProcessScreen;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare type RetryScreenProps = {
3
+ errorCode: number;
4
+ onReset: () => void;
5
+ };
6
+ declare function RetryScreen({ errorCode, onReset }: RetryScreenProps): JSX.Element;
7
+ export default RetryScreen;
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { cameraFacingMode, webCameraComponentMode, WebComponentsError } from '../constants';
3
+ import { CaptureFrameType, VideoParamsType, VideoStatusParamsType } from '../types';
4
+ declare type WebCameraVideoProps = {
5
+ captureMode: webCameraComponentMode;
6
+ onVideoStatusChange: (status: VideoStatusParamsType) => void;
7
+ onCapture: (document: CaptureFrameType) => void;
8
+ onVideoSizeChange?: (params: VideoParamsType) => void;
9
+ mode?: cameraFacingMode;
10
+ resolution?: {
11
+ width: number;
12
+ height: number;
13
+ };
14
+ mirroring?: boolean;
15
+ onFailStatus?: (reason: WebComponentsError) => void;
16
+ cameraId?: string;
17
+ };
18
+ declare function WebCamera({ captureMode, onVideoStatusChange, onCapture, onVideoSizeChange, mode, resolution, mirroring, onFailStatus, cameraId, }: WebCameraVideoProps): JSX.Element;
19
+ declare const _default: React.MemoExoticComponent<typeof WebCamera>;
20
+ export default _default;