@getyoti/react-face-capture 1.3.1-test.1 → 2.0.0-beta.1

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/index.d.ts CHANGED
@@ -15,6 +15,9 @@ declare module '@getyoti/react-face-capture' {
15
15
  INTERNAL_ERROR = 'INTERNAL_ERROR',
16
16
  VIDEO_STREAM_INTERRUPTED = 'VIDEO_STREAM_INTERRUPTED',
17
17
  SECURE_SESSION_EXPIRED = 'SECURE_SESSION_EXPIRED',
18
+ EXCEEDED_TIME_TO_LOAD = 'EXCEEDED_TIME_TO_LOAD',
19
+ VERSION_NO_LONGER_AVAILABLE = 'VERSION_NO_LONGER_AVAILABLE',
20
+ INVALID_SECURE_CLIENT_SDK_ID = 'INVALID_SECURE_CLIENT_SDK_ID',
18
21
  }
19
22
 
20
23
  /**
@@ -50,16 +53,6 @@ declare module '@getyoti/react-face-capture' {
50
53
  LOW = 'low',
51
54
  }
52
55
 
53
- /**
54
- * Scenarios in which the countdown will be used.
55
- */
56
- export enum COUNTDOWN_MODES {
57
- ALWAYS = 'always',
58
- ONLY_MOBILE = 'only_mobile',
59
- ONLY_DESKTOP = 'only_desktop',
60
- NEVER = 'never',
61
- }
62
-
63
56
  /**
64
57
  * Politeness setting of the live region supported by the Face Capture.
65
58
  */
