@regulaforensics/idv-gui 2.3.127-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 +175 -7
  2. package/dist/main.js +65903 -3395
  3. package/package.json +5 -1
package/dist/index.d.ts CHANGED
@@ -4,26 +4,42 @@ 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;
11
19
 
12
- declare const GuiIdvSteps: {
20
+ export declare const GuiIdvSteps: {
13
21
  readonly INFO: "INFO";
14
22
  readonly INFO_DETAILS: "INFO_DETAILS";
15
23
  readonly STATUS: "STATUS";
16
24
  readonly PROGRESS: "PROGRESS";
25
+ readonly QUESTIONS: "QUESTIONS";
17
26
  };
18
27
 
19
- declare type GuiIdvSteps = keyof typeof GuiIdvSteps;
28
+ export declare type GuiIdvSteps = (typeof GuiIdvSteps)[keyof typeof GuiIdvSteps];
20
29
 
21
30
  declare type GuiModuleConfig = Record<string, any>;
22
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
+
23
38
  export declare type GuiModuleProps = {
24
39
  [K in keyof GuiModulePropsMap]: {
25
40
  templateId: K;
26
- templateLayout?: GuiModulePropsMap[K];
41
+ templateLayout: GuiModulePropsMap[K];
42
+ dataSource?: QuestionsDataSource | null;
27
43
  sessionId?: string;
28
44
  serviceToken?: string;
29
45
  };
@@ -34,11 +50,13 @@ declare type GuiModulePropsMap = {
34
50
  [GuiIdvSteps.INFO_DETAILS]: UIInfoDetailsScreenClientConfig;
35
51
  [GuiIdvSteps.PROGRESS]: UIProgressScreenClientConfig;
36
52
  [GuiIdvSteps.STATUS]: UIStatusScreenClientConfig;
53
+ [GuiIdvSteps.QUESTIONS]: UIQuestionsScreenClientConfig;
37
54
  };
38
55
 
39
56
  export declare type GuiModulePropsUnknown = {
40
57
  templateId: string;
41
58
  templateLayout?: Record<string, any>;
59
+ dataSource?: Record<string, unknown> | null;
42
60
  sessionId?: string;
43
61
  serviceToken?: string;
44
62
  };
@@ -66,9 +84,15 @@ export declare const IDV_UI_ICONS: {
66
84
  readonly ONBOARDING_TAKE_SELFIE: "onboardgTakeASelfie";
67
85
  readonly PREPARE_DOCUMENT_STEP: "prepareDocumentStep";
68
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";
69
93
  };
70
94
 
71
- 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];
72
96
 
73
97
  declare type IdvModuleMethods = {
74
98
  isReady: () => boolean;
@@ -86,7 +110,61 @@ declare type IdvModuleProps<T, R> = {
86
110
  idvEventListener: (module: string, data: any) => void;
87
111
  };
88
112
 
89
- 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];
90
168
 
91
169
  /** Common UI elements types */
92
170
  declare const TextAlignment: {
@@ -95,17 +173,22 @@ declare const TextAlignment: {
95
173
  readonly RIGHT: "RIGHT";
96
174
  };
97
175
 
98
- declare type TextAlignment = keyof typeof TextAlignment;
176
+ declare type TextAlignment = (typeof TextAlignment)[keyof typeof TextAlignment];
99
177
 
100
178
  declare type UIButton = {
179
+ type?: 'RESPONSE_BODY' | 'FORM';
101
180
  title?: UILabel;
102
181
  image?: UIImage;
103
182
  responseBody?: string | Record<string, any>;
104
183
  backgroundColor?: string;
105
184
  cornerRadius?: number;
106
185
  highlightColor?: string;
186
+ borderColor?: string;
187
+ borderWidth?: number;
107
188
  };
108
189
 
190
+ declare type UIButtonOption = UIButton;
191
+
109
192
  declare type UIDetailsItem = {
110
193
  title?: UILabel;
111
194
  description?: UILabel;
@@ -120,6 +203,14 @@ declare type UIDetailsList = {
120
203
  cornerRadius: number;
121
204
  };
122
205
 
206
+ declare type UIDropdownOption = {
207
+ title?: UILabel;
208
+ image?: UIImage;
209
+ backgroundColor?: string;
210
+ cornerRadius?: number;
211
+ highlightColor?: string;
212
+ };
213
+
123
214
  declare type UIImage = {
124
215
  imageURL?: string;
125
216
  base64?: string;
@@ -166,6 +257,12 @@ declare type UILabel = {
166
257
  cornerRadius?: number;
167
258
  };
168
259
 
260
+ declare type UIMultiSelectorQuestion = QuestionItem & {
261
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.MULTI_SELECTOR_DROPDOWN;
262
+ option: UIDropdownOption;
263
+ optionSelected: UIDropdownOption;
264
+ };
265
+
169
266
  declare type UIProgressScreenClientConfig = {
170
267
  header?: UIInfoHeaderView;
171
268
  progressView?: UIProgressView;
@@ -178,6 +275,47 @@ declare type UIProgressView = {
178
275
  indicatorColor: string;
179
276
  };
180
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
+
181
319
  declare type UIStatusScreenClientConfig = {
182
320
  header?: UIInfoHeaderView;
183
321
  image?: UIImage;
@@ -187,4 +325,34 @@ declare type UIStatusScreenClientConfig = {
187
325
  backgroundColor?: string;
188
326
  };
189
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
+
190
358
  export { }