@regulaforensics/vp-frontend-face-components 2.0.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.
Files changed (33) hide show
  1. package/README.md +14 -2
  2. package/dist/main.js +1 -1
  3. package/dist/main.js.LICENSE.txt +10 -0
  4. package/lib/common/Button.d.ts +2 -2
  5. package/lib/common/Message.d.ts +2 -2
  6. package/lib/components/ButtonFaceLiveness.d.ts +2 -2
  7. package/lib/components/DocumentCapture.d.ts +2 -2
  8. package/lib/components/DocumentReaderLayout.d.ts +2 -2
  9. package/lib/components/ErrorBoundary.d.ts +4 -4
  10. package/lib/components/FaceCapture.d.ts +4 -4
  11. package/lib/components/FaceHintAnimaition.d.ts +2 -2
  12. package/lib/components/FaceLayout.d.ts +2 -2
  13. package/lib/components/InfoScreenFaceLiveness.d.ts +1 -1
  14. package/lib/components/SectorAnimationSvg.d.ts +2 -2
  15. package/lib/components/WebCamera.d.ts +2 -2
  16. package/lib/constants.d.ts +10 -28
  17. package/lib/contexts/DocumentAttributesContext.d.ts +2 -2
  18. package/lib/contexts/DocumentSDKContext.d.ts +2 -2
  19. package/lib/contexts/FaceAttributesContext.d.ts +3 -2
  20. package/lib/hoc/withDocumentAttributesContext.d.ts +2 -2
  21. package/lib/hoc/withDocumentSDKContext.d.ts +2 -2
  22. package/lib/hoc/withFaceAttributesContext.d.ts +2 -2
  23. package/lib/hoc/withLocalize.d.ts +2 -2
  24. package/lib/hooks/useDocumentReaderSeries.d.ts +1 -2
  25. package/lib/hooks/useDocumentReaderSingle.d.ts +1 -2
  26. package/lib/models/CustomError.d.ts +2 -2
  27. package/lib/services/DeviceOrientationService.d.ts +18 -0
  28. package/lib/services/DocumentReaderProcessor.d.ts +7 -14
  29. package/lib/services/DocumentReaderService.d.ts +23 -43
  30. package/lib/services/FaceLivenessService.d.ts +9 -1
  31. package/lib/services/FaceService.d.ts +9 -9
  32. package/lib/types.d.ts +4 -4
  33. package/package.json +1 -1
@@ -10,6 +10,16 @@
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
 
