@regulaforensics/idv-gui 2.3.128-nightly → 2.3.129-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.
Files changed (3) hide show
  1. package/dist/index.d.ts +173 -6
  2. package/dist/main.js +65900 -3392
  3. package/package.json +5 -1
package/dist/index.d.ts CHANGED
@@ -4,7 +4,15 @@ declare const ContentMode: {
4
4
  readonly FILL: "FILL";
5
5
  };
6
6
 
7
- declare type ContentMode = keyof typeof ContentMode;
7
+ declare type ContentMode = (typeof ContentMode)[keyof typeof ContentMode];
8
+
9
+ declare const DATA_SOURCE_ANSWER_TYPE: {
10
+ readonly text: "text";
11
+ readonly selector: "selector";
12
+ readonly multiselector: "multiselector";
13
+ };
14
+
15
+ declare type DATA_SOURCE_ANSWER_TYPE = (typeof DATA_SOURCE_ANSWER_TYPE)[keyof typeof DATA_SOURCE_ANSWER_TYPE];
8
16
 
9
17
  declare const GuiIdv: React.FC<IdvModuleProps<GuiModuleProps | GuiModulePropsUnknown, GuiModuleConfig>> & IdvModuleMethods;
10
18
  export default GuiIdv;
@@ -17,14 +25,21 @@ export declare const GuiIdvSteps: {
17
25
  readonly QUESTIONS: "QUESTIONS";
18
26
  };
19
27
 
20
- export declare type GuiIdvSteps = keyof typeof GuiIdvSteps;
28
+ export declare type GuiIdvSteps = (typeof GuiIdvSteps)[keyof typeof GuiIdvSteps];
21
29
 
22
30
  declare type GuiModuleConfig = Record<string, any>;
23
31
 
