@regulaforensics/idv-gui 4.0.687-rc → 4.0.688-nightly

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 CLIENT_VALIDATOR_TYPE: {
9
10
  readonly NOT_EMPTY: "notEmpty";
10
11
  readonly REGEX: "regex";
@@ -12,6 +13,23 @@ declare const CLIENT_VALIDATOR_TYPE: {
12
13
 
13
14
  declare type CLIENT_VALIDATOR_TYPE = (typeof CLIENT_VALIDATOR_TYPE)[keyof typeof CLIENT_VALIDATOR_TYPE];
14
15
 
16
+ declare const CodeFieldInputType: {
17
+ readonly NUMERIC: "NUMERIC";
18
+ readonly ALPHA_NUMERIC: "ALPHA_NUMERIC";
19
+ };
20
+
21
+ declare type CodeFieldInputType = (typeof CodeFieldInputType)[keyof typeof CodeFieldInputType];
22
+
23
+ declare type CodeInputDataItem = {
24
+ id: string | number;
25
+ text: string;
26
+ required: boolean | null;
27
+ property: {
28
+ id: string;
29
+ };
30
+ validators: Array<Validator>;
31
+ };
32
+
15
33
  declare const ContentMode: {
16
34
  readonly ASPECT_FILL: "ASPECT_FILL";
17
35
  readonly ASPECT_FIT: "ASPECT_FIT";
@@ -28,6 +46,27 @@ declare const DATA_SOURCE_ANSWER_TYPE: {
28
46
 
29
47
  declare type DATA_SOURCE_ANSWER_TYPE = (typeof DATA_SOURCE_ANSWER_TYPE)[keyof typeof DATA_SOURCE_ANSWER_TYPE];
30
48
 
49
+ declare type DataItem = {
50
+ type: typeof ListElementTypes.GENERIC_COLUMN;
51
+ uiComponentId: string;
52
+ } | {
53
+ type: typeof ListElementTypes.QUESTION;
54
+ uiComponentId: string;
55
+ content: QuestionDataItem;
56
+ } | {
57
+ type: typeof ListElementTypes.SECTION;
58
+ uiComponentId: string;
59
+ content: SectionDataItem;
60
+ } | {
61
+ type: typeof ListElementTypes.CODE_INPUT;
62
+ uiComponentId: string;
63
+ content: CodeInputDataItem;
64
+ } | {
65
+ type: typeof ListElementTypes.TEXT_INPUT;
66
+ uiComponentId: string;
67
+ content: TextInputDataItem;
68
+ };
69
+
31
70
  declare type DropdownControl = {
32
71
  backgroundColor?: string;
33
72
  cornerRadius?: number;
@@ -38,6 +77,12 @@ declare type DropdownControl = {
38
77
  expandButton?: UIImage;
39
78
  };
40
79
 
80
+ declare type FailedAssets = {
81
+ imageURL: Set<string>;
82
+ base64: Set<string>;
83
+ blockingAssets: Set<string>;
84
+ };
85
+
41
86
  declare const FontWeight: {
42
87
  readonly NORMAL: "NORMAL";
43
88
  readonly BOLD: "BOLD";
@@ -45,6 +90,10 @@ declare const FontWeight: {
45
90
 
46
91
  declare type FontWeight = (typeof FontWeight)[keyof typeof FontWeight];
47
92
 
93
+ declare type GenericListDataSource = {
94
+ dataItems: DataItem[];
95
+ };
96
+
48
97
  declare type GenericPopup = {
49
98
  rootElement: UIRootElement;
50
99
  reason: string;
@@ -67,7 +116,7 @@ export declare class GuiIdv extends BaseModule<GuiModuleProps, GuiModuleConfig>
67
116
  private render;
68
117
  disconnectedCallback(): void;
69
118
  static isReady(): boolean;
70
- static getSupportedTemplates: () => ("INFO" | "INFO_DETAILS" | "STATUS" | "PROGRESS" | "QUESTIONS" | "CAMERA" | "GALLERY" | "GEOLOCATION" | "DEVICE_TRANSFER" | "GENERIC" | "GENERIC_LOCATION" | "GENERIC_PROGRESS" | "UPLOAD_FILES")[];
119
+ static getSupportedTemplates: () => ("INFO" | "INFO_DETAILS" | "STATUS" | "PROGRESS" | "QUESTIONS" | "CAMERA" | "GALLERY" | "GEOLOCATION" | "DEVICE_TRANSFER" | "GENERIC" | "GENERIC_LIST" | "GENERIC_LOCATION" | "GENERIC_PROGRESS" | "UPLOAD_FILES")[];
71
120
  static initialize(_modulesConfig: Record<string, unknown>): void;
72
121
  static deinitialize(): void;
73
122
  static getIdentifier: () => string;
@@ -88,6 +137,7 @@ export declare const GuiIdvSteps: {
88
137
  readonly GEOLOCATION: "GEOLOCATION";
89
138
  readonly DEVICE_TRANSFER: "DEVICE_TRANSFER";
90
139
  readonly GENERIC: "GENERIC";
140
+ readonly GENERIC_LIST: "GENERIC_LIST";
91
141
  readonly GENERIC_LOCATION: "GENERIC_LOCATION";
92
142
  readonly GENERIC_PROGRESS: "GENERIC_PROGRESS";
93
143
  readonly UPLOAD_FILES: "UPLOAD_FILES";
@@ -168,6 +218,11 @@ export declare type GuiModuleProps = {
168
218
  } | {
169
219
  templateId: typeof GuiIdvSteps.GENERIC;
170
220
  templateLayout: UIGenericScreenClientConfig;
221
+ } | {
222
+ templateId: typeof GuiIdvSteps.GENERIC_LIST;
223
+ templateLayout: UIGenericListScreenClientConfig;
224
+ dataSource?: GenericListDataSource | null;
225
+ properties?: SessionPropertiesItem[];
171
226
  } | {
172
227
  templateId: typeof GuiIdvSteps.GENERIC_PROGRESS;
173
228
  templateLayout: UIGenericProgressScreenClientConfig;
@@ -219,6 +274,26 @@ export declare type IDV_UI_ICONS = (typeof IDV_UI_ICONS)[keyof typeof IDV_UI_ICO
219
274
 
220
275
  export declare const idvIconDataUrlMap: Record<IDV_UI_ICONS, (color?: string) => string>;
221
276
 
277
+ declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
278
+ isProcessing?: (isProcessing: boolean) => void;
279
+ moduleProps: TModuleProps;
280
+ modulesConfig?: TModulesConfig;
281
+ perform: (data: any, type?: PerformType) => void;
282
+ idvEventListener: (module: string, data: any, logLevel?: 'INFO' | 'DEBUG') => void;
283
+ nonce?: string;
284
+ };
285
+
286
+ declare type ImageBase = {
287
+ imageURL?: string;
288
+ imageId?: string;
289
+ base64?: string;
290
+ prepareRequired?: boolean;
291
+ failurePolicy?: ImageFailurePolicy;
292
+ timeout?: number;
293
+ };
294
+
295
+ declare type ImageFailurePolicy = 'ignore' | 'placeholderImage' | 'error';
296
+
222
297
  declare type JsonArray = JsonValue[];
223
298
 
224
299
  declare type JsonObject = {
@@ -227,6 +302,18 @@ declare type JsonObject = {
227
302
 
228
303
  declare type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
229
304
 
305
+ declare const ListElementTypes: {
306
+ readonly GENERIC_COLUMN: "genericColumn";
307
+ readonly QUESTION: "question";
308
+ readonly SECTION: "section";
309
+ readonly CODE_INPUT: "codeInput";
310
+ readonly TEXT_INPUT: "textInput";
311
+ };
312
+
313
+ declare const ListRootElementTypes: {
314
+ readonly LIST_SCAFFOLD: "listScaffold";
315
+ };
316
+
230
317
  declare enum LocationAccuracy {
231
318
  HIGH = "HIGH",
232
319
  BALANCED = "BALANCED",
@@ -240,6 +327,13 @@ declare type LocationSettings = {
240
327
  locationAccuracy: LocationAccuracy;
241
328
  };
242
329
 
330
+ declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
331
+
332
+ declare const PerformTypes: {
333
+ readonly FORM: "form";
334
+ readonly DATA: "data";
335
+ };
336
+
243
337
  declare type PopupActionButton = {
244
338
  title?: UILabel;
245
339
  type: 'FORM';
@@ -256,6 +350,8 @@ export declare const PopupReason: {
256
350
 
257
351
  export declare type PopupReason = (typeof PopupReason)[keyof typeof PopupReason];
258
352
 
353
+ declare type QuestionDataItem = QuestionDataSource;
354
+
259
355
  declare type QuestionDataSource = {
260
356
  id: string | number;
261
357
  placeholder?: string | null;
@@ -307,6 +403,10 @@ declare const RootElementTypes: {
307
403
  readonly SCAFFOLD: "scaffold";
308
404
  };
309
405
 
406
+ declare type SectionDataItem = {
407
+ dataItems: DataItem[];
408
+ };
409
+
310
410
  declare type SessionPropertiesItem = {
311
411
  id: string;
312
412
  createdAt: string;
@@ -344,6 +444,24 @@ declare const TextAlignment: {
344
444
 
345
445
  declare type TextAlignment = (typeof TextAlignment)[keyof typeof TextAlignment];
346
446
 
447
+ declare const TextFieldInputType: {
448
+ readonly EMAIL: "EMAIL";
449
+ readonly PHONE: "PHONE";
450
+ };
451
+
452
+ declare type TextFieldInputType = (typeof TextFieldInputType)[keyof typeof TextFieldInputType];
453
+
454
+ declare type TextInputDataItem = {
455
+ id: string | number;
456
+ text: string;
457
+ placeholder?: string | null;
458
+ required: boolean | null;
459
+ property: {
460
+ id: string;
461
+ };
462
+ validators: Array<Validator>;
463
+ };
464
+
347
465
  declare type UIButton = {
348
466
  actionId?: string;
349
467
  type?: 'RESPONSE_BODY' | 'FORM' | 'URL';
@@ -378,6 +496,36 @@ declare type UIChip = {
378
496
  backgroundColor?: string;
379
497
  };
380
498
 
499
+ declare type UICodeField = {
500
+ codeLength?: number;
501
+ inputType?: CodeFieldInputType;
502
+ fontName?: string;
503
+ fontColor?: string;
504
+ fontSize?: number;
505
+ fontWeight?: FontWeight;
506
+ interSlotSpacing?: number;
507
+ slot: UICodeFieldSlot;
508
+ };
509
+
510
+ declare type UICodeFieldSlot = {
511
+ width?: number;
512
+ height?: number;
513
+ backgroundColor?: string;
514
+ cornerRadius?: number;
515
+ borderWidth?: number;
516
+ borderColor?: string;
517
+ focusedBorderWidth?: number;
518
+ focusedBorderColor?: string;
519
+ errorBorderWidth?: number;
520
+ errorBorderColor?: string;
521
+ };
522
+
523
+ declare type UICodeInput = {
524
+ titleLabel?: UILabel;
525
+ codeField: UICodeField;
526
+ descriptionLabel?: UILabel;
527
+ };
528
+
381
529
  declare type UIColumn = {
382
530
  elements?: UIElement[];
383
531
  horizontalAlignment?: UIHorizontalAlignment;
@@ -387,6 +535,28 @@ declare type UIColumn = {
387
535
  paddings?: UIPaddings;
388
536
  };
389
537
 
538
+ declare type UiComponent = {
539
+ id: string;
540
+ type: typeof ListElementTypes.GENERIC_COLUMN;
541
+ content: UIColumn;
542
+ } | {
543
+ id: string;
544
+ type: typeof ListElementTypes.QUESTION;
545
+ content: QuestionsItem;
546
+ } | {
547
+ id: string;
548
+ type: typeof ListElementTypes.SECTION;
549
+ content: UISection;
550
+ } | {
551
+ id: string;
552
+ type: typeof ListElementTypes.CODE_INPUT;
553
+ content: UICodeInput;
554
+ } | {
555
+ id: string;
556
+ type: typeof ListElementTypes.TEXT_INPUT;
557
+ content: UITextInput;
558
+ };
559
+
390
560
  declare type UIDetailsItem = {
391
561
  title?: UILabel;
392
562
  description?: UILabel;
@@ -488,6 +658,11 @@ declare type UIGalleryScreenClientConfig = {
488
658
  selectionLimit?: number;
489
659
  };
490
660
 
661
+ declare type UIGenericListScreenClientConfig = {
662
+ rootElement: UIListRootElement;
663
+ dataSource: GenericListDataSource;
664
+ };
665
+
491
666
  declare type UIGenericLocationScreenClientConfig = {
492
667
  rootElement: UIRootElement;
493
668
  popups: GenericPopup[];
@@ -590,6 +765,28 @@ declare type UILabel = {
590
765
  fontWeight?: FontWeight;
591
766
  };
592
767
 
768
+ declare type UIListColumn = {
769
+ uiComponents: UiComponent[];
770
+ verticalAlignment?: UIVerticalAlignment;
771
+ backgroundColor?: string;
772
+ cornerRadius?: number;
773
+ paddings?: UIPaddings;
774
+ };
775
+
776
+ declare type UIListRootElement = {
777
+ type: typeof ListRootElementTypes.LIST_SCAFFOLD;
778
+ content: UIListScaffoldContainer;
779
+ };
780
+
781
+ declare type UIListScaffoldContainer = {
782
+ topColumn: UIColumn;
783
+ mainListColumn: UIListColumn;
784
+ bottomColumn: UIColumn;
785
+ backgroundColor: string;
786
+ backgroundImage?: UIImage;
787
+ cornerRadius?: number;
788
+ };
789
+
593
790
  declare type UIMultiDropdownControl = DropdownControl & {
594
791
  chip: UIChip;
595
792
  };
@@ -689,6 +886,12 @@ declare type UIScaffoldContainer = {
689
886
  cornerRadius?: number;
690
887
  };
691
888
 
889
+ declare type UISection = {
890
+ backgroundColor?: string;
891
+ cornerRadius?: number;
892
+ paddings?: UIPaddings;
893
+ };
894
+
692
895
  declare type UISelectorButtonsQuestion = QuestionItem & {
693
896
  displayType: typeof QUESTIONS_DISPLAY_TYPES.SELECTOR_BUTTONS;
694
897
  option: UIButtonOption;
@@ -727,18 +930,39 @@ declare type UIStatusScreenClientConfig = {
727
930
  backgroundImage?: UIImage;
728
931
  };
729
932
 
730
- declare type UITextField = UILabel & {
933
+ declare type UITextField = {
934
+ inputType?: TextFieldInputType;
935
+ fontName: string;
936
+ fontColor: string;
937
+ fontSize: number;
938
+ fontWeight: FontWeight;
731
939
  placeholder?: UILabel;
732
- inputType?: TEXT_INPUT_TYPES;
733
940
  backgroundColor?: string;
734
941
  cornerRadius?: number;
735
942
  borderWidth?: number;
736
943
  borderColor?: string;
944
+ focusedBorderWidth?: number;
945
+ focusedBorderColor?: string;
946
+ errorBorderWidth?: number;
947
+ errorBorderColor?: string;
948
+ };
949
+
950
+ declare type UITextInput = {
951
+ titleLabel?: UILabel;
952
+ textField: UITextField;
953
+ descriptionLabel?: UILabel;
737
954
  };
738
955
 
739
956
  declare type UITextQuestion = QuestionItem & {
740
957
  displayType: typeof QUESTIONS_DISPLAY_TYPES.TEXT_EXPANDABLE | typeof QUESTIONS_DISPLAY_TYPES.TEXT_SINGLE_LINE;
741
- textField?: UITextField;
958
+ textField?: UILabel & {
959
+ placeholder?: UILabel;
960
+ inputType?: TEXT_INPUT_TYPES;
961
+ backgroundColor?: string;
962
+ cornerRadius?: number;
963
+ borderWidth?: number;
964
+ borderColor?: string;
965
+ };
742
966
  };
743
967
 
744
968
  declare type UIUploadFilesScreenClientConfig = {