@idscan/idvc2 3.6.0 → 3.8.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.
@@ -1 +1,4 @@
1
- export declare const SHOW_PREVIEW_DELAY = 4000;
1
+ export declare const TIME_TO_SCALE = 1000;
2
+ export declare const TIME_TO_ROTATE = 1000;
3
+ export declare const TIME_TO_SCAN = 1000;
4
+ export declare const SHOW_PREVIEW_DELAY: number;
@@ -23,7 +23,7 @@ export type StepConfig = {
23
23
  autocaptureDelay?: number;
24
24
  enableDesktopNotification?: boolean;
25
25
  enableFourCornerCapture?: boolean;
26
- shouldRecordVideo?: boolean;
26
+ shouldRecordMultiImages?: boolean;
27
27
  delayUntilCaptureButtonVisible?: number;
28
28
  };
29
29
  export type DocumentType = {
@@ -0,0 +1,3 @@
1
+ import type { StepType } from './stepsDescription';
2
+ import { DocumentTypeName } from './documentTypes';
3
+ export declare const checkIsNeedRotateCard: (stepType: StepType, documentTypeName: '' | DocumentTypeName) => boolean;
@@ -1,2 +1,5 @@
1
1
  import { StepTypeImageName } from '../environment/stepsDescription';
2
- export declare const getStepBackground: (stepType: StepTypeImageName) => string;
2
+ import { DocumentTypeName } from '../environment/documentTypes';
3
+ export declare const getFrontImageOfDocument: (documentTypeName: DocumentTypeName | '') => string;
4
+ export declare const getScanLineTranslateYRange: (stepType: StepTypeImageName, documentTypeName: DocumentTypeName | '') => readonly [string, string];
5
+ export declare const getStepBackground: (stepType: StepTypeImageName, documentTypeName: DocumentTypeName | '') => string | undefined;
@@ -20,7 +20,7 @@ export interface IStepObj {
20
20
  time?: number;
21
21
  configs?: StepConfig[];
22
22
  stepTypeImageName: StepTypeImageName;
23
- shouldRecordVideo?: boolean;
23
+ shouldRecordMultiImages?: boolean;
24
24
  delayUntilCaptureButtonVisible?: number;
25
25
  }
26
26
  export interface IStepCallback {
@@ -28,8 +28,8 @@ export interface IStepCallback {
28
28
  img: Base64Image | null;
29
29
  /** blob step image */
30
30
  blob: Blob | null;
31
- /** blob step video */
32
- videoBlob?: Blob | null;
31
+ /** blob step MultiImages */
32
+ multiImagesBlob?: Blob | null;
33
33
  /** step type */
34
34
  type: StepType;
35
35
  /** is it autocaptured from camera */
@@ -51,7 +51,7 @@ export interface IStepCallback {
51
51
  }
52
52
  export default class Step implements IStepCallback, IStepObj {
53
53
  blob: Blob | null;
54
- videoBlob: Blob | null;
54
+ multiImagesBlob: Blob | null;
55
55
  errorCode: ErrorCodes | null | undefined;
56
56
  mrzText?: string;
57
57
  mrzImg?: Base64Image | null;
@@ -68,9 +68,9 @@ export default class Step implements IStepCallback, IStepObj {
68
68
  img: Base64Image | null;
69
69
  cameraInfo: Record<string, any>;
70
70
  stepTypeImageName: StepTypeImageName;
71
- shouldRecordVideo: boolean;
71
+ shouldRecordMultiImages: boolean;
72
72
  delayUntilCaptureButtonVisible?: number;
73
- constructor(nameOrObj: string | IStepObj, type?: StepType, camera?: VideoFacingModeEnum, time?: number, img?: Base64Image | null);
73
+ constructor(nameOrObj: string | IStepObj);
74
74
  get isShowManualSwitchButton(): boolean;
75
75
  get capturingMode(): StepMode;
76
76
  static createStep(stepObj: IStepObj, currentDocumentType: DocumentTypeName | ''): Step;
@@ -0,0 +1,2 @@
1
+ export { ControlButton } from './ControlButton';
2
+ export type { ControlButtonClickedCustomEvent, ControlButtonEvents } from './ControlButton';
@@ -4,7 +4,7 @@ import { CardStep } from '../CardStep/CardStep';
4
4
  import { VideoWrapper } from '../VideoWrapper/VideoWrapper';
5
5
  import { UploaderUI } from '../Uploader/UploaderUI';
6
6
  import { StepType } from '../../../environment/stepsDescription';
7
- import { ControlButton, ControlButtonClickedCustomEvent } from '../ControlButton/ControlButton';
7
+ import { ControlButton, ControlButtonClickedCustomEvent } from '../ControlButton';
8
8
  import { CallbackHandler, MessageBox } from '../MessageBox/MessageBox';
9
9
  import { DesktopNotification, DesktopNotificationVisibility } from '../DesktopNotification/DesktopNotification';
10
10
  import { LoaderUI } from '../Loader/LoaderUI';
@@ -1,4 +1,5 @@
1
1
  import { ComponentLit } from '../ComponentLit';
2
+ import { DocumentTypeName } from '../../../environment/documentTypes';
2
3
  import type { StepTypeImageName } from '../../../environment/stepsDescription';
3
4
  import type { ErrorCodes } from '../../../environment/langs';
4
5
  import Step from '../../Step';
@@ -9,6 +10,7 @@ export type UploaderState = {
9
10
  image: string;
10
11
  errorCode?: ErrorCodes;
11
12
  isBadImage?: boolean;
13
+ documentTypeName: DocumentTypeName | '';
12
14
  };
13
15
  export type UploaderUIEvents = {
14
16
  onFileInput: (event: Event) => void;
@@ -25,12 +25,12 @@ export declare class CanvasWrapper {
25
25
  private readonly faceOffset;
26
26
  private readonly canvasNames;
27
27
  private readonly canvasCtxNames;
28
- private videoRecorder;
28
+ private multiImagesRecorder;
29
29
  constructor(componentWrapper: HTMLElement, video: HTMLVideoElement);
30
30
  saveCanvas(): void;
31
31
  restoreCanvas(): void;
32
32
  toggleBorderCanvas(currentStepType: StepType, isStarted: boolean): void;
33
- toggleRecordVideo(currentStepObj: Step, isStarted: boolean): void;
33
+ toggleRecordMultiImages(currentStepObj: Step, isStarted: boolean): void;
34
34
  clearBorderCtx(): void;
35
35
  setVideoCanvasSizes({ width, height }: Size): void;
36
36
  getBaseSizes(coefficient?: number): {
@@ -0,0 +1,15 @@
1
+ import { ControlButtonEvents } from '../ControlButton';
2
+ export interface ICaptureButton {
3
+ setStart(): void;
4
+ setStop(): void;
5
+ }
6
+ export declare class CaptureButton implements ICaptureButton {
7
+ private controlButton;
8
+ private readonly checkIsCameraErrorVisible;
9
+ constructor(element: HTMLElement, onClick: ControlButtonEvents, checkIsCameraErrorVisible: () => boolean);
10
+ private timeout;
11
+ private showCaptureButtonTimeout;
12
+ private setVisible;
13
+ setStart: () => void;
14
+ setStop: () => void;
15
+ }
@@ -1,7 +1,7 @@
1
- export declare class VideoRecorderService {
1
+ export declare class MultiImagesRecorderService {
2
2
  private mediaRecorder;
3
3
  private recordedBlobs;
4
- private videoType;
4
+ private multiImagesType;
5
5
  startRecording(canvas: HTMLCanvasElement): void;
6
6
  stopRecording(): void;
7
7
  private handleDataAvailable;
@@ -1,16 +1,19 @@
1
1
  import { ComponentLit } from '../../ComponentLit';
2
2
  import type { StepType } from '../../../../environment/stepsDescription';
3
+ import { DocumentTypeName } from '../../../../environment/documentTypes';
3
4
  type StepPreviewState = {
4
5
  stepType: StepType;
6
+ documentTypeName: DocumentTypeName | '';
5
7
  };
6
8
  export declare class StepPreview extends ComponentLit<StepPreviewState> {
7
- private backgroundElement;
9
+ #private;
8
10
  constructor(mountElement: any, state: StepPreviewState);
9
- showPreview(timeToShow: number, isEnabled: boolean): Promise<void>;
11
+ showPreview(isEnabled: boolean): Promise<void>;
12
+ stopAnimation: () => void;
10
13
  backToInitialState(): void;
11
14
  remount(): void;
12
- protected updateView(): void;
13
- private setStepBackground;
14
- private getStepTypeBackground;
15
+ protected updateView(): Promise<void>;
16
+ private updateStepBackground;
17
+ private setBackgroundMarkup;
15
18
  }
16
19
  export {};
@@ -4,8 +4,8 @@ import { CanvasWrapper } from './CanvasWrapper';
4
4
  import { UiHints } from './UIHints';
5
5
  import Step from '../../Step';
6
6
  import { StepPreview } from './StepPreview/StepPreview';
7
- import { ControlButton } from '../ControlButton/ControlButton';
8
7
  import { StatusPlank } from '../StatusPlank/StatusPlank';
8
+ import { ICaptureButton } from './CaptureButton';
9
9
  export type UpdateVideoWrapParams = {
10
10
  currentStepImg: string;
11
11
  currentStepObj: Step;
@@ -18,7 +18,7 @@ export declare class VideoWrapper {
18
18
  canvasWrapper: CanvasWrapper;
19
19
  hints: UiHints;
20
20
  stepPreview: StepPreview;
21
- captureButton: ControlButton;
21
+ captureButton: ICaptureButton;
22
22
  statusPlank: StatusPlank;
23
23
  video: HTMLVideoElement;
24
24
  videoWrap: HTMLDivElement;
@@ -31,7 +31,6 @@ export declare class VideoWrapper {
31
31
  private cameraErrorHeader;
32
32
  private cameraErrorText;
33
33
  private UIComponents;
34
- private isShowDemandButton;
35
34
  constructor(componentWrapper: HTMLElement);
36
35
  updateVideoWrap({ currentStepImg, currentStepObj, }: UpdateVideoWrapParams): void;
37
36
  setMirroring(isMirroring: boolean): void;
@@ -40,12 +39,11 @@ export declare class VideoWrapper {
40
39
  setFakeContourStyles(width: number): void;
41
40
  hideVideoError(): void;
42
41
  showVideoError(errorCode: string): void;
43
- setCaptureButtonHidden(newValue: boolean): void;
44
42
  private init;
45
43
  setCameraErrorText(header: string, text: string): void;
46
44
  showCameraError(): void;
47
45
  hideCameraError(): void;
48
- checkIsCameraErrorVisible(): boolean;
46
+ checkIsCameraErrorVisible: () => boolean;
49
47
  changeType(step: Step): void;
50
48
  remountUIComponents(): void;
51
49
  private getFakeContourWidth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",