@regulaforensics/idv-gui 4.0.510-nightly → 4.0.511-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,10 +1,11 @@
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
 
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
+ }
8
+
8
9
  declare const ContentMode: {
9
10
  readonly ASPECT_FILL: "ASPECT_FILL";
10
11
  readonly ASPECT_FIT: "ASPECT_FIT";
@@ -31,6 +32,12 @@ declare type DropdownControl = {
31
32
  expandButton?: UIImage;
32
33
  };
33
34
 
35
+ declare type FailedAssets = {
36
+ imageURL: Set<string>;
37
+ base64: Set<string>;
38
+ blockingAssets: Set<string>;
39
+ };
40
+
34
41
  declare const FontWeight: {
35
42
  readonly NORMAL: "NORMAL";
36
43
  readonly BOLD: "BOLD";
@@ -38,11 +45,6 @@ declare const FontWeight: {
38
45
 
39
46
  declare type FontWeight = (typeof FontWeight)[keyof typeof FontWeight];
40
47
 
41
- declare type GenericPopup = {
42
- rootElement: UIRootElement;
43
- reason: string;
44
- };
45
-
46
48
  export declare class GuiIdv extends BaseModule<GuiModuleProps, GuiModuleConfig> {
47
49
  private _mounted;
48
50
  private _shadowRoot;
@@ -59,13 +61,13 @@ export declare class GuiIdv extends BaseModule<GuiModuleProps, GuiModuleConfig>
59
61
  private render;
60
62
  disconnectedCallback(): void;
61
63
  static isReady(): boolean;
62
- 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")[];
63
65
  static initialize(_modulesConfig: Record<string, unknown>): void;
64
66
  static deinitialize(): void;
65
67
  static getIdentifier: () => string;
66
68
  }
67
69
 
68
- 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> & {
69
71
  devSettings?: GuiModuleDevSettings;
70
72
  }) => JSX.Element;
71
73
 
@@ -80,8 +82,6 @@ export declare const GuiIdvSteps: {
80
82
  readonly GEOLOCATION: "GEOLOCATION";
81
83
  readonly DEVICE_TRANSFER: "DEVICE_TRANSFER";
82
84
  readonly GENERIC: "GENERIC";
83
- readonly GENERIC_LOCATION: "GENERIC_LOCATION";
84
- readonly GENERIC_PROGRESS: "GENERIC_PROGRESS";
85
85
  readonly UPLOAD_FILES: "UPLOAD_FILES";
86
86
  };
87
87
 
@@ -105,7 +105,6 @@ export declare type GuiModuleDevSettings = {
105
105
  progressBarRange?: number;
106
106
  name?: string;
107
107
  serverError?: string;
108
- size?: number;
109
108
  }[];
110
109
  };
111
110
  };