13
+ /**
14
+ * @license React
15
+ * react-jsx-runtime.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
+
13
23
  /**
14
24
  * @license React
15
25
  * react.production.min.js
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  declare type ButtonProps = {
3
- children: React.ReactNode | string;
3
+ children: ReactNode | string;
4
4
  onClick: () => void;
5
5
  };
6
6
  declare function Button({ children, onClick, ...rest }: ButtonProps): JSX.Element;
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  declare type MessageProps = {
3
3
  children: string;
4
4
  isLivenessDetection?: boolean;
5
5
  };
6
6
  declare function Message({ children, isLivenessDetection }: MessageProps): JSX.Element;
7
- declare const _default: React.MemoExoticComponent<typeof Message>;
7
+ declare const _default: import("react").MemoExoticComponent<typeof Message>;
8
8
  export default _default;
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  declare type ButtonLivenessDetectionProps = {
3
- children: React.ReactNode | string;
3
+ children: ReactNode | string;
4
4
  onClick: () => void;
5
5
  };
6
6
  declare function ButtonFaceLiveness({ children, onClick, ...rest }: ButtonLivenessDetectionProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import { DocumentCompletionStatus } from '../constants';
3
3
  import { Response as DocumentReaderResponseType } from '../models/DocReaderWebclient/ext';
4
4
  declare type DocumentCaptureProps = {
@@ -7,5 +7,5 @@ declare type DocumentCaptureProps = {
7
7
  onFileImageSet: (images: Array<ImageData> | null) => void;
8
8
  };
9
9
  declare function DocumentCapture({ onResponse, onStatusChange, onFileImageSet }: DocumentCaptureProps): JSX.Element;
10
- declare const _default: React.MemoExoticComponent<typeof DocumentCapture>;
10
+ declare const _default: import("react").MemoExoticComponent<typeof DocumentCapture>;
11
11
  export default _default;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import { DocumentCaptureStatus } from '../constants';
3
3
  import { ImageInputParamType, VideoParamsType, VideoStatusParamsType } from '../types';
4
4
  declare type DocumentReaderLayoutProps = {
@@ -18,5 +18,5 @@ declare type DocumentReaderLayoutProps = {
18
18
  showChangeCameraButton?: boolean;
19
19
  };
20
20
  declare function DocumentReaderLayout({ status, isServiceInitialized, children, mirroring, onChangeMirroring, onChangeCamera, videoStatusParams, videoElementParams, onClose, onSnapshotProcess, onCameraSnapshot, onSkip, frameParams, showChangeCameraButton, }: DocumentReaderLayoutProps): JSX.Element;
21
- declare const _default: React.MemoExoticComponent<typeof DocumentReaderLayout>;
21
+ declare const _default: import("react").MemoExoticComponent<typeof DocumentReaderLayout>;
22
22
  export default _default;
@@ -1,18 +1,18 @@
1
- import * as React from 'react';
2
1
  import { ErrorTypes } from '../constants';
3
2
  import { SupportedBrowserVersionsByOsType } from '../types';
4
3
  import CustomError from '../models/CustomError';
4
+ import { Component, ReactNode } from 'react';
5
5
  declare type PropsType = {
6
- children: React.ReactNode;
6
+ children: ReactNode;
7
7
  onError: (error: ErrorTypes) => void;
8
8
  supportedBrowserVersions?: SupportedBrowserVersionsByOsType;
9
9
  };
10
- declare class ErrorBoundary extends React.Component<PropsType> {
10
+ declare class ErrorBoundary extends Component<PropsType> {
11
11
  onError: (error: ErrorTypes) => void;
12
12
  supportedBrowserVersions?: SupportedBrowserVersionsByOsType;
13
13
  constructor(props: PropsType);
14
14
  componentDidCatch(error: Error | CustomError): void;
15
15
  componentDidMount(): void;
16
- render(): React.ReactNode;
16
+ render(): ReactNode;
17
17
  }
18
18
  export default ErrorBoundary;
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import { FaceAbortSessionStatus, FaceCompletionStatus } from '../constants';
2
+ import { Dispatch, SetStateAction } from 'react';
3
3
  declare type FaceCapturePropsLivenessDetection = {
4
4
  onStatusChange: (completionStatus: FaceCompletionStatus) => void;
5
5
  onImagesCapture: (images: Array<string>) => void;
@@ -14,11 +14,11 @@ declare type FaceCapturePropsLivenessDetection = {
14
14
  showChangeCameraButton?: boolean;
15
15
  backendUrl?: string;
16
16
  userCameraId?: string;
17
- setUserCameraId: React.Dispatch<React.SetStateAction<string | undefined>>;
17
+ setUserCameraId: Dispatch<SetStateAction<string | undefined>>;
18
18
  onRestart: (forceCapture?: boolean) => void;
19
19
  abortProcess?: boolean;
20
- setAbortProcess?: React.Dispatch<React.SetStateAction<boolean>>;
21
- setAbortSessionStatus?: React.Dispatch<React.SetStateAction<FaceAbortSessionStatus | null>>;
20
+ setAbortProcess?: Dispatch<SetStateAction<boolean>>;
21
+ setAbortSessionStatus?: Dispatch<SetStateAction<FaceAbortSessionStatus | null>>;
22
22
  videoRecording?: boolean;
23
23
  };
24
24
  declare function FaceCapture({ onStatusChange, onImagesCapture, onReset, sessionId, setSessionId, onRequestChange, faceSnapshot, debug, showChangeCameraButton, setTransactionId, setPublicKey, backendUrl, userCameraId, setUserCameraId, onRestart, abortProcess, setAbortProcess, setAbortSessionStatus, videoRecording, }: FaceCapturePropsLivenessDetection): JSX.Element;
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import { FacePositionLivenessDetection } from '../types';
2
+ import { FC } from 'react';
3
3
  declare type FaceHintAnimaitionProps = {
4
4
  targetSector: number;
5
5
  roundRadiusX?: number;
@@ -12,5 +12,5 @@ declare type FaceHintAnimaitionProps = {
12
12
  centerX: number;
13
13
  centerY: number;
14
14
  };
15
- export declare const FaceHintAnimaition: React.FC<FaceHintAnimaitionProps>;
15
+ export declare const FaceHintAnimaition: FC<FaceHintAnimaitionProps>;
16
16
  export {};
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import { FaceMessage } from '../constants';
3
3
  import { FacePositionLivenessDetection, FrameObject, VideoStatusParamsType } from '../types';
4
4
  declare type FaceLayoutProps = {
@@ -19,5 +19,5 @@ declare type FaceLayoutProps = {
19
19
  faceSnapshot: boolean | undefined;
20
20
  };
21
21
  declare function FaceLayout({ children, captureFrame, videoStatusParams, message, prepared, onChangeCamera, readiness, numSectors, currSector, targetSector, step, showChangeCameraButton, facePosition, faceSnapshot, }: FaceLayoutProps): JSX.Element;
22
- declare const _default: React.MemoExoticComponent<typeof FaceLayout>;
22
+ declare const _default: import("react").MemoExoticComponent<typeof FaceLayout>;
23
23
  export default _default;
@@ -8,5 +8,5 @@ declare type InfoScreenFaceLivenessProps = {
8
8
  size?: number;
9
9
  iconColor?: string;
10
10
  };
11
- declare function InfoScreenFaceLiveness({ title, type, subtitle, onReset, size, iconColor, }: InfoScreenFaceLivenessProps): JSX.Element;
11
+ declare function InfoScreenFaceLiveness({ title, type, subtitle, onReset, size, iconColor }: InfoScreenFaceLivenessProps): JSX.Element;
12
12
  export default InfoScreenFaceLiveness;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { FC } from 'react';
2
2
  interface SectorAnimationSvgProps {
3
3
  numSectors: number;
4
4
  targetSector: number;
@@ -7,5 +7,5 @@ interface SectorAnimationSvgProps {
7
7
  centerY: number;
8
8
  sectorRadius: number;
9
9
  }
10
- export declare const SectorAnimationSvg: React.FC<SectorAnimationSvgProps>;
10
+ export declare const SectorAnimationSvg: FC<SectorAnimationSvgProps>;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import { CameraFacingMode, ErrorTypes } from '../constants';
3
3
  import { VideoParamsType, VideoStatusParamsType } from '../types';
4
4
  declare type WebCameraVideoProps = {
@@ -15,5 +15,5 @@ declare type WebCameraVideoProps = {
15
15
  videoRecording?: boolean;
16
16
  };
17
17
  declare function WebCamera({ onVideoStatusChange, onVideoSizeChange, mode, resolution, mirroring, onFailStatus, cameraId, videoRecording, }: WebCameraVideoProps): JSX.Element;
18
- declare const _default: React.MemoExoticComponent<typeof WebCamera>;
18
+ declare const _default: import("react").MemoExoticComponent<typeof WebCamera>;
19
19
  export default _default;
@@ -39,6 +39,7 @@ export declare enum DocumentEventActions {
39
39
  PRESS_RETRY_BUTTON = "PRESS_RETRY_BUTTON",
40
40
  PRESS_SKIP_BUTTON = "PRESS_SKIP_BUTTON",
41
41
  CLOSE = "CLOSE",
42
+ CAMERA_PROCESS_CLOSED = "CAMERA_PROCESS_CLOSED",
42
43
  CAMERA_PROCESS_STARTED = "CAMERA_PROCESS_STARTED",
43
44
  FILE_PROCESS_STARTED = "FILE_PROCESS_STARTED",
44
45
  PROCESS_FINISHED = "PROCESS_FINISHED",
@@ -136,12 +137,6 @@ export declare enum ProcessingStatus {
136
137
  FINISHED = 1,
137
138
  TIMEOUT = 2
138
139
  }
139
- export declare enum DocumentCommandCode {
140
- PROCESS = 12101,
141
- PROCESS_IMAGE = 12104,
142
- START_NEW_DOCUMENT = 12105,
143
- START_NEW_PAGE = 12106
144
- }
145
140
  export declare enum ObjectFit {
146
141
  contain = "contain",
147
142
  cover = "cover"
@@ -172,14 +167,12 @@ export declare enum ErrorTypes {
172
167
  ALREADY_INITIALIZED = "ALREADY_INITIALIZED"
173
168
  }
174
169
  export declare enum Method {
175
- onRuntimeInitialized = "onRuntimeInitialized",
176
- processImage = "processImage",
177
- process = "process",
178
- startNewPage = "startNewPage",
179
- startNewDocument = "startNewDocument",
180
- initializeService = "initializeService",
181
- close = "close",
182
- stderr = "strerr"
170
+ prepare = 12000,
171
+ initialize = 12100,
172
+ process = 12101,
173
+ processImage = 12104,
174
+ startNewPage = 12106,
175
+ startNewDocument = 12105
183
176
  }
184
177
  export declare enum MediaElementReadyState {
185
178
  HAVE_NOTHING = 0,
@@ -191,20 +184,9 @@ export declare enum MediaElementReadyState {
191
184
  export declare enum Target {
192
185
  stdout = "stdout",
193
186
  stderr = "stderr",
194
- custom = "custom"
195
- }
196
- export declare enum PromiseMethod {
197
- resolve = "resolve",
198
- reject = "reject"
199
- }
200
- export declare enum PromiseName {
201
- empty = "empty",
202
- prepare = "prepare",
203
- initialize = "initialize",
204
- process = "process",
205
- processImage = "processImage",
206
- startNewPage = "startNewPage",
207
- startNewDocument = "startNewDocument"
187
+ custom = "custom",
188
+ gl = "gl",
189
+ init = "worker-init"
208
190
  }
209
191
  export declare enum logLevels {
210
192
  OFF = 0,
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { CameraSnapshotResponseType, DocumentDictionaries, DocumentReaderResponseType, Locales } from '../types';
3
3
  import { DocumentEventActions, InternalScenarios, ErrorTypes } from '../constants';
4
4
  declare type DocumentCallbackArgTypes = DocumentReaderResponseType | CameraSnapshotResponseType;
@@ -20,6 +20,6 @@ export declare type DocumentAttributesContextType = {
20
20
  changeCamera?: boolean;
21
21
  translations?: DocumentDictionaries;
22
22
  };
23
- export declare const DocumentAttributesContext: React.Context<DocumentAttributesContextType>;
23
+ export declare const DocumentAttributesContext: import("react").Context<DocumentAttributesContextType>;
24
24
  export declare const useDocumentContext: () => DocumentAttributesContextType;
25
25
  export {};
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import DocumentReaderService from '../services/DocumentReaderService';
3
3
  declare type DocumentSDKContextType = {
4
4
  service: DocumentReaderService | null;
5
5
  };
6
- export declare const DocumentSDKContext: React.Context<DocumentSDKContextType>;
6
+ export declare const DocumentSDKContext: import("react").Context<DocumentSDKContextType>;
7
7
  export declare const useDocumentSDKContext: () => DocumentSDKContextType;
8
8
  export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { FaceDetectionResponseType, Locales, FaceLivenessResponseType } from '../types';
3
3
  import { FaceEventActions, ErrorTypes } from '../constants';
4
4
  declare type FaceCallbackArgTypes = FaceDetectionResponseType | FaceLivenessResponseType;
@@ -19,7 +19,8 @@ export declare type FaceAttributesContextType = {
19
19
  changeCamera?: boolean;
20
20
  startScreen?: boolean;
21
21
  videoRecording?: boolean;
22
+ deviceOrientation?: boolean;
22
23
  };
23
- export declare const FaceAttributesContext: React.Context<FaceAttributesContextType>;
24
+ export declare const FaceAttributesContext: import("react").Context<FaceAttributesContextType>;
24
25
  export declare const useFaceContext: () => FaceAttributesContextType;
25
26
  export {};
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
1
  import { DocumentAttributesContextType } from '../contexts/DocumentAttributesContext';
3
- declare function withDocumentAttributesContext<T extends DocumentAttributesContextType>(Component: React.ComponentType<T>): React.ComponentType<T>;
2
+ import { ComponentType } from 'react';
3
+ declare function withDocumentAttributesContext<T extends DocumentAttributesContextType>(Component: ComponentType<T>): ComponentType<T>;
4
4
  export default withDocumentAttributesContext;
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
2
- declare function withDocumentSDKContext<T>(Component: React.ComponentType<T>): React.ComponentType<T>;
1
+ import { ComponentType } from 'react';
2
+ declare function withDocumentSDKContext<T>(Component: ComponentType<T>): ComponentType<T>;
3
3
  export default withDocumentSDKContext;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
2
1
  import { FaceAttributesContextType } from '../contexts/FaceAttributesContext';
3
- declare function withFaceAttributesContext<T extends FaceAttributesContextType>(Component: React.ComponentType<T>): React.ComponentType<T>;
2
+ import { ComponentType } from 'react';
3
+ declare function withFaceAttributesContext<T extends FaceAttributesContextType>(Component: ComponentType<T>): ComponentType<T>;
4
4
  export default withFaceAttributesContext;
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
1
  import { DocumentDictionaries, Locales } from '../types';
2
+ import { ComponentType } from 'react';
3
3
  interface LocalizedProps {
4
4
  locale?: Locales;
5
5
  translations?: DocumentDictionaries;
6
6
  }
7
- declare function withLocalize<T>(Component: React.ComponentType<T>): React.ComponentType<T & LocalizedProps>;
7
+ declare function withLocalize<T>(Component: ComponentType<T>): ComponentType<T & LocalizedProps>;
8
8
  export default withLocalize;
@@ -1,11 +1,10 @@
1
1
  import { Response } from '../models/DocReaderWebclient/ext';
2
2
  import { DocumentCaptureStatus, InternalScenarios, StreamStatus } from '../constants';
3
3
  import { ImageInputParamType, VideoParamsType } from '../types';
4
- import CustomError from '../models/CustomError';
5
4
  declare type ResponseType = {
6
5
  status: DocumentCaptureStatus;
7
6
  initialized: boolean;
8
- error: CustomError | null;
7
+ error: unknown;
9
8
  response: Response | null;
10
9
  };
11
10
  interface IUseDocumentReaderSeries extends ResponseType {
@@ -1,9 +1,8 @@
1
1
  import { DocumentCaptureStatus, InternalScenarios } from '../constants';
2
2
  import { Response } from '../models/DocReaderWebclient/ext';
3
- import CustomError from '../models/CustomError';
4
3
  declare type ResponseType = {
5
4
  status: DocumentCaptureStatus;
6
- error: CustomError | null;
5
+ error: unknown;
7
6
  response: Response | null;
8
7
  initialized: boolean;
9
8
  prepared: boolean;
@@ -1,7 +1,7 @@
1
1
  import { ErrorTypes } from '../constants';
2
2
  declare class CustomError {
3
3
  type: ErrorTypes;
4
- details?: any;
5
- constructor(type: ErrorTypes, details?: any);
4
+ details?: unknown;
5
+ constructor(type: ErrorTypes, details?: unknown);
6
6
  }
7
7
  export default CustomError;
@@ -0,0 +1,18 @@
1
+ declare class DeviceOrientationService {
2
+ private angles;
3
+ initialized: boolean;
4
+ private debugPlate;
5
+ constructor();
6
+ private setAngle;
7
+ private setAngleLink;
8
+ private setListeners;
9
+ init(debug: boolean | undefined): void;
10
+ getAngle(): {
11
+ alpha: number | null;
12
+ beta: number | null;
13
+ gamma: number | null;
14
+ } | null;
15
+ shutdown(): void;
16
+ }
17
+ declare const _default: DeviceOrientationService;
18
+ export default _default;
@@ -1,22 +1,22 @@
1
1
  import { CurrentPage, ImageProcessingRequest, ProcessingRequest, StreamParams } from '../types';
2
2
  import { Response } from '../models/DocReaderWebclient/ext';
3
- declare type RecognizerListener = ((data: Response) => void) | null;
3
+ declare type RecognizeListener = (data: Response) => void;
4
4
  declare type ResponseListener = (currentPage: CurrentPage) => void;
5
5
  declare class DocumentReaderProcessor {
6
- private _videoElement;
7
6
  private _streamData;
8
7
  private _documentReaderService;
9
8
  private _canvas;
10
- private _streamParam;
11
9
  private _camerasInfo;
12
10
  private _devices;
13
11
  private _videoEventListener;
14
- private _recognizerListener;
15
12
  private _frameListener;
16
- private _isPrepared;
17
- private _isInitialized;
18
- private _isProcessing;
19
13
  private _pageIdx;
14
+ private _streamParam;
15
+ isPrepared: boolean;
16
+ isProcessing: boolean;
17
+ isInitialized: boolean;
18
+ videoElement: HTMLVideoElement | null;
19
+ recognizeListener: RecognizeListener | null;
20
20
  constructor(videoElement?: HTMLVideoElement);
21
21
  get streamParam(): Partial<StreamParams>;
22
22
  set streamParam(params: Partial<StreamParams>);
@@ -24,13 +24,6 @@ declare class DocumentReaderProcessor {
24
24
  set recognizerProcessParam(params: ProcessingRequest);
25
25
  get imageProcessParam(): ImageProcessingRequest;
26
26
  set imageProcessParam(params: ImageProcessingRequest);
27
- get recognizeListener(): RecognizerListener;
28
- set recognizeListener(listener: RecognizerListener);
29
- set videoElement(videoElement: HTMLVideoElement | null);
30
- get videoElement(): HTMLVideoElement | null;
31
- get isPrepared(): boolean;
32
- get isInitialized(): boolean;
33
- get isProcessing(): boolean;
34
27
  private startStream;
35
28
  private stopStream;
36
29
  private startRecognizeProcess;
@@ -1,57 +1,37 @@
1
- import { DocumentCommandCode } from '../constants';
2
- import { ProcessingRequest, ImageProcessingRequest } from '../types';
1
+ import { ImageProcessingRequest, ProcessingRequest } from '../types';
3
2
  import { Response } from '../models/DocReaderWebclient/ext';
4
- declare type PrepareListener = (status: {
5
- isInitialized: boolean;
6
- isPrepared: boolean;
7
- }) => void;
8
- declare type ProcessingListener = (status: {
9
- isProcessing: boolean;
10
- }) => void;
3
+ declare type TLicense = {
4
+ license: {
5
+ errorCode: number;
6
+ message: string;
7
+ status: boolean;
8
+ };
9
+ };
11
10
  declare class DocumentReaderService {
12
- private _isPrepared;
13
- private _isInitialized;
14
- private _isProcessing;
15
11
  private _worker;
16
- private _prepareListener;
17
- private _processingListener;
18
- private _currentPromise;
19
- private _recognizerProcessParam;
20
- private _imageProcessParam;
21
- constructor();
22
- get recognizerProcessParam(): ProcessingRequest;
23
- set recognizerProcessParam(params: ProcessingRequest);
24
- get imageProcessParam(): ImageProcessingRequest;
25
- set imageProcessParam(params: ImageProcessingRequest);
26
- get isInitialized(): boolean;
27
- set isInitialized(value: boolean);
28
- get isPrepared(): boolean;
29
- set isPrepared(value: boolean);
30
- get isProcessing(): boolean;
31
- set isProcessing(value: boolean);
32
- get prepareListener(): PrepareListener | null;
33
- set prepareListener(listener: PrepareListener | null);
34
- get processingListener(): ProcessingListener | null;
35
- set processingListener(listener: ProcessingListener | null);
36
- private postCustomMessage;
37
- private createProcessImageRequest;
38
- private createPromise;
39
- private finishPromise;
40
- private rejectPromise;
12
+ private _tasks;
13
+ isPrepared: boolean;
14
+ isInitialized: boolean;
15
+ isProcessing: boolean;
16
+ recognizerProcessParam: ProcessingRequest;
17
+ imageProcessParam: ImageProcessingRequest;
18
+ version: {
19
+ component: string;
20
+ };
41
21
  private print;
42
22
  private printErr;
23
+ private createPromise;
24
+ private createProcessImageRequest;
43
25
  private onWorkerMessage;
44
- private callPrepareListener;
45
- private callProcessingListener;
46
26
  prepare(): Promise<void>;
47
27
  initialize(initData?: {
48
28
  license: string | undefined;
49
- }): Promise<void>;
50
- processImage(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<Response>;
51
- process(imageDataArray: Array<ImageData>, commandCode: DocumentCommandCode): Promise<Response>;
29
+ }): Promise<TLicense>;
30
+ processImageBase64(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<Response>;
31
+ process(imageDataArray: Array<ImageData>): Promise<Response>;
32
+ processImage(imageDataArray: Array<ImageData>): Promise<Response>;
52
33
  startNewPage(): Promise<void>;
53
34
  startNewDocument(): Promise<void>;
54
35
  shutdown(): void;
55
- showVersion(): void;
56
36
  }
57
37
  export default DocumentReaderService;
@@ -39,6 +39,14 @@ declare type InitializeData = InitializedFaceLivenessData | InitializedFaceCaptu
39
39
  declare type ParamsData = {
40
40
  initializedData: InitializeData;
41
41
  };
42
+ declare type ProcessData = {
43
+ deviceOrientation?: {
44
+ yaw: number;
45
+ pitch: number;
46
+ roll: number;
47
+ };
48
+ abortSession?: boolean;
49
+ };
42
50
  declare class FaceLivenessService {
43
51
  initialized: boolean;
44
52
  processing: boolean;
@@ -57,6 +65,6 @@ declare class FaceLivenessService {
57
65
  private printErr;
58
66
  private onWorkerMessage;
59
67
  shutdown(): void;
60
- processImage(videoFrame: Uint8ClampedArray, abortSession?: boolean): void;
68
+ processImage(videoFrame: Uint8ClampedArray, processData: ProcessData): void;
61
69
  }
62
70
  export default FaceLivenessService;
@@ -3,7 +3,6 @@ import CameraModel from '../models/CameraModel';
3
3
  declare type GetLivenessDetectionResultOptions = {
4
4
  transactionId: string;
5
5
  backendURL?: string;
6
- headers?: Record<string, string>;
7
6
  publicKey: string;
8
7
  };
9
8
  declare type DeviceMetadata = {
@@ -28,12 +27,13 @@ declare type InitializedFaceLivenessDataResult = {
28
27
  sessionId: string;
29
28
  transactionId: string;
30
29
  };
31
- declare function getLivenessDetectionResult(encryptedBody: Uint8Array, { transactionId, backendURL, headers, publicKey }: GetLivenessDetectionResultOptions): Promise<FaceLivenessResultType>;
32
- declare function getInitialisingData(deviceMetadata: DeviceMetadata, sessionId?: string, backendUrl?: string): Promise<InitializedFaceLivenessDataResult>;
33
- declare function sendVideoData(data: Uint8Array, transactionId: string, backendURL?: string, tag?: string): Promise<void>;
34
- declare const _default: {
35
- getInitialisingData: typeof getInitialisingData;
36
- getLivenessDetectionResult: typeof getLivenessDetectionResult;
37
- sendVideoData: typeof sendVideoData;
38
- };
30
+ declare class FaceService {
31
+ headers: Record<string, string>;
32
+ constructor();
33
+ provideHeaders(headers: Record<string, string> | undefined): void;
34
+ getLivenessDetectionResult(encryptedBody: Uint8Array, { transactionId, backendURL, publicKey }: GetLivenessDetectionResultOptions): Promise<FaceLivenessResultType>;
35
+ sendVideoData(data: Uint8Array, transactionId: string, backendURL?: string, tag?: string): Promise<void>;
36
+ getInitialisingData(deviceMetadata: DeviceMetadata, sessionId?: string, backendUrl?: string): Promise<InitializedFaceLivenessDataResult>;
37
+ }
38
+ declare const _default: FaceService;
39
39
  export default _default;
package/lib/types.d.ts CHANGED
@@ -228,10 +228,10 @@ interface DetailEvent<A, R> {
228
228
  action: A;
229
229
  data: CustomEventDataType<R> | null;
230
230
  }
231
- export declare type FaceLivenessDetailType = DetailEvent<FaceEventActions, FaceLivenessResponseType>;
232
- export declare type FaceCaptureDetailType = DetailEvent<FaceEventActions, FaceDetectionResponseType>;
233
- export declare type DocumentReaderDetailType = DetailEvent<DocumentEventActions, DocumentReaderResponseType>;
234
- export declare type CameraSnapshotDetailType = DetailEvent<DocumentEventActions, CameraSnapshotResponseType>;
231
+ export declare type FaceLivenessDetailType = DetailEvent<keyof typeof FaceEventActions, FaceLivenessResponseType>;
232
+ export declare type FaceCaptureDetailType = DetailEvent<keyof typeof FaceEventActions, FaceDetectionResponseType>;
233
+ export declare type DocumentReaderDetailType = DetailEvent<keyof typeof DocumentEventActions, DocumentReaderResponseType>;
234
+ export declare type CameraSnapshotDetailType = DetailEvent<keyof typeof DocumentEventActions, CameraSnapshotResponseType>;
235
235
  export declare type DocumentReaderImage = {
236
236
  data: string;
237
237
  light: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/vp-frontend-face-components",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Regula framework agnostic web components to work with webcamera",
5
5
  "types": "lib/types.d.ts",
6
6
  "main": "dist/main.js",