ngx-scandoc 1.2.3 → 1.3.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/core/components/components.module.d.ts +10 -7
- package/core/components/manual-scan/manual-scan.component.d.ts +61 -0
- package/core/components/scan/scan.component.d.ts +21 -24
- package/core/components/scan-results/scan-results.component.d.ts +11 -4
- package/core/components/webcam/util/webcam.util.d.ts +1 -1
- package/core/components/webcam/webcam/webcam.component.d.ts +26 -180
- package/core/components/webcam/webcam.module.d.ts +2 -0
- package/core/interfaces/config.d.ts +4 -0
- package/dialogs/components/prompt-manual/prompt-manual.component.d.ts +12 -0
- package/dialogs/components/scan-profile/scan-profile.component.d.ts +6 -1
- package/dialogs/components/scan-selfie/scan-selfie.component.d.ts +15 -61
- package/dialogs/dialogs.core.provider.d.ts +1 -0
- package/dialogs/dialogs.module.d.ts +12 -9
- package/esm2020/core/components/camera-switch/camera-switch.component.mjs +6 -4
- package/esm2020/core/components/components.module.mjs +32 -10
- package/esm2020/core/components/manual-scan/manual-scan.component.mjs +290 -0
- package/esm2020/core/components/scan/scan.component.mjs +290 -181
- package/esm2020/core/components/scan-results/scan-results.component.mjs +38 -12
- package/esm2020/core/components/webcam/util/webcam.util.mjs +7 -5
- package/esm2020/core/components/webcam/webcam/webcam.component.mjs +296 -773
- package/esm2020/core/components/webcam/webcam.module.mjs +8 -1
- package/esm2020/core/interfaces/config.mjs +1 -1
- package/esm2020/dialogs/components/confirm/confirm.component.mjs +3 -3
- package/esm2020/dialogs/components/prompt-manual/prompt-manual.component.mjs +30 -0
- package/esm2020/dialogs/components/scan-profile/scan-profile.component.mjs +36 -17
- package/esm2020/dialogs/components/scan-selfie/scan-selfie.component.mjs +41 -336
- package/esm2020/dialogs/dialogs.core.provider.mjs +12 -1
- package/esm2020/dialogs/dialogs.module.mjs +24 -11
- package/esm2020/forms/types/avatar.type.mjs +26 -21
- package/esm2020/forms/types/profile.image.type.mjs +51 -41
- package/esm2020/forms/types/title.type.mjs +7 -35
- package/esm2020/lib/ngx-scandoc.module.mjs +8 -6
- package/esm2020/providers/auth.provider.mjs +15 -2
- package/esm2020/providers/camera.provider.mjs +37 -4
- package/esm2020/providers/interceptor.provider.mjs +2 -2
- package/esm2020/providers/layout.provider.mjs +7 -5
- package/esm2020/providers/scan.form.mjs +173 -215
- package/esm2020/providers/scan.provider.mjs +264 -7
- package/esm2020/providers/translation.provider.mjs +18 -23
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/ngx-scandoc.mjs +1722 -1989
- package/fesm2015/ngx-scandoc.mjs.map +1 -1
- package/fesm2020/ngx-scandoc.mjs +1719 -1983
- package/fesm2020/ngx-scandoc.mjs.map +1 -1
- package/forms/types/avatar.type.d.ts +1 -0
- package/forms/types/profile.image.type.d.ts +6 -1
- package/lib/ngx-scandoc.module.d.ts +2 -3
- package/package.json +1 -1
- package/providers/camera.provider.d.ts +17 -1
- package/providers/layout.provider.d.ts +3 -1
- package/providers/scan.form.d.ts +2 -0
- package/providers/scan.provider.d.ts +6 -1
- package/public-api.d.ts +2 -0
- package/src/assets/i18n/en.json +14 -3
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
import * as i1 from "./scan/scan.component";
|
|
3
4
|
import * as i2 from "./scan-results/scan-results.component";
|
|
4
5
|
import * as i3 from "./camera-switch/camera-switch.component";
|
|
5
|
-
import * as i4 from "
|
|
6
|
-
import * as i5 from "@angular/
|
|
7
|
-
import * as i6 from "@
|
|
8
|
-
import * as i7 from "
|
|
9
|
-
import * as i8 from "
|
|
10
|
-
import * as i9 from "
|
|
6
|
+
import * as i4 from "./manual-scan/manual-scan.component";
|
|
7
|
+
import * as i5 from "@angular/common";
|
|
8
|
+
import * as i6 from "@angular/forms";
|
|
9
|
+
import * as i7 from "@ngx-translate/core";
|
|
10
|
+
import * as i8 from "./webcam/webcam.module";
|
|
11
|
+
import * as i9 from "../shared/material.module";
|
|
12
|
+
import * as i10 from "../../forms/form.module";
|
|
11
13
|
export declare class CoreComponentsModule {
|
|
14
|
+
static forRoot(): ModuleWithProviders<CoreComponentsModule>;
|
|
12
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<CoreComponentsModule, never>;
|
|
13
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CoreComponentsModule, [typeof i1.ScanComponent, typeof i2.ScanResultsComponent, typeof i3.CameraSwitchComponent], [typeof
|
|
16
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CoreComponentsModule, [typeof i1.ScanComponent, typeof i2.ScanResultsComponent, typeof i3.CameraSwitchComponent, typeof i4.ManualScanComponent], [typeof i5.CommonModule, typeof i6.FormsModule, typeof i7.TranslateModule, typeof i8.WebcamModule, typeof i9.MaterialModule, typeof i10.AppFormModule, typeof i6.ReactiveFormsModule], [typeof i8.WebcamModule, typeof i1.ScanComponent, typeof i3.CameraSwitchComponent, typeof i4.ManualScanComponent]>;
|
|
14
17
|
static ɵinj: i0.ɵɵInjectorDeclaration<CoreComponentsModule>;
|
|
15
18
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit, ChangeDetectorRef, ElementRef, NgZone } from '@angular/core';
|
|
2
|
+
import { NgxScandocCameraProvider } from '../../../providers/camera.provider';
|
|
3
|
+
import { Observable, Subject } from 'rxjs';
|
|
4
|
+
import { BaseComponent } from '../base.component';
|
|
5
|
+
import { LayoutProvider } from '../../../providers/layout.provider';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ManualScanComponent extends BaseComponent implements OnInit, OnDestroy {
|
|
8
|
+
cameraProvider: NgxScandocCameraProvider;
|
|
9
|
+
private cd;
|
|
10
|
+
private layoutProvider;
|
|
11
|
+
private zone;
|
|
12
|
+
action: EventEmitter<any>;
|
|
13
|
+
videoOptions: MediaTrackConstraints;
|
|
14
|
+
cameraReady: boolean;
|
|
15
|
+
scanBlastData: any;
|
|
16
|
+
error: boolean;
|
|
17
|
+
scaning: boolean;
|
|
18
|
+
documentTypeSelected: boolean;
|
|
19
|
+
selectedSide: any;
|
|
20
|
+
preview: any;
|
|
21
|
+
scanType: any;
|
|
22
|
+
width: any;
|
|
23
|
+
height: any;
|
|
24
|
+
videoWidth: any;
|
|
25
|
+
videoHeight: any;
|
|
26
|
+
scanDatas: any;
|
|
27
|
+
scanSide: any;
|
|
28
|
+
result: any;
|
|
29
|
+
webcamImage: any;
|
|
30
|
+
trigger: Subject<number>;
|
|
31
|
+
nextWebcam: Subject<boolean | string>;
|
|
32
|
+
isMobile: boolean;
|
|
33
|
+
wraper?: ElementRef;
|
|
34
|
+
get class(): boolean;
|
|
35
|
+
onResize(): void;
|
|
36
|
+
constructor(cameraProvider: NgxScandocCameraProvider, cd: ChangeDetectorRef, layoutProvider: LayoutProvider, zone: NgZone);
|
|
37
|
+
ngOnInit(): void;
|
|
38
|
+
get nextWebcamObservable(): Observable<boolean | string>;
|
|
39
|
+
cameraWasSwitched(deviceId: string): void;
|
|
40
|
+
handleInitError(error: any): void;
|
|
41
|
+
resolutionLimit(file: any): Observable<unknown>;
|
|
42
|
+
private getImgBase64;
|
|
43
|
+
getBase64(file: any): Observable<unknown>;
|
|
44
|
+
handleFileInput(target: any, event: any, side: any): void;
|
|
45
|
+
cameraOff(ev: any): void;
|
|
46
|
+
ngOnDestroy(): void;
|
|
47
|
+
singleScan(side: any): void;
|
|
48
|
+
scanBlastFinish(): void;
|
|
49
|
+
get scanBlastCanUpload(): boolean;
|
|
50
|
+
handleImage(webcamImage: any): void;
|
|
51
|
+
continue(): void;
|
|
52
|
+
retry(): void;
|
|
53
|
+
triggerSnapshot(): void;
|
|
54
|
+
scan(): void;
|
|
55
|
+
rotateBase64Image(base64data: any): Observable<unknown>;
|
|
56
|
+
singleScanRotate(side: any): void;
|
|
57
|
+
videoReady(event: boolean): void;
|
|
58
|
+
singleScanRemove(side: any): void;
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ManualScanComponent, never>;
|
|
60
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ManualScanComponent, "ngx-manual-scan", never, {}, { "action": "action"; }, never, never, false>;
|
|
61
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { EventEmitter,
|
|
2
|
-
import {
|
|
3
|
-
import { Subject, Observable, Subscription } from 'rxjs';
|
|
1
|
+
import { EventEmitter, ChangeDetectorRef, AfterViewInit, OnDestroy, NgZone, Injector, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { Subject, Subscription } from 'rxjs';
|
|
4
3
|
import { FormGroup } from '@angular/forms';
|
|
5
4
|
import { TranslateService } from '@ngx-translate/core';
|
|
6
5
|
import { ScanProvider } from '../../../providers/scan.provider';
|
|
@@ -10,6 +9,8 @@ import { AuthProvider } from '../../../providers/auth.provider';
|
|
|
10
9
|
import { NgxScandocCameraProvider } from '../../../providers/camera.provider';
|
|
11
10
|
import { LayoutProvider } from '../../../providers/layout.provider';
|
|
12
11
|
import { BaseComponent } from '../base.component';
|
|
12
|
+
import { Platform } from '@angular/cdk/platform';
|
|
13
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
13
14
|
import * as i0 from "@angular/core";
|
|
14
15
|
export interface IWindow extends Window {
|
|
15
16
|
TextDetector: any;
|
|
@@ -27,25 +28,23 @@ interface Timestamps {
|
|
|
27
28
|
export declare class ScanComponent extends BaseComponent implements AfterViewInit, OnDestroy {
|
|
28
29
|
cd: ChangeDetectorRef;
|
|
29
30
|
private zone;
|
|
30
|
-
private translate;
|
|
31
31
|
cameraProvider: NgxScandocCameraProvider;
|
|
32
32
|
private injector;
|
|
33
33
|
private layoutProvider;
|
|
34
|
+
private platform;
|
|
35
|
+
private translate;
|
|
36
|
+
private snackBar;
|
|
37
|
+
private view;
|
|
34
38
|
private auth;
|
|
35
39
|
scanBlastData: any;
|
|
36
40
|
type: string;
|
|
37
41
|
dialogs: any;
|
|
38
42
|
actions: EventEmitter<any>;
|
|
39
|
-
mediaDevices: any;
|
|
40
43
|
deviceId?: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
data: any;
|
|
44
|
+
scanResults: Subject<unknown>;
|
|
45
|
+
scanSecondSide: boolean;
|
|
44
46
|
startTime: number;
|
|
45
|
-
isDebug: boolean;
|
|
46
|
-
multipleWebcamsAvailable: boolean;
|
|
47
47
|
scanInProgress: boolean;
|
|
48
|
-
fields: any;
|
|
49
48
|
documentTypeSelected: boolean;
|
|
50
49
|
imageHandlerSubscription: Subscription;
|
|
51
50
|
selectedSide: any;
|
|
@@ -53,23 +52,19 @@ export declare class ScanComponent extends BaseComponent implements AfterViewIni
|
|
|
53
52
|
scanTimeout: any;
|
|
54
53
|
preview: any;
|
|
55
54
|
scanType: any;
|
|
56
|
-
width: any;
|
|
57
|
-
height: any;
|
|
58
|
-
videoWidth: any;
|
|
59
|
-
videoHeight: any;
|
|
60
55
|
errorCode: string;
|
|
61
56
|
displayInfo: any;
|
|
62
|
-
allowCameraSwitch: boolean;
|
|
63
57
|
verificationErrorSent: boolean;
|
|
64
58
|
error: boolean;
|
|
65
59
|
cameraReady: boolean;
|
|
66
60
|
result: any;
|
|
67
61
|
scaning: boolean;
|
|
62
|
+
promptManual: boolean;
|
|
68
63
|
frontImage: any;
|
|
69
64
|
backImage: any;
|
|
70
65
|
imageHandler: Subject<unknown>;
|
|
66
|
+
manualDataSet: boolean;
|
|
71
67
|
logData: Troubleshooting;
|
|
72
|
-
defaultDevice: any;
|
|
73
68
|
scanDatas: any;
|
|
74
69
|
scanSide: any;
|
|
75
70
|
idScan: any;
|
|
@@ -82,39 +77,41 @@ export declare class ScanComponent extends BaseComponent implements AfterViewIni
|
|
|
82
77
|
nextWebcam: Subject<boolean | string>;
|
|
83
78
|
imageVerified: boolean;
|
|
84
79
|
form: FormGroup<{}>;
|
|
80
|
+
manual: boolean;
|
|
85
81
|
isMobile: boolean;
|
|
86
82
|
showDialog: boolean;
|
|
87
83
|
scanImageTimestamps: Timestamps;
|
|
88
|
-
wraper?: ElementRef;
|
|
89
84
|
get class(): boolean;
|
|
90
85
|
onResize(): void;
|
|
91
86
|
scanProvider: ScanProvider;
|
|
92
|
-
constructor(cd: ChangeDetectorRef, zone: NgZone,
|
|
87
|
+
constructor(cd: ChangeDetectorRef, zone: NgZone, cameraProvider: NgxScandocCameraProvider, injector: Injector, layoutProvider: LayoutProvider, platform: Platform, translate: TranslateService, snackBar: MatSnackBar, view: ViewContainerRef, auth: AuthProvider);
|
|
93
88
|
private resetLogData;
|
|
94
|
-
ngOnDestroy(): void;
|
|
95
89
|
init(): void;
|
|
96
|
-
cameraOff(ev: any): void;
|
|
97
90
|
continue(): void;
|
|
98
91
|
scan(): void;
|
|
99
92
|
handleImage(webcamImage: WebcamImage): void;
|
|
100
93
|
private handleBurstData;
|
|
94
|
+
closeDialog(): void;
|
|
101
95
|
handleInitError(error: WebcamInitError): void;
|
|
102
96
|
get scanBlastCanUpload(): boolean;
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
private manualMode;
|
|
98
|
+
private handleExtractionError;
|
|
105
99
|
private handleLongValidationError;
|
|
106
100
|
ngAfterViewInit(): void;
|
|
107
101
|
handleBitmapImage(bitmap: any): any;
|
|
108
102
|
autoScan(): void;
|
|
109
103
|
singleScan(side: any): void;
|
|
104
|
+
manualScanData(data: any): void;
|
|
110
105
|
private getImgBase64;
|
|
111
106
|
scanBlastFinish(): void;
|
|
112
107
|
retry(): void;
|
|
113
|
-
triggerSnapshot(): void;
|
|
114
108
|
retake(): void;
|
|
115
109
|
use(): void;
|
|
116
110
|
selfie(): void;
|
|
111
|
+
cameraOff(ev: any): void;
|
|
117
112
|
videoReady(event: boolean): void;
|
|
113
|
+
manualSet(key: boolean): void;
|
|
114
|
+
ngOnDestroy(): void;
|
|
118
115
|
static ɵfac: i0.ɵɵFactoryDeclaration<ScanComponent, never>;
|
|
119
116
|
static ɵcmp: i0.ɵɵComponentDeclaration<ScanComponent, "ngx-scan", never, { "type": "type"; "dialogs": "dialogs"; "showDialog": "showDialog"; }, { "actions": "actions"; }, never, never, false>;
|
|
120
117
|
}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit, ChangeDetectorRef, NgZone } from '@angular/core';
|
|
2
2
|
import { NgxScandocCameraProvider } from '../../../providers/camera.provider';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { ScanFieldsProvider } from '../../../providers/scan.form';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import { BaseComponent } from '../base.component';
|
|
7
|
+
import { ScanProvider } from '../../../providers/scan.provider';
|
|
5
8
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class ScanResultsComponent implements OnInit, OnDestroy {
|
|
9
|
+
export declare class ScanResultsComponent extends BaseComponent implements OnInit, OnDestroy {
|
|
7
10
|
cameraProvider: NgxScandocCameraProvider;
|
|
8
11
|
private formProvider;
|
|
12
|
+
private provider;
|
|
13
|
+
private cd;
|
|
14
|
+
private zone;
|
|
15
|
+
data: Subject<any>;
|
|
9
16
|
model: any;
|
|
10
17
|
images: any;
|
|
11
18
|
fields: any;
|
|
12
19
|
form: FormGroup;
|
|
13
20
|
action: EventEmitter<any>;
|
|
14
|
-
constructor(cameraProvider: NgxScandocCameraProvider, formProvider: ScanFieldsProvider);
|
|
21
|
+
constructor(cameraProvider: NgxScandocCameraProvider, formProvider: ScanFieldsProvider, provider: ScanProvider, cd: ChangeDetectorRef, zone: NgZone);
|
|
15
22
|
ngOnInit(): void;
|
|
16
23
|
ngOnDestroy(): void;
|
|
17
24
|
selfie(): void;
|
|
18
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<ScanResultsComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ScanResultsComponent, "ngx-scan-results", never, { "
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ScanResultsComponent, "ngx-scan-results", never, { "data": "data"; "images": "images"; "form": "form"; }, { "action": "action"; }, never, never, false>;
|
|
20
27
|
}
|
|
@@ -4,5 +4,5 @@ export declare class WebcamUtil {
|
|
|
4
4
|
* Lists available videoInput devices
|
|
5
5
|
* @returns a list of media device info.
|
|
6
6
|
*/
|
|
7
|
-
static getAvailableVideoInputs(): Observable<MediaDeviceInfo[]>;
|
|
7
|
+
static getAvailableVideoInputs(facingMode?: 'user' | 'environment'): Observable<MediaDeviceInfo[]>;
|
|
8
8
|
}
|
|
@@ -2,7 +2,6 @@ import { AfterViewInit, ChangeDetectorRef, EventEmitter, NgZone, OnDestroy } fro
|
|
|
2
2
|
import { WebcamInitError } from '../domain/webcam-init-error';
|
|
3
3
|
import { WebcamImage } from '../domain/webcam-image';
|
|
4
4
|
import { Observable, Subject } from 'rxjs';
|
|
5
|
-
import { WebcamMirrorProperties } from '../domain/webcam-mirror-properties';
|
|
6
5
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
7
6
|
import { Platform } from '@angular/cdk/platform';
|
|
8
7
|
import { NgxScandocCameraProvider } from '../../../../providers/camera.provider';
|
|
@@ -14,192 +13,39 @@ export declare class WebcamComponent extends BaseComponent implements AfterViewI
|
|
|
14
13
|
private cd;
|
|
15
14
|
private zone;
|
|
16
15
|
private cameraProvider;
|
|
17
|
-
trackProcessor: any;
|
|
18
|
-
trackSettings: any;
|
|
19
|
-
imageHandler: Subject<any>;
|
|
20
|
-
private static DEFAULT_VIDEO_OPTIONS;
|
|
21
|
-
private static DEFAULT_IMAGE_TYPE;
|
|
22
|
-
private static DEFAULT_IMAGE_QUALITY;
|
|
23
|
-
id?: any;
|
|
24
|
-
type?: 'document' | 'selfie';
|
|
25
|
-
/** Defines the max width of the webcam area in px */
|
|
26
|
-
width: number;
|
|
27
|
-
/** Defines the max height of the webcam area in px */
|
|
28
|
-
height: number;
|
|
29
|
-
/** Defines base constraints to apply when requesting video track from UserMedia */
|
|
30
|
-
videoOptions: MediaTrackConstraints;
|
|
31
|
-
/** Flag to enable/disable camera switch. If enabled, a switch icon will be displayed if multiple cameras were found */
|
|
32
|
-
allowCameraSwitch: boolean;
|
|
33
|
-
/** Parameter to control image mirroring (i.e. for user-facing camera). ["auto", "always", "never"] */
|
|
34
|
-
mirrorImage?: string | WebcamMirrorProperties;
|
|
35
|
-
/** Flag to control whether an ImageData object is stored into the WebcamImage object. */
|
|
36
|
-
captureImageData: boolean;
|
|
37
|
-
/** The image type to use when capturing snapshots */
|
|
38
|
-
imageType: string;
|
|
39
|
-
/** The image quality to use when capturing snapshots (number between 0 and 1) */
|
|
40
|
-
imageQuality: number;
|
|
41
|
-
/** EventEmitter which fires when an image has been captured */
|
|
42
|
-
imageCapture: EventEmitter<WebcamImage>;
|
|
43
|
-
/** Emits a mediaError if webcam cannot be initialized (e.g. missing user permissions) */
|
|
44
|
-
initError: EventEmitter<WebcamInitError>;
|
|
45
|
-
/** Emits when the webcam video was clicked */
|
|
46
|
-
imageClick: EventEmitter<void>;
|
|
47
|
-
/** Emits the active deviceId after the active video device was switched */
|
|
48
|
-
cameraSwitched: EventEmitter<string>;
|
|
49
|
-
videoReady: EventEmitter<boolean>;
|
|
50
|
-
showVideo: boolean;
|
|
51
|
-
destroyed: EventEmitter<any>;
|
|
52
|
-
/** available video devices */
|
|
53
|
-
availableVideoInputs: MediaDeviceInfo[];
|
|
54
|
-
/** Indicates whether the video device is ready to be switched */
|
|
55
|
-
videoInitialized: boolean;
|
|
56
|
-
canvasEl: HTMLCanvasElement;
|
|
57
|
-
/** If the Observable represented by this subscription emits, an image will be captured and emitted through
|
|
58
|
-
* the 'imageCapture' EventEmitter */
|
|
59
16
|
private triggerSubscription?;
|
|
60
|
-
/** Index of active video in availableVideoInputs */
|
|
61
|
-
private activeVideoInputIndex;
|
|
62
|
-
/** Subscription to switchCamera events */
|
|
63
|
-
private switchCameraSubscription?;
|
|
64
|
-
/** MediaStream object in use for streaming UserMedia data */
|
|
65
|
-
private mediaStream;
|
|
66
|
-
private video;
|
|
67
|
-
private videoStreamer;
|
|
68
|
-
/** Canvas for Video Snapshots */
|
|
69
|
-
private canvas;
|
|
70
|
-
/** Canvas for Video Snapshots */
|
|
71
|
-
private canvasSnapshot;
|
|
72
|
-
private canvasResize;
|
|
73
|
-
/** width and height of the active video stream */
|
|
74
|
-
activeVideoSettings: any;
|
|
75
|
-
shutdown: boolean;
|
|
76
|
-
private canStart;
|
|
77
|
-
videoSize: any;
|
|
78
17
|
canvasSize: any;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* @param switchCamera Indicates which webcam to switch to
|
|
87
|
-
* true: cycle forwards through available webcams
|
|
88
|
-
* false: cycle backwards through available webcams
|
|
89
|
-
* string: activate the webcam with the given id
|
|
90
|
-
*/
|
|
91
|
-
switchCamera: any;
|
|
18
|
+
showVideo: boolean;
|
|
19
|
+
canvasData: any;
|
|
20
|
+
mediaStream: MediaStream;
|
|
21
|
+
imageHandler: Subject<any>;
|
|
22
|
+
type?: 'document' | 'selfie' | 'manual';
|
|
23
|
+
trigger: Observable<number>;
|
|
24
|
+
resizeTimeout: any;
|
|
92
25
|
onResize(): void;
|
|
26
|
+
private chunks;
|
|
27
|
+
private canvas;
|
|
28
|
+
private videoRef;
|
|
29
|
+
cameraSwitched: EventEmitter<string>;
|
|
30
|
+
videoReady: EventEmitter<boolean>;
|
|
31
|
+
imageCapture: EventEmitter<WebcamImage>;
|
|
32
|
+
initError: EventEmitter<WebcamInitError>;
|
|
93
33
|
constructor(breakpointObserver: BreakpointObserver, platform: Platform, cd: ChangeDetectorRef, zone: NgZone, cameraProvider: NgxScandocCameraProvider);
|
|
94
|
-
/**
|
|
95
|
-
* Get MediaTrackConstraints to request streaming the given device
|
|
96
|
-
* @param deviceId
|
|
97
|
-
* @param baseMediaTrackConstraints base constraints to merge deviceId-constraint into
|
|
98
|
-
* @returns
|
|
99
|
-
*/
|
|
100
|
-
private static getMediaConstraintsForDevice;
|
|
101
|
-
/**
|
|
102
|
-
* Tries to harvest the deviceId from the given mediaStreamTrack object.
|
|
103
|
-
* Browsers populate this object differently; this method tries some different approaches
|
|
104
|
-
* to read the id.
|
|
105
|
-
* @param mediaStreamTrack
|
|
106
|
-
* @returns deviceId if found in the mediaStreamTrack
|
|
107
|
-
*/
|
|
108
|
-
private static getDeviceIdFromMediaStreamTrack;
|
|
109
|
-
/**
|
|
110
|
-
* Tries to harvest the facingMode from the given mediaStreamTrack object.
|
|
111
|
-
* Browsers populate this object differently; this method tries some different approaches
|
|
112
|
-
* to read the value.
|
|
113
|
-
* @param mediaStreamTrack
|
|
114
|
-
* @returns facingMode if found in the mediaStreamTrack
|
|
115
|
-
*/
|
|
116
|
-
private static getFacingModeFromMediaStreamTrack;
|
|
117
|
-
/**
|
|
118
|
-
* Determines whether the given mediaStreamTrack claims itself as user facing
|
|
119
|
-
* @param mediaStreamTrack
|
|
120
|
-
*/
|
|
121
|
-
private static isUserFacing;
|
|
122
|
-
landscape: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Extracts the value from the given ConstrainDOMString
|
|
125
|
-
* @param constrainDOMString
|
|
126
|
-
*/
|
|
127
|
-
private static getValueFromConstrainDOMString;
|
|
128
|
-
resizeStage(): void;
|
|
129
|
-
get canvasHeight(): number;
|
|
130
|
-
updatecanvasSize(): void;
|
|
131
|
-
private setupWorker;
|
|
132
34
|
ngAfterViewInit(): void;
|
|
133
|
-
|
|
35
|
+
get video(): any;
|
|
36
|
+
get isMobile(): boolean;
|
|
37
|
+
private setConstraints;
|
|
38
|
+
private get activeTrackSettings();
|
|
39
|
+
private get activeTrackCapabilities();
|
|
40
|
+
private init;
|
|
41
|
+
private setup;
|
|
42
|
+
private startVideo;
|
|
43
|
+
setCanvas(): void;
|
|
134
44
|
private takeSelfie;
|
|
135
|
-
/**
|
|
136
|
-
* Takes a snapshot of the current webcam's view and emits the image as an event
|
|
137
|
-
*/
|
|
138
45
|
takeSnapshot(time: number): void;
|
|
139
|
-
private
|
|
140
|
-
resizeImage(base64data: any): Observable<any>;
|
|
141
|
-
/**
|
|
142
|
-
* Switches to the next/previous video device
|
|
143
|
-
* @param forward
|
|
144
|
-
*/
|
|
145
|
-
rotateVideoInput(forward: boolean): void;
|
|
146
|
-
/**
|
|
147
|
-
* Switches the camera-view to the specified video device
|
|
148
|
-
*/
|
|
149
|
-
switchToVideoInput(deviceId: string): void;
|
|
150
|
-
/**
|
|
151
|
-
* Event-handler for video resize event.
|
|
152
|
-
* Triggers Angular change detection so that new video dimensions get applied
|
|
153
|
-
*/
|
|
154
|
-
videoResize(): void;
|
|
155
|
-
get videoWidth(): number;
|
|
156
|
-
get videoHeight(): number;
|
|
157
|
-
get videoStyleClasses(): string;
|
|
158
|
-
get nativeVideoElement(): any;
|
|
159
|
-
/**
|
|
160
|
-
* Returns the video aspect ratio of the active video stream
|
|
161
|
-
*/
|
|
162
|
-
private getVideoAspectRatio;
|
|
163
|
-
private updateSize;
|
|
164
|
-
getStreamTrack(stream: MediaStream): MediaStreamTrack;
|
|
165
|
-
getTrackSettings(): void;
|
|
166
|
-
accesVideoTrack(videoTrackConstraints: MediaStreamConstraints): any;
|
|
46
|
+
private stopAllTracks;
|
|
167
47
|
private drawRectangle;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Init webcam live view
|
|
171
|
-
*/
|
|
172
|
-
private initWebcam;
|
|
173
|
-
get isMobile(): boolean;
|
|
174
|
-
get cardRectangle(): {
|
|
175
|
-
padding: number;
|
|
176
|
-
top: number;
|
|
177
|
-
rWidth: number;
|
|
178
|
-
rHeight: number;
|
|
179
|
-
};
|
|
180
|
-
get snapRectangle(): {
|
|
181
|
-
padding: number;
|
|
182
|
-
top: number;
|
|
183
|
-
rWidth: number;
|
|
184
|
-
rHeight: number;
|
|
185
|
-
};
|
|
186
|
-
private setActiveCamera;
|
|
187
|
-
private getActiveVideoTrack;
|
|
188
|
-
private isMirrorImage;
|
|
189
|
-
/**
|
|
190
|
-
* Stops all active media tracks.
|
|
191
|
-
* This prevents the webcam from being indicated as active,
|
|
192
|
-
* even if it is no longer used by this component.
|
|
193
|
-
*/
|
|
194
|
-
private stopMediaTracks;
|
|
195
|
-
/**
|
|
196
|
-
* Unsubscribe from all open subscriptions
|
|
197
|
-
*/
|
|
198
|
-
private unsubscribeFromSubscriptions;
|
|
199
|
-
/**
|
|
200
|
-
* Reads available input devices
|
|
201
|
-
*/
|
|
202
|
-
private detectAvailableDevices;
|
|
48
|
+
ngOnDestroy(): void;
|
|
203
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<WebcamComponent, never>;
|
|
204
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<WebcamComponent, "ngx-scandoc-webcam", never, { "imageHandler": "imageHandler"; "
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WebcamComponent, "ngx-scandoc-webcam", never, { "imageHandler": "imageHandler"; "type": "type"; "trigger": "trigger"; }, { "cameraSwitched": "cameraSwitched"; "videoReady": "videoReady"; "imageCapture": "imageCapture"; "initError": "initError"; }, never, never, false>;
|
|
205
51
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
import * as i1 from "./webcam/webcam.component";
|
|
3
4
|
import * as i2 from "@angular/common";
|
|
4
5
|
import * as i3 from "@angular/cdk/platform";
|
|
5
6
|
export declare class WebcamModule {
|
|
7
|
+
static forRoot(): ModuleWithProviders<WebcamModule>;
|
|
6
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<WebcamModule, never>;
|
|
7
9
|
static ɵmod: i0.ɵɵNgModuleDeclaration<WebcamModule, [typeof i1.WebcamComponent], [typeof i2.CommonModule, typeof i3.PlatformModule], [typeof i1.WebcamComponent]>;
|
|
8
10
|
static ɵinj: i0.ɵɵInjectorDeclaration<WebcamModule>;
|
|
@@ -4,6 +4,7 @@ export interface AuthConfig {
|
|
|
4
4
|
clientId: string;
|
|
5
5
|
login?: string;
|
|
6
6
|
refresh?: string;
|
|
7
|
+
version?: string;
|
|
7
8
|
validDomains?: string[];
|
|
8
9
|
}
|
|
9
10
|
export interface ScanConfig {
|
|
@@ -13,6 +14,9 @@ export interface ScanConfig {
|
|
|
13
14
|
stateLessPath: string;
|
|
14
15
|
development?: boolean;
|
|
15
16
|
hideResults?: boolean;
|
|
17
|
+
enableVerification: boolean;
|
|
18
|
+
manualScanDelay: number;
|
|
19
|
+
showManualMode?: boolean;
|
|
16
20
|
}
|
|
17
21
|
export interface ScanDataConfig {
|
|
18
22
|
auth: AuthConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class PromptManualComponent implements OnInit {
|
|
5
|
+
dialogRef: MatDialogRef<PromptManualComponent>;
|
|
6
|
+
data: any;
|
|
7
|
+
constructor(dialogRef: MatDialogRef<PromptManualComponent>, data: any);
|
|
8
|
+
ngOnInit(): void;
|
|
9
|
+
close(key: boolean): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PromptManualComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PromptManualComponent, "app-prompt-manual", never, {}, {}, never, never, false>;
|
|
12
|
+
}
|
|
@@ -2,13 +2,18 @@ import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
3
|
import { BaseComponent } from '../../../core/components/base.component';
|
|
4
4
|
import { DialogsCoreProvider } from '../../../dialogs/dialogs.core.provider';
|
|
5
|
+
import { NgxScandocCameraProvider } from '../../../providers/camera.provider';
|
|
6
|
+
import { Platform } from '@angular/cdk/platform';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
export declare class ScanProfileComponent extends BaseComponent implements AfterViewInit, OnDestroy {
|
|
7
9
|
dialogs: DialogsCoreProvider;
|
|
10
|
+
cameraProvider: NgxScandocCameraProvider;
|
|
8
11
|
dialogRef: MatDialogRef<ScanProfileComponent>;
|
|
12
|
+
private platform;
|
|
9
13
|
type: string;
|
|
10
14
|
showDialog: boolean;
|
|
11
|
-
|
|
15
|
+
handleTouchMove(event: any): void;
|
|
16
|
+
constructor(dialogs: DialogsCoreProvider, cameraProvider: NgxScandocCameraProvider, dialogRef: MatDialogRef<ScanProfileComponent>, platform: Platform);
|
|
12
17
|
ngAfterViewInit(): void;
|
|
13
18
|
ngOnDestroy(): void;
|
|
14
19
|
actions(event: any): void;
|
|
@@ -1,83 +1,37 @@
|
|
|
1
|
-
import { EventEmitter,
|
|
1
|
+
import { EventEmitter, ChangeDetectorRef, AfterViewInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
-
import { Subject
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
4
|
import { FormGroup } from '@angular/forms';
|
|
5
5
|
import { WebcamImage } from '../../../core/components/webcam/domain/webcam-image';
|
|
6
6
|
import { WebcamInitError } from '../../../core/components/webcam/domain/webcam-init-error';
|
|
7
|
+
import { NgxScandocCameraProvider } from '../../../providers/camera.provider';
|
|
7
8
|
import { DialogsCoreProvider } from '../../../dialogs/dialogs.core.provider';
|
|
8
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import { ScanProvider } from '../../../providers/scan.provider';
|
|
10
|
+
import { BaseComponent } from '../../../core/components/base.component';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
|
-
export
|
|
12
|
-
TextDetector: any;
|
|
13
|
-
}
|
|
14
|
-
export declare class ScanSelfieComponent implements AfterViewInit {
|
|
12
|
+
export declare class ScanSelfieComponent extends BaseComponent implements AfterViewInit, OnDestroy {
|
|
15
13
|
cd: ChangeDetectorRef;
|
|
14
|
+
dialogRef: MatDialogRef<ScanSelfieComponent>;
|
|
15
|
+
cameraProvider: NgxScandocCameraProvider;
|
|
16
16
|
scanProvider: ScanProvider;
|
|
17
17
|
private dialogs;
|
|
18
|
-
private translate;
|
|
19
|
-
scanBlastData: any;
|
|
20
|
-
type: string;
|
|
21
18
|
actions: EventEmitter<any>;
|
|
22
|
-
mediaDevices: any;
|
|
23
|
-
deviceId?: string;
|
|
24
|
-
videoOptions: MediaTrackConstraints;
|
|
25
|
-
dialogRef?: MatDialogRef<any>;
|
|
26
19
|
data: any;
|
|
27
|
-
multipleWebcamsAvailable: boolean;
|
|
28
|
-
fields: any;
|
|
29
|
-
documentTypeSelected: boolean;
|
|
30
|
-
selectedSide: any;
|
|
31
|
-
images: any;
|
|
32
|
-
preview: any;
|
|
33
|
-
scanType: any;
|
|
34
|
-
width: any;
|
|
35
|
-
height: any;
|
|
36
|
-
videoWidth: any;
|
|
37
|
-
videoHeight: any;
|
|
38
|
-
allowCameraSwitch: boolean;
|
|
39
|
-
error: boolean;
|
|
40
20
|
cameraReady: boolean;
|
|
41
|
-
|
|
42
|
-
scaning: boolean;
|
|
43
|
-
defaultDevice: any;
|
|
44
|
-
scanDatas: any;
|
|
45
|
-
scanSide: any;
|
|
46
|
-
webcamImage?: WebcamImage;
|
|
47
|
-
model: any;
|
|
21
|
+
preview: any;
|
|
48
22
|
trigger: Subject<number>;
|
|
49
|
-
nextWebcam: Subject<boolean | string>;
|
|
50
23
|
form: FormGroup<{}>;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
constructor(cd: ChangeDetectorRef, scanProvider: ScanProvider, dialogs: DialogsCoreProvider, translate: TranslateService);
|
|
54
|
-
init(): void;
|
|
24
|
+
webcamImage: any;
|
|
25
|
+
constructor(cd: ChangeDetectorRef, dialogRef: MatDialogRef<ScanSelfieComponent>, cameraProvider: NgxScandocCameraProvider, scanProvider: ScanProvider, dialogs: DialogsCoreProvider);
|
|
55
26
|
handleImage(webcamImage: WebcamImage): void;
|
|
56
27
|
handleInitError(error: WebcamInitError): void;
|
|
57
|
-
|
|
58
|
-
cameraWasSwitched(deviceId: string): void;
|
|
59
|
-
get nextWebcamObservable(): Observable<boolean | string>;
|
|
28
|
+
videoReady(ev: any): void;
|
|
60
29
|
ngAfterViewInit(): void;
|
|
61
|
-
|
|
62
|
-
close(): void;
|
|
63
|
-
singleScan(side: any): void;
|
|
64
|
-
getBase64(file: any): Observable<unknown>;
|
|
65
|
-
handleFileInput(target: any, event: any, side: any): void;
|
|
66
|
-
rotateBase64Image(base64data: any): Observable<unknown>;
|
|
67
|
-
sendMobile(): void;
|
|
68
|
-
singleScanRotate(side: any): void;
|
|
69
|
-
singleScanRemove(side: any): void;
|
|
70
|
-
resolutionLimit(file: any): Observable<unknown>;
|
|
71
|
-
private getImgBase64;
|
|
72
|
-
scanBlastFinish(): void;
|
|
73
|
-
cameraOff(ev: any): void;
|
|
74
|
-
continue(): void;
|
|
30
|
+
ngOnDestroy(): void;
|
|
75
31
|
retry(): void;
|
|
76
|
-
triggerSnapshot(): void;
|
|
77
32
|
scan(): void;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
selfie(): void;
|
|
33
|
+
continue(): void;
|
|
34
|
+
close(): void;
|
|
81
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<ScanSelfieComponent, never>;
|
|
82
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ScanSelfieComponent, "app-scan-selfie", never, {
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ScanSelfieComponent, "app-scan-selfie", never, {}, { "actions": "actions"; }, never, never, false>;
|
|
83
37
|
}
|
|
@@ -12,6 +12,7 @@ export declare class DialogsCoreProvider {
|
|
|
12
12
|
loading(title?: string): MatDialogRef<BlankComponent, any>;
|
|
13
13
|
alert(title: string, text: string): MatDialogRef<BlankComponent, any>;
|
|
14
14
|
turnDocument(idScan: any): import("rxjs").Observable<any>;
|
|
15
|
+
promptManual(): import("rxjs").Observable<any>;
|
|
15
16
|
scanSelfie(data: any): MatDialogRef<BlankComponent, any>;
|
|
16
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<DialogsCoreProvider, never>;
|
|
17
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<DialogsCoreProvider>;
|