@regulaforensics/vp-frontend-document-components 2.4.0 → 2.5.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.
- package/README.md +349 -165
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +0 -10
- package/esm/main.js +1 -1
- package/esm/main.js.LICENSE.txt +0 -10
- package/lib/index.d.ts +74 -18
- package/package.json +1 -1
package/esm/main.js.LICENSE.txt
CHANGED
|
@@ -39,13 +39,3 @@
|
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
@license @nocompile
|
|
45
|
-
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
46
|
-
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
47
|
-
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
48
|
-
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
49
|
-
Code distributed by Google as part of the polymer project is also
|
|
50
|
-
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
51
|
-
*/
|
package/lib/index.d.ts
CHANGED
|
@@ -1668,6 +1668,7 @@ interface OriginalSymbol {
|
|
|
1668
1668
|
}
|
|
1669
1669
|
|
|
1670
1670
|
interface TextFieldValue {
|
|
1671
|
+
containerType: number;
|
|
1671
1672
|
source: Source;
|
|
1672
1673
|
value: string;
|
|
1673
1674
|
originalValue?: string;
|
|
@@ -2051,9 +2052,16 @@ type DocumentEventActions =
|
|
|
2051
2052
|
| 'PRESS_FILE_BUTTON'
|
|
2052
2053
|
| 'PRESS_RETRY_BUTTON'
|
|
2053
2054
|
| 'PRESS_SKIP_BUTTON'
|
|
2055
|
+
| 'PRESS_CAPTURE_BUTTON'
|
|
2056
|
+
| 'PRESS_CHANGE_CAMERA_BUTTON'
|
|
2057
|
+
| 'PRESS_MIRRORING_BUTTON'
|
|
2058
|
+
| 'NEW_PAGE_AVAILABLE'
|
|
2059
|
+
| 'NEW_PAGE_STARTED'
|
|
2054
2060
|
| 'CLOSE'
|
|
2055
2061
|
| 'CAMERA_PROCESS_CLOSED'
|
|
2056
2062
|
| 'CAMERA_PROCESS_STARTED'
|
|
2063
|
+
| 'VIDEO_STARTED'
|
|
2064
|
+
| 'VIDEO_STOPPED'
|
|
2057
2065
|
| 'FILE_PROCESS_STARTED'
|
|
2058
2066
|
| 'PROCESS_FINISHED'
|
|
2059
2067
|
| 'SERVICE_INITIALIZED';
|
|
@@ -2102,6 +2110,12 @@ type InternalScenarios =
|
|
|
2102
2110
|
| 'MrzOrBarcode'
|
|
2103
2111
|
| 'BarcodeAndLocate';
|
|
2104
2112
|
|
|
2113
|
+
type CaptureMode = 'auto' | 'captureVideo' | 'captureFrame';
|
|
2114
|
+
|
|
2115
|
+
type FrameShapeType = 'line' | 'corners';
|
|
2116
|
+
|
|
2117
|
+
type FrameLineCap = 'butt' | 'round' | 'square';
|
|
2118
|
+
|
|
2105
2119
|
type DocumentReaderResponseType = Response;
|
|
2106
2120
|
type CameraSnapshotResponseType = Array<{ raw: string; mimeType: string }>;
|
|
2107
2121
|
|
|
@@ -2166,8 +2180,6 @@ interface DocumentReaderProcessParam {
|
|
|
2166
2180
|
customParams?: Record<string, object>;
|
|
2167
2181
|
imageOutputMaxHeight?: number;
|
|
2168
2182
|
imageOutputMaxWidth?: number;
|
|
2169
|
-
doublePageSpread?: boolean;
|
|
2170
|
-
generateDoublePageSpreadImage?: boolean;
|
|
2171
2183
|
fieldTypesFilter?: Array<TextFieldType>;
|
|
2172
2184
|
dateFormat?: string;
|
|
2173
2185
|
measureSystem?: MeasureSystem;
|
|
@@ -2260,6 +2272,7 @@ interface CameraSnapshotSettings {
|
|
|
2260
2272
|
cameraId?: string;
|
|
2261
2273
|
changeCameraButton?: boolean;
|
|
2262
2274
|
closeButton?: boolean;
|
|
2275
|
+
nonce?: string;
|
|
2263
2276
|
}
|
|
2264
2277
|
|
|
2265
2278
|
interface DocumentReaderSettings extends CameraSnapshotSettings {
|
|
@@ -2267,20 +2280,47 @@ interface DocumentReaderSettings extends CameraSnapshotSettings {
|
|
|
2267
2280
|
multipageProcessing?: boolean;
|
|
2268
2281
|
devLicense?: string;
|
|
2269
2282
|
captureButton?: boolean;
|
|
2270
|
-
|
|
2283
|
+
captureMode?: CaptureMode | string;
|
|
2284
|
+
flipFrontIcon?: string;
|
|
2285
|
+
flipBackIcon?: string;
|
|
2286
|
+
skipButton?: boolean;
|
|
2287
|
+
cameraFrameBorderWidth?: number;
|
|
2288
|
+
backgroundMaskAlpha?: number;
|
|
2289
|
+
cameraFramePortraitAspectRatio?: number;
|
|
2290
|
+
cameraFrameLandscapeAspectRatio?: number;
|
|
2291
|
+
statusPositionMultiplier?: number;
|
|
2292
|
+
statusIcon?: number;
|
|
2293
|
+
cameraFrameOffsetWidth?: number;
|
|
2294
|
+
cameraFrameVerticalPositionMultiplier?: number;
|
|
2295
|
+
cameraFrameShapeType?: FrameShapeType;
|
|
2296
|
+
cameraFrameLineCap?: FrameLineCap;
|
|
2297
|
+
cameraFrameLineLength?: number;
|
|
2298
|
+
cameraFrameCornerRadius?: number;
|
|
2299
|
+
cameraFrame?: boolean;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
type TScenarioParams = {
|
|
2303
|
+
name: string;
|
|
2304
|
+
desc: string;
|
|
2305
|
+
caption: string;
|
|
2306
|
+
frameKWHDoublePageSpreadLandscape: string;
|
|
2307
|
+
frameKWHDoublePageSpreadPortrait: string;
|
|
2308
|
+
frameKWHLandscape: string;
|
|
2309
|
+
frameKWHPortrait: string;
|
|
2310
|
+
frameOrientation: number;
|
|
2311
|
+
barcodeExt?: number;
|
|
2312
|
+
faceExt?: number;
|
|
2313
|
+
manualCrop?: number;
|
|
2314
|
+
multiPageOff?: number;
|
|
2315
|
+
seriesProcessMode?: number;
|
|
2316
|
+
UVTorch?: number;
|
|
2317
|
+
};
|
|
2271
2318
|
|
|
2272
2319
|
type DocumentDictionaries = Partial<Record<Locales, DocumentTranslations>>;
|
|
2273
2320
|
type RecognizeListener = (data: Response) => void;
|
|
2274
2321
|
type ResponseListener = (currentPage: CurrentPage) => void;
|
|
2275
2322
|
type PrepareListener = ({ isPrepared }: { isPrepared: boolean }) => void;
|
|
2276
|
-
|
|
2277
|
-
interface TLicense {
|
|
2278
|
-
license: {
|
|
2279
|
-
errorCode: number;
|
|
2280
|
-
message: string;
|
|
2281
|
-
status: boolean;
|
|
2282
|
-
};
|
|
2283
|
-
}
|
|
2323
|
+
type InitializeListener = ({ isInitialized }: { isInitialized: boolean }) => void;
|
|
2284
2324
|
|
|
2285
2325
|
declare global {
|
|
2286
2326
|
interface HTMLElementEventMap {
|
|
@@ -2299,6 +2339,15 @@ export interface ICameraSnapshot {
|
|
|
2299
2339
|
'close-button'?: boolean;
|
|
2300
2340
|
}
|
|
2301
2341
|
|
|
2342
|
+
export type License = {
|
|
2343
|
+
license: {
|
|
2344
|
+
errorCode: number;
|
|
2345
|
+
message: string;
|
|
2346
|
+
status: boolean;
|
|
2347
|
+
};
|
|
2348
|
+
scenario: Array<TScenarioParams>;
|
|
2349
|
+
};
|
|
2350
|
+
|
|
2302
2351
|
export interface IDocumentReader extends ICameraSnapshot {
|
|
2303
2352
|
'internal-scenario'?: InternalScenarios;
|
|
2304
2353
|
'multipage-processing'?: boolean;
|
|
@@ -2328,41 +2377,48 @@ export class DocumentReaderCaptureWebComponent extends HTMLElement {
|
|
|
2328
2377
|
}
|
|
2329
2378
|
|
|
2330
2379
|
export class DocumentReaderProcessor {
|
|
2331
|
-
isPrepared: boolean;
|
|
2332
2380
|
isProcessing: boolean;
|
|
2333
2381
|
isInitialized: boolean;
|
|
2334
2382
|
videoElement: HTMLVideoElement | null;
|
|
2335
|
-
recognizeListener: RecognizeListener | null;
|
|
2336
2383
|
constructor(videoElement?: HTMLVideoElement);
|
|
2384
|
+
get recognizeListener(): RecognizeListener | null;
|
|
2385
|
+
set recognizeListener(listener: RecognizeListener | null);
|
|
2337
2386
|
get streamParam(): Partial<StreamParams>;
|
|
2338
2387
|
set streamParam(params: Partial<StreamParams>);
|
|
2339
2388
|
get recognizerProcessParam(): ProcessingRequest;
|
|
2340
2389
|
set recognizerProcessParam(params: ProcessingRequest);
|
|
2341
2390
|
get imageProcessParam(): ImageProcessingRequest;
|
|
2342
2391
|
set imageProcessParam(params: ImageProcessingRequest);
|
|
2392
|
+
get workerPath(): string;
|
|
2393
|
+
set workerPath(url: string);
|
|
2343
2394
|
switchCamera(): Promise<void>;
|
|
2344
2395
|
startRecognition(responseListener?: ResponseListener): Promise<Response | null>;
|
|
2345
2396
|
processImage(images: FileList | Array<Blob>): Promise<Response>;
|
|
2346
2397
|
stopRecognition(): void;
|
|
2347
|
-
|
|
2348
|
-
initialize(license?: { license: string | undefined }): Promise<TLicense>;
|
|
2398
|
+
initialize(license?: { license: string | undefined }): Promise<License>;
|
|
2349
2399
|
shutdown(): void;
|
|
2350
2400
|
}
|
|
2351
2401
|
|
|
2352
2402
|
export class DocumentReaderService {
|
|
2403
|
+
isAutoPrepare: boolean;
|
|
2353
2404
|
isPrepared: boolean;
|
|
2354
2405
|
isInitialized: boolean;
|
|
2355
2406
|
isProcessing: boolean;
|
|
2407
|
+
initData: License | null;
|
|
2356
2408
|
recognizerProcessParam: ProcessingRequest;
|
|
2357
2409
|
imageProcessParam: ImageProcessingRequest;
|
|
2410
|
+
recognizeListener: RecognizeListener | null;
|
|
2411
|
+
workerPath: string;
|
|
2358
2412
|
version: { component: string };
|
|
2359
2413
|
get prepareListener(): PrepareListener | null;
|
|
2360
2414
|
set prepareListener(listener: PrepareListener | null);
|
|
2415
|
+
get initializeListener(): InitializeListener | null;
|
|
2416
|
+
set initializeListener(listener: InitializeListener | null);
|
|
2361
2417
|
prepare(): Promise<void>;
|
|
2362
|
-
initialize(initData?: { license: string | undefined }): Promise<
|
|
2418
|
+
initialize(initData?: { license: string | undefined }): Promise<License>;
|
|
2363
2419
|
processImageBase64(base64ImagesArray: Array<string>, params: ProcessingRequest): Promise<Response>;
|
|
2364
|
-
process(imageDataArray: Array<ImageData
|
|
2365
|
-
processImage(imageDataArray: Array<ImageData
|
|
2420
|
+
process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
|
|
2421
|
+
processImage(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
|
|
2366
2422
|
startNewPage(): Promise<void>;
|
|
2367
2423
|
startNewDocument(): Promise<void>;
|
|
2368
2424
|
shutdown(): void;
|
package/package.json
CHANGED