@regulaforensics/idv-gui 3.10.596-nightly → 3.10.597-rc

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 CHANGED
@@ -1,16 +1,10 @@
1
- import { BaseModule } from '../../interfaces-idv/src';
2
- import { FailedAssets } from '../../interfaces-idv/src';
3
1
  import { FunctionComponent } from 'preact';
4
- import { IdvModuleProps } from '../../interfaces-idv/src';
5
- import { ImageBase } from '../../interfaces-idv/src';
6
2
  import { JSX } from 'preact';
7
3
 
8
- declare const CLIENT_VALIDATOR_TYPE: {
9
- readonly NOT_EMPTY: "notEmpty";
10
- readonly REGEX: "regex";
11
- };
12
-
13
- declare type CLIENT_VALIDATOR_TYPE = (typeof CLIENT_VALIDATOR_TYPE)[keyof typeof CLIENT_VALIDATOR_TYPE];
4
+ declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
5
+ abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
6
+ abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
7
+ }
14
8
 
15
9
  declare const ContentMode: {
16
10
  readonly ASPECT_FILL: "ASPECT_FILL";
@@ -38,6 +32,12 @@ declare type DropdownControl = {
38
32
  expandButton?: UIImage;
39
33
  };
40
34
 
35
+ declare type FailedAssets = {
36
+ imageURL: Set<string>;
37
+ base64: Set<string>;
38
+ blockingAssets: Set<string>;
39
+ };
40
+
41
41
  declare const FontWeight: {
42
42
  readonly NORMAL: "NORMAL";
43
43
  readonly BOLD: "BOLD";
@@ -45,11 +45,6 @@ declare const FontWeight: {
45
45
 
46
46
  declare type FontWeight = (typeof FontWeight)[keyof typeof FontWeight];
47
47
 
48
- declare type GenericPopup = {
49
- rootElement: UIRootElement;
50
- reason: string;
51
- };
52
-
53
48
  export declare class GuiIdv extends BaseModule<GuiModuleProps, GuiModuleConfig> {
54
49
  private _mounted;
55
50
  private _shadowRoot;
@@ -63,17 +58,16 @@ export declare class GuiIdv extends BaseModule<GuiModuleProps, GuiModuleConfig>
63
58
  devSettings?: GuiModuleDevSettings;
64
59
  }): void;
65
60
  connectedCallback(): void;
66
- static cancel(): void;
67
61
  private render;
68
62
  disconnectedCallback(): void;
69
63
  static isReady(): boolean;
70
- static getSupportedTemplates: () => ("INFO" | "INFO_DETAILS" | "STATUS" | "PROGRESS" | "QUESTIONS" | "CAMERA" | "GALLERY" | "GEOLOCATION" | "DEVICE_TRANSFER" | "GENERIC" | "GENERIC_LOCATION" | "GENERIC_PROGRESS" | "UPLOAD_FILES")[];
64
+ static getSupportedTemplates: () => ("INFO" | "INFO_DETAILS" | "STATUS" | "PROGRESS" | "QUESTIONS" | "CAMERA" | "GALLERY" | "GEOLOCATION" | "DEVICE_TRANSFER" | "GENERIC" | "UPLOAD_FILES")[];
71
65
  static initialize(_modulesConfig: Record<string, unknown>): void;
72
66
  static deinitialize(): void;
73
67
  static getIdentifier: () => string;
74
68
  }
75
69
 
76
- export declare const GuiIdvReactComponent: ({ isProcessing: setIsProcessingCallback, moduleProps, perform, devSettings, idvEventListener, }: IdvModuleProps<GuiModuleProps, GuiModuleConfig> & {
70
+ export declare const GuiIdvReactComponent: ({ isProcessing: setIsProcessingCallback, moduleProps, perform, devSettings, }: IdvModuleProps<GuiModuleProps, GuiModuleConfig> & {
77
71
  devSettings?: GuiModuleDevSettings;
78
72
  }) => JSX.Element;
79
73
 
@@ -88,8 +82,6 @@ export declare const GuiIdvSteps: {
88
82
  readonly GEOLOCATION: "GEOLOCATION";
89
83
  readonly DEVICE_TRANSFER: "DEVICE_TRANSFER";
90
84
  readonly GENERIC: "GENERIC";
91
- readonly GENERIC_LOCATION: "GENERIC_LOCATION";
92
- readonly GENERIC_PROGRESS: "GENERIC_PROGRESS";
93
85
  readonly UPLOAD_FILES: "UPLOAD_FILES";
94
86
  };
95
87
 
@@ -113,7 +105,6 @@ export declare type GuiModuleDevSettings = {
113
105
  progressBarRange?: number;
114
106
  name?: string;
115
107
  serverError?: string;
116
- size?: number;
117
108
  }[];
118
109
  };
119
110
  };
@@ -155,7 +146,6 @@ export declare type GuiModuleProps = {
155
146
  templateId: typeof GuiIdvSteps.GEOLOCATION;
156
147
  templateLayout: UIGeolocationScreenClientConfig;
157
148
  getLocationTimeout?: number;
158
- locationAccuracy?: LocationAccuracy;
159
149
  } | {
160
150
  templateId: typeof GuiIdvSteps.QUESTIONS;
161
151
  templateLayout: UIQuestionsScreenClientConfig;
@@ -168,12 +158,6 @@ export declare type GuiModuleProps = {
168
158
  } | {
169
159
  templateId: typeof GuiIdvSteps.GENERIC;
170
160
  templateLayout: UIGenericScreenClientConfig;
171
- } | {
172
- templateId: typeof GuiIdvSteps.GENERIC_PROGRESS;
173
- templateLayout: UIGenericProgressScreenClientConfig;
174
- } | {
175
- templateId: typeof GuiIdvSteps.GENERIC_LOCATION;
176
- templateLayout: UIGenericLocationScreenClientConfig;
177
161
  } | {
178
162
  templateId: typeof GuiIdvSteps.UPLOAD_FILES;
179
163
  templateLayout: UIUploadFilesScreenClientConfig;
@@ -219,6 +203,26 @@ export declare type IDV_UI_ICONS = (typeof IDV_UI_ICONS)[keyof typeof IDV_UI_ICO
219
203
 
220
204
  export declare const idvIconDataUrlMap: Record<IDV_UI_ICONS, (color?: string) => string>;
221
205
 
206
+ declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
207
+ isProcessing?: (isProcessing: boolean) => void;
208
+ moduleProps: TModuleProps;
209
+ modulesConfig?: TModulesConfig;
210
+ perform: (data: any, type?: PerformType) => void;
211
+ idvEventListener: (module: string, data: any) => void;
212
+ nonce?: string;
213
+ };
214
+
215
+ declare type ImageBase = {
216
+ imageURL?: string;
217
+ imageId?: string;
218
+ base64?: string;
219
+ prepareRequired?: boolean;
220
+ failurePolicy?: ImageFailurePolicy;
221
+ timeout?: number;
222
+ };
223
+
224
+ declare type ImageFailurePolicy = 'ignore' | 'placeholderImage' | 'error';
225
+
222
226
  declare type JsonArray = JsonValue[];
223
227
 
224
228
  declare type JsonObject = {
@@ -227,17 +231,11 @@ declare type JsonObject = {
227
231
 
228
232
  declare type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
229
233
 
230
- declare enum LocationAccuracy {
231
- HIGH = "HIGH",
232
- BALANCED = "BALANCED",
233
- LOW = "LOW",
234
- PASSIVE = "PASSIVE"
235
- }
234
+ declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
236
235
 
237
- declare type LocationSettings = {
238
- askEveryTime: boolean;
239
- getLocationTimeout: number;
240
- locationAccuracy: LocationAccuracy;
236
+ declare const PerformTypes: {
237
+ readonly FORM: "form";
238
+ readonly DATA: "data";
241
239
  };
242
240
 
243
241
  declare type PopupActionButton = {
@@ -301,7 +299,7 @@ declare type QuestionsDataSource = {
301
299
  questions: QuestionDataSource[];
302
300
  };
303
301
 
304
- declare type QuestionsItem = UITextQuestion | UISelectorQuestion | UIMultiSelectorQuestion | UIMultiSelectorButtonsQuestion | UIMultiSelectorOptionsQuestion;
302
+ declare type QuestionsItemTypes = Array<UITextQuestion | UISelectorQuestion | UIMultiSelectorQuestion | UIMultiSelectorButtonsQuestion | UIMultiSelectorOptionsQuestion>;
305
303
 
306
304
  declare const RootElementTypes: {
307
305
  readonly SCAFFOLD: "scaffold";
@@ -353,7 +351,6 @@ declare type UIButton = {
353
351
  backgroundColor?: string;
354
352
  cornerRadius?: number;
355
353
  highlightColor?: string;
356
- hoverColor?: string;
357
354
  borderColor?: string;
358
355
  borderWidth?: number;
359
356
  paddings?: UIPaddings;
@@ -365,7 +362,6 @@ declare type UICameraScreenClientConfig = {
365
362
  header?: UIInfoHeaderView;
366
363
  footer?: UIInfoFooterView;
367
364
  backgroundColor?: string;
368
- backgroundImage?: UIImage;
369
365
  buttons?: UIButton[];
370
366
  selectionLimit?: number;
371
367
  };
@@ -407,7 +403,6 @@ declare type UIDeviceTransferScreenClientConfig = {
407
403
  buttons?: UIButton[];
408
404
  footer?: UIInfoFooterView;
409
405
  backgroundColor?: string;
410
- backgroundImage?: UIImage;
411
406
  qr?: {
412
407
  color?: string;
413
408
  };
@@ -453,9 +448,6 @@ declare type UIElement = {
453
448
  } | {
454
449
  type: typeof UIElementTypes.SPACER;
455
450
  content: WithWeightProp<WithWidthAndHeightProps<UISpacer>>;
456
- } | {
457
- type: typeof UIElementTypes.PROGRESS_VIEW;
458
- content: WithWidthAndHeightProps<UIProgressView>;
459
451
  };
460
452
 
461
453
  declare const UIElementTypes: {
@@ -466,7 +458,6 @@ declare const UIElementTypes: {
466
458
  readonly COLUMN: "column";
467
459
  readonly ROW: "row";
468
460
  readonly SPACER: "spacer";
469
- readonly PROGRESS_VIEW: "progressView";
470
461
  };
471
462
 
472
463
  declare type UIFileUploadPopupFilesLimitExceededOnly = UIPopup & {
@@ -481,21 +472,10 @@ declare type UIGalleryScreenClientConfig = {
481
472
  header?: UIInfoHeaderView;
482
473
  footer?: UIInfoFooterView;
483
474
  backgroundColor?: string;
484
- backgroundImage?: UIImage;
485
475
  buttons?: UIButton[];
486
476
  selectionLimit?: number;
487
477
  };
488
478
 
489
- declare type UIGenericLocationScreenClientConfig = {
490
- rootElement: UIRootElement;
491
- popups: GenericPopup[];
492
- settings: LocationSettings;
493
- };
494
-
495
- declare type UIGenericProgressScreenClientConfig = {
496
- rootElement: UIRootElement;
497
- };
498
-
499
479
  declare type UIGenericScreenClientConfig = {
500
480
  rootElement: UIRootElement;
501
481
  };
@@ -512,7 +492,6 @@ declare type UIGeolocationScreenClientConfig = {
512
492
  buttons?: UIButton[];
513
493
  footer?: UIInfoFooterView;
514
494
  backgroundColor?: string;
515
- backgroundImage?: UIImage;
516
495
  popups: [UIGeolocationPopupSystemRestrictedOnly];
517
496
  askEveryTime?: boolean;
518
497
  };
@@ -535,15 +514,9 @@ declare type UIImage = ImageBase & {
535
514
  };
536
515
 
537
516
  declare type UIImageButton = {
538
- actionId?: string;
539
- type?: 'DATA' | 'FORM';
540
517
  paddings?: UIPaddings;
541
518
  image: UIImage;
542
519
  responseBody?: JsonObject;
543
- backgroundColor?: string;
544
- highlightColor?: string;
545
- hoverColor?: string;
546
- cornerRadius?: number;
547
520
  };
548
521
 
549
522
  declare type UIInfoDetailsScreenClientConfig = {
@@ -553,7 +526,6 @@ declare type UIInfoDetailsScreenClientConfig = {
553
526
  buttons?: UIButton[];
554
527
  footer?: UIInfoFooterView;
555
528
  backgroundColor?: string;
556
- backgroundImage?: UIImage;
557
529
  };
558
530
 
559
531
  declare type UIInfoFooterView = {
@@ -572,7 +544,6 @@ declare type UIInfoScreenClientConfig = {
572
544
  buttons?: UIButton[];
573
545
  footer?: UIInfoFooterView;
574
546
  backgroundColor?: string;
575
- backgroundImage?: UIImage;
576
547
  };
577
548
 
578
549
  declare type UILabel = {
@@ -634,7 +605,6 @@ declare type UIProgressScreenClientConfig = {
634
605
  progressView?: UIProgressView;
635
606
  footer?: UIInfoFooterView;
636
607
  backgroundColor?: string;
637
- backgroundImage?: UIImage;
638
608
  };
639
609
 
640
610
  declare type UIProgressView = {
@@ -647,11 +617,10 @@ declare type UIQuestionsScreenClientConfig = {
647
617
  title?: UILabel;
648
618
  buttons?: UIButton[];
649
619
  questions: {
650
- itemTypes: QuestionsItem[];
620
+ itemTypes: QuestionsItemTypes;
651
621
  backgroundColor?: string;
652
622
  };
653
623
  backgroundColor?: string;
654
- backgroundImage?: UIImage;
655
624
  cornerRadius?: number;
656
625
  };
657
626
 
@@ -682,8 +651,6 @@ declare type UIScaffoldContainer = {
682
651
  mainColumn?: UIColumn;
683
652
  bottomColumn?: UIColumn;
684
653
  backgroundColor?: string;
685
- backgroundImage?: UIImage;
686
- cornerRadius?: number;
687
654
  };
688
655
 
689
656
  declare type UISelectorButtonsQuestion = QuestionItem & {
@@ -721,7 +688,6 @@ declare type UIStatusScreenClientConfig = {
721
688
  buttons?: UIButton[];
722
689
  footer?: UIInfoFooterView;
723
690
  backgroundColor?: string;
724
- backgroundImage?: UIImage;
725
691
  };
726
692
 
727
693
  declare type UITextField = UILabel & {
@@ -745,7 +711,6 @@ declare type UIUploadFilesScreenClientConfig = {
745
711
  buttons?: UIButton[];
746
712
  footer?: UIInfoFooterView;
747
713
  backgroundColor?: string;
748
- backgroundImage?: UIImage;
749
714
  popups?: [UIFileUploadPopupNoFilesOnly, UIFileUploadPopupFilesLimitExceededOnly];
750
715
  settings: {
751
716
  supportedFileFormats: string[];
@@ -783,18 +748,21 @@ declare type UploadFileToTemp = (file: File, onProgress: (sentBytes: number, tot
783
748
  }>;
784
749
 
785
750
  declare type Validator = {
786
- type: typeof CLIENT_VALIDATOR_TYPE.NOT_EMPTY;
751
+ type: typeof VALIDATOR_TYPE.NOT_EMPTY;
787
752
  message: string;
788
753
  } | {
789
- type: typeof CLIENT_VALIDATOR_TYPE.REGEX;
754
+ type: typeof VALIDATOR_TYPE.REGEX;
790
755
  message: string;
791
756
  regex: string;
792
- } | {
793
- type: string;
794
- message: string;
795
- passed?: boolean | null;
796
757
  };
797
758
 
759
+ declare const VALIDATOR_TYPE: {
760
+ readonly NOT_EMPTY: "notEmpty";
761
+ readonly REGEX: "regex";
762
+ };
763
+
764
+ declare type VALIDATOR_TYPE = (typeof VALIDATOR_TYPE)[keyof typeof VALIDATOR_TYPE];
765
+
798
766
  declare type WithWeightProp<T> = T & {
799
767
  weight?: number;
800
768
  };