@@ -159,12 +158,6 @@ export declare type GuiModuleProps = {
159
158
  } | {
160
159
  templateId: typeof GuiIdvSteps.GENERIC;
161
160
  templateLayout: UIGenericScreenClientConfig;
162
- } | {
163
- templateId: typeof GuiIdvSteps.GENERIC_PROGRESS;
164
- templateLayout: UIGenericProgressScreenClientConfig;
165
- } | {
166
- templateId: typeof GuiIdvSteps.GENERIC_LOCATION;
167
- templateLayout: UIGenericLocationScreenClientConfig;
168
161
  } | {
169
162
  templateId: typeof GuiIdvSteps.UPLOAD_FILES;
170
163
  templateLayout: UIUploadFilesScreenClientConfig;
@@ -210,6 +203,26 @@ export declare type IDV_UI_ICONS = (typeof IDV_UI_ICONS)[keyof typeof IDV_UI_ICO
210
203
 
211
204
  export declare const idvIconDataUrlMap: Record<IDV_UI_ICONS, (color?: string) => string>;
212
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
+
213
226
  declare type JsonArray = JsonValue[];
214
227
 
215
228
  declare type JsonObject = {
@@ -218,9 +231,11 @@ declare type JsonObject = {
218
231
 
219
232
  declare type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
220
233
 
221
- declare type LocationSettings = {
222
- askEveryTime: boolean;
223
- getLocationTimeout: number;
234
+ declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
235
+
236
+ declare const PerformTypes: {
237
+ readonly FORM: "form";
238
+ readonly DATA: "data";
224
239
  };
225
240
 
226
241
  declare type PopupActionButton = {
@@ -336,7 +351,6 @@ declare type UIButton = {
336
351
  backgroundColor?: string;
337
352
  cornerRadius?: number;
338
353
  highlightColor?: string;
339
- hoverColor?: string;
340
354
  borderColor?: string;
341
355
  borderWidth?: number;
342
356
  paddings?: UIPaddings;
@@ -348,7 +362,6 @@ declare type UICameraScreenClientConfig = {
348
362
  header?: UIInfoHeaderView;
349
363
  footer?: UIInfoFooterView;
350
364
  backgroundColor?: string;
351
- backgroundImage?: UIImage;
352
365
  buttons?: UIButton[];
353
366
  selectionLimit?: number;
354
367
  };
@@ -390,7 +403,6 @@ declare type UIDeviceTransferScreenClientConfig = {
390
403
  buttons?: UIButton[];
391
404
  footer?: UIInfoFooterView;
392
405
  backgroundColor?: string;
393
- backgroundImage?: UIImage;
394
406
  qr?: {
395
407
  color?: string;
396
408
  };
@@ -436,9 +448,6 @@ declare type UIElement = {
436
448
  } | {
437
449
  type: typeof UIElementTypes.SPACER;
438
450
  content: WithWeightProp<WithWidthAndHeightProps<UISpacer>>;
439
- } | {
440
- type: typeof UIElementTypes.PROGRESS_VIEW;
441
- content: WithWidthAndHeightProps<UIProgressView>;
442
451
  };
443
452
 
444
453
  declare const UIElementTypes: {
@@ -449,7 +458,6 @@ declare const UIElementTypes: {
449
458
  readonly COLUMN: "column";
450
459
  readonly ROW: "row";
451
460
  readonly SPACER: "spacer";
452
- readonly PROGRESS_VIEW: "progressView";
453
461
  };
454
462
 
455
463
  declare type UIFileUploadPopupFilesLimitExceededOnly = UIPopup & {
@@ -464,21 +472,10 @@ declare type UIGalleryScreenClientConfig = {
464
472
  header?: UIInfoHeaderView;
465
473
  footer?: UIInfoFooterView;
466
474
  backgroundColor?: string;
467
- backgroundImage?: UIImage;
468
475
  buttons?: UIButton[];
469
476
  selectionLimit?: number;
470
477
  };
471
478
 
472
- declare type UIGenericLocationScreenClientConfig = {
473
- rootElement: UIRootElement;
474
- popups: GenericPopup[];
475
- settings: LocationSettings;
476
- };
477
-
478
- declare type UIGenericProgressScreenClientConfig = {
479
- rootElement: UIRootElement;
480
- };
481
-
482
479
  declare type UIGenericScreenClientConfig = {
483
480
  rootElement: UIRootElement;
484
481
  };
@@ -495,7 +492,6 @@ declare type UIGeolocationScreenClientConfig = {
495
492
  buttons?: UIButton[];
496
493
  footer?: UIInfoFooterView;
497
494
  backgroundColor?: string;
498
- backgroundImage?: UIImage;
499
495
  popups: [UIGeolocationPopupSystemRestrictedOnly];
500
496
  askEveryTime?: boolean;
501
497
  };
@@ -518,15 +514,9 @@ declare type UIImage = ImageBase & {
518
514
  };
519
515
 
520
516
  declare type UIImageButton = {
521
- actionId?: string;
522
- type?: 'DATA' | 'FORM';
523
517
  paddings?: UIPaddings;
524
518
  image: UIImage;
525
519
  responseBody?: JsonObject;
526
- backgroundColor?: string;
527
- highlightColor?: string;
528
- hoverColor?: string;
529
- cornerRadius?: number;
530
520
  };
531
521
 
532
522
  declare type UIInfoDetailsScreenClientConfig = {
@@ -536,7 +526,6 @@ declare type UIInfoDetailsScreenClientConfig = {
536
526
  buttons?: UIButton[];
537
527
  footer?: UIInfoFooterView;
538
528
  backgroundColor?: string;
539
- backgroundImage?: UIImage;
540
529
  };
541
530
 
542
531
  declare type UIInfoFooterView = {
@@ -555,7 +544,6 @@ declare type UIInfoScreenClientConfig = {
555
544
  buttons?: UIButton[];
556
545
  footer?: UIInfoFooterView;
557
546
  backgroundColor?: string;
558
- backgroundImage?: UIImage;
559
547
  };
560
548
 
561
549
  declare type UILabel = {
@@ -617,7 +605,6 @@ declare type UIProgressScreenClientConfig = {
617
605
  progressView?: UIProgressView;
618
606
  footer?: UIInfoFooterView;
619
607
  backgroundColor?: string;
620
- backgroundImage?: UIImage;
621
608
  };
622
609
 
623
610
  declare type UIProgressView = {
@@ -634,7 +621,6 @@ declare type UIQuestionsScreenClientConfig = {
634
621
  backgroundColor?: string;
635
622
  };
636
623
  backgroundColor?: string;
637
- backgroundImage?: UIImage;
638
624
  cornerRadius?: number;
639
625
  };
640
626
 
@@ -665,8 +651,6 @@ declare type UIScaffoldContainer = {
665
651
  mainColumn?: UIColumn;
666
652
  bottomColumn?: UIColumn;
667
653
  backgroundColor?: string;
668
- backgroundImage?: UIImage;
669
- cornerRadius?: number;
670
654
  };
671
655
 
672
656
  declare type UISelectorButtonsQuestion = QuestionItem & {
@@ -704,7 +688,6 @@ declare type UIStatusScreenClientConfig = {
704
688
  buttons?: UIButton[];
705
689
  footer?: UIInfoFooterView;
706
690
  backgroundColor?: string;
707
- backgroundImage?: UIImage;
708
691
  };
709
692
 
710
693
  declare type UITextField = UILabel & {
@@ -728,7 +711,6 @@ declare type UIUploadFilesScreenClientConfig = {
728
711
  buttons?: UIButton[];
729
712
  footer?: UIInfoFooterView;
730
713
  backgroundColor?: string;
731
- backgroundImage?: UIImage;
732
714
  popups?: [UIFileUploadPopupNoFilesOnly, UIFileUploadPopupFilesLimitExceededOnly];
733
715
  settings: {
734
716
  supportedFileFormats: string[];