@idscan/idvc2 3.1.1 → 3.3.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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -23,14 +23,16 @@ export type StepConfig = {
23
23
  autocaptureDelay?: number;
24
24
  enableDesktopNotification?: boolean;
25
25
  enableFourCornerCapture?: boolean;
26
+ shouldRecordVideo?: boolean;
26
27
  };
27
28
  export type DocumentType = {
28
29
  type: DocumentTypeName;
29
30
  steps: StepConfig[];
30
31
  mode?: StepMode;
32
+ tooltipText?: string;
31
33
  };
32
34
  type ImageURI = 'png' | 'jpeg' | 'webp';
33
- export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'customTranslations' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'fixFrontOrientAfterUpload' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onReloaded';
35
+ export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'customTranslations' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'fixFrontOrientAfterUpload' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onDocumentTypeSelect' | 'onReloaded';
34
36
  /**
35
37
  * IDefaultConfig
36
38
  * @param {string} name,
@@ -29,6 +29,7 @@ export declare class WeblibUI {
29
29
  private setFaceOffsets;
30
30
  private setCropFace;
31
31
  private initMainScreenComponents;
32
+ private getDocumentsFromAllowedTypes;
32
33
  private initStepsList;
33
34
  updateInitScreenDocuments(allowedTypesIds: any): void;
34
35
  private initDocumentsList;
@@ -6,7 +6,7 @@ import { DocumentTypeName } from '../environment/documentTypes';
6
6
  import { DeepPartial } from '../types/helpers/DeepPartial';
7
7
  import { IDocumentTypeConfig } from './validator';
8
8
  import { IStepCallback } from './Step';
9
- import { IDataForSubmit } from '../util';
9
+ import { IDataForDocumentTypeSelect, IDataForSubmit } from '../util';
10
10
  import ValidateDocumentTypes from './validation/ValidateDocumentTypes';
11
11
  /**
12
12
  * @param {string} el,
@@ -126,8 +126,15 @@ export interface IConfig {
126
126
  onReset?: (data: IDataForSubmit) => void;
127
127
  /** function which will be called in case the camera is not available */
128
128
  onCameraError?: (data: Error) => void;
129
- /** function which will be called after clicking the submit button */
129
+ /** function which will be called after clicking the submit button
130
+ *
131
+ * This option switches on/off the HEIC image processing (HEIC is Apple’s proprietary version of the Image File format). It’s possible to upload an image of this type only using a Mac/MacBook
132
+ */
130
133
  submit?: (data: IDataForSubmit) => void;
134
+ /**
135
+ * Function that will be called when a document type is selected.
136
+ */
137
+ onDocumentTypeSelect?: (data: IDataForDocumentTypeSelect) => void;
131
138
  }