@@ -81,49 +74,87 @@ declare module '@getyoti/react-face-capture' {
81
74
  */
82
75
  export enum LANGUAGE_CODE {
83
76
  AR = 'ar',
77
+ AR_XN = 'ar-XN',
78
+ BG = 'bg',
84
79
  BG_BG = 'bg-BG',
85
80
  CS = 'cs',
81
+ CS_CZ = 'cs-CZ',
86
82
  DA = 'da',
83
+ DA_DK = 'da-DK',
87
84
  DE = 'de',
85
+ DE_DE = 'de-DE',
88
86
  EL = 'el',
87
+ EL_GR = 'el-GR',
89
88
  EN = 'en',
89
+ EN_GB = 'en-GB',
90
90
  ES = 'es',
91
+ ES_ES = 'es-ES',
91
92
  ES_419 = 'es-419',
92
93
  ET = 'et',
94
+ ET_EE = 'et-EE',
95
+ FA = 'fa',
93
96
  FA_IR = 'fa-IR',
94
97
  FI = 'fi',
98
+ FI_FI = 'fi-FI',
95
99
  FR = 'fr',
100
+ FR_FR = 'fr-FR',
96
101
  HE = 'he',
102
+ HE_IL = 'he-IL',
97
103
  HI = 'hi',
104
+ HI_IN = 'hi-IN',
105
+ HU = 'hu',
106
+ HU_HU = 'hu-HU',
98
107
  HY = 'hy',
108
+ HY_AM = 'hy-AM',
99
109
  ID = 'id',
110
+ ID_ID = 'id-ID',
100
111
  IT = 'it',
112
+ IT_IT = 'it-IT',
101
113
  JA = 'ja',
114
+ JA_JP = 'ja-JP',
102
115
  KO = 'ko',
116
+ KO_KR = 'ko-KR',
103
117
  LT = 'lt',
118
+ LT_LT = 'lt-LT',
104
119
  LV = 'lv',
120
+ LV_LV = 'lv-LV',
105
121
  MS = 'ms',
122
+ MS_MY = 'ms-MY',
106
123
  NB = 'nb',
124
+ NB_NO = 'nb-NO',
107
125
  NL = 'nl',
126
+ NL_NL = 'nl-NL',
108
127
  PL = 'pl',
109
- /**
110
- * @deprecated Use {@link LANGUAGE_CODE.PT_BR} or {@link LANGUAGE_CODE.PT_PT} instead.
111
- */
128
+ PL_PL = 'pl-PL',
112
129
  PT = 'pt',
113
130
  PT_BR = 'pt-BR',
114
131
  PT_PT = 'pt-PT',
115
132
  RO = 'ro',
133
+ RO_RO = 'ro-RO',
116
134
  RU = 'ru',
135
+ RU_RU = 'ru-RU',
136
+ SK = 'sk',
137
+ SK_SK = 'sk-SK',
117
138
  SV = 'sv',
139
+ SV_SE = 'sv-SE',
118
140
  TH = 'th',
141
+ TH_TH = 'th-TH',
142
+ TL = 'tl',
143
+ TL_PH = 'tl-PH',
119
144
  TR = 'tr',
145
+ TR_TR = 'tr-TR',
120
146
  UK = 'uk',
147
+ UK_UA = 'uk-UA',
121
148
  UR = 'ur',
149
+ UR_PK = 'ur-PK',
122
150
  VI = 'vi',
151
+ VI_VN = 'vi-VN',
152
+ ZH = 'zh',
153
+ ZH_CN = 'zh-CN',
123
154
  }
124
155
 
125
156
  /**
126
- * Secure information the Face Capture will provide as result when it takes a picture (onSuccess callback). Only when the secure prop is set to true.
157
+ * Secure information the Face Capture will provide as a result when it takes a picture (onSuccess callback). Only when the secure prop is set to true.
127
158
  */
128
159
  export interface Secure {
129
160
  version: string;
@@ -133,9 +164,10 @@ declare module '@getyoti/react-face-capture' {
133
164
  }
134
165
 
135
166
  /**
136
- * Result entity the FCM will return on the onSuccess callback.
167
+ * Result entity the FCM will return on the onSuccess callback. It is the
168
+ * content that needs to be sent to the Yoti AI services.
137
169
  */
138
- export interface FCMResult {
170
+ export interface FCMPayload {
139
171
  img: string;
140
172
  secure?: Secure;
141
173
  }
@@ -144,14 +176,14 @@ declare module '@getyoti/react-face-capture' {
144
176
  * Face Capture properties.
145
177
  */
146
178
  export interface FaceCaptureProps {
147
- /** Root url where assets for the face detection are located. */
179
+ /** Root URL where assets for the face detection are located. */
148
180
  faceCaptureAssetsRootUrl?: string;
149
181
  /** Capture method to take the photo: by clicking a button or auto-capture. (default:auto) */
150
182
  captureMethod?: CAPTURE_METHOD;
151
183
  /** If true, the face capture module will use the secure mode. (default:false) */
152
184
  secure?: boolean;
153
185
  /** Callback called once the result (capture) is complete. */
154
- onSuccess: (e: FCMResult) => void;
186
+ onSuccess: (payload: FCMPayload, base64PreviewImage?: string) => void;
155
187
  /** Callback called when there is an error. */
156
188
  onError?: (e: ERROR_CODE) => void;
157
189
  /** Callback called when the face capture module is ready to take images. */
@@ -162,12 +194,6 @@ declare module '@getyoti/react-face-capture' {
162
194
  resolutionType?: RESOLUTION_TYPE;
163
195
  /** Image format type. (default:jpeg) */
164
196
  format?: FORMAT_TYPE;
165
- /** Custom UI of the manual capture button. It uses onClick and disabled as props */
166
- CustomManualButton?: (props: any) => JSX.Element;
167
- /** Custom UI of the consent button. It uses onClick and disabled as props */
168
- CustomConsentButton?: (props: any) => JSX.Element;
169
- /** Indicates when the countdown will be used. Note: It's only used if captureMethod is set to manual. (default:never) */
170
- countdownMode?: COUNTDOWN_MODES;
171
197
  /** imageType select if the image will be the original or it will be cropped in order to improve the timing
172
198
  response when processing the image in the API call. (default:original) */
173
199
  imageType?: IMAGE_TYPE;
@@ -177,10 +203,25 @@ declare module '@getyoti/react-face-capture' {
177
203
  language?: LANGUAGE_CODE;
178
204
  /** Determines the politeness setting of the live region used to read out prompts for screen reader users. (default:polite) */
179
205
  a11yLiveRegionMode?: A11Y_LIVE_REGION_MODE;
180
- /** isConsentRequired Adds a step to click a button to ensure the user gives consent to the tool to start the face capture process. (default:false) */
181
- isConsentRequired?: boolean;
206
+ /** showInitialGuidance determines if the initial help guidance will show or not the help section */
207
+ showInitialGuidance?: boolean;
182
208
  /** Indicates if the face capture will use the manual capture method because of slow performance. (default:true) */
183
209
  manualCaptureFallback?: boolean;
210
+ /** Indicates the time (in milliseconds) to call the onError callback if the module takes that time to load */
211
+ loadTimeout?: number;
212
+ /** Identifies your Yoti Hub application. */
213
+ clientSdkId?: string;
214
+ /** If the Get Help button is shown or not. */
215
+ showGetHelpButton?: boolean;
216
+ /** Automatically renews sessions after they expire. */
217
+ autoSessionReload?: boolean;
218
+ /** Gives the possibility to users to retry several times when an error occurs. */
219
+ userRetryError?: boolean;
220
+ /** If the `onSuccess` method will return the base64 image. */
221
+ returnPreviewImage?: boolean;
222
+ /** If the face capture will encrypt the image inside the payload argument
223
+ * on the `onSuccess` callback when it runs the secure mode. */
224
+ encryptImage?: boolean;
184
225
  }
185
226
 
186
227
  /**