@regulaforensics/idv-gui 0.1.118-rc → 0.1.206-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,25 +1,117 @@
1
- declare enum ContentMode {
2
- ASPECT_FILL = "ASPECT_FILL",
3
- ASPECT_FIT = "ASPECT_FIT",
4
- FILL = "FILL"
1
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
2
+
3
+ declare function AgeIcon({ size }: {
4
+ size?: number;
5
+ color?: string;
6
+ }): JSX_2.Element;
7
+
8
+ declare function AndroidIcon({ size, color }: {
9
+ size?: number;
10
+ color?: string;
11
+ }): JSX_2.Element;
12
+
13
+ declare function ArrowIcon({ size }: {
14
+ size?: number;
15
+ color?: string;
16
+ }): JSX_2.Element;
17
+
18
+ declare function BackIcon({ size }: {
19
+ size?: number;
20
+ color?: string;
21
+ }): JSX_2.Element;
22
+
23
+ declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
24
+ abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
25
+ abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
5
26
  }
6
27
 
7
- declare const GuiIdv: React.FC<IdvModuleProps<GuiModuleProps, GuiModuleConfig>> & IdvModuleMethods;
28
+ declare function BiometricIcon({ size }: {
29
+ size?: number;
30
+ color?: string;
31
+ }): JSX_2.Element;
32
+
33
+ declare const ContentMode: {
34
+ readonly ASPECT_FILL: "ASPECT_FILL";
35
+ readonly ASPECT_FIT: "ASPECT_FIT";
36
+ readonly FILL: "FILL";
37
+ };
38
+
39
+ declare type ContentMode = (typeof ContentMode)[keyof typeof ContentMode];
40
+
41
+ declare const DATA_SOURCE_ANSWER_TYPE: {
42
+ readonly text: "text";
43
+ readonly selector: "selector";
44
+ readonly multiSelector: "multiSelector";
45
+ };
46
+
47
+ declare type DATA_SOURCE_ANSWER_TYPE = (typeof DATA_SOURCE_ANSWER_TYPE)[keyof typeof DATA_SOURCE_ANSWER_TYPE];
48
+
49
+ declare type DropdownControl = {
50
+ backgroundColor?: string;
51
+ cornerRadius?: number;
52
+ borderWidth?: number;
53
+ borderColor?: string;
54
+ highlightBorderColor?: string;
55
+ clearButton?: UIImage;
56
+ expandButton?: UIImage;
57
+ };
58
+
59
+ declare function ErrorIcon({ size, color }: {
60
+ size?: number;
61
+ color?: string;
62
+ }): JSX_2.Element;
63
+
64
+ declare class GuiIdv extends BaseModule<GuiModuleProps, GuiModuleConfig> {
65
+ private _root;
66
+ private _mounted;
67
+ props: IdvModuleProps<GuiModuleProps, GuiModuleConfig> | null;
68
+ constructor();
69
+ static displayName: string;
70
+ setProps(props: IdvModuleProps<GuiModuleProps, GuiModuleConfig>): void;
71
+ connectedCallback(): void;
72
+ private render;
73
+ disconnectedCallback(): void;
74
+ static isReady(): boolean;
75
+ static getSupportedTemplates: () => ("INFO" | "INFO_DETAILS" | "STATUS" | "PROGRESS" | "QUESTIONS")[];
76
+ static initialize(modulesConfig: Record<string, unknown>): void;
77
+ static deinitialize(): void;
78
+ static getIdentifier: () => string;
79
+ }
80
+ export { GuiIdv }
8
81
  export default GuiIdv;
9
82
 
