@idscan/idvc2 2.14.0 → 3.0.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 +17 -0
- package/dist/idvc.js +1 -1
- package/dist/idvc.js.LICENSE.txt +6 -0
- package/dist/idvc.js.gzip +0 -0
- package/dist/index.html +34 -31
- package/dist/js/defaultConfig.ts +27 -28
- package/dist/js/environment/documentTypes.ts +26 -8
- package/dist/js/environment/langs.js +1 -1
- package/dist/langs.js.gzip +0 -0
- package/dist/networks/Blur-chunk.js +1 -1
- package/dist/networks/Bubble-chunk.js +1 -1
- package/dist/networks/Face-chunk.js +1 -1
- package/dist/networks/GeneralTypeDetectionYolo-chunk.js +1 -1
- package/dist/networks/MRZ-chunk.js +1 -1
- package/dist/networks/PDF-chunk.js +1 -1
- package/dist/networks/ZXing-chunk.js +1 -1
- package/dist/networks/blurWorker.js.gzip +0 -0
- package/dist/networks/mrzWorker.js.gzip +0 -0
- package/dist/networks/pdfWorker.js.gzip +0 -0
- package/dist/types/defaultConfig.d.ts +1 -1
- package/dist/types/environment/documentTypes.d.ts +8 -5
- package/dist/types/environment/langs.d.ts +13 -9
- package/dist/types/eventListeners/eventListeners.d.ts +1 -1
- package/dist/types/eventListeners/selectDocumentType/selectHandler.d.ts +2 -2
- package/dist/types/helpers/validationEligibility.d.ts +1 -0
- package/dist/types/initialize.d.ts +3 -0
- package/dist/types/loader/asyncLoader.d.ts +1 -1
- package/dist/types/loop.d.ts +0 -1
- package/dist/types/modules/App/UI.d.ts +2 -2
- package/dist/types/modules/Config.d.ts +5 -15
- package/dist/types/modules/Loader/Loader.d.ts +1 -1
- package/dist/types/modules/camera/camera.d.ts +1 -1
- package/dist/types/modules/ui/CardStep/Card.d.ts +3 -5
- package/dist/types/modules/ui/CardStep/card-template.d.ts +5 -0
- package/dist/types/modules/ui/{Component.d.ts → ComponentLit.d.ts} +9 -11
- package/dist/types/modules/ui/ControlButton/ControlButton.d.ts +7 -9
- package/dist/types/modules/ui/ControlButton/control-button-template.d.ts +4 -0
- package/dist/types/modules/ui/ControlButton/controlButtonTemplate.d.ts +1 -0
- package/dist/types/modules/ui/DesktopNotification/DesktopNotification.d.ts +4 -6
- package/dist/types/modules/ui/DesktopNotification/desktop-notification-template.d.ts +2 -0
- package/dist/types/modules/ui/IDVCVersionPlank/IDVCVersionPlank.d.ts +4 -6
- package/dist/types/modules/ui/IDVCVersionPlank/idvc-version-plank-template.d.ts +2 -0
- package/dist/types/modules/ui/InitScreeen/InitScreen.d.ts +20 -0
- package/dist/types/modules/ui/InitScreeen/init-screen-template.d.ts +4 -0
- package/dist/types/modules/ui/Loader/LoaderUI.d.ts +10 -0
- package/dist/types/modules/ui/Loader/loader-template.d.ts +2 -0
- package/dist/types/modules/ui/MainScreen/MainScreen.d.ts +3 -3
- package/dist/types/modules/ui/MessageBox/MessageBox.d.ts +6 -13
- package/dist/types/modules/ui/MessageBox/message-box-template.d.ts +2 -0
- package/dist/types/modules/ui/ModeSwitch/ModeSwitch.d.ts +7 -8
- package/dist/types/modules/ui/ModeSwitch/mode-switch-template.d.ts +4 -0
- package/dist/types/modules/ui/Notification/Notification.d.ts +5 -6
- package/dist/types/modules/ui/Notification/notification-template.d.ts +2 -0
- package/dist/types/modules/ui/StatusPlank/StatusPlank.d.ts +5 -6
- package/dist/types/modules/ui/StatusPlank/status-plank-template.d.ts +2 -0
- package/dist/types/modules/ui/StepsList/StepsScreen.d.ts +5 -3
- package/dist/types/modules/ui/Uploader/UploaderUI.d.ts +10 -16
- package/dist/types/modules/ui/Uploader/uploader-template.d.ts +9 -0
- package/dist/types/modules/ui/VideoWrapper/StepPreview/StepPreview.d.ts +3 -3
- package/dist/types/modules/ui/VideoWrapper/StepPreview/step-preview-template.d.ts +2 -0
- package/dist/types/modules/ui/{selectDocumentType/documentSelectedEvent.d.ts → documentSelectedEvent.d.ts} +1 -1
- package/dist/types/neural models/generalTypeDetectionYoloModel.d.ts +1 -0
- package/dist/types/stepProcessing.d.ts +1 -1
- package/dist/types/types/context.d.ts +2 -1
- package/dist/types/util.d.ts +1 -6
- package/package.json +2 -4
- package/dist/types/loader/loaderUploadMode.d.ts +0 -1
- package/dist/types/modules/ui/DocumentsList/InitScreen.d.ts +0 -21
- package/dist/types/modules/ui/Spinner/LoaderUI.d.ts +0 -11
- /package/dist/types/modules/{blurModule.d.ts → BlurModule.d.ts} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -29,7 +29,7 @@ export type DocumentType = {
|
|
|
29
29
|
mode?: StepMode;
|
|
30
30
|
};
|
|
31
31
|
type ImageURI = 'png' | 'jpeg' | 'webp';
|
|
32
|
-
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | '
|
|
32
|
+
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'fixFrontOrientAfterUpload' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onReloaded';
|
|
33
33
|
/**
|
|
34
34
|
* IDefaultConfig
|
|
35
35
|
* @param {string} name,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export type DocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 9 | 10 | 11;
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
1
|
+
export type DocumentTypeIndex = 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 11;
|
|
2
|
+
export type DIVEDocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 9 | 10 | 11;
|
|
3
|
+
export type DocumentTypeName = 'DL' | 'IC' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | 'Barcode' | 'FaceAuthorization' | 'EmploymentAuthorization';
|
|
4
|
+
export type HumanName = 'Driver\'s License' | 'Identification Card' | 'Passport' | 'US Passport Card' | 'Green Card' | 'International ID' | '1-D and 2-D Barcodes' | 'Face Authorization' | 'Employment Authorization';
|
|
4
5
|
export type ImageSource = 'video' | 'file';
|
|
5
6
|
export declare enum DocumentTypeIDs {
|
|
6
|
-
'
|
|
7
|
+
'DL' = 1,
|
|
8
|
+
'IC' = 1,
|
|
7
9
|
'Passport' = 2,
|
|
8
10
|
'PassportCard' = 3,
|
|
9
11
|
'GreenCard' = 6,
|
|
@@ -15,6 +17,7 @@ export declare enum DocumentTypeIDs {
|
|
|
15
17
|
export interface DocumentRecord {
|
|
16
18
|
name: DocumentTypeName;
|
|
17
19
|
id: DocumentTypeIndex;
|
|
20
|
+
diveDocumentID: DIVEDocumentTypeIndex;
|
|
18
21
|
nName: string;
|
|
19
22
|
humanName: HumanName;
|
|
20
23
|
}
|
|
@@ -23,7 +26,7 @@ interface DocumentType {
|
|
|
23
26
|
length: number;
|
|
24
27
|
ids(): DocumentTypeIndex[];
|
|
25
28
|
names(): DocumentTypeName[];
|
|
26
|
-
nameById(id: DocumentTypeIndex): DocumentTypeName | '';
|
|
29
|
+
nameById(id: DocumentTypeIndex | 0): DocumentTypeName | '';
|
|
27
30
|
humanNameById(id: DocumentTypeIndex | 0): HumanName | '';
|
|
28
31
|
humanNames(): HumanName[];
|
|
29
32
|
humanNameByName(name: DocumentTypeName): HumanName | '';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CameraNotSupportedReason } from '../types/modules/camera.enum';
|
|
2
|
-
type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | '
|
|
3
|
-
type AllTypes = IErrorCodes | IHintTexts | KeyError |
|
|
2
|
+
type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'general' | 'uploaderDescription' | 'documentsTypes' | 'loaderText';
|
|
3
|
+
type AllTypes = IErrorCodes | IHintTexts | KeyError | IGeneral | IDocumentsTypes | IUploaderDescription | ISpinnerText;
|
|
4
4
|
type Label = Record<LabelGroup, AllTypes>;
|
|
5
5
|
type KeyError = string[];
|
|
6
6
|
type GetTranslation = {
|
|
@@ -8,7 +8,6 @@ type GetTranslation = {
|
|
|
8
8
|
(groupName: 'errorCodes'): IErrorCodes;
|
|
9
9
|
(groupName: 'hintTexts'): IHintTexts;
|
|
10
10
|
(groupName: 'keyErrors'): KeyError;
|
|
11
|
-
(groupName: 'camera'): ICameraLabels;
|
|
12
11
|
(groupName: 'general'): IGeneral;
|
|
13
12
|
(groupName: 'loaderText'): ISpinnerText;
|
|
14
13
|
(groupName: LabelGroup): AllTypes;
|
|
@@ -53,10 +52,6 @@ interface IHintTexts {
|
|
|
53
52
|
captureCorners: string;
|
|
54
53
|
frontSideNotMatch: string;
|
|
55
54
|
}
|
|
56
|
-
interface ICameraLabels {
|
|
57
|
-
loading: string;
|
|
58
|
-
awaiting: string;
|
|
59
|
-
}
|
|
60
55
|
interface IGeneral {
|
|
61
56
|
step: string;
|
|
62
57
|
scan: string;
|
|
@@ -76,6 +71,7 @@ interface IGeneral {
|
|
|
76
71
|
notificationSubmit: string;
|
|
77
72
|
notificationCaptureHook: string;
|
|
78
73
|
notificationCaptureSide: string;
|
|
74
|
+
notificationCaptureWithWarnings: string;
|
|
79
75
|
idvcVersionPlank: string;
|
|
80
76
|
submitProcessSpinner: {
|
|
81
77
|
top: string;
|
|
@@ -102,6 +98,7 @@ interface IGeneral {
|
|
|
102
98
|
default: string;
|
|
103
99
|
changeDocumentTypeText: string;
|
|
104
100
|
documentTypeText: string;
|
|
101
|
+
disableProcessing: string;
|
|
105
102
|
};
|
|
106
103
|
controlButtons: {
|
|
107
104
|
upload: string;
|
|
@@ -136,7 +133,8 @@ interface IGeneral {
|
|
|
136
133
|
pressToUpdateTextSuccess: string;
|
|
137
134
|
}
|
|
138
135
|
interface IDocumentsTypes {
|
|
139
|
-
|
|
136
|
+
DL: string;
|
|
137
|
+
IC: string;
|
|
140
138
|
Passport: string;
|
|
141
139
|
PassportCard: string;
|
|
142
140
|
GreenCard: string;
|
|
@@ -160,8 +158,14 @@ interface ISpinnerText {
|
|
|
160
158
|
top: string;
|
|
161
159
|
bottom: string;
|
|
162
160
|
};
|
|
161
|
+
awaiting: string;
|
|
162
|
+
loadingStep: string;
|
|
163
|
+
changeMode: string;
|
|
164
|
+
resetting: string;
|
|
165
|
+
uploading: string;
|
|
166
|
+
preparingToWork: string;
|
|
167
|
+
loadingDocument: string;
|
|
163
168
|
}
|
|
164
|
-
export type CameraLabels = keyof ICameraLabels;
|
|
165
169
|
export declare const supportedLanguages: readonly ["en", "es"];
|
|
166
170
|
export declare const setTranslation: (translationLang?: SupportedLanguage) => void;
|
|
167
171
|
export declare const getTranslation: GetTranslation;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DocumentSelectEvent } from '../../modules/ui/
|
|
2
|
-
declare const _default: ({ docType, id }: DocumentSelectEvent) => Promise<void>;
|
|
1
|
+
import { DocumentSelectEvent } from '../../modules/ui/documentSelectedEvent';
|
|
2
|
+
declare const _default: ({ docType, id }: DocumentSelectEvent, isNeedToClearLoaderState?: boolean) => Promise<void>;
|
|
3
3
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkEligibilityForValidation: () => void;
|
|
@@ -6,6 +6,9 @@ declare const _default: {
|
|
|
6
6
|
isCameraRequired: () => any;
|
|
7
7
|
isUploaderRequired: () => any;
|
|
8
8
|
isCameraNeeded: () => any;
|
|
9
|
+
isUploaderRequiredForCurrentDocument: () => any;
|
|
10
|
+
isCameraRequiredForCurrentDocument: () => any;
|
|
11
|
+
isCameraNeededForCurrentDocument: () => any;
|
|
9
12
|
detectAndSetBrowser: () => void;
|
|
10
13
|
detectAndSetRealFaceMode: () => void;
|
|
11
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const asyncLoader: () => Promise<void>;
|
|
1
|
+
export declare const asyncLoader: (isNeedToClearLoaderState?: boolean) => Promise<void>;
|
package/dist/types/loop.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export interface IMrzCoords {
|
|
|
3
3
|
locations: MRZLocation;
|
|
4
4
|
color: 'green' | 'yellow';
|
|
5
5
|
}
|
|
6
|
-
export declare const videoCaptureTimeout: (ms: number) => Promise<unknown>;
|
|
7
6
|
export declare const loopTimeout: (ms: number) => Promise<unknown>;
|
|
8
7
|
export declare const unmountIDVC: () => void;
|
|
9
8
|
export declare const loop: () => Promise<false>;
|
|
@@ -2,7 +2,7 @@ import { MainScreen } from '../ui/MainScreen/MainScreen';
|
|
|
2
2
|
import { Size } from '../../helpers/image';
|
|
3
3
|
import { Loader } from '../Loader/Loader';
|
|
4
4
|
import SelectDocumentType from '../ui/SelectDocumentType';
|
|
5
|
-
import { InitScreen } from '../ui/
|
|
5
|
+
import { InitScreen } from '../ui/InitScreeen/InitScreen';
|
|
6
6
|
import { StepsScreen } from '../ui/StepsList/StepsScreen';
|
|
7
7
|
import { IDVCVersionPlank } from '../ui/IDVCVersionPlank/IDVCVersionPlank';
|
|
8
8
|
import { AnimationSettings, Notification, NotificationState } from '../ui/Notification/Notification';
|
|
@@ -19,7 +19,7 @@ export declare class WeblibUI {
|
|
|
19
19
|
remountUI(): void;
|
|
20
20
|
createNotification(notificationContainer: HTMLElement, { status, message, }: NotificationState, animationSettings: AnimationSettings): Notification;
|
|
21
21
|
updateResetButton({ steps, }: Context): void;
|
|
22
|
-
updateControlButtons({ steps, config, }: Context): void;
|
|
22
|
+
updateControlButtons({ steps, config, licenseKeyError, isProcessingDisabledForCurrentDocumentType, }: Context): void;
|
|
23
23
|
initGeneralText(context: Context): void;
|
|
24
24
|
updateMessageBox({ type, licenseKeyError }: Context): void;
|
|
25
25
|
resizeBorders(): void;
|
|
@@ -5,7 +5,7 @@ import { StepType } from '../environment/stepsDescription';
|
|
|
5
5
|
import { DocumentTypeName } from '../environment/documentTypes';
|
|
6
6
|
import { IDocumentTypeConfig } from './validator';
|
|
7
7
|
import { IStepCallback } from './Step';
|
|
8
|
-
import {
|
|
8
|
+
import { IDataForSubmit } from '../util';
|
|
9
9
|
/**
|
|
10
10
|
* @param {string} el,
|
|
11
11
|
* @param {string} licenseKey,
|
|
@@ -72,10 +72,6 @@ export interface IConfig {
|
|
|
72
72
|
networkUrl?: string;
|
|
73
73
|
/** the web library supports two languages, english and spanish. English uses en and Spanish uses es */
|
|
74
74
|
language?: SupportedLanguage;
|
|
75
|
-
/**
|
|
76
|
-
* Path to the folder with chunks. Specify the path on the server if you need to remove the folder to another location.
|
|
77
|
-
*/
|
|
78
|
-
chunkPublicPath?: string;
|
|
79
75
|
/**
|
|
80
76
|
* if this setting is set to false the document type dialog will not be displayed to the end user
|
|
81
77
|
*/
|
|
@@ -92,6 +88,10 @@ export interface IConfig {
|
|
|
92
88
|
* This option allows the user to perform a 'submit' even if there are warnings
|
|
93
89
|
*/
|
|
94
90
|
allowSubmitWithWarnings?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The option specifies the strictness of the type recognition decision filter. The value must be a floating point number between 0 and 1. Where 1 is the strictest filter, 0 is the least strict.
|
|
93
|
+
*/
|
|
94
|
+
autocaptureConfidence?: number;
|
|
95
95
|
/**
|
|
96
96
|
* This option allows you not to display the step selection screen when selecting a document.
|
|
97
97
|
*/
|
|
@@ -100,16 +100,6 @@ export interface IConfig {
|
|
|
100
100
|
* This option allows you to turn off step preview animations.
|
|
101
101
|
*/
|
|
102
102
|
playPreviewAnimations?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* This option allows you to set a timer in seconds, how long after the start of video capture the hook 'onCaptureTimeout' will be triggered.
|
|
105
|
-
*/
|
|
106
|
-
captureTimeout?: number;
|
|
107
|
-
/**
|
|
108
|
-
* function will be called after the user failed to capture the document from the camera
|
|
109
|
-
* in the time specified by the 'captureTimeout' option
|
|
110
|
-
* @param data - Step objects of current pipeline
|
|
111
|
-
*/
|
|
112
|
-
onCaptureTimeout?: (data: CaptureTimeoutData) => void;
|
|
113
103
|
/** function which will be called after each step completes */
|
|
114
104
|
onChange?: (data: {
|
|
115
105
|
step: IStepCallback;
|
|
@@ -5,7 +5,7 @@ export declare const cameraErrorHandling: (err: Error | CameraError) => Promise<
|
|
|
5
5
|
declare const _default: {
|
|
6
6
|
initUploader: () => Promise<void>;
|
|
7
7
|
stopTrack: () => void;
|
|
8
|
-
init: () => Promise<void>;
|
|
8
|
+
init: (label?: string) => Promise<void>;
|
|
9
9
|
start: (mode: VideoFacingModeEnum) => Promise<void>;
|
|
10
10
|
setCapture: (val: boolean) => void;
|
|
11
11
|
checkFlashAvailable: (mode?: VideoFacingModeEnum) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
2
|
import { StepTypeImageName } from '../../../environment/stepsDescription';
|
|
3
3
|
export declare const STEPS_ICON_DICTIONARY: Record<StepTypeImageName, string>;
|
|
4
4
|
export type CardState = {
|
|
@@ -20,14 +20,12 @@ export type CardEvents = {
|
|
|
20
20
|
onEdit?: (e: Event) => void;
|
|
21
21
|
onCardClick?: (event: CustomEvent) => void;
|
|
22
22
|
};
|
|
23
|
-
export declare class Card extends
|
|
23
|
+
export declare class Card extends ComponentLit<CardState> {
|
|
24
24
|
constructor(mountElement: any, state: CardState, events?: CardEvents);
|
|
25
25
|
backToInitialState(): void;
|
|
26
26
|
changeState(state: Partial<CardState>): void;
|
|
27
27
|
protected updateView(property?: keyof CardState): void;
|
|
28
|
-
protected
|
|
28
|
+
protected renderTemplate(): void;
|
|
29
29
|
private setImage;
|
|
30
30
|
private setSvgIcon;
|
|
31
|
-
private addEditListener;
|
|
32
|
-
private addCardClickListener;
|
|
33
31
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
1
2
|
import { getTranslation } from '../../environment/langs';
|
|
2
|
-
type Events = {
|
|
3
|
+
export type Events = {
|
|
3
4
|
[key: string]: (data?: any) => void;
|
|
4
5
|
};
|
|
5
|
-
type HTMLElementID = string;
|
|
6
|
-
export type StateBase = Record<string, any> & {
|
|
6
|
+
export type HTMLElementID = string;
|
|
7
|
+
export type StateBase = (Record<string, any> & {
|
|
7
8
|
translation?: ReturnType<typeof getTranslation>;
|
|
8
|
-
} | Record<string, never>;
|
|
9
|
-
export declare abstract class
|
|
9
|
+
}) | Record<string, never>;
|
|
10
|
+
export declare abstract class ComponentLit<T extends StateBase> {
|
|
10
11
|
protected mountElement: HTMLElement | HTMLElementID;
|
|
11
|
-
protected html: string;
|
|
12
12
|
events?: Events;
|
|
13
13
|
state: T;
|
|
14
14
|
protected initialState: T;
|
|
15
|
-
protected renderedHTML: string;
|
|
16
15
|
protected componentWrapper: HTMLElement;
|
|
17
|
-
protected
|
|
16
|
+
protected templateFn: (state: T) => TemplateResult;
|
|
17
|
+
protected constructor(mountElement: HTMLElement | HTMLElementID, state: T, templateFn: (state: any, handlers?: any) => TemplateResult, events?: Events);
|
|
18
18
|
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
19
19
|
backToInitialState(): void;
|
|
20
20
|
unmount(): void;
|
|
@@ -24,9 +24,7 @@ export declare abstract class Component<T extends StateBase> {
|
|
|
24
24
|
protected changeState(state: Record<string, any>): void;
|
|
25
25
|
protected updateView(property?: any): void;
|
|
26
26
|
protected replaceHTMLContent(className: string, newContent: string): void;
|
|
27
|
-
protected abstract addEventListeners(): void;
|
|
28
27
|
private wrapStateToProxy;
|
|
29
|
-
|
|
28
|
+
protected renderTemplate(): void;
|
|
30
29
|
private mount;
|
|
31
30
|
}
|
|
32
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ControlButtonState = {
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
|
+
export type ControlButtonState = {
|
|
3
3
|
type: 'start' | 'upload' | 'reset' | 'submit' | 'back' | 'edit' | 'continue' | 'capture' | 'retake';
|
|
4
4
|
disabled: boolean;
|
|
5
5
|
hidden: boolean;
|
|
@@ -7,16 +7,14 @@ type ControlButtonState = {
|
|
|
7
7
|
contentPosition?: 'left' | 'center' | 'right';
|
|
8
8
|
isActive?: boolean;
|
|
9
9
|
};
|
|
10
|
-
type ControlButtonEvents = {
|
|
10
|
+
export type ControlButtonEvents = {
|
|
11
11
|
onClick: (event: Event) => void;
|
|
12
12
|
};
|
|
13
|
-
type ControlButtonClickedEventDetail = {
|
|
13
|
+
export type ControlButtonClickedEventDetail = {
|
|
14
14
|
type: ControlButtonState['type'];
|
|
15
15
|
};
|
|
16
16
|
export type ControlButtonClickedCustomEvent = CustomEvent<ControlButtonClickedEventDetail>;
|
|
17
|
-
export declare class ControlButton extends
|
|
18
|
-
constructor(mountElement:
|
|
19
|
-
protected
|
|
20
|
-
private addClickListener;
|
|
17
|
+
export declare class ControlButton extends ComponentLit<ControlButtonState> {
|
|
18
|
+
constructor(mountElement: HTMLElement | string, state: ControlButtonState, events: ControlButtonEvents);
|
|
19
|
+
protected renderTemplate(): void;
|
|
21
20
|
}
|
|
22
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const template: (state: any) => import("lit-html").TemplateResult<1>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
2
|
import { StepType } from '../../../environment/stepsDescription';
|
|
3
|
-
type DesktopNotificationState = {
|
|
3
|
+
export type DesktopNotificationState = {
|
|
4
4
|
enabled: boolean;
|
|
5
5
|
textType: 'barcode' | 'other' | 'mrz';
|
|
6
6
|
};
|
|
@@ -9,9 +9,7 @@ export type DesktopNotificationVisibility = {
|
|
|
9
9
|
currentStepType: StepType;
|
|
10
10
|
isMobile: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare class DesktopNotification extends
|
|
13
|
-
constructor(mountElement:
|
|
12
|
+
export declare class DesktopNotification extends ComponentLit<DesktopNotificationState> {
|
|
13
|
+
constructor(mountElement: HTMLElement | string, state: DesktopNotificationState);
|
|
14
14
|
setDesktopNotificationVisibility({ isEnabledDesktopNotification, currentStepType, isMobile, }: DesktopNotificationVisibility): void;
|
|
15
|
-
protected addEventListeners(): void;
|
|
16
15
|
}
|
|
17
|
-
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type IDVCVersionPlankState = {
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
|
+
export type IDVCVersionPlankState = {
|
|
3
3
|
version: string;
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare class IDVCVersionPlank extends
|
|
7
|
-
constructor(mountElement:
|
|
8
|
-
protected addEventListeners(): void;
|
|
6
|
+
export declare class IDVCVersionPlank extends ComponentLit<IDVCVersionPlankState> {
|
|
7
|
+
constructor(mountElement: HTMLElement | string, state: IDVCVersionPlankState);
|
|
9
8
|
}
|
|
10
|
-
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
|
+
import { DocumentSelectEvent } from '../documentSelectedEvent';
|
|
3
|
+
import { DocumentTypeIndex, DocumentTypeName, HumanName } from '../../../environment/documentTypes';
|
|
4
|
+
export type DocumentState = {
|
|
5
|
+
name: DocumentTypeName;
|
|
6
|
+
humanName: HumanName;
|
|
7
|
+
id: 0 | DocumentTypeIndex;
|
|
8
|
+
};
|
|
9
|
+
export type InitScreenState = {
|
|
10
|
+
documents: DocumentState[];
|
|
11
|
+
isHidden: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type InitScreenEvents = {
|
|
14
|
+
onDocumentClick?: (res: DocumentSelectEvent) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare class InitScreen extends ComponentLit<InitScreenState> {
|
|
17
|
+
constructor(mountElement: HTMLElement | string, state: InitScreenState, events?: InitScreenEvents);
|
|
18
|
+
protected renderTemplate(): void;
|
|
19
|
+
private handleDocumentClick;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
|
+
export type LoaderState = {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
spinnerVisibility: boolean;
|
|
5
|
+
bottomText?: string;
|
|
6
|
+
topText?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class LoaderUI extends ComponentLit<LoaderState> {
|
|
9
|
+
constructor(mountElement: HTMLElement | string, state: LoaderState, events?: any);
|
|
10
|
+
}
|
|
@@ -7,8 +7,8 @@ import { StepType } from '../../../environment/stepsDescription';
|
|
|
7
7
|
import { ControlButton, ControlButtonClickedCustomEvent } from '../ControlButton/ControlButton';
|
|
8
8
|
import { CallbackHandler, MessageBox } from '../MessageBox/MessageBox';
|
|
9
9
|
import { DesktopNotification, DesktopNotificationVisibility } from '../DesktopNotification/DesktopNotification';
|
|
10
|
-
import { LoaderUI } from '../
|
|
11
|
-
import {
|
|
10
|
+
import { LoaderUI } from '../Loader/LoaderUI';
|
|
11
|
+
import { ComponentLit, StateBase } from '../ComponentLit';
|
|
12
12
|
import type { Context } from '../../../types/context';
|
|
13
13
|
import { DocumentTypeIndex, DocumentTypeName } from '../../../environment/documentTypes';
|
|
14
14
|
import { Slider } from '../../Slider';
|
|
@@ -37,7 +37,7 @@ export declare class MainScreen {
|
|
|
37
37
|
continueButton: ControlButton;
|
|
38
38
|
messageBox: MessageBox;
|
|
39
39
|
cardStepsSlider: Slider;
|
|
40
|
-
UIComponents:
|
|
40
|
+
UIComponents: ComponentLit<StateBase>[];
|
|
41
41
|
constructor(mountElement: HTMLElement, events: MainScreenUIEvents, context: Context);
|
|
42
42
|
setCaptureButtonsVisibility(isVisible: boolean): void;
|
|
43
43
|
updateCaptureButtonsState(state: 'success' | 'edit', showContinueButton: boolean, showRetakeButton: boolean): void;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type MessageBoxType = 'error' | 'primary' | 'pointer' | 'disabled' | null;
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
|
+
export type MessageBoxType = 'error' | 'primary' | 'pointer' | 'disabled' | 'warning' | null;
|
|
3
3
|
export type CallbackHandler = (event: Event) => void;
|
|
4
|
-
type MessageBoxState = {
|
|
4
|
+
export type MessageBoxState = {
|
|
5
5
|
isHidden: boolean;
|
|
6
6
|
isCaretHidden: boolean;
|
|
7
7
|
type: MessageBoxType;
|
|
8
8
|
typesCount: number;
|
|
9
9
|
text?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare class MessageBox extends
|
|
11
|
+
export declare class MessageBox extends ComponentLit<MessageBoxState> {
|
|
12
12
|
private clickHandler;
|
|
13
|
-
constructor(mountElement:
|
|
13
|
+
constructor(mountElement: HTMLElement | string, state: MessageBoxState, events?: any);
|
|
14
14
|
get type(): MessageBoxType;
|
|
15
|
-
/**
|
|
16
|
-
* sets the message in message-box
|
|
17
|
-
* @param {string} text - text to set in message-box
|
|
18
|
-
* @param {'error', 'primary'} type - type of message. Default: primary
|
|
19
|
-
*/
|
|
20
15
|
message(text?: string, type?: MessageBoxType): void;
|
|
21
16
|
addChangeDocumentTypeListener(handler: CallbackHandler): void;
|
|
22
17
|
updateTypesCount(typesCount: number): void;
|
|
23
|
-
protected updateView(property?:
|
|
24
|
-
protected addEventListeners(): void;
|
|
18
|
+
protected updateView(property?: keyof MessageBoxState): void;
|
|
25
19
|
private updateByType;
|
|
26
20
|
private updateByTypesCount;
|
|
27
21
|
private applyAllChangeDocumentTypeListener;
|
|
28
22
|
private removeAllChangeDocumentTypeListener;
|
|
29
23
|
}
|
|
30
|
-
export {};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
2
|
import type { IStepModeKeys } from '../../../defaultConfig';
|
|
3
|
-
type ModeSwitchState = {
|
|
3
|
+
export type ModeSwitchState = {
|
|
4
4
|
mode: IStepModeKeys;
|
|
5
5
|
isAvailable: boolean;
|
|
6
6
|
isEnabled: boolean;
|
|
7
7
|
};
|
|
8
|
-
type ModeSwitchEvents = {
|
|
8
|
+
export type ModeSwitchEvents = {
|
|
9
9
|
onSwitch: (event: Event) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare class ModeSwitch extends
|
|
12
|
-
constructor(mountElement:
|
|
11
|
+
export declare class ModeSwitch extends ComponentLit<ModeSwitchState> {
|
|
12
|
+
constructor(mountElement: HTMLElement | string, state: ModeSwitchState, events: ModeSwitchEvents);
|
|
13
13
|
setAvailable(value: boolean): void;
|
|
14
14
|
setEnabled(value: boolean): void;
|
|
15
15
|
setMode(mode: IStepModeKeys): void;
|
|
16
16
|
changeState(state: Partial<ModeSwitchState>): void;
|
|
17
|
-
protected
|
|
18
|
-
private
|
|
17
|
+
protected renderTemplate(): void;
|
|
18
|
+
private handleSwitch;
|
|
19
19
|
}
|
|
20
|
-
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
2
|
export type NotificationState = {
|
|
3
3
|
status: 'success' | 'warning' | 'info' | 'error';
|
|
4
4
|
message: string;
|
|
5
5
|
};
|
|
6
|
-
type AnimationName = 'left' | 'right' | 'top' | 'bottom';
|
|
6
|
+
export type AnimationName = 'left' | 'right' | 'top' | 'bottom';
|
|
7
7
|
export type AnimationSettings = {
|
|
8
8
|
showDuration: number;
|
|
9
9
|
holdDuration: number;
|
|
@@ -12,9 +12,9 @@ export type AnimationSettings = {
|
|
|
12
12
|
hideDirection: AnimationName;
|
|
13
13
|
isNeedToStay?: boolean;
|
|
14
14
|
};
|
|
15
|
-
export declare class Notification extends
|
|
16
|
-
private animationSettings?;
|
|
17
|
-
constructor(mountElement:
|
|
15
|
+
export declare class Notification extends ComponentLit<NotificationState> {
|
|
16
|
+
private readonly animationSettings?;
|
|
17
|
+
constructor(mountElement: HTMLElement | string, state: NotificationState, animationSettings?: AnimationSettings, events?: any);
|
|
18
18
|
showAnimation(): Promise<void>;
|
|
19
19
|
unmount(): void;
|
|
20
20
|
changeState(state: NotificationState): void;
|
|
@@ -23,4 +23,3 @@ export declare class Notification extends Component<NotificationState> {
|
|
|
23
23
|
private acceptAnimationSettings;
|
|
24
24
|
private addCloseListener;
|
|
25
25
|
}
|
|
26
|
-
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type StatusPlankState = {
|
|
1
|
+
import { ComponentLit } from '../ComponentLit';
|
|
2
|
+
export type StatusPlankState = {
|
|
3
3
|
status: 'ready' | 'warning' | 'success' | 'disabled';
|
|
4
|
+
errorCode?: string;
|
|
4
5
|
};
|
|
5
|
-
export declare class StatusPlank extends
|
|
6
|
-
constructor(mountElement:
|
|
7
|
-
protected addEventListeners(): void;
|
|
6
|
+
export declare class StatusPlank extends ComponentLit<StatusPlankState> {
|
|
7
|
+
constructor(mountElement: HTMLElement | string, state: StatusPlankState);
|
|
8
8
|
}
|
|
9
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentLit, StateBase } from '../ComponentLit';
|
|
2
2
|
import { DocumentTypeName } from '../../../environment/documentTypes';
|
|
3
3
|
import Step from '../../Step';
|
|
4
|
-
import { CallbackHandler, MessageBox } from '../MessageBox/MessageBox';
|
|
4
|
+
import { CallbackHandler, MessageBox, MessageBoxType } from '../MessageBox/MessageBox';
|
|
5
5
|
import { ControlButton, ControlButtonClickedCustomEvent } from '../ControlButton/ControlButton';
|
|
6
6
|
import { CardStep } from '../CardStep/CardStep';
|
|
7
7
|
import { CardState } from '../CardStep/Card';
|
|
@@ -15,7 +15,7 @@ export type StepsScreenEvents = {
|
|
|
15
15
|
export declare class StepsScreen {
|
|
16
16
|
mountElement: HTMLElement;
|
|
17
17
|
events: any;
|
|
18
|
-
UIComponents:
|
|
18
|
+
UIComponents: ComponentLit<StateBase>[];
|
|
19
19
|
messageBox: MessageBox;
|
|
20
20
|
resetButton: ControlButton;
|
|
21
21
|
startButton: ControlButton;
|
|
@@ -25,10 +25,12 @@ export declare class StepsScreen {
|
|
|
25
25
|
steps: CardStep[];
|
|
26
26
|
constructor(mountElement: HTMLElement, events: any, context: Context);
|
|
27
27
|
disableScreen(): void;
|
|
28
|
+
disableCurrentDocumentProcessing(): void;
|
|
28
29
|
setVisibility(isVisible: boolean): void;
|
|
29
30
|
resetState(): void;
|
|
30
31
|
addChangeDocumentTypeListener(handler: CallbackHandler): void;
|
|
31
32
|
updateKeyError(licenseKeyError: string): void;
|
|
33
|
+
updateMessageBoxState(message: string, type: MessageBoxType): void;
|
|
32
34
|
updateStepImg({ steps, currentStep, currentStepImg, }: {
|
|
33
35
|
steps: Step[];
|
|
34
36
|
currentStep: number;
|