@regulaforensics/vp-frontend-document-components 7.6.2186-rc → 7.6.2242-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.
- package/dist/index.d.ts +116 -85
- package/dist/main.iife.js +27 -27
- package/dist/main.js +15086 -16120
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContainerList } from '@regulaforensics/document-reader-webclient';
|
|
2
2
|
import { GetTransactionsByTagResponse } from '@regulaforensics/document-reader-webclient';
|
|
3
|
+
import { Light } from '@regulaforensics/document-reader-webclient';
|
|
3
4
|
import { ProcessParams } from '@regulaforensics/document-reader-webclient';
|
|
4
5
|
import { ProcessResponse } from '@regulaforensics/document-reader-webclient';
|
|
5
6
|
import { Response as Response_2 } from '@regulaforensics/document-reader-webclient';
|
|
@@ -37,7 +38,7 @@ export declare type CameraSnapshotResponseType = Array<{
|
|
|
37
38
|
|
|
38
39
|
export declare interface CameraSnapshotSettings {
|
|
39
40
|
startScreen?: boolean;
|
|
40
|
-
locale?: Locales
|
|
41
|
+
locale?: Locales;
|
|
41
42
|
multipleFileInput?: boolean;
|
|
42
43
|
regulaLogo?: boolean;
|
|
43
44
|
copyright?: boolean;
|
|
@@ -53,6 +54,10 @@ export declare interface CameraSnapshotSettings {
|
|
|
53
54
|
uploadFileButton?: boolean;
|
|
54
55
|
mirrorButton?: boolean;
|
|
55
56
|
mirrorType?: MirrorType;
|
|
57
|
+
statusPositionMultiplier?: number;
|
|
58
|
+
statusIcon?: boolean;
|
|
59
|
+
activityIndicatorPortraitPositionMultiplier?: number;
|
|
60
|
+
activityIndicatorLandscapePositionMultiplier?: number;
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
export declare type CaptureFrameType = {
|
|
@@ -70,7 +75,7 @@ export declare enum CaptureMode {
|
|
|
70
75
|
export declare type CaptureType = Array<Omit<CaptureFrameType, 'imageData'>>;
|
|
71
76
|
|
|
72
77
|
export declare interface CurrentPage {
|
|
73
|
-
data:
|
|
78
|
+
data: DocumentReaderResponseType | null;
|
|
74
79
|
startNextPage: () => Promise<void>;
|
|
75
80
|
finishRecognition: () => void;
|
|
76
81
|
}
|
|
@@ -92,6 +97,22 @@ export declare interface DetailEvent<A, R> {
|
|
|
92
97
|
|
|
93
98
|
export declare type DocumentDictionaries = Partial<Record<Locales, DocumentTranslations>>;
|
|
94
99
|
|
|
100
|
+
declare enum DocumentImageType {
|
|
101
|
+
Unknown = 0,
|
|
102
|
+
PassportSinglePage = 1,
|
|
103
|
+
PassportTwoPages = 2,
|
|
104
|
+
IDFront = 3,
|
|
105
|
+
IDFrontMRZ = 4,
|
|
106
|
+
IDBack = 5,
|
|
107
|
+
IDBackMrz = 6,
|
|
108
|
+
IDBackBarcode = 7,
|
|
109
|
+
IDBackBarcodeMRZ = 8,
|
|
110
|
+
BankCardFront = 9,
|
|
111
|
+
BankCardBack = 10,
|
|
112
|
+
DocumentFront = 11,
|
|
113
|
+
DocumentBack = 12
|
|
114
|
+
}
|
|
115
|
+
|
|
95
116
|
declare enum DocumentReaderAttributes {
|
|
96
117
|
locale = "locale",
|
|
97
118
|
multiple = "multiple",
|
|
@@ -112,12 +133,12 @@ export declare class DocumentReaderCaptureWebComponent extends HTMLElement {
|
|
|
112
133
|
private _translations;
|
|
113
134
|
private _settings;
|
|
114
135
|
constructor();
|
|
115
|
-
static get observedAttributes(): CameraSnapshotAttributes
|
|
136
|
+
static get observedAttributes(): Array<CameraSnapshotAttributes>;
|
|
116
137
|
private onEvent;
|
|
117
138
|
attributeChangedCallback(name: CameraSnapshotAttributes): void;
|
|
118
139
|
connectedCallback(): void;
|
|
119
|
-
set translations(dictionary:
|
|
120
|
-
get translations():
|
|
140
|
+
set translations(dictionary: DocumentDictionaries | null);
|
|
141
|
+
get translations(): DocumentDictionaries | null;
|
|
121
142
|
set settings(params: CameraSnapshotSettings);
|
|
122
143
|
get settings(): CameraSnapshotSettings;
|
|
123
144
|
private render;
|
|
@@ -147,8 +168,8 @@ export declare class DocumentReaderProcessor {
|
|
|
147
168
|
isInitialized: boolean;
|
|
148
169
|
videoElement: HTMLVideoElement | null;
|
|
149
170
|
constructor(videoElement?: HTMLVideoElement);
|
|
150
|
-
get recognizeListener():
|
|
151
|
-
set recognizeListener(listener:
|
|
171
|
+
get recognizeListener(): RecognizeListener | null;
|
|
172
|
+
set recognizeListener(listener: RecognizeListener | null);
|
|
152
173
|
get streamParam(): Partial<StreamParams>;
|
|
153
174
|
set streamParam(params: Partial<StreamParams>);
|
|
154
175
|
get recognizerProcessParam(): ProcessingRequest;
|
|
@@ -164,8 +185,8 @@ export declare class DocumentReaderProcessor {
|
|
|
164
185
|
private startNewPage;
|
|
165
186
|
private startNewDocument;
|
|
166
187
|
switchCamera(): Promise<void>;
|
|
167
|
-
startRecognition(responseListener?: ResponseListener): Promise<
|
|
168
|
-
processImage(images: FileList | Array<Blob>): Promise<
|
|
188
|
+
startRecognition(responseListener?: ResponseListener): Promise<DocumentReaderResponseType | null>;
|
|
189
|
+
processImage(images: FileList | Array<Blob>): Promise<DocumentReaderResponseType>;
|
|
169
190
|
stopRecognition(): void;
|
|
170
191
|
initialize(license?: {
|
|
171
192
|
license: string | undefined;
|
|
@@ -174,6 +195,7 @@ export declare class DocumentReaderProcessor {
|
|
|
174
195
|
}
|
|
175
196
|
|
|
176
197
|
export declare type DocumentReaderProcessParam = Pick<ProcessParams, 'generateNumericCodes' | 'returnUncroppedImage' | 'log' | 'resultTypeOutput' | 'customParams' | 'imageOutputMaxHeight' | 'imageOutputMaxWidth' | 'fieldTypesFilter' | 'dateFormat' | 'measureSystem' | 'imageDpiOutMax' | 'alreadyCropped' | 'fastDocDetect' | 'updateOCRValidityByGlare' | 'returnCroppedBarcode' | 'respectImageQuality' | 'forceDocFormat' | 'noGraphics' | 'depersonalizeLog' | 'multiDocOnImage' | 'shiftExpiryDate' | 'minimalHolderAge' | 'mrzFormatsFilter' | 'forceReadMrzBeforeLocate' | 'parseBarcodes' | 'splitNames' | 'doublePageSpread' | 'strictImageQuality' | 'doDetectCan' | 'generateDoublePageSpreadImage' | 'mrzDetectMode' | 'strictBarcodeDigitalSignatureCheck' | 'selectLongestNames'> & {
|
|
198
|
+
generateAlpha2Codes?: boolean;
|
|
177
199
|
returnPackageForReprocess?: boolean;
|
|
178
200
|
scenario?: InternalScenarios;
|
|
179
201
|
multipageProcessing?: boolean;
|
|
@@ -182,6 +204,10 @@ export declare type DocumentReaderProcessParam = Pick<ProcessParams, 'generateNu
|
|
|
182
204
|
timeoutFromFirstDocType?: number;
|
|
183
205
|
documentAreaMin?: number;
|
|
184
206
|
imageQa?: {
|
|
207
|
+
angleThreshold?: number;
|
|
208
|
+
focusCheck?: boolean;
|
|
209
|
+
documentPositionIndent?: number;
|
|
210
|
+
brightnessThreshold?: number;
|
|
185
211
|
expectedPass?: Array<ImageQualityChecks>;
|
|
186
212
|
dpiThreshold?: number;
|
|
187
213
|
glaresCheck?: boolean;
|
|
@@ -235,9 +261,9 @@ export declare class DocumentReaderService {
|
|
|
235
261
|
license: string | undefined;
|
|
236
262
|
}): Promise<License>;
|
|
237
263
|
private doProcess;
|
|
238
|
-
processImageBase64(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<
|
|
239
|
-
process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<
|
|
240
|
-
processImage(imageDataArray: Array<ImageData> | Array<ArrayBuffer>, params?: ProcessingRequest): Promise<
|
|
264
|
+
processImageBase64(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<DocumentReaderResponseType>;
|
|
265
|
+
process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<DocumentReaderResponseType>;
|
|
266
|
+
processImage(imageDataArray: Array<ImageData> | Array<ArrayBuffer>, params?: ProcessingRequest): Promise<DocumentReaderResponseType>;
|
|
241
267
|
startNewPage(): Promise<void>;
|
|
242
268
|
startNewDocument(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
243
269
|
createBackendTransaction(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
@@ -252,15 +278,11 @@ export declare interface DocumentReaderSettings extends CameraSnapshotSettings {
|
|
|
252
278
|
devLicense?: string;
|
|
253
279
|
captureButton?: boolean;
|
|
254
280
|
captureMode?: CaptureMode;
|
|
255
|
-
flipFrontIcon?: string;
|
|
256
|
-
flipBackIcon?: string;
|
|
257
281
|
skipButton?: boolean;
|
|
258
282
|
cameraFrameBorderWidth?: number;
|
|
259
283
|
backgroundMaskAlpha?: number;
|
|
260
284
|
cameraFramePortraitAspectRatio?: number;
|
|
261
285
|
cameraFrameLandscapeAspectRatio?: number;
|
|
262
|
-
statusPositionMultiplier?: number;
|
|
263
|
-
statusIcon?: boolean;
|
|
264
286
|
cameraFrameOffsetWidth?: number;
|
|
265
287
|
cameraFrameVerticalPositionMultiplier?: number;
|
|
266
288
|
cameraFrameHorizontalPositionMultiplier?: number;
|
|
@@ -288,67 +310,19 @@ export declare class DocumentReaderWebComponent extends HTMLElement {
|
|
|
288
310
|
private _translations;
|
|
289
311
|
private _settings;
|
|
290
312
|
constructor();
|
|
291
|
-
static get observedAttributes(): DocumentReaderAttributes
|
|
313
|
+
static get observedAttributes(): Array<DocumentReaderAttributes>;
|
|
292
314
|
private onEvent;
|
|
293
315
|
attributeChangedCallback(name: DocumentReaderAttributes): void;
|
|
294
316
|
connectedCallback(): void;
|
|
295
|
-
set translations(dictionary:
|
|
296
|
-
get translations():
|
|
317
|
+
set translations(dictionary: DocumentDictionaries | null);
|
|
318
|
+
get translations(): DocumentDictionaries | null;
|
|
297
319
|
set settings(params: DocumentReaderSettings);
|
|
298
320
|
get settings(): DocumentReaderSettings;
|
|
299
321
|
private render;
|
|
300
322
|
disconnectedCallback(): void;
|
|
301
323
|
}
|
|
302
324
|
|
|
303
|
-
export declare
|
|
304
|
-
scanIDInBrowser?: string;
|
|
305
|
-
useYourDeviceCamera?: string;
|
|
306
|
-
success?: string;
|
|
307
|
-
processingFinished?: string;
|
|
308
|
-
largeFile?: string;
|
|
309
|
-
selectSmallerFile?: string;
|
|
310
|
-
versionNotSupported?: string;
|
|
311
|
-
httpNotSupported?: string;
|
|
312
|
-
insecurePageContext?: string;
|
|
313
|
-
updateBrowser?: string;
|
|
314
|
-
licenseError?: string;
|
|
315
|
-
licenseExpired?: string;
|
|
316
|
-
fileCorrupt?: string;
|
|
317
|
-
selectAnotherFile?: string;
|
|
318
|
-
timeout?: string;
|
|
319
|
-
error?: string;
|
|
320
|
-
somethingWentWrong?: string;
|
|
321
|
-
tryAgain?: string;
|
|
322
|
-
fromCamera?: string;
|
|
323
|
-
fromGallery?: string;
|
|
324
|
-
processing?: string;
|
|
325
|
-
preparingService?: string;
|
|
326
|
-
placeDocumentIntoFrame?: string;
|
|
327
|
-
positionDocumentCenter?: string;
|
|
328
|
-
noFocus?: string;
|
|
329
|
-
moveCloser?: string;
|
|
330
|
-
glaresOnDocument?: string;
|
|
331
|
-
holdDocumentStraight?: string;
|
|
332
|
-
documentProcessing?: string;
|
|
333
|
-
flipDocument?: string;
|
|
334
|
-
cameraUnavailable?: string;
|
|
335
|
-
preparingCamera?: string;
|
|
336
|
-
noCameraAvailable?: string;
|
|
337
|
-
incorrectCameraId?: string;
|
|
338
|
-
allowAccessToCamera?: string;
|
|
339
|
-
cameraConnection?: string;
|
|
340
|
-
checkCameraId?: string;
|
|
341
|
-
photoCapturedSuccessfully?: string;
|
|
342
|
-
uploadPhoto?: string;
|
|
343
|
-
useCameraOrGallery?: string;
|
|
344
|
-
connect?: string;
|
|
345
|
-
disconnect?: string;
|
|
346
|
-
process?: string;
|
|
347
|
-
device?: string;
|
|
348
|
-
service?: string;
|
|
349
|
-
autoScan?: string;
|
|
350
|
-
keepDeviceStill?: string;
|
|
351
|
-
}
|
|
325
|
+
export declare type DocumentTranslations = Partial<Record<Labels, string>>;
|
|
352
326
|
|
|
353
327
|
export declare enum ErrorTypes {
|
|
354
328
|
WASM_ERROR = "WASM_ERROR",
|
|
@@ -399,6 +373,13 @@ export declare enum FrameLineCap {
|
|
|
399
373
|
square = "square"
|
|
400
374
|
}
|
|
401
375
|
|
|
376
|
+
export declare interface FramePosition {
|
|
377
|
+
frameBottom: number;
|
|
378
|
+
frameLeft: number;
|
|
379
|
+
frameRight: number;
|
|
380
|
+
frameTop: number;
|
|
381
|
+
}
|
|
382
|
+
|
|
402
383
|
export declare enum FrameShapeType {
|
|
403
384
|
line = "line",
|
|
404
385
|
corners = "corners"
|
|
@@ -409,6 +390,19 @@ export declare class FullScreenContainer extends HTMLElement {
|
|
|
409
390
|
constructor();
|
|
410
391
|
}
|
|
411
392
|
|
|
393
|
+
declare enum HoloAnimationType {
|
|
394
|
+
Unknown = 0,
|
|
395
|
+
Horizontal = 1,
|
|
396
|
+
Vertical = 2,
|
|
397
|
+
LeftBottomRightTop = 4,
|
|
398
|
+
RightBottomLeftTop = 8
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export declare interface HoloData {
|
|
402
|
+
hologramTiltType: HoloAnimationType;
|
|
403
|
+
livenessAnimationImage: DocumentImageType;
|
|
404
|
+
}
|
|
405
|
+
|
|
412
406
|
export declare interface ICameraSnapshot {
|
|
413
407
|
locale?: Locales;
|
|
414
408
|
copyright?: boolean;
|
|
@@ -426,14 +420,10 @@ export declare interface IDocumentReader extends ICameraSnapshot {
|
|
|
426
420
|
'capture-button'?: boolean;
|
|
427
421
|
}
|
|
428
422
|
|
|
429
|
-
export declare
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
frameTop: number;
|
|
434
|
-
light: number;
|
|
435
|
-
resolutionType: number;
|
|
436
|
-
}
|
|
423
|
+
export declare type ImageInputParamType = Partial<FramePosition> & {
|
|
424
|
+
light?: Light;
|
|
425
|
+
resolutionType?: number;
|
|
426
|
+
};
|
|
437
427
|
|
|
438
428
|
export declare type ImageProcessingRequest = BaseRequest;
|
|
439
429
|
|
|
@@ -461,6 +451,10 @@ declare interface IOptions {
|
|
|
461
451
|
color?: string;
|
|
462
452
|
}
|
|
463
453
|
|
|
454
|
+
declare type Labels = 'preparingCamera' | 'timeout' | 'noFocus' | 'somethingWentWrong' | 'incorrectCameraId' | 'done' | 'cameraUnavailable' | 'versionNotSupported' | 'httpNotSupported' | 'insecurePageContext' | 'badLicense' | 'fileCorrupt' | 'largeFile' | 'placeDocumentIntoFrame' | 'holdDocumentStraight' | 'glaresOnDocument' | 'tryAgain' | 'noCameraAvailable' | 'positionDocumentCenter' | 'uploadPhoto' | 'moveCloser' | 'keepDeviceStill' | 'camera' | 'switchToMobile' | 'openPhoneCamera' | 'pleaseWait' | 'mobileDevice' | 'verifyYourIdentity' | 'fromCameraFilesMobileDesktop' | 'fromCameraFilesDesktop' | 'fromCameraMobileDesktop' | 'fromFilesMobileDesktop' | 'fromCameraDesktop' | 'fromFilesDesktop' | 'fromMobileDesktop' | 'fromCameraGalleryMobile' | 'fromGalleryMobile' | 'gallery' | 'files' | 'returnToComputer' | 'documentCaptured';
|
|
455
|
+
|
|
456
|
+
declare type Languages = 'ru' | 'en' | 'de' | 'pl' | 'it' | 'hu' | 'zh' | 'sk' | 'uk' | 'fr' | 'es' | 'pt' | 'ar' | 'nl' | 'id' | 'vi' | 'ko' | 'ms' | 'ro' | 'el' | 'tr' | 'ja' | 'cs' | 'th' | 'hi' | 'bn' | 'he' | 'fi' | 'sv' | 'da' | 'hr' | 'no' | 'uz' | 'hy' | 'ky';
|
|
457
|
+
|
|
464
458
|
export declare type License = {
|
|
465
459
|
license: {
|
|
466
460
|
errorCode: number;
|
|
@@ -470,7 +464,7 @@ export declare type License = {
|
|
|
470
464
|
scenario: Array<TScenarioParams>;
|
|
471
465
|
};
|
|
472
466
|
|
|
473
|
-
export declare type Locales =
|
|
467
|
+
export declare type Locales = Languages | string;
|
|
474
468
|
|
|
475
469
|
export declare const Logger: Logger_2;
|
|
476
470
|
|
|
@@ -502,6 +496,8 @@ export declare interface PackageParams {
|
|
|
502
496
|
metadata?: Record<string, any>;
|
|
503
497
|
}
|
|
504
498
|
|
|
499
|
+
export declare type ProcessHoloResponse = HoloData & ProcessResponseWithLight;
|
|
500
|
+
|
|
505
501
|
export declare interface ProcessingRequest extends BaseRequest {
|
|
506
502
|
metadata?: Record<string, any>;
|
|
507
503
|
delegateProcessing?: {
|
|
@@ -512,13 +508,21 @@ export declare interface ProcessingRequest extends BaseRequest {
|
|
|
512
508
|
imagesList?: Array<DocumentReaderImage>;
|
|
513
509
|
}
|
|
514
510
|
|
|
511
|
+
export declare interface ProcessMultiPageResponse extends ProcessResponse {
|
|
512
|
+
multipageAnimationImage: Array<DocumentImageType>;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
515
|
export declare interface ProcessRejectResponse extends ProcessResponse {
|
|
516
516
|
licensing_code: number;
|
|
517
517
|
reject_message: string;
|
|
518
518
|
reject_reason: number;
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
-
declare
|
|
521
|
+
export declare interface ProcessResponseWithLight extends ProcessResponse {
|
|
522
|
+
lightType: Array<Light>;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
declare type RecognizeListener = (data: DocumentReaderResponseType) => void;
|
|
522
526
|
|
|
523
527
|
export declare type Resolution = Partial<WidthAndHeight>;
|
|
524
528
|
|
|
@@ -607,24 +611,51 @@ export * from "@regulaforensics/document-reader-webclient";
|
|
|
607
611
|
export { }
|
|
608
612
|
|
|
609
613
|
|
|
614
|
+
|
|
610
615
|
declare global {
|
|
616
|
+
const UI_COMPONENTS_VERSION: string;
|
|
617
|
+
const DOC_WASM_S3_PATH: string;
|
|
618
|
+
const DOCUMENT_API: string;
|
|
619
|
+
const LICENSE: string | undefined;
|
|
620
|
+
|
|
621
|
+
namespace React.JSX {
|
|
622
|
+
interface IntrinsicElements {
|
|
623
|
+
'document-reader': React.DetailedHTMLProps<
|
|
624
|
+
IDocumentReader & React.HTMLAttributes<DocumentReaderWebComponent>,
|
|
625
|
+
DocumentReaderWebComponent
|
|
626
|
+
>;
|
|
627
|
+
'camera-snapshot': React.DetailedHTMLProps<
|
|
628
|
+
ICameraSnapshot & React.HTMLAttributes<DocumentReaderCaptureWebComponent>,
|
|
629
|
+
DocumentReaderCaptureWebComponent
|
|
630
|
+
>;
|
|
631
|
+
'fullscreen-container': React.DetailedHTMLProps<
|
|
632
|
+
React.HTMLAttributes<FullScreenContainer>,
|
|
633
|
+
FullScreenContainer
|
|
634
|
+
>;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
611
638
|
interface HTMLElementEventMap {
|
|
612
639
|
'document-reader': CustomEvent<DocumentReaderDetailType | TransactionEvent>;
|
|
613
640
|
'camera-snapshot': CustomEvent<CameraSnapshotDetailType>;
|
|
614
641
|
}
|
|
642
|
+
|
|
615
643
|
interface Window {
|
|
616
644
|
RegulaDocumentSDK: DocumentReaderService;
|
|
617
645
|
}
|
|
618
646
|
}
|
|
619
647
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
var URL: string;
|
|
648
|
+
declare global {
|
|
649
|
+
const VERSION: string;
|
|
650
|
+
const ENV: string;
|
|
624
651
|
}
|
|
625
652
|
|
|
653
|
+
declare module 'react' {
|
|
654
|
+
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
655
|
+
part?: string;
|
|
656
|
+
}
|
|
626
657
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
658
|
+
interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
659
|
+
part?: string;
|
|
660
|
+
}
|
|
630
661
|
}
|