@idscan/idvc2 3.2.0 → 3.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 (34) hide show
  1. package/README.md +9 -0
  2. package/dist/idvc.js +1 -1
  3. package/dist/idvc.js.gzip +0 -0
  4. package/dist/js/defaultConfig.ts +21 -9
  5. package/dist/js/environment/langs.js +1 -1
  6. package/dist/langs.js.gzip +0 -0
  7. package/dist/networks/Face-chunk.js +1 -1
  8. package/dist/networks/angle03032023.onnx.gzip +0 -0
  9. package/dist/networks/blurWorker.js.gzip +0 -0
  10. package/dist/networks/bubbleWorker.js.gzip +0 -0
  11. package/dist/networks/faceDetection03032023.onnx.gzip +0 -0
  12. package/dist/networks/faceLandmark03032023.onnx.gzip +0 -0
  13. package/dist/networks/mrz03032023.onnx.gzip +0 -0
  14. package/dist/networks/mrzWorker.js.gzip +0 -0
  15. package/dist/networks/ort-wasm-simd.wasm.gzip +0 -0
  16. package/dist/networks/ort-wasm.wasm.gzip +0 -0
  17. package/dist/networks/pdfWorker.js.gzip +0 -0
  18. package/dist/networks/yoloFaceFingers.onnx.gzip +0 -0
  19. package/dist/types/defaultConfig.d.ts +3 -1
  20. package/dist/types/environment/langs.d.ts +1 -0
  21. package/dist/types/loop.d.ts +2 -1
  22. package/dist/types/modules/App/UI.d.ts +1 -0
  23. package/dist/types/modules/Config.d.ts +9 -2
  24. package/dist/types/modules/Step.d.ts +2 -0
  25. package/dist/types/modules/ui/ControlButton/iconTemplate.d.ts +2 -0
  26. package/dist/types/modules/ui/HelpTooltip/HelpTooltip.d.ts +3 -0
  27. package/dist/types/modules/ui/HelpTooltip/index.d.ts +1 -0
  28. package/dist/types/modules/ui/InitScreeen/InitScreen.d.ts +1 -1
  29. package/dist/types/modules/ui/SelectDocumentType.d.ts +6 -2
  30. package/dist/types/modules/ui/VideoWrapper/VideoWrapper.d.ts +2 -0
  31. package/dist/types/modules/validation/ValidateDocumentTypes.d.ts +2 -0
  32. package/dist/types/util.d.ts +5 -1
  33. package/package.json +1 -1
  34. package/dist/types/modules/ui/ControlButton/controlButtonTemplate.d.ts +0 -1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -24,14 +24,16 @@ export type StepConfig = {
24
24
  enableDesktopNotification?: boolean;
25
25
  enableFourCornerCapture?: boolean;
26
26
  shouldRecordVideo?: boolean;
27
+ delayUntilCaptureButtonVisible?: number;
27
28
  };
28
29
  export type DocumentType = {
29
30
  type: DocumentTypeName;
30
31
  steps: StepConfig[];
31
32
  mode?: StepMode;
33
+ tooltipText?: string;
32
34
  };
33
35
  type ImageURI = 'png' | 'jpeg' | 'webp';
34
- 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';
36
+ 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';
35
37
  /**
36
38
  * IDefaultConfig
37
39
  * @param {string} name,
@@ -52,6 +52,7 @@ interface IHintTexts {
52
52
  holdCamera: string;
53
53
  captureCorners: string;
54
54
  frontSideNotMatch: string;
55
+ demandCaptureMessage: string;
55
56
  }
56
57
  interface IGeneral {
57
58
  step: string;
@@ -3,7 +3,8 @@ export interface IMrzCoords {
3
3
  locations: MRZLocation;
4
4
  color: 'green' | 'yellow';
5
5
  }
6
- export declare const loopTimeout: (ms: number) => Promise<unknown>;
6
+ export declare const loopTimeout: (ms: number) => Promise<void>;
7
+ export declare const demandCapturingTimeout: (ms: number) => Promise<void>;
7
8
  export declare const unmountIDVC: () => void;
8
9
  export declare const loop: () => Promise<false>;
9
10
  declare const _default: {
@@ -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;
@@ -21,6 +21,7 @@ export interface IStepObj {
21
21
  configs?: StepConfig[];
22
22
  stepTypeImageName: StepTypeImageName;
23
23
  shouldRecordVideo?: boolean;
24
+ delayUntilCaptureButtonVisible?: number;
24
25
  }
25
26
  export interface IStepCallback {
26
27
  /** base64 encoded step image */
@@ -68,6 +69,7 @@ export default class Step implements IStepCallback, IStepObj {
68
69
  cameraInfo: Record<string, any>;
69
70
  stepTypeImageName: StepTypeImageName;
70
71
  shouldRecordVideo: boolean;
72
+ delayUntilCaptureButtonVisible?: number;
71
73
  constructor(nameOrObj: string | IStepObj, type?: StepType, camera?: VideoFacingModeEnum, time?: number, img?: Base64Image | null);
72
74
  get isShowManualSwitchButton(): boolean;
73
75
  get capturingMode(): StepMode;
@@ -0,0 +1,2 @@
1
+ import { TemplateResult } from 'lit-html';
2
+ export declare const iconTemplate: (type: string) => TemplateResult;
@@ -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;
@@ -31,6 +31,7 @@ export declare class VideoWrapper {
31
31
  private cameraErrorHeader;
32
32
  private cameraErrorText;
33
33
  private UIComponents;
34
+ private isShowDemandButton;
34
35
  constructor(componentWrapper: HTMLElement);
35
36
  updateVideoWrap({ currentStepImg, currentStepObj, }: UpdateVideoWrapParams): void;
36
37
  setMirroring(isMirroring: boolean): void;
@@ -39,6 +40,7 @@ export declare class VideoWrapper {
39
40
  setFakeContourStyles(width: number): void;
40
41
  hideVideoError(): void;
41
42
  showVideoError(errorCode: string): void;
43
+ showDemandButton(): void;
42
44
  private init;
43
45
  setCameraErrorText(header: string, text: string): void;
44
46
  showCameraError(): void;
@@ -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.2.0",
3
+ "version": "3.4.0",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",
@@ -1 +0,0 @@
1
- export declare const template: (state: any) => import("lit-html").TemplateResult<1>;