10
- declare const GuiIdvSteps: {
83
+ export declare const GuiIdvReactComponent: React.FC<IdvModuleProps<GuiModuleProps | GuiModulePropsUnknown, GuiModuleConfig>>;
84
+
85
+ export declare const GuiIdvSteps: {
11
86
  readonly INFO: "INFO";
12
87
  readonly INFO_DETAILS: "INFO_DETAILS";
13
88
  readonly STATUS: "STATUS";
14
89
  readonly PROGRESS: "PROGRESS";
90
+ readonly QUESTIONS: "QUESTIONS";
15
91
  };
16
92
 
93
+ export declare type GuiIdvSteps = (typeof GuiIdvSteps)[keyof typeof GuiIdvSteps];
94
+
95
+ export declare const GuiIdvStyleInjectionWrapper: React.FC<{
96
+ children: React.ReactNode;
97
+ }>;
98
+
17
99
  declare type GuiModuleConfig = Record<string, any>;
18
100
 
19
- declare type GuiModuleProps = {
101
+ export declare const GuiModuleError: {
102
+ readonly DECODING_FAILED: "DECODING_FAILED";
103
+ };
104
+
105
+ export declare type GuiModuleError = (typeof GuiModuleError)[keyof typeof GuiModuleError];
106
+
107
+ export declare type GuiModuleProps = {
20
108
  [K in keyof GuiModulePropsMap]: {
21
- templateId?: K;
22
- templateLayout?: GuiModulePropsMap[K];
109
+ templateId: K;
110
+ templateLayout: GuiModulePropsMap[K];
111
+ dataSource?: QuestionsDataSource | null;
112
+ properties?: SessionPropertiesItem[];
113
+ sessionId?: string;
114
+ serviceToken?: string;
23
115
  };
24
116
  }[keyof GuiModulePropsMap];
25
117
 
@@ -28,40 +120,233 @@ declare type GuiModulePropsMap = {
28
120
  [GuiIdvSteps.INFO_DETAILS]: UIInfoDetailsScreenClientConfig;
29
121
  [GuiIdvSteps.PROGRESS]: UIProgressScreenClientConfig;
30
122
  [GuiIdvSteps.STATUS]: UIStatusScreenClientConfig;
123
+ [GuiIdvSteps.QUESTIONS]: UIQuestionsScreenClientConfig;
124
+ };
125
+
126
+ export declare type GuiModulePropsUnknown = {
127
+ templateId: string;
128
+ templateLayout?: Record<string, any>;
129
+ dataSource?: Record<string, unknown> | null;
130
+ sessionId?: string;
131
+ serviceToken?: string;
31
132
  };
32
133
 
33
- declare type IdvModuleMethods = {
34
- isReady: () => boolean;
35
- getSupportedTemplates: () => string[];
36
- getIdentifier: () => string;
37
- initialize: (modulesConfig: Record<string, any>) => void;
38
- deinitialize?: () => void;
134
+ export declare const IDV_UI_ICONS: {
135
+ readonly WARNING: "warning_icon";
136
+ readonly SPINNER: "spinner";
137
+ readonly ERROR: "failure";
138
+ readonly AGE: "age";
139
+ readonly ANDROID: "android";
140
+ readonly ARROW: "arrow";
141
+ readonly APPLE: "apple";
142
+ readonly BACK: "back";
143
+ readonly BIOMETRIC: "biometricIcon";
144
+ readonly INFO: "info";
145
+ readonly TO_MOBILE: "toMobile";
146
+ readonly UNDERAGE: "underage";
147
+ readonly CROSS: "cross";
148
+ readonly REGULA_LOGO: "regulaLogo";
149
+ readonly POWERED_BY: "signature";
150
+ readonly SUCCESS: "success";
151
+ readonly DEFAULT: "empty";
152
+ readonly ONBOARDING_SCAN_ID: "onboardingScanYourId";
153
+ readonly ONBOARDING_READ_RFID: "onboardingReadRfidChip";
154
+ readonly ONBOARDING_TAKE_SELFIE: "onboardgTakeASelfie";
155
+ readonly PREPARE_DOCUMENT_STEP: "prepareDocumentStep";
156
+ readonly PREPARE_LIVENESS_STEP: "prepareLivenessStep";
157
+ readonly CIRCLE_SELECTED: "radio_selected";
158
+ readonly CIRCLE_NORMAL: "radio_normal";
159
+ readonly SQUARE_SELECTED: "square_selected";
160
+ readonly SQUARE_NORMAL: "square_normal";
161
+ readonly SELECTED: "selected";
162
+ readonly CHEVRON_DOWN: "chevronDown";
163
+ readonly CLOSE_ICON: "close_icon";
164
+ };
165
+
166
+ export declare type IDV_UI_ICONS = (typeof IDV_UI_ICONS)[keyof typeof IDV_UI_ICONS];
167
+
168
+ export declare const idvIconComponents: {
169
+ warning_icon: typeof WarningIcon;
170
+ spinner: ({ indicatorColor }: {
171
+ indicatorColor?: string;
172
+ }) => JSX_2.Element;
173
+ failure: typeof ErrorIcon;
174
+ age: typeof AgeIcon;
175
+ android: typeof AndroidIcon;
176
+ arrow: typeof ArrowIcon;
177
+ apple: ({ size, color }: {
178
+ size?: number;
179
+ color?: string;
180
+ }) => JSX_2.Element;
181
+ back: typeof BackIcon;
182
+ biometricIcon: typeof BiometricIcon;
183
+ info: typeof InfoIcon;
184
+ toMobile: typeof ToMobileIcon;
185
+ underage: typeof UnderageIcon;
186
+ cross: ({ size, color }: {
187
+ size?: number;
188
+ color?: string;
189
+ }) => JSX_2.Element;
190
+ regulaLogo: ({ size, color }: {
191
+ size?: number;
192
+ color?: string;
193
+ }) => JSX_2.Element;
194
+ empty: () => JSX_2.Element;
195
+ signature: typeof PoweredByRegula;
196
+ success: ({ size, color }: {
197
+ size?: number;
198
+ color?: string;
199
+ }) => JSX_2.Element;
200
+ onboardingScanYourId: () => JSX_2.Element;
201
+ onboardingReadRfidChip: () => JSX_2.Element;
202
+ onboardgTakeASelfie: () => JSX_2.Element;
203
+ prepareDocumentStep: () => JSX_2.Element;
204
+ prepareLivenessStep: () => JSX_2.Element;
205
+ radio_selected: () => JSX_2.Element;
206
+ radio_normal: () => JSX_2.Element;
207
+ square_selected: () => JSX_2.Element;
208
+ square_normal: () => JSX_2.Element;
209
+ selected: ({ color }: {
210
+ color?: string | undefined;
211
+ }) => JSX_2.Element;
212
+ chevronDown: ({ color }: {
213
+ color?: string | undefined;
214
+ }) => JSX_2.Element;
215
+ close_icon: ({ size, color }: {
216
+ size?: number;
217
+ color?: string;
218
+ }) => JSX_2.Element;
39
219
  };
40
220
 
41
- declare type IdvModuleProps<T, R> = {
221
+ declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
42
222
  isProcessing?: (isProcessing: boolean) => void;
43
- moduleProps: T;
44
- modulesConfig?: R;
223
+ moduleProps: TModuleProps;
224
+ modulesConfig?: TModulesConfig;
45
225
  perform: (data: any) => void;
46
226
  idvEventListener: (module: string, data: any) => void;
47
227
  };
48
228
 
49
- export declare const MODULE_NAME = "GUI";
229
+ declare function InfoIcon({ size, color }: {
230
+ size?: number;
231
+ color?: string;
232
+ }): JSX_2.Element;
233
+
234
+ declare type JsonArray = JsonValue[];
235
+
236
+ declare type JsonObject = {
237
+ [key: string]: JsonValue;
238
+ };
239
+
240
+ declare type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
241
+
242
+ declare function PoweredByRegula(): JSX_2.Element;
243
+
244
+ declare type QuestionDataSource = {
245
+ id: string | number;
246
+ placeholder?: string | null;
247
+ text: string;
248
+ answerType: DATA_SOURCE_ANSWER_TYPE;
249
+ required: boolean | null;
250
+ property: {
251
+ id: string;
252
+ };
253
+ validators: Array<Validator>;
254
+ options: Array<{
255
+ id: number | string;
256
+ text: string;
257
+ }>;
258
+ };
259
+
260
+ declare type QuestionItem = {
261
+ answerType: DATA_SOURCE_ANSWER_TYPE;
262
+ questionIds?: string[];
263
+ title?: UILabel;
264
+ validationMessage: UILabel;
265
+ backgroundColor?: string;
266
+ cornerRadius?: number;
267
+ validationBorderColor?: string;
268
+ validationBorderWidth?: number;
269
+ };
270
+
271
+ declare const QUESTIONS_DISPLAY_TYPES: {
272
+ readonly TEXT_EXPANDABLE: "text_expandable";
273
+ readonly TEXT_SINGLE_LINE: "text_single_line";
274
+ readonly SELECTOR_OPTIONS: "selector_options";
275
+ readonly SELECTOR_BUTTONS: "selector_buttons";
276
+ readonly SELECTOR_DROPDOWN: "selector_dropdown";
277
+ readonly MULTI_SELECTOR_BUTTONS: "multi_selector_buttons";
278
+ readonly MULTI_SELECTOR_OPTIONS: "multi_selector_options";
279
+ readonly MULTI_SELECTOR_DROPDOWN: "multi_selector_dropdown";
280
+ };
281
+
282
+ declare type QUESTIONS_DISPLAY_TYPES = (typeof QUESTIONS_DISPLAY_TYPES)[keyof typeof QUESTIONS_DISPLAY_TYPES];
283
+
284
+ declare type QuestionsDataSource = {
285
+ static: boolean;
286
+ questions: QuestionDataSource[];
287
+ };
288
+
289
+ declare type QuestionsItemTypes = Array<UITextQuestion | UISelectorQuestion | UIMultiSelectorQuestion>;
290
+
291
+ declare type SessionPropertiesItem = {
292
+ id: string;
293
+ createdAt: string;
294
+ updatedAt: string;
295
+ createdBy: unknown;
296
+ updatedBy: unknown;
297
+ action: unknown;
298
+ step: string;
299
+ name: string;
300
+ path: unknown;
301
+ string: string;
302
+ array?: string[];
303
+ integer: unknown;
304
+ decimal: unknown;
305
+ object: unknown;
306
+ };
307
+
308
+ declare const TEXT_INPUT_TYPES: {
309
+ readonly FREE_TEXT: "FREE_TEXT";
310
+ readonly EMAIL: "EMAIL";
311
+ readonly NUMBER: "NUMBER";
312
+ readonly SECURE: "SECURE";
313
+ };
314
+
315
+ declare type TEXT_INPUT_TYPES = (typeof TEXT_INPUT_TYPES)[keyof typeof TEXT_INPUT_TYPES];
50
316
 
51
317
  /** Common UI elements types */
52
- declare enum TextAlignment {
53
- LEFT = "LEFT",
54
- CENTER = "CENTER",
55
- RIGHT = "RIGHT"
56
- }
318
+ declare const TextAlignment: {
319
+ readonly LEFT: "LEFT";
320
+ readonly CENTER: "CENTER";
321
+ readonly RIGHT: "RIGHT";
322
+ };
323
+
324
+ declare type TextAlignment = (typeof TextAlignment)[keyof typeof TextAlignment];
325
+
326
+ declare function ToMobileIcon({ size }: {
327
+ size?: number;
328
+ color?: string;
329
+ }): JSX_2.Element;
57
330
 
58
331
  declare type UIButton = {
332
+ type?: 'RESPONSE_BODY' | 'FORM';
59
333
  title?: UILabel;
60
334
  image?: UIImage;
61
- responseBody?: string;
335
+ responseBody?: JsonObject;
62
336
  backgroundColor?: string;
63
337
  cornerRadius?: number;
64
338
  highlightColor?: string;
339
+ borderColor?: string;
340
+ borderWidth?: number;
341
+ };
342
+
343
+ declare type UIButtonOption = UIButton;
344
+
345
+ declare type UIChip = {
346
+ title?: UILabel;
347
+ removeImage?: UIImage;
348
+ cornerRadius?: number;
349
+ backgroundColor?: string;
65
350
  };
66
351
 
67
352
  declare type UIDetailsItem = {
@@ -78,6 +363,25 @@ declare type UIDetailsList = {
78
363
  cornerRadius: number;
79
364
  };
80
365
 
366
+ declare type UIDropdownControl = DropdownControl & {
367
+ title: UILabel;
368
+ };
369
+
370
+ declare type UIDropdownOption = {
371
+ title?: UILabel;
372
+ image?: UIImage;
373
+ backgroundColor?: string;
374
+ cornerRadius?: number;
375
+ highlightColor?: string;
376
+ };
377
+
378
+ declare type UIDropdownPicker = {
379
+ backgroundColor?: string;
380
+ cornerRadius?: number;
381
+ borderWidth?: number;
382
+ borderColor?: string;
383
+ };
384
+
81
385
  declare type UIImage = {
82
386
  imageURL?: string;
83
387
  base64?: string;
@@ -117,13 +421,25 @@ declare type UIInfoScreenClientConfig = {
117
421
  declare type UILabel = {
118
422
  text?: string;
119
423
  fontName?: string;
120
- fontSize?: string;
424
+ fontSize?: string | number;
121
425
  fontColor?: string;
122
426
  alignment?: TextAlignment;
123
427
  backgroundColor?: string;
124
428
  cornerRadius?: number;
125
429
  };
126
430
 
431
+ declare type UIMultiDropdownControl = DropdownControl & {
432
+ chip: UIChip;
433
+ };
434
+
435
+ declare type UIMultiSelectorQuestion = QuestionItem & {
436
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.MULTI_SELECTOR_DROPDOWN;
437
+ option: UIDropdownOption;
438
+ optionSelected: UIDropdownOption;
439
+ dropdownControl: UIMultiDropdownControl;
440
+ dropdownPicker: UIDropdownPicker;
441
+ };
442
+
127
443
  declare type UIProgressScreenClientConfig = {
128
444
  header?: UIInfoHeaderView;
129
445
  progressView?: UIProgressView;
@@ -132,17 +448,100 @@ declare type UIProgressScreenClientConfig = {
132
448
  };
133
449
 
134
450
  declare type UIProgressView = {
135
- title?: UILabel;
136
451
  indicatorColor: string;
137
452
  };
138
453
 
454
+ declare type UIQuestionsScreenClientConfig = {
455
+ header?: UIInfoHeaderView;
456
+ footer?: UIInfoFooterView;
457
+ title?: UILabel;
458
+ buttons?: UIButton[];
459
+ questions: {
460
+ itemTypes: QuestionsItemTypes;
461
+ backgroundColor?: string;
462
+ };
463
+ backgroundColor?: string;
464
+ cornerRadius?: number;
465
+ };
466
+
467
+ declare type UIRadioOption = {
468
+ image: UIImage;
469
+ title?: UILabel;
470
+ backgroundColor?: string;
471
+ cornerRadius?: number;
472
+ highlightColor?: string;
473
+ };
474
+
475
+ declare type UISelectorButtonsQuestion = QuestionItem & {
476
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.SELECTOR_BUTTONS;
477
+ option: UIButtonOption;
478
+ optionSelected: UIButtonOption;
479
+ };
480
+
481
+ declare type UISelectorDropdownQuestion = QuestionItem & {
482
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.SELECTOR_DROPDOWN;
483
+ option: UIDropdownOption;
484
+ optionSelected: UIDropdownOption;
485
+ dropdownControl: UIDropdownControl;
486
+ dropdownPicker: UIDropdownPicker;
487
+ };
488
+
489
+ declare type UISelectorOptionsQuestion = QuestionItem & {
490
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.SELECTOR_OPTIONS;
491
+ option: UIRadioOption;
492
+ optionSelected: UIRadioOption;
493
+ };
494
+
495
+ declare type UISelectorQuestion = UISelectorOptionsQuestion | UISelectorButtonsQuestion | UISelectorDropdownQuestion;
496
+
139
497
  declare type UIStatusScreenClientConfig = {
140
498
  header?: UIInfoHeaderView;
141
499
  image?: UIImage;
142
500
  title?: UILabel;
501
+ description: UILabel;
143
502
  buttons?: UIButton[];
144
503
  footer?: UIInfoFooterView;
145
504
  backgroundColor?: string;
146
505
  };
147
506
 
507
+ declare type UITextField = UILabel & {
508
+ placeholder?: UILabel;
509
+ inputType?: TEXT_INPUT_TYPES;
510
+ backgroundColor?: string;
511
+ cornerRadius?: number;
512
+ borderWidth?: number;
513
+ borderColor?: string;
514
+ };
515
+
516
+ declare type UITextQuestion = QuestionItem & {
517
+ displayType: typeof QUESTIONS_DISPLAY_TYPES.TEXT_EXPANDABLE | typeof QUESTIONS_DISPLAY_TYPES.TEXT_SINGLE_LINE;
518
+ textField?: UITextField;
519
+ };
520
+
521
+ declare function UnderageIcon({ size }: {
522
+ size?: number;
523
+ color?: string;
524
+ }): JSX_2.Element;
525
+
526
+ declare type Validator = {
527
+ type: typeof VALIDATOR_TYPE.NOT_EMPTY;
528
+ message: string;
529
+ } | {
530
+ type: typeof VALIDATOR_TYPE.REGEX;
531
+ message: string;
532
+ regex: string;
533
+ };
534
+
535
+ declare const VALIDATOR_TYPE: {
536
+ readonly NOT_EMPTY: "notEmpty";
537
+ readonly REGEX: "regex";
538
+ };
539
+
540
+ declare type VALIDATOR_TYPE = (typeof VALIDATOR_TYPE)[keyof typeof VALIDATOR_TYPE];
541
+
542
+ declare function WarningIcon({ size, color }: {
543
+ size?: number;
544
+ color?: string;
545
+ }): JSX_2.Element;
546
+
148
547
  export { }