@idscan/idvc2 2.8.1 → 2.8.2

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,4 +1,5 @@
1
- import { ISize } from '../helpers/image';
1
+ import type { ISize } from '../helpers/image';
2
+ import type { PDFPreProcessResult, PDFResult } from '../types/pdf';
2
3
  interface Coord {
3
4
  x: number;
4
5
  y: number;
@@ -46,10 +47,6 @@ export declare class PdfModule {
46
47
  * @param {{width: number, height: number}} canvasSizes - ui.borderCanvas
47
48
  */
48
49
  init(geometry: any, minPDFframes: any, cropSize: any, canvasSizes: any): void;
49
- /**
50
- * returns error Object
51
- * @return {{errorType: string, error: boolean, errorVal: string}}
52
- */
53
50
  licenseError(): {
54
51
  error: boolean;
55
52
  errorType: string;
@@ -60,7 +57,7 @@ export declare class PdfModule {
60
57
  initReader(key: any): void;
61
58
  destroyReader(): void;
62
59
  setPdfData(data: any): void;
63
- readPdf(): any;
60
+ readPdf(): PDFResult;
64
61
  releasePdf(): void;
65
62
  create(): void;
66
63
  free(): void;
@@ -71,32 +68,8 @@ export declare class PdfModule {
71
68
  };
72
69
  allocate(): void;
73
70
  drawCords(locations: Record<string, number>): Coord[];
74
- processPDF(data: ImageData): {
75
- status: boolean;
76
- predict: boolean;
77
- touch: boolean;
78
- image: any;
79
- type: string;
80
- error: any;
81
- coords: any[];
82
- trackString: string;
83
- pdfSuccessCount: number;
84
- pdfCount: number;
85
- isSuccessProcess: boolean;
86
- pdfCapturedCount: number;
87
- };
88
- processPDFWithPreProcess(data: ImageData): {
89
- error: boolean;
90
- errorType: string;
91
- errorVal: any;
92
- } | {
93
- direction: any;
94
- status: any;
95
- error: any;
96
- location: any;
97
- resultParams: any;
98
- trackString: any;
99
- };
71
+ processPDF(data: ImageData): Record<string, any>;
72
+ processPDFWithPreProcess(data: ImageData): PDFPreProcessResult;
100
73
  private readPDF;
101
74
  private readPDFWithPreProcess;
102
75
  }
@@ -0,0 +1,8 @@
1
+ export declare enum EResultStatus {
2
+ Empty = 0,
3
+ Detected = 1,
4
+ Decoded = 2,
5
+ Error = 3,
6
+ InvalidLicenseKey = 4,
7
+ LicenseKeyHasExpired = 5
8
+ }
@@ -0,0 +1,43 @@
1
+ import { EResultStatus } from './enums/pdf';
2
+ export type PDFParameters = {
3
+ rows: number;
4
+ columns: number;
5
+ ecl: number;
6
+ };
7
+ export type PDFLocation = {
8
+ x1: number;
9
+ y1: number;
10
+ x2: number;
11
+ y2: number;
12
+ x3: number;
13
+ y3: number;
14
+ x4: number;
15
+ y4: number;
16
+ };
17
+ export type PDFStatus = {
18
+ value: EResultStatus;
19
+ };
20
+ export type PDFResult = {
21
+ error?: any;
22
+ data: string;
23
+ errorDesc: string;
24
+ location: PDFLocation;
25
+ parameters: PDFParameters;
26
+ status: PDFStatus;
27
+ trackString?: string;
28
+ };
29
+ export type PDFError = {
30
+ errorType: string;
31
+ error: boolean;
32
+ errorVal: any;
33
+ };
34
+ export type PDFPreProcessResult = {
35
+ direction: {
36
+ value: number;
37
+ };
38
+ error: string;
39
+ location: PDFLocation;
40
+ resultParams: PDFParameters;
41
+ status: PDFStatus;
42
+ trackString: string;
43
+ } | PDFError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",