@idscan/idvc2 2.7.7 → 2.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 @@
1
- export declare const MIN_BACK_WITHOUT_BARCODE_FRAMES = 5;
1
+ export declare const MIN_BACK_WITHOUT_BARCODE_FRAMES = 6;
@@ -20,7 +20,7 @@ export declare const drawImageOnTestCanvas: (idata: ImageData | HTMLImageElement
20
20
  canvas: HTMLCanvasElement;
21
21
  ctx: CanvasRenderingContext2D;
22
22
  };
23
- export declare const drawCropOnCanvas: (idata: ImageData, bbox: Bbox, ctx: CanvasRenderingContext2D) => void;
23
+ export declare const drawCropOnCanvas: (bbox: Bbox, ctx: CanvasRenderingContext2D) => void;
24
24
  export declare const resize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement, offsets?: IOffset, cropSizes?: ISize) => ImageData;
25
25
  export declare const cropAndResize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement) => {
26
26
  crop: ICrop;
@@ -31,5 +31,16 @@ export declare const rectCenter: (start: Point, end: Point) => Point;
31
31
  export declare const angleBetweenTwoVectors: (vector1: number[], vector2: number[]) => number;
32
32
  export declare const distanceBetweenPointsXoR: (p1: Point, p2: Point) => number;
33
33
  export declare const triangleArea: (a: number, b: number, c: number) => number;
34
+ export declare const calculateBboxAspectRatio: (bbox: {
35
+ topLeft: {
36
+ x: number;
37
+ y: number;
38
+ };
39
+ bottomRight: {
40
+ x: number;
41
+ y: number;
42
+ };
43
+ }) => number;
44
+ export declare const isValidAspectRatio: (aspectRatio: number) => boolean;
34
45
  declare const geometry: Geometry;
35
46
  export default geometry;
@@ -1,13 +1,16 @@
1
1
  import { ClassLocalExitType } from '../neural models/classLocal/exits';
2
2
  export type Status = 'PENDING' | 'FULFILLED';
3
- interface ProcessUploadedImageResult {
3
+ type ClassLocalRecognitionResult = Promise<{
4
4
  side: ClassLocalExitType;
5
+ aspectRatio: number;
6
+ }>;
7
+ type ProcessUploadedImageResult = Awaited<ClassLocalRecognitionResult> & {
5
8
  perimeter: 'low' | 'ok';
6
- }
7
- interface FillingQueueResult {
8
- promise: Promise<ClassLocalExitType>;
9
+ };
10
+ type FillingQueueResult = {
9
11
  status: Status;
10
- }
12
+ promise: ClassLocalRecognitionResult;
13
+ };
11
14
  export declare const clearQueue: () => void;
12
15
  export declare const processUploadedImage: (smallImage: ImageData) => Promise<ProcessUploadedImageResult>;
13
16
  export declare const fillingQueue: (smallImage?: ImageData) => Promise<FillingQueueResult>;
@@ -13,7 +13,6 @@ export declare class PdfModule {
13
13
  out: any;
14
14
  isAllocate: boolean;
15
15
  successCount: number;
16
- _errorId: number;
17
16
  edgMem: any;
18
17
  src2: any;
19
18
  outLen: any;
@@ -26,6 +25,10 @@ export declare class PdfModule {
26
25
  cropSizes: ISize;
27
26
  canvasSizes: ISize;
28
27
  constructor(core: any, processor: any);
28
+ _errorId: number;
29
+ get errorId(): number;
30
+ set errorId(id: number);
31
+ get errorVal(): any;
29
32
  /**
30
33
  *
31
34
  * @param geometry
@@ -34,9 +37,6 @@ export declare class PdfModule {
34
37
  * @param {{width: number, height: number}} canvasSizes - ui.borderCanvas
35
38
  */
36
39
  init(geometry: any, minPDFframes: any, cropSize: any, canvasSizes: any): void;
37
- set errorId(id: number);
38
- get errorId(): number;
39
- get errorVal(): any;
40
40
  /**
41
41
  * returns error Object
42
42
  * @return {{errorType: string, error: boolean, errorVal: string}}
@@ -1,20 +1,3 @@
1
- import { Status } from '../FrontProcessing';
2
- import { ClassLocalExitType } from '../../neural models/classLocal/exits';
3
- interface ClassLocalResult {
4
- type: ClassLocalExitType;
5
- status: Status;
6
- }
7
1
  export declare const dropRes: () => void;
8
- declare const _default: (data: ImageData, result?: ClassLocalResult) => Promise<{
9
- status: boolean;
10
- predict: boolean;
11
- touch: boolean;
12
- image: ImageData;
13
- type: string;
14
- error: any;
15
- coords: any[];
16
- trackString: string;
17
- pdfSuccessCount: number;
18
- pdfCount: number;
19
- }>;
2
+ declare const _default: (data: ImageData) => Promise<Record<string, any>>;
20
3
  export default _default;
@@ -1,8 +1,10 @@
1
+ import { StepType } from '../../environment/stepsDescription';
1
2
  declare class MaskCapture {
2
- #private;
3
- private svg;
4
- private strokeMask;
3
+ private readonly svg;
4
+ private readonly strokeMask;
5
5
  private successMask;
6
+ private readonly pdfHint;
7
+ private readonly mrzHint;
6
8
  private type;
7
9
  private cssVarContainer;
8
10
  private borders;
@@ -11,6 +13,7 @@ declare class MaskCapture {
11
13
  width: string;
12
14
  height: string;
13
15
  };
16
+ private mappedState;
14
17
  constructor(cssVarContainer: any);
15
18
  /**
16
19
  * get computed width and height of element
@@ -21,6 +24,10 @@ declare class MaskCapture {
21
24
  width: string;
22
25
  height: string;
23
26
  };
27
+ applyMaskCaptureSizes(mainContainer: Element, currentStepType: StepType): void;
28
+ applyCaptureHintMask(mainContainer: Element): void;
29
+ applyMainContainerSize(mainContainer: Element): void;
30
+ changeHintState(currentStepType: StepType): void;
24
31
  get svgSizes(): {
25
32
  width: string;
26
33
  height: string;
@@ -30,16 +37,29 @@ declare class MaskCapture {
30
37
  height: number;
31
38
  };
32
39
  get strokeLength(): number;
40
+ private calculateUserSizes;
41
+ private set borderSizes(value);
42
+ private calculateEnvironmentSizes;
43
+ private calculateFieldMaskSizes;
44
+ private applySizes;
33
45
  set sizes({ width, height }: {
34
46
  width: any;
35
47
  height: any;
36
48
  });
49
+ private addAnimation;
50
+ private removeAnimation;
37
51
  set fillPercentage(percentage: any);
38
52
  /**
39
53
  * sets the type of capturing mask and it position on screen
40
54
  * @param {VideoFacingModeEnum} type - 'environment', 'user'
41
55
  */
42
56
  set maskType(type: any);
57
+ /**
58
+ *
59
+ * @param {Number} size1
60
+ * @param {Number} size2
61
+ */
62
+ private calculateSize;
43
63
  /**
44
64
  * resizes frame based on width and height of main container
45
65
  * @param {{width: number, height: number}} param - width and height of main container
@@ -45,6 +45,7 @@ declare class Ui {
45
45
  constructor();
46
46
  initTypeSelect(): void;
47
47
  resizeMainContainer(): void;
48
+ updateMaskCapture(): void;
48
49
  updateHoldText(data?: number, isCorrectDirection?: boolean): void;
49
50
  updateStepImg(): void;
50
51
  showVideoError(errorCode: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "2.7.7",
3
+ "version": "2.8.0",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",