@regulaforensics/vp-frontend-document-components 7.6.2186-rc → 7.6.2241-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 -83
- package/dist/main.iife.js +25 -25
- package/dist/main.js +14808 -14977
- 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>;
|
|
@@ -259,8 +285,6 @@ export declare interface DocumentReaderSettings extends CameraSnapshotSettings {
|
|
|
259
285
|
backgroundMaskAlpha?: number;
|
|
260
286
|
cameraFramePortraitAspectRatio?: number;
|
|
261
287
|
cameraFrameLandscapeAspectRatio?: number;
|
|
262
|
-
statusPositionMultiplier?: number;
|
|
263
|
-
statusIcon?: boolean;
|
|
264
288
|
cameraFrameOffsetWidth?: number;
|
|
265
289
|
cameraFrameVerticalPositionMultiplier?: number;
|
|
266
290
|
cameraFrameHorizontalPositionMultiplier?: number;
|
|
@@ -288,67 +312,19 @@ export declare class DocumentReaderWebComponent extends HTMLElement {
|
|
|
288
312
|
private _translations;
|
|
289
313
|
private _settings;
|
|
290
314
|
constructor();
|
|
291
|
-
static get observedAttributes(): DocumentReaderAttributes
|
|
315
|
+
static get observedAttributes(): Array<DocumentReaderAttributes>;
|
|
292
316
|
private onEvent;
|
|
293
317
|
attributeChangedCallback(name: DocumentReaderAttributes): void;
|
|
294
318
|
connectedCallback(): void;
|
|
295
|
-
set translations(dictionary:
|
|
296
|
-
get translations():
|
|
319
|
+
set translations(dictionary: DocumentDictionaries | null);
|
|
320
|
+
get translations(): DocumentDictionaries | null;
|
|
297
321
|
set settings(params: DocumentReaderSettings);
|
|
298
322
|
get settings(): DocumentReaderSettings;
|
|
299
323
|
private render;
|
|
300
324
|
disconnectedCallback(): void;
|
|
301
325
|
}
|
|
302
326
|
|
|
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
|
-
}
|
|
327
|
+
export declare type DocumentTranslations = Partial<Record<Labels, string>>;
|
|
352
328
|
|
|
353
329
|
export declare enum ErrorTypes {
|
|
354
330
|
WASM_ERROR = "WASM_ERROR",
|
|
@@ -399,6 +375,13 @@ export declare enum FrameLineCap {
|
|
|
399
375
|
square = "square"
|
|
400
376
|
}
|
|
401
377
|
|
|
378
|
+
export declare interface FramePosition {
|
|
379
|
+
frameBottom: number;
|
|
380
|
+
frameLeft: number;
|
|
381
|
+
frameRight: number;
|
|
382
|
+
frameTop: number;
|
|
383
|
+
}
|
|
384
|
+
|
|
402
385
|
export declare enum FrameShapeType {
|
|
403
386
|
line = "line",
|
|
404
387
|
corners = "corners"
|
|
@@ -409,6 +392,19 @@ export declare class FullScreenContainer extends HTMLElement {
|
|
|
409
392
|
constructor();
|
|
410
393
|
}
|
|
411
394
|
|
|
395
|
+
declare enum HoloAnimationType {
|
|
396
|
+
Unknown = 0,
|
|
397
|
+
Horizontal = 1,
|
|
398
|
+
Vertical = 2,
|
|
399
|
+
LeftBottomRightTop = 4,
|
|
400
|
+
RightBottomLeftTop = 8
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export declare interface HoloData {
|
|
404
|
+
hologramTiltType: HoloAnimationType;
|
|
405
|
+
livenessAnimationImage: DocumentImageType;
|
|
406
|
+
}
|
|
407
|
+
|
|
412
408
|
export declare interface ICameraSnapshot {
|
|
413
409
|
locale?: Locales;
|
|
414
410
|
copyright?: boolean;
|
|
@@ -426,14 +422,10 @@ export declare interface IDocumentReader extends ICameraSnapshot {
|
|
|
426
422
|
'capture-button'?: boolean;
|
|
427
423
|
}
|
|
428
424
|
|
|
429
|
-
export declare
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
frameTop: number;
|
|
434
|
-
light: number;
|
|
435
|
-
resolutionType: number;
|
|
436
|
-
}
|
|
425
|
+
export declare type ImageInputParamType = Partial<FramePosition> & {
|
|
426
|
+
light?: Light;
|
|
427
|
+
resolutionType?: number;
|
|
428
|
+
};
|
|
437
429
|
|
|
438
430
|
export declare type ImageProcessingRequest = BaseRequest;
|
|
439
431
|
|
|
@@ -461,6 +453,10 @@ declare interface IOptions {
|
|
|
461
453
|
color?: string;
|
|
462
454
|
}
|
|
463
455
|
|
|
456
|
+
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';
|
|
457
|
+
|
|
458
|
+
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';
|
|
459
|
+
|
|
464
460
|
export declare type License = {
|
|
465
461
|
license: {
|
|
466
462
|
errorCode: number;
|
|
@@ -470,7 +466,7 @@ export declare type License = {
|
|
|
470
466
|
scenario: Array<TScenarioParams>;
|
|
471
467
|
};
|
|
472
468
|
|
|
473
|
-
export declare type Locales =
|
|
469
|
+
export declare type Locales = Languages | string;
|
|
474
470
|
|
|
475
471
|
export declare const Logger: Logger_2;
|
|
476
472
|
|
|
@@ -502,6 +498,8 @@ export declare interface PackageParams {
|
|
|
502
498
|
metadata?: Record<string, any>;
|
|
503
499
|
}
|
|
504
500
|
|
|
501
|
+
export declare type ProcessHoloResponse = HoloData & ProcessResponseWithLight;
|
|
502
|
+
|
|
505
503
|
export declare interface ProcessingRequest extends BaseRequest {
|
|
506
504
|
metadata?: Record<string, any>;
|
|
507
505
|
delegateProcessing?: {
|
|
@@ -512,13 +510,21 @@ export declare interface ProcessingRequest extends BaseRequest {
|
|
|
512
510
|
imagesList?: Array<DocumentReaderImage>;
|
|
513
511
|
}
|
|
514
512
|
|
|
513
|
+
export declare interface ProcessMultiPageResponse extends ProcessResponse {
|
|
514
|
+
multipageAnimationImage: Array<DocumentImageType>;
|
|
515
|
+
}
|
|
516
|
+
|
|
515
517
|
export declare interface ProcessRejectResponse extends ProcessResponse {
|
|
516
518
|
licensing_code: number;
|
|
517
519
|
reject_message: string;
|
|
518
520
|
reject_reason: number;
|
|
519
521
|
}
|
|
520
522
|
|
|
521
|
-
declare
|
|
523
|
+
export declare interface ProcessResponseWithLight extends ProcessResponse {
|
|
524
|
+
lightType: Array<Light>;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
declare type RecognizeListener = (data: DocumentReaderResponseType) => void;
|
|
522
528
|
|
|
523
529
|
export declare type Resolution = Partial<WidthAndHeight>;
|
|
524
530
|
|
|
@@ -607,24 +613,51 @@ export * from "@regulaforensics/document-reader-webclient";
|
|
|
607
613
|
export { }
|
|
608
614
|
|
|
609
615
|
|
|
616
|
+
|
|
610
617
|
declare global {
|
|
618
|
+
const UI_COMPONENTS_VERSION: string;
|
|
619
|
+
const DOC_WASM_S3_PATH: string;
|
|
620
|
+
const DOCUMENT_API: string;
|
|
621
|
+
const LICENSE: string | undefined;
|
|
622
|
+
|
|
623
|
+
namespace React.JSX {
|
|
624
|
+
interface IntrinsicElements {
|
|
625
|
+
'document-reader': React.DetailedHTMLProps<
|
|
626
|
+
IDocumentReader & React.HTMLAttributes<DocumentReaderWebComponent>,
|
|
627
|
+
DocumentReaderWebComponent
|
|
628
|
+
>;
|
|
629
|
+
'camera-snapshot': React.DetailedHTMLProps<
|
|
630
|
+
ICameraSnapshot & React.HTMLAttributes<DocumentReaderCaptureWebComponent>,
|
|
631
|
+
DocumentReaderCaptureWebComponent
|
|
632
|
+
>;
|
|
633
|
+
'fullscreen-container': React.DetailedHTMLProps<
|
|
634
|
+
React.HTMLAttributes<FullScreenContainer>,
|
|
635
|
+
FullScreenContainer
|
|
636
|
+
>;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
611
640
|
interface HTMLElementEventMap {
|
|
612
641
|
'document-reader': CustomEvent<DocumentReaderDetailType | TransactionEvent>;
|
|
613
642
|
'camera-snapshot': CustomEvent<CameraSnapshotDetailType>;
|
|
614
643
|
}
|
|
644
|
+
|
|
615
645
|
interface Window {
|
|
616
646
|
RegulaDocumentSDK: DocumentReaderService;
|
|
617
647
|
}
|
|
618
648
|
}
|
|
619
649
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
var URL: string;
|
|
650
|
+
declare global {
|
|
651
|
+
const VERSION: string;
|
|
652
|
+
const ENV: string;
|
|
624
653
|
}
|
|
625
654
|
|
|
655
|
+
declare module 'react' {
|
|
656
|
+
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
657
|
+
part?: string;
|
|
658
|
+
}
|
|
626
659
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
660
|
+
interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
661
|
+
part?: string;
|
|
662
|
+
}
|
|
630
663
|
}
|