32
+ export declare const GuiModuleError: {
33
+ readonly DECODING_FAILED: "DECODING_FAILED";
34
+ };
35
+
36
+ export declare type GuiModuleError = (typeof GuiModuleError)[keyof typeof GuiModuleError];
37
+
24
38
  export declare type GuiModuleProps = {
25
39
  [K in keyof GuiModulePropsMap]: {
26
40
  templateId: K;
27
- templateLayout?: GuiModulePropsMap[K];
41
+ templateLayout: GuiModulePropsMap[K];
42
+ dataSource?: QuestionsDataSource | null;
28
43
  sessionId?: string;
29
44
  serviceToken?: string;
30
45
  };
@@ -35,11 +50,13 @@ declare type GuiModulePropsMap = {
35
50
  [GuiIdvSteps.INFO_DETAILS]: UIInfoDetailsScreenClientConfig;
36
51
  [GuiIdvSteps.PROGRESS]: UIProgressScreenClientConfig;
37
52
  [GuiIdvSteps.STATUS]: UIStatusScreenClientConfig;
53
+ [GuiIdvSteps.QUESTIONS]: UIQuestionsScreenClientConfig;
38
54
  };
39
55
 
40
56
  export declare type GuiModulePropsUnknown = {
41
57
  templateId: string;
42
58
  templateLayout?: Record<string, any>;
59
+ dataSource?: Record<string, unknown> | null;
43
60
  sessionId?: string;
44
61
  serviceToken?: string;
45
62
  };
@@ -67,9 +84,15 @@ export declare const IDV_UI_ICONS: {
67
84
  readonly ONBOARDING_TAKE_SELFIE: "onboardgTakeASelfie";
68
85
  readonly PREPARE_DOCUMENT_STEP: "prepareDocumentStep";
69
86
  readonly PREPARE_LIVENESS_STEP: "prepareLivenessStep";
87
+ readonly CIRCLE_SELECTED: "radio_selected";
88
+ readonly CIRCLE_NORMAL: "radio_normal";
89
+ readonly SQUARE_SELECTED: "square_selected";
90
+ readonly SQUARE_NORMAL: "square_normal";
91
+ readonly SELECTED: "selected";
92
+ readonly CHEVRON_DOWN: "chevronDown";
70
93
  };
71
94
 
72
- export declare type IDV_UI_ICONS = keyof typeof IDV_UI_ICONS;
95
+ export declare type IDV_UI_ICONS = (typeof IDV_UI_ICONS)[keyof typeof IDV_UI_ICONS];
73
96
 
74
97
  declare type IdvModuleMethods = {
75
98
  isReady: () => boolean;
@@ -87,7 +110,61 @@ declare type IdvModuleProps<T, R> = {
87
110
  idvEventListener: (module: string, data: any) => void;
88
111
  };
89
112
 
90
- export declare const MODULE_NAME = "GUI";
113
+ declare type QuestionDataSource = {
114
+ id: string | number;
115
+ placeholder?: string | null;
116
+ text: string;
117
+ answerType: DATA_SOURCE_ANSWER_TYPE;
118
+ required: boolean | null;
119
+ property: {
120
+ id: string;
121
+ };
122
+ validators: Array<Validator>;
123
+ options: Array<{
124
+ id: number | string;
125
+ text: string;
126
+ }>;
127
+ };
128
+
129
+ declare type QuestionItem = {
130
+ answerType: DATA_SOURCE_ANSWER_TYPE;
131
+ questionIds?: string[];
132
+ title?: UILabel;
133
+ validationMessage: UILabel;
134
+ backgroundColor?: string;
135
+ cornerRadius?: number;
136
+ validationBorderColor?: string;
137
+ validationBorderWidth?: number;
138
+ };
139
+
140
+ declare const QUESTIONS_DISPLAY_TYPES: {
141
+ readonly TEXT_EXPANDABLE: "text_expandable";
142
+ readonly TEXT_SINGLE_LINE: "text_single_line";
143
+ readonly SELECTOR_OPTIONS: "selector_options";
144
+ readonly SELECTOR_BUTTONS: "selector_buttons";
145
+ readonly SELECTOR_DROPDOWN: "selector_dropdown";
146
+ readonly MULTI_SELECTOR_BUTTONS: "multi_selector_buttons";
147
+ readonly MULTI_SELECTOR_OPTIONS: "multi_selector_options";
148
+ readonly MULTI_SELECTOR_DROPDOWN: "multi_selector_dropdown";
149
+ };
150
+
151
+ declare type QUESTIONS_DISPLAY_TYPES = (typeof QUESTIONS_DISPLAY_TYPES)[keyof typeof QUESTIONS_DISPLAY_TYPES];
152
+
153
+ declare type QuestionsDataSource = {
154
+ static: boolean;
155
+ questions: QuestionDataSource[];
156
+ };
157
+
158
+ declare type QuestionsItemTypes = Array<UITextQuestion | UISelectorQuestion | UIMultiSelectorQuestion>;
159
+
160
+ declare const TEXT_INPUT_TYPES: {
161
+ readonly FREE_TEXT: "FREE_TEXT";
162
+ readonly EMAIL: "EMAIL";
163
+ readonly NUMBER: "NUMBER";
164
+ readonly SECURE: "SECURE";
165
+ };
166
+
167
+ declare type TEXT_INPUT_TYPES = (typeof TEXT_INPUT_TYPES)[keyof typeof TEXT_INPUT_TYPES];
91
168
 
92
169
  /** Common UI elements types */
93
170
  declare const TextAlignment: {
@@ -96,17 +173,22 @@ declare const TextAlignment: {
96
173
  readonly RIGHT: "RIGHT";
97
174
  };
98
175
 
99
- declare type TextAlignment = keyof typeof TextAlignment;
176
+ declare type TextAlignment = (typeof TextAlignment)[keyof typeof TextAlignment];
100
177
 
101
178
  declare type UIButton = {
179
+ type?: 'RESPONSE_BODY' | 'FORM';
102
180
  title?: UILabel;
103
181
  image?: UIImage;
104
182
  responseBody?: string | Record<string, any>;
105
183
  backgroundColor?: string;
106
184
  cornerRadius?: number;
107
185
  highlightColor?: string;
186
+ borderColor?: string;
187
+ borderWidth?: number;
108
188
  };
109
189
 
190
+ declare type UIButtonOption = UIButton;
191
+
110
192
  declare type UIDetailsItem = {
111
193
  title?: UILabel;
112
194
  description?: UILabel;
@@ -121,6 +203,14 @@ declare type UIDetailsList = {
121
203
  cornerRadius: number;
122
204
  };
123
205
 
206
+ declare type UIDropdownOption = {
207
+ title?: UILabel;
208
+ image?: UIImage;
209
+ backgroundColor?: string;
210
+ cornerRadius?: number;
211
+ highlightColor?: string;
212
+ };
213
+
124
214
  declare type UIImage = {
125
215
  imageURL?: string;
126
216
  base64?: string;
@@ -167,6 +257,12 @@ declare type UILabel = {
167
257
  cornerRadius?: number;
168
258
  };
169
259
 
260
+ declare type UIMultiSelectorQuestion = QuestionItem & {
261
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.MULTI_SELECTOR_DROPDOWN;
262
+ option: UIDropdownOption;
263
+ optionSelected: UIDropdownOption;
264
+ };
265
+
170
266
  declare type UIProgressScreenClientConfig = {
171
267
  header?: UIInfoHeaderView;
172
268
  progressView?: UIProgressView;
@@ -179,6 +275,47 @@ declare type UIProgressView = {
179
275
  indicatorColor: string;
180
276
  };
181
277
 
278
+ declare type UIQuestionsScreenClientConfig = {
279
+ header?: UIInfoHeaderView;
280
+ footer?: UIInfoFooterView;
281
+ title?: UILabel;
282
+ buttons?: UIButton[];
283
+ questions: {
284
+ itemTypes: QuestionsItemTypes;
285
+ backgroundColor?: string;
286
+ };
287
+ backgroundColor?: string;
288
+ cornerRadius?: number;
289
+ };
290
+
291
+ declare type UIRadioOption = {
292
+ image: UIImage;
293
+ title?: UILabel;
294
+ backgroundColor?: string;
295
+ cornerRadius?: number;
296
+ highlightColor?: string;
297
+ };
298
+
299
+ declare type UISelectorButtonsQuestion = QuestionItem & {
300
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.SELECTOR_BUTTONS;
301
+ option: UIButtonOption;
302
+ optionSelected: UIButtonOption;
303
+ };
304
+
305
+ declare type UISelectorDropdownQuestion = QuestionItem & {
306
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.SELECTOR_DROPDOWN;
307
+ option: UIDropdownOption;
308
+ optionSelected: UIDropdownOption;
309
+ };
310
+
311
+ declare type UISelectorOptionsQuestion = QuestionItem & {
312
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.SELECTOR_OPTIONS;
313
+ option: UIRadioOption;
314
+ optionSelected: UIRadioOption;
315
+ };
316
+
317
+ declare type UISelectorQuestion = UISelectorOptionsQuestion | UISelectorButtonsQuestion | UISelectorDropdownQuestion;
318
+
182
319
  declare type UIStatusScreenClientConfig = {
183
320
  header?: UIInfoHeaderView;
184
321
  image?: UIImage;
@@ -188,4 +325,34 @@ declare type UIStatusScreenClientConfig = {
188
325
  backgroundColor?: string;
189
326
  };
190
327
 
328
+ declare type UITextField = UILabel & {
329
+ placeholder?: UILabel;
330
+ inputType?: TEXT_INPUT_TYPES;
331
+ backgroundColor?: string;
332
+ cornerRadius?: number;
333
+ borderWidth?: number;
334
+ borderColor?: string;
335
+ };
336
+
337
+ declare type UITextQuestion = QuestionItem & {
338
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.TEXT_EXPANDABLE | typeof QUESTIONS_DISPLAY_TYPES.TEXT_SINGLE_LINE;
339
+ textField?: UITextField;
340
+ };
341
+
342
+ declare type Validator = {
343
+ type: typeof VALIDATOR_TYPE.REQUIRED;
344
+ message: string;
345
+ } | {
346
+ type: typeof VALIDATOR_TYPE.REGEX;
347
+ message: string;
348
+ regex: string;
349
+ };
350
+
351
+ declare const VALIDATOR_TYPE: {
352
+ readonly REQUIRED: "required";
353
+ readonly REGEX: "regex";
354
+ };
355
+
356
+ declare type VALIDATOR_TYPE = (typeof VALIDATOR_TYPE)[keyof typeof VALIDATOR_TYPE];
357
+
191
358
  export { }