132
139
  declare class Config implements IConfig {
133
140
  el: string;
@@ -20,12 +20,15 @@ export interface IStepObj {
20
20
  time?: number;
21
21
  configs?: StepConfig[];
22
22
  stepTypeImageName: StepTypeImageName;
23
+ shouldRecordVideo?: boolean;
23
24
  }
24
25
  export interface IStepCallback {
25
26
  /** base64 encoded step image */
26
27
  img: Base64Image | null;
27
28
  /** blob step image */
28
29
  blob: Blob | null;
30
+ /** blob step video */
31
+ videoBlob?: Blob | null;
29
32
  /** step type */
30
33
  type: StepType;
31
34
  /** is it autocaptured from camera */
@@ -47,6 +50,7 @@ export interface IStepCallback {
47
50
  }
48
51
  export default class Step implements IStepCallback, IStepObj {
49
52
  blob: Blob | null;
53
+ videoBlob: Blob | null;
50
54
  errorCode: ErrorCodes | null | undefined;
51
55
  mrzText?: string;
52
56
  mrzImg?: Base64Image | null;
@@ -63,6 +67,7 @@ export default class Step implements IStepCallback, IStepObj {
63
67
  img: Base64Image | null;
64
68
  cameraInfo: Record<string, any>;
65
69
  stepTypeImageName: StepTypeImageName;
70
+ shouldRecordVideo: boolean;
66
71
  constructor(nameOrObj: string | IStepObj, type?: StepType, camera?: VideoFacingModeEnum, time?: number, img?: Base64Image | null);
67
72
  get isShowManualSwitchButton(): boolean;
68
73
  get capturingMode(): StepMode;
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from 'lit-html';
2
+ export declare function toggleTooltip(event: Event): void;
3
+ export declare function HelpTooltipTemplate(tooltipText: string): TemplateResult;
@@ -0,0 +1 @@
1
+ export { HelpTooltipTemplate } from './HelpTooltip';
@@ -16,5 +16,5 @@ export type InitScreenEvents = {
16
16
  export declare class InitScreen extends ComponentLit<InitScreenState> {
17
17
  constructor(mountElement: HTMLElement | string, state: InitScreenState, events?: InitScreenEvents);
18
18
  protected renderTemplate(): void;
19
- private handleDocumentClick;
19
+ handleDocumentClick: (event: Event) => void;
20
20
  }
@@ -1,6 +1,7 @@
1
1
  import Modal from './Modal';
2
2
  import { DocumentRecord, DocumentTypeName } from '../../environment/documentTypes';
3
3
  import { ModalPositionKeys } from '../../environment/modalPosition';
4
+ import { IDataForDocumentTypeSelect } from '../../util';
4
5
  interface ILoader {
5
6
  addState: () => void;
6
7
  showLoader: () => void;
@@ -9,17 +10,20 @@ interface ILoader {
9
10
  hideLoader: () => void;
10
11
  }
11
12
  declare class SelectDocumentType extends Modal {
13
+ #private;
12
14
  private elementsList;
13
15
  private header;
14
16
  private list;
15
17
  private loader;
16
- constructor(componentWrapper: HTMLElement, loader: ILoader, modalPositionClass: ModalPositionKeys);
18
+ constructor(componentWrapper: HTMLElement, loader: ILoader, modalPositionClass: ModalPositionKeys, onDocumentTypeSelect: (params: IDataForDocumentTypeSelect) => void);
17
19
  show(currentDocument: DocumentTypeName | ''): void;
18
20
  hide(): void;
19
21
  showCancelButton(): void;
20
22
  addCancelHandler(handler: (e?: Event) => void): void;
21
23
  clearList(): void;
22
- addType({ name: docType, humanName, id }: DocumentRecord): void;
24
+ addType({ name: docType, humanName, id, tooltipText, }: DocumentRecord & {
25
+ tooltipText?: string;
26
+ }): void;
23
27
  render(): void;
24
28
  private hideCancelButton;
25
29
  private createElement;
@@ -1,6 +1,7 @@
1
1
  import { BrowserInfo } from 'detect-browser';
2
2
  import type { Size } from '../../../helpers/image';
3
3
  import type { StepType } from '../../../environment/stepsDescription';
4
+ import Step from '../../Step';
4
5
  export declare class CanvasWrapper {
5
6
  private componentWrapper;
6
7
  videoCanvas: HTMLCanvasElement;
@@ -22,10 +23,12 @@ export declare class CanvasWrapper {
22
23
  private readonly faceOffset;
23
24
  private readonly canvasNames;
24
25
  private readonly canvasCtxNames;
26
+ private videoRecorder;
25
27
  constructor(componentWrapper: HTMLElement, video: HTMLVideoElement);
26
28
  saveCanvas(): void;
27
29
  restoreCanvas(): void;
28
30
  toggleBorderCanvas(currentStepType: StepType, isStarted: boolean): void;
31
+ toggleRecordVideo(currentStepObj: Step, isStarted: boolean): void;
29
32
  clearBorderCtx(): void;
30
33
  setVideoCanvasSizes({ width, height }: Size): void;
31
34
  getBaseSizes(coefficient?: number): {
@@ -0,0 +1,9 @@
1
+ export declare class VideoRecorderService {
2
+ private mediaRecorder;
3
+ private recordedBlobs;
4
+ private videoType;
5
+ startRecording(canvas: HTMLCanvasElement): void;
6
+ stopRecording(): void;
7
+ private handleDataAvailable;
8
+ private handleStop;
9
+ }
@@ -7,12 +7,14 @@ export interface IValidateDocumentTypes {
7
7
  steps: any[];
8
8
  commonStepTypes: Set<StepType>;
9
9
  documentTypes: IDocumentTypeConfig;
10
+ tooltipTextMap: Partial<Record<DocumentTypeName, string>>;
10
11
  }
11
12
  declare class ValidateDocumentTypes implements IValidator<DocumentType[]> {
12
13
  types: any[];
13
14
  steps: any[];
14
15
  commonStepTypes: Set<StepType>;
15
16
  documentTypes: IDocumentTypeConfig;
17
+ tooltipTextMap: Partial<Record<DocumentTypeName, string>>;
16
18
  static checkIsDocumentTypes(obj: unknown): obj is IValidateDocumentTypes;
17
19
  validate(val: DocumentType[], fallback: DocumentType[], configName: DefaultConfigName): IValidateDocumentTypes;
18
20
  validateTypes(types: string[]): DocumentTypeName[];
@@ -1,7 +1,11 @@
1
1
  import { Base64Image } from './helpers/image';
2
2
  import { IStepCallback } from './modules/Step';
3
- import { DocumentTypeIndex } from './environment/documentTypes';
3
+ import { DocumentTypeIndex, DocumentTypeName } from './environment/documentTypes';
4
4
  import { Context } from './types/context';
5
+ export interface IDataForDocumentTypeSelect {
6
+ docType: DocumentTypeName;
7
+ id: 0 | DocumentTypeIndex;
8
+ }
5
9
  export interface IDataForSubmit {
6
10
  metaData?: string;
7
11
  payload?: Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "3.1.1",
3
+ "version": "3.3.0",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",