@regulaforensics/vp-frontend-document-components 7.2.1705-nightly → 7.2.1707-nightly

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,41 +0,0 @@
1
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
2
-
3
- /**
4
- * @license React
5
- * react-dom.production.min.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
-
13
- /**
14
- * @license React
15
- * react-jsx-runtime.production.min.js
16
- *
17
- * Copyright (c) Facebook, Inc. and its affiliates.
18
- *
19
- * This source code is licensed under the MIT license found in the
20
- * LICENSE file in the root directory of this source tree.
21
- */
22
-
23
- /**
24
- * @license React
25
- * react.production.min.js
26
- *
27
- * Copyright (c) Facebook, Inc. and its affiliates.
28
- *
29
- * This source code is licensed under the MIT license found in the
30
- * LICENSE file in the root directory of this source tree.
31
- */
32
-
33
- /**
34
- * @license React
35
- * scheduler.production.min.js
36
- *
37
- * Copyright (c) Facebook, Inc. and its affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */
package/lib/index.d.ts DELETED
@@ -1,496 +0,0 @@
1
- import {
2
- Response,
3
- Result,
4
- TextFieldType,
5
- MeasureSystem,
6
- DocumentFormat,
7
- MRZFormat,
8
- ContainerList,
9
- } from '@regulaforensics/document-reader-webclient';
10
-
11
- type ErrorTypes =
12
- | 'WASM_ERROR'
13
- | 'WASM_LICENSE'
14
- | 'FILE_SIZE'
15
- | 'INCORRECT_FILE'
16
- | 'INCORRECT_SCENARIO'
17
- | 'UNKNOWN_ERROR'
18
- | 'NOT_SUPPORTED'
19
- | 'CAMERA_UNKNOWN_ERROR'
20
- | 'CAMERA_PERMISSION_DENIED'
21
- | 'NO_CAMERA'
22
- | 'INCORRECT_CAMERA_ID'
23
- | 'CONNECTION_ERROR';
24
-
25
- type DocumentEventActions =
26
- | 'ELEMENT_VISIBLE'
27
- | 'PRESS_CAMERA_BUTTON'
28
- | 'PRESS_FILE_BUTTON'
29
- | 'PRESS_RETRY_BUTTON'
30
- | 'PRESS_SKIP_BUTTON'
31
- | 'PRESS_CAPTURE_BUTTON'
32
- | 'PRESS_CHANGE_CAMERA_BUTTON'
33
- | 'PRESS_MIRRORING_BUTTON'
34
- | 'PRESS_CONNECT_BUTTON'
35
- | 'PRESS_DISCONNECT_BUTTON'
36
- | 'PRESS_AUTOSCAN_BUTTON'
37
- | 'PRESS_PROCESS_BUTTON'
38
- | 'NEW_PAGE_AVAILABLE'
39
- | 'NEW_PAGE_STARTED'
40
- | 'CLOSE'
41
- | 'CAMERA_PROCESS_CLOSED'
42
- | 'CAMERA_PROCESS_STARTED'
43
- | 'VIDEO_STARTED'
44
- | 'VIDEO_STOPPED'
45
- | 'FILE_PROCESS_STARTED'
46
- | 'PROCESS_STARTED'
47
- | 'PROCESS_FINISHED'
48
- | 'SERVICE_INITIALIZED';
49
-
50
- type Locales =
51
- | 'ru'
52
- | 'en'
53
- | 'de'
54
- | 'pl'
55
- | 'it'
56
- | 'hu'
57
- | 'zh'
58
- | 'sk'
59
- | 'uk'
60
- | 'fr'
61
- | 'es'
62
- | 'pt'
63
- | 'ar'
64
- | 'nl'
65
- | 'id'
66
- | 'vi'
67
- | 'ko'
68
- | 'ms'
69
- | 'ro'
70
- | 'el'
71
- | 'tr'
72
- | 'ja'
73
- | 'cs'
74
- | 'th'
75
- | 'hi'
76
- | 'bn'
77
- | 'he'
78
- | 'fi'
79
- | 'sv'
80
- | 'da'
81
- | 'hr'
82
- | 'no'
83
- | string;
84
-
85
- type InternalScenarios =
86
- | 'MrzAndLocate'
87
- | 'MrzOrLocate'
88
- | 'Mrz'
89
- | 'Locate'
90
- | 'Barcode'
91
- | 'MrzOrBarcode'
92
- | 'BarcodeAndLocate';
93
-
94
- type CaptureMode = 'auto' | 'captureVideo' | 'captureFrame';
95
-
96
- type FrameShapeType = 'line' | 'corners';
97
-
98
- type FrameLineCap = 'butt' | 'round' | 'square';
99
-
100
- type CameraMode = 'user' | 'environment';
101
-
102
- type DocumentReaderResponseType = Response & { TransactionInfo?: TransactionInfo };
103
- type CameraSnapshotResponseType = Array<{ raw: string; mimeType: string }>;
104
-
105
- declare enum ResponseCode {
106
- EMPTY = -1,
107
- ERROR = 0,
108
- OK = 1,
109
- TIMEOUT = 2,
110
- }
111
-
112
- interface CustomEventDataType<R> {
113
- status: ResponseCode;
114
- details?: unknown;
115
- reason?: ErrorTypes;
116
- response?: R;
117
- video?: VideoData;
118
- }
119
-
120
- interface DetailEvent<A, R> {
121
- action: A;
122
- data: CustomEventDataType<R> | null;
123
- }
124
-
125
- interface ImageInputParamType {
126
- frameBottom: number;
127
- frameLeft: number;
128
- frameRight: number;
129
- frameTop: number;
130
- light: number;
131
- resolutionType: number;
132
- }
133
-
134
- type CaptureFrameType = {
135
- imageData: Array<ImageData>;
136
- raw: string;
137
- mimeType: string;
138
- };
139
-
140
- type CaptureType = Array<Omit<CaptureFrameType, 'imageData'>>;
141
-
142
- interface DocumentReaderImage {
143
- data: string;
144
- light: number;
145
- pageIdx: number;
146
- }
147
-
148
- interface WidthAndHeight {
149
- width: number;
150
- height: number;
151
- }
152
-
153
- type Resolution = Partial<WidthAndHeight>;
154
-
155
- interface StreamParams {
156
- cameraMode: CameraMode;
157
- preferredCameraId: string;
158
- resolution: Resolution;
159
- }
160
-
161
- interface VideoData {
162
- data: Blob;
163
- mimeType: string;
164
- }
165
-
166
- interface VideoRecordSettings {
167
- delay?: number;
168
- duration?: number;
169
- }
170
-
171
- interface TransactionInfo {
172
- tag: string;
173
- transactionId: string;
174
- }
175
-
176
- interface PackageParams {
177
- sizeBytes: number;
178
- dataName: string;
179
- metadata?: Record<string, any>;
180
- }
181
-
182
- interface DocumentReaderProcessParam {
183
- returnPackageForReprocess?: boolean;
184
- returnUncroppedImage?: boolean;
185
- scenario?: InternalScenarios;
186
- multipageProcessing?: boolean;
187
- timeout?: number;
188
- log?: boolean;
189
- timeoutFromFirstDetect?: number;
190
- timeoutFromFirstDocType?: number;
191
- resultTypeOutput?: Array<Result>;
192
- customParams?: Record<string, object>;
193
- imageOutputMaxHeight?: number;
194
- imageOutputMaxWidth?: number;
195
- fieldTypesFilter?: Array<TextFieldType>;
196
- dateFormat?: string;
197
- measureSystem?: MeasureSystem;
198
- imageDpiOutMax?: number;
199
- alreadyCropped?: boolean;
200
- fastDocDetect?: boolean;
201
- updateOCRValidityByGlare?: boolean;
202
- returnCroppedBarcode?: boolean;
203
- respectImageQuality?: boolean;
204
- forceDocFormat?: DocumentFormat;
205
- noGraphics?: boolean;
206
- documentAreaMin?: number;
207
- depersonalizeLog?: boolean;
208
- multiDocOnImage?: boolean;
209
- shiftExpiryDate?: number;
210
- minimalHolderAge?: number;
211
- mrzFormatsFilter?: Array<MRZFormat>;
212
- forceReadMrzBeforeLocate?: boolean;
213
- parseBarcodes?: boolean;
214
- splitNames?: boolean;
215
- imageQa?: {
216
- expectedPass?: Array<string>;
217
- dpiThreshold?: number;
218
- glaresCheck?: boolean;
219
- glaresCheckParams?: {
220
- imgMarginPart?: number;
221
- maxGlaringPart?: number;
222
- };
223
- };
224
- backendProcessing?: {
225
- serviceURL?: string;
226
- httpHeaders?: Record<string, string>;
227
- };
228
- }
229
-
230
- interface NewTransaction {
231
- ContainerList: ContainerList;
232
- TransactionInfo: {
233
- ComputerName: string;
234
- DateTime: string;
235
- SystemInfo: string;
236
- Tag: string;
237
- TransactionID: string;
238
- };
239
- sessionLogFolder: string;
240
- }
241
-
242
- interface BaseRequest {
243
- tag?: string;
244
- tenant?: string;
245
- env?: string;
246
- }
247
-
248
- interface ProcessingRequest extends BaseRequest {
249
- metadata?: Record<string, any>;
250
- processParam: DocumentReaderProcessParam;
251
- imagesList?: Array<DocumentReaderImage>;
252
- imageInputParam?: ImageInputParamType;
253
- }
254
-
255
- interface ImageProcessingRequest extends BaseRequest {
256
- imageInputParam?: ImageInputParamType;
257
- processParam: Pick<
258
- DocumentReaderProcessParam,
259
- 'returnPackageForReprocess' | 'returnUncroppedImage' | 'scenario' | 'backendProcessing'
260
- >;
261
- }
262
-
263
- interface CurrentPage {
264
- data: Response | null;
265
- startNextPage: () => Promise<void>;
266
- finishRecognition: () => void;
267
- }
268
-
269
- interface DocumentTranslations {
270
- scanIDInBrowser?: string;
271
- useYourDeviceCamera?: string;
272
- success?: string;
273
- processingFinished?: string;
274
- largeFile?: string;
275
- selectSmallerFile?: string;
276
- versionNotSupported?: string;
277
- updateBrowser?: string;
278
- licenseError?: string;
279
- licenseExpired?: string;
280
- fileCorrupt?: string;
281
- selectAnotherFile?: string;
282
- timeout?: string;
283
- error?: string;
284
- somethingWentWrong?: string;
285
- tryAgain?: string;
286
- fromCamera?: string;
287
- fromGallery?: string;
288
- processing?: string;
289
- preparingService?: string;
290
- placeDocumentIntoFrame?: string;
291
- positionDocumentCenter?: string;
292
- noFocus?: string;
293
- moveCloser?: string;
294
- glaresOnDocument?: string;
295
- holdDocumentStraight?: string;
296
- documentProcessing?: string;
297
- flipDocument?: string;
298
- cameraUnavailable?: string;
299
- preparingCamera?: string;
300
- noCameraAvailable?: string;
301
- incorrectCameraId?: string;
302
- allowAccessToCamera?: string;
303
- cameraConnection?: string;
304
- checkCameraId?: string;
305
- photoCapturedSuccessfully?: string;
306
- uploadPhoto?: string;
307
- useCameraOrGallery?: string;
308
- connect?: string;
309
- disconnect?: string;
310
- process?: string;
311
- device?: string;
312
- service?: string;
313
- autoScan?: string;
314
- keepDeviceStill?: string;
315
- }
316
-
317
- interface CameraSnapshotSettings {
318
- startScreen?: boolean;
319
- locale?: Locales | string;
320
- multipleFileInput?: boolean;
321
- regulaLogo?: boolean;
322
- cameraId?: string;
323
- changeCameraButton?: boolean;
324
- closeButton?: boolean;
325
- resolution?: Resolution;
326
- cameraMode?: CameraMode;
327
- nonce?: string;
328
- statusTextColor?: string;
329
- statusBackgroundColor?: string;
330
- }
331
-
332
- interface DocumentReaderSettings extends CameraSnapshotSettings {
333
- internalScenario?: InternalScenarios | string;
334
- multipageProcessing?: boolean;
335
- devLicense?: string;
336
- captureButton?: boolean;
337
- captureMode?: CaptureMode;
338
- flipFrontIcon?: string;
339
- flipBackIcon?: string;
340
- skipButton?: boolean;
341
- cameraFrameBorderWidth?: number;
342
- backgroundMaskAlpha?: number;
343
- cameraFramePortraitAspectRatio?: number;
344
- cameraFrameLandscapeAspectRatio?: number;
345
- statusPositionMultiplier?: number;
346
- statusIcon?: boolean;
347
- cameraFrameOffsetWidth?: number;
348
- cameraFrameVerticalPositionMultiplier?: number;
349
- cameraFrameShapeType?: FrameShapeType;
350
- cameraFrameLineCap?: FrameLineCap;
351
- cameraFrameLineLength?: number;
352
- cameraFrameCornerRadius?: number;
353
- cameraFrameActiveColor?: string;
354
- cameraFrameDefaultColor?: string;
355
- cameraFrame?: boolean;
356
- captureButtonDelay?: number;
357
- videoRecord?: boolean | VideoRecordSettings;
358
- videoCaptureMotionControl?: boolean;
359
- }
360
-
361
- type TScenarioParams = {
362
- name: string;
363
- desc: string;
364
- caption: string;
365
- frameKWHDoublePageSpreadLandscape: string;
366
- frameKWHDoublePageSpreadPortrait: string;
367
- frameKWHLandscape: string;
368
- frameKWHPortrait: string;
369
- frameOrientation: number;
370
- barcodeExt?: number;
371
- faceExt?: number;
372
- manualCrop?: number;
373
- multiPageOff?: number;
374
- seriesProcessMode?: number;
375
- UVTorch?: number;
376
- };
377
-
378
- type DocumentDictionaries = Partial<Record<Locales, DocumentTranslations>>;
379
- type RecognizeListener = (data: Response) => void;
380
- type ResponseListener = (currentPage: CurrentPage) => void;
381
- type PrepareListener = ({ isPrepared }: { isPrepared: boolean }) => void;
382
- type ProcessingListener = ({ isProcessing }: { isProcessing: boolean }) => void;
383
- type InitializeListener = ({ isInitialized }: { isInitialized: boolean }) => void;
384
-
385
- declare global {
386
- interface HTMLElementEventMap {
387
- 'document-reader': CustomEvent<DocumentReaderDetailType>;
388
- 'camera-snapshot': CustomEvent<CameraSnapshotDetailType>;
389
- }
390
- }
391
-
392
- export interface ICameraSnapshot {
393
- locale?: Locales;
394
- copyright?: boolean;
395
- 'camera-id'?: string;
396
- 'change-camera'?: boolean;
397
- 'start-screen'?: boolean;
398
- multiple?: boolean;
399
- 'close-button'?: boolean;
400
- }
401
-
402
- export type License = {
403
- license: {
404
- errorCode: number;
405
- message: string;
406
- status: boolean;
407
- };
408
- scenario: Array<TScenarioParams>;
409
- };
410
-
411
- export interface IDocumentReader extends ICameraSnapshot {
412
- 'internal-scenario'?: InternalScenarios;
413
- 'multipage-processing'?: boolean;
414
- license?: string;
415
- 'capture-button'?: boolean;
416
- }
417
-
418
- export interface ILogger {
419
- logListener: (log: string) => void;
420
- }
421
-
422
- declare const Logger: ILogger;
423
-
424
- export type DocumentReaderDetailType = DetailEvent<DocumentEventActions, DocumentReaderResponseType>;
425
- export type CameraSnapshotDetailType = DetailEvent<DocumentEventActions, CameraSnapshotResponseType>;
426
-
427
- export function defineComponents(): Promise<void>;
428
-
429
- export class FullScreenContainer extends HTMLElement {}
430
-
431
- export class DocumentReaderWebComponent extends HTMLElement {
432
- set translations(dictionary: DocumentDictionaries | null);
433
- get translations(): DocumentDictionaries | null;
434
- set settings(params: DocumentReaderSettings);
435
- get settings(): DocumentReaderSettings;
436
- }
437
-
438
- export class DocumentReaderCaptureWebComponent extends HTMLElement {
439
- set translations(dictionary: DocumentDictionaries | null);
440
- get translations(): DocumentDictionaries | null;
441
- set settings(params: CameraSnapshotSettings);
442
- get settings(): CameraSnapshotSettings;
443
- }
444
-
445
- export class DocumentReaderProcessor {
446
- isProcessing: boolean;
447
- isInitialized: boolean;
448
- videoElement: HTMLVideoElement | null;
449
- constructor(videoElement?: HTMLVideoElement);
450
- get recognizeListener(): RecognizeListener | null;
451
- set recognizeListener(listener: RecognizeListener | null);
452
- get streamParam(): Partial<StreamParams>;
453
- set streamParam(params: Partial<StreamParams>);
454
- get recognizerProcessParam(): ProcessingRequest;
455
- set recognizerProcessParam(params: ProcessingRequest);
456
- get imageProcessParam(): ImageProcessingRequest;
457
- set imageProcessParam(params: ImageProcessingRequest);
458
- get workerPath(): string;
459
- set workerPath(url: string);
460
- switchCamera(): Promise<void>;
461
- startRecognition(responseListener?: ResponseListener): Promise<Response | null>;
462
- processImage(images: FileList | Array<Blob>): Promise<Response>;
463
- stopRecognition(): void;
464
- initialize(license?: { license: string | undefined }): Promise<License>;
465
- shutdown(): void;
466
- }
467
-
468
- export class DocumentReaderService {
469
- isAutoPrepare: boolean;
470
- isPrepared: boolean;
471
- isInitialized: boolean;
472
- isProcessing: boolean;
473
- initData: License | null;
474
- recognizerProcessParam: ProcessingRequest;
475
- imageProcessParam: ImageProcessingRequest;
476
- recognizeListener: RecognizeListener | null;
477
- workerPath: string;
478
- version: { component: string };
479
- get processingListener(): ProcessingListener | null;
480
- set processingListener(listener: ProcessingListener | null);
481
- get prepareListener(): PrepareListener | null;
482
- set prepareListener(listener: PrepareListener | null);
483
- get initializeListener(): InitializeListener | null;
484
- set initializeListener(listener: InitializeListener | null);
485
- prepare(): Promise<void>;
486
- initialize(initData?: { license: string | undefined }): Promise<License>;
487
- processImageBase64(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<Response>;
488
- process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
489
- processImage(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
490
- startNewPage(): Promise<void>;
491
- startNewDocument(metadata?: Record<string, any>): Promise<NewTransaction>;
492
- createBackendTransaction(metadata?: Record<string, any>): Promise<NewTransaction>;
493
- finalizePackage(): Promise<TransactionInfo>;
494
- addDataToPackage(data: Uint8ClampedArray, params: PackageParams): Promise<void>;
495
- shutdown(): void;
496
- }