@regulaforensics/vp-frontend-face-components 1.3.0 → 1.4.0
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/README.md +292 -29
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +42 -0
- package/lib/common/BackCameraIcon.d.ts +6 -0
- package/lib/common/Button.d.ts +7 -0
- package/lib/common/CameraChangeIcon.d.ts +6 -0
- package/lib/common/CameraIcon.d.ts +6 -0
- package/lib/common/CheckIcon.d.ts +6 -0
- package/lib/common/CrossIcon.d.ts +6 -0
- package/lib/common/DocReaderCameraDisabled.d.ts +5 -0
- package/lib/common/DocReaderCameraPreparing.d.ts +5 -0
- package/lib/common/DocReaderFlip.d.ts +5 -0
- package/lib/common/DocReaderProcessing.d.ts +5 -0
- package/lib/common/DocReaderProcessingError.d.ts +5 -0
- package/lib/common/DocReaderProcessingFinished.d.ts +6 -0
- package/lib/common/DocReaderSearch.d.ts +5 -0
- package/lib/common/ErrorIcon.d.ts +6 -0
- package/lib/common/FromCameraIcon.d.ts +5 -0
- package/lib/common/FromGalleryIcon.d.ts +5 -0
- package/lib/common/FrontCameraIcon.d.ts +6 -0
- package/lib/common/FullscreenExitIcon.d.ts +6 -0
- package/lib/common/FullscreenIcon.d.ts +6 -0
- package/lib/common/Icon.d.ts +7 -0
- package/lib/common/InstructionIconFaceDetection.d.ts +5 -0
- package/lib/common/InstructionIconFaceLiveness.d.ts +5 -0
- package/lib/common/Message.d.ts +7 -0
- package/lib/common/NoGlareIcon.d.ts +5 -0
- package/lib/common/NoSmilingIcon.d.ts +5 -0
- package/lib/common/RegulaLogo.d.ts +6 -0
- package/lib/common/SnapshotIcon.d.ts +6 -0
- package/lib/common/Spinner.d.ts +3 -0
- package/lib/common/SquareIcon.d.ts +6 -0
- package/lib/common/StopIcon.d.ts +6 -0
- package/lib/common/VerifiedIcon.d.ts +6 -0
- package/lib/components/ErrorBoundary.d.ts +17 -0
- package/lib/components/FaceCapture.d.ts +17 -0
- package/lib/components/FaceDetection.d.ts +2 -0
- package/lib/components/FaceFullScreenOverlay.d.ts +11 -0
- package/lib/components/FaceLayout.d.ts +19 -0
- package/lib/components/FaceLiveness.d.ts +2 -0
- package/lib/components/InfoScreen.d.ts +10 -0
- package/lib/components/InstructionScreen.d.ts +9 -0
- package/lib/components/ProcessScreen.d.ts +6 -0
- package/lib/components/RetryScreen.d.ts +7 -0
- package/lib/components/WebCamera.d.ts +20 -0
- package/lib/constants.d.ts +366 -0
- package/lib/contexts/FaceAttributesContext.d.ts +24 -0
- package/lib/hoc/withFaceAttributesContext.d.ts +4 -0
- package/lib/hoc/withLocalize.d.ts +7 -0
- package/lib/hooks/useDebounce.d.ts +2 -0
- package/lib/hooks/useFaceLiveness.d.ts +33 -0
- package/lib/hooks/useInterval.d.ts +3 -0
- package/lib/hooks/useOrientationChange.d.ts +10 -0
- package/lib/hooks/useStream.d.ts +16 -0
- package/lib/hooks/useUserAgent.d.ts +3 -0
- package/lib/hooks/useWindowBlur.d.ts +2 -0
- package/lib/i18n/dictionaries/_dictionaries.d.ts +2051 -0
- package/lib/index-face.d.ts +1 -0
- package/lib/models/CameraModel.d.ts +9 -0
- package/lib/models/ImageModel.d.ts +7 -0
- package/lib/services/DebugService.d.ts +13 -0
- package/lib/services/DocumentReaderService.d.ts +39 -0
- package/lib/services/EventEmitter.d.ts +9 -0
- package/lib/services/FaceLivenessService.d.ts +46 -0
- package/lib/services/FaceService.d.ts +11 -0
- package/lib/services/WasmFeatureDetectService.d.ts +4 -0
- package/lib/types.d.ts +219 -0
- package/lib/utils.d.ts +65 -0
- package/lib/web-components/FaceDetection.d.ts +11 -0
- package/lib/web-components/FaceLiveness.d.ts +14 -0
- package/lib/web-components/FullScreenContainer.d.ts +4 -0
- package/lib/web-components.d.ts +47 -0
- package/package.json +30 -35
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
export declare enum eFL_Message {
|
|
2
|
+
eFL_Message_Empty = 0,
|
|
3
|
+
eFL_Message_FitFaceIntoOval = 1,
|
|
4
|
+
eFL_Message_LookStraight = 2,
|
|
5
|
+
eFL_Message_MoveCloser = 3,
|
|
6
|
+
eFL_Message_MoveAway = 4,
|
|
7
|
+
eFL_Message_HoldStill = 5,
|
|
8
|
+
eFL_Message_ShowOnlyOneFace = 6
|
|
9
|
+
}
|
|
10
|
+
export declare enum eFL_ProcessingStage {
|
|
11
|
+
eFL_ProcessingStage_Far = 0,
|
|
12
|
+
eFL_ProcessingStage_Near = 1
|
|
13
|
+
}
|
|
14
|
+
export declare enum eFL_MessageStyle {
|
|
15
|
+
eFL_MessageStyle_Normal = 0,
|
|
16
|
+
eFL_MessageStyle_Alarm = 1
|
|
17
|
+
}
|
|
18
|
+
export declare enum eFL_Status {
|
|
19
|
+
eFL_Status_Finished = 0,
|
|
20
|
+
eFL_Status_InProcess = 1,
|
|
21
|
+
eFL_Status_Timeout = 2,
|
|
22
|
+
eFL_Status_Failed = 3
|
|
23
|
+
}
|
|
24
|
+
export declare enum eFL_Commands {
|
|
25
|
+
eFL_Command_Init = 0,
|
|
26
|
+
eFL_Command_StartNewSession = 1,
|
|
27
|
+
eFL_Command_Process = 2,
|
|
28
|
+
eFL_Command_Free = 3
|
|
29
|
+
}
|
|
30
|
+
export declare enum webCameraComponentMode {
|
|
31
|
+
ONLY_UINT = 0,
|
|
32
|
+
ONLY_RAW = 1,
|
|
33
|
+
UINT_AND_RAW = 2
|
|
34
|
+
}
|
|
35
|
+
export declare enum faceEventActions {
|
|
36
|
+
ELEMENT_VISIBLE = "ELEMENT_VISIBLE",
|
|
37
|
+
PRESS_START_BUTTON = "PRESS_START_BUTTON",
|
|
38
|
+
PRESS_RETRY_BUTTON = "PRESS_RETRY_BUTTON",
|
|
39
|
+
CLOSE = "CLOSE",
|
|
40
|
+
PROCESS_FINISHED = "PROCESS_FINISHED",
|
|
41
|
+
SERVICE_INITIALIZED = "SERVICE_INITIALIZED"
|
|
42
|
+
}
|
|
43
|
+
export declare enum documentEventActions {
|
|
44
|
+
ELEMENT_VISIBLE = "ELEMENT_VISIBLE",
|
|
45
|
+
PRESS_CAMERA_BUTTON = "PRESS_CAMERA_BUTTON",
|
|
46
|
+
PRESS_FILE_BUTTON = "PRESS_FILE_BUTTON",
|
|
47
|
+
PRESS_RETRY_BUTTON = "PRESS_RETRY_BUTTON",
|
|
48
|
+
PRESS_SKIP_BUTTON = "PRESS_SKIP_BUTTON",
|
|
49
|
+
CLOSE = "CLOSE",
|
|
50
|
+
PROCESS_FINISHED = "PROCESS_FINISHED",
|
|
51
|
+
SERVICE_INITIALIZED = "SERVICE_INITIALIZED"
|
|
52
|
+
}
|
|
53
|
+
export declare enum faceCaptureStatus {
|
|
54
|
+
ACCURATE = "faceCaptureStatus.ACCURATE",
|
|
55
|
+
NOFACE = "faceCaptureStatus.NOFACE",
|
|
56
|
+
SMALL = "faceCaptureStatus.SMALL",
|
|
57
|
+
HUGE = "faceCaptureStatus.HUGE",
|
|
58
|
+
PROCESSING = "faceCaptureStatus.PROCESSING",
|
|
59
|
+
NOT_CENTERED = "faceCaptureStatus.NOT_CENTERED"
|
|
60
|
+
}
|
|
61
|
+
export declare enum documentReaderCaptureStatus {
|
|
62
|
+
FINDING = "documentReaderStatus.FINDING",
|
|
63
|
+
PROCESSING = "documentReaderStatus.PROCESSING",
|
|
64
|
+
SUCCESS = "documentReaderStatus.SUCCESS",
|
|
65
|
+
FAILED = "documentReaderStatus.FAILED",
|
|
66
|
+
RESOLUTION = "documentReaderStatus.RESOLUTION",
|
|
67
|
+
GLARE = "documentReaderStatus.GLARE",
|
|
68
|
+
HOLD = "documentReaderStatus.HOLD",
|
|
69
|
+
START_DETECTION = "documentReaderStatus.START_DETECTION",
|
|
70
|
+
START_NEXT_PAGE = "documentReaderStatus.START_NEXT_PAGE",
|
|
71
|
+
SNAPSHOT = "documentReaderStatus.SNAPSHOT",
|
|
72
|
+
TIMEOUT = "documentReaderStatus.TIMEOUT"
|
|
73
|
+
}
|
|
74
|
+
export declare enum eImageQualityCheckType {
|
|
75
|
+
IMAGE_GLARES = 0,
|
|
76
|
+
IMAGE_FOCUS = 1,
|
|
77
|
+
IMAGE_RESOLUTION = 2,
|
|
78
|
+
IMAGE_COLORNESS = 3,
|
|
79
|
+
PERSPECTIVE = 4,
|
|
80
|
+
BOUNDS = 5,
|
|
81
|
+
SCREEN_CAPTURE = 6,
|
|
82
|
+
PORTRAIT = 7,
|
|
83
|
+
HANDWRITTEN = 8
|
|
84
|
+
}
|
|
85
|
+
export declare enum responseCode {
|
|
86
|
+
EMPTY = -1,
|
|
87
|
+
ERROR = 0,
|
|
88
|
+
OK = 1
|
|
89
|
+
}
|
|
90
|
+
export declare enum eCheckResult {
|
|
91
|
+
ERROR = 0,
|
|
92
|
+
OK = 1,
|
|
93
|
+
WAS_NOT_DONE = 2
|
|
94
|
+
}
|
|
95
|
+
export declare enum streamStatus {
|
|
96
|
+
PREPARING = "streamStatus.PREPARING",
|
|
97
|
+
REQUESTING = "streamStatus.REQUESTING",
|
|
98
|
+
READY = "streamStatus.READY",
|
|
99
|
+
PLAY = "streamStatus.PLAY",
|
|
100
|
+
UNKNOWN_ERROR = "streamStatus.UNKNOWN_ERROR",
|
|
101
|
+
PERMISSION_DENIED = "streamStatus.PERMISSION_DENIED",
|
|
102
|
+
NO_CAMERA = "streamStatus.NO_CAMERA",
|
|
103
|
+
INCORRECT_CAMERA_ID = "streamStatus.INCORRECT_CAMERA_ID"
|
|
104
|
+
}
|
|
105
|
+
export declare enum faceCaptureComplitionStatus {
|
|
106
|
+
INSTRUCTION = "faceCaptureReducerStatus.INSTRUCTION",
|
|
107
|
+
SUCCESS = "faceCaptureReducerStatus.SUCCESS",
|
|
108
|
+
FAILED = "faceCaptureReducerStatus.FAILED",
|
|
109
|
+
CAPTURING = "faceCaptureReducerStatus.CAPTURING",
|
|
110
|
+
PROCESSING_REQUEST = "faceCaptureReducerStatus.PROCESSING_REQUEST",
|
|
111
|
+
WASM_DEFAULT_ERROR = "faceCaptureReducerStatus.WASM_DEFAULT_ERROR",
|
|
112
|
+
NOT_SUPPORTED_ERROR = "faceCaptureReducerStatus.NOT_SUPPORTED_ERROR",
|
|
113
|
+
WASM_LICENSE_ERROR = "faceCaptureReducerStatus.WASM_LICENSE_ERROR",
|
|
114
|
+
UNKNOWN_ERROR = "faceCaptureReducerStatus.UNKNOWN_ERROR"
|
|
115
|
+
}
|
|
116
|
+
export declare enum documentReaderComplitionStatus {
|
|
117
|
+
CHOOSE_INPUT_SOURCE = "documentReaderReducerStatus.CHOOSE_INPUT_SOURCE",
|
|
118
|
+
CAMERA_PROCESSING = "documentReaderReducerStatus.CAMERA_PROCESSING",
|
|
119
|
+
FILE_PROCESSING = "documentReaderReducerStatus.FILE_PROCESSING",
|
|
120
|
+
API_PROCESSING = "documentReaderReducerStatus.API_PROCESSING",
|
|
121
|
+
SUCCESS = "documentReaderReducerStatus.SUCCESS",
|
|
122
|
+
FAILED = "documentReaderReducerStatus.FAILED",
|
|
123
|
+
FILE_SIZE_ERROR = "documentReaderReducerStatus.FILE_SIZE_ERROR",
|
|
124
|
+
WASM_DEFAULT_ERROR = "documentReaderReducerStatus.WASM_DEFAULT_ERROR",
|
|
125
|
+
NOT_SUPPORTED_ERROR = "documentReaderReducerStatus.NOT_SUPPORTED_ERROR",
|
|
126
|
+
WASM_LICENSE_ERROR = "documentReaderReducerStatus.WASM_LICENSE_ERROR",
|
|
127
|
+
INCORRECT_FILE_ERROR = "documentReaderReducerStatus.INCORRECT_FILE_ERROR",
|
|
128
|
+
UNKNOWN_ERROR = "documentReaderReducerStatus.UNKNOWN_ERROR"
|
|
129
|
+
}
|
|
130
|
+
export declare enum cameraFacingMode {
|
|
131
|
+
USER = "user",
|
|
132
|
+
ENVIRONMENT = "environment"
|
|
133
|
+
}
|
|
134
|
+
export declare enum ProcessingStatus {
|
|
135
|
+
NOT_FINISHED = 0,
|
|
136
|
+
FINISHED = 1,
|
|
137
|
+
TIMEOUT = 2
|
|
138
|
+
}
|
|
139
|
+
export declare const FACE_LIVENESS_EVENT = "face-liveness";
|
|
140
|
+
export declare const FACE_CAPTURE_EVENT = "face-capture";
|
|
141
|
+
export declare const DOCUMENT_READER_EVENT = "document-reader";
|
|
142
|
+
export declare const CAMERA_SNAPSHOT_EVENT = "camera-snapshot";
|
|
143
|
+
export declare const MINIMUM_DOCUMENT_AREA_PERCENT = 20;
|
|
144
|
+
export declare const PERCENT_FRAME_OFFSET = 10;
|
|
145
|
+
export declare const HEIGHT_ACCURACY_COEF = 0.45;
|
|
146
|
+
export declare const WIDTH_ACCURACY_COEF = 0.93;
|
|
147
|
+
export declare const FRAME_RATIO = 1.4;
|
|
148
|
+
export declare const FACE_POSITION_ACCURACY = 0.1;
|
|
149
|
+
export declare const SQUARE_RATIO_SMALL_X1 = 0.75;
|
|
150
|
+
export declare const SQUARE_RATIO_HUGE_X1 = 0.9;
|
|
151
|
+
export declare const SQUARE_RATIO_SMALL_X2 = 0.68;
|
|
152
|
+
export declare const SQUARE_RATIO_HUGE_X2 = 0.8;
|
|
153
|
+
export declare const CAPTURE_RATE_MS = 30;
|
|
154
|
+
export declare const SUCCESS_CAPTURE_COUNT = 15;
|
|
155
|
+
export declare const FRAME_SCALE_X1 = 0.8;
|
|
156
|
+
export declare const FRAME_SCALE_X2 = 1.35;
|
|
157
|
+
export declare const RESULT_TIMEOUT_MS = 2000;
|
|
158
|
+
export declare const documentReaderCommandCode: {
|
|
159
|
+
PROCESS: number;
|
|
160
|
+
PROCESS_IMAGE: number;
|
|
161
|
+
START_NEW_DOCUMENT: number;
|
|
162
|
+
START_NEW_PAGE: number;
|
|
163
|
+
};
|
|
164
|
+
export declare const PERMISSION_DENIED_ERROR_NAME = "NotAllowedError";
|
|
165
|
+
export declare const FACE_BACKEND_URL = "https://faceapi.regulaforensics.com";
|
|
166
|
+
export declare const cameraResolution: {
|
|
167
|
+
VGA: {
|
|
168
|
+
width: number;
|
|
169
|
+
height: number;
|
|
170
|
+
};
|
|
171
|
+
HD: {
|
|
172
|
+
width: number;
|
|
173
|
+
height: number;
|
|
174
|
+
};
|
|
175
|
+
FULL_HD: {
|
|
176
|
+
width: number;
|
|
177
|
+
height: number;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export declare const backCameraKeywords: string[];
|
|
181
|
+
export declare const faceErrorCodes: {
|
|
182
|
+
231: {
|
|
183
|
+
name: string;
|
|
184
|
+
type: number;
|
|
185
|
+
};
|
|
186
|
+
232: {
|
|
187
|
+
name: string;
|
|
188
|
+
type: number;
|
|
189
|
+
};
|
|
190
|
+
245: {
|
|
191
|
+
name: string;
|
|
192
|
+
type: number;
|
|
193
|
+
};
|
|
194
|
+
230: {
|
|
195
|
+
name: string;
|
|
196
|
+
type: number;
|
|
197
|
+
};
|
|
198
|
+
233: {
|
|
199
|
+
name: string;
|
|
200
|
+
type: number;
|
|
201
|
+
};
|
|
202
|
+
234: {
|
|
203
|
+
name: string;
|
|
204
|
+
type: number;
|
|
205
|
+
};
|
|
206
|
+
235: {
|
|
207
|
+
name: string;
|
|
208
|
+
type: number;
|
|
209
|
+
};
|
|
210
|
+
236: {
|
|
211
|
+
name: string;
|
|
212
|
+
type: number;
|
|
213
|
+
};
|
|
214
|
+
239: {
|
|
215
|
+
name: string;
|
|
216
|
+
type: number;
|
|
217
|
+
};
|
|
218
|
+
240: {
|
|
219
|
+
name: string;
|
|
220
|
+
type: number;
|
|
221
|
+
};
|
|
222
|
+
242: {
|
|
223
|
+
name: string;
|
|
224
|
+
type: number;
|
|
225
|
+
};
|
|
226
|
+
243: {
|
|
227
|
+
name: string;
|
|
228
|
+
type: number;
|
|
229
|
+
};
|
|
230
|
+
244: {
|
|
231
|
+
name: string;
|
|
232
|
+
type: number;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
export declare enum WebComponentsError {
|
|
236
|
+
WASM_ERROR = "WASM_ERROR",
|
|
237
|
+
WASM_LICENSE = "WASM_LICENSE",
|
|
238
|
+
FILE_SIZE = "FILE_SIZE",
|
|
239
|
+
INCORRECT_FILE = "INCORRECT_FILE",
|
|
240
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
241
|
+
NOT_SUPPORTED = "NOT_SUPPORTED",
|
|
242
|
+
CAMERA_UNKNOWN_ERROR = "CAMERA_UNKNOWN_ERROR",
|
|
243
|
+
CAMERA_PERMISSION_DENIED = "CAMERA_PERMISSION_DENIED",
|
|
244
|
+
NO_CAMERA = "NO_CAMERA",
|
|
245
|
+
CONNECTION_ERROR = "CONNECTION_ERROR",
|
|
246
|
+
LANDSCAPE_MODE_RESTRICTED = "LANDSCAPE_MODE_RESTRICTED"
|
|
247
|
+
}
|
|
248
|
+
export declare const webComponentErrorByStreamStatus: {
|
|
249
|
+
"streamStatus.UNKNOWN_ERROR": WebComponentsError;
|
|
250
|
+
"streamStatus.PERMISSION_DENIED": WebComponentsError;
|
|
251
|
+
"streamStatus.NO_CAMERA": WebComponentsError;
|
|
252
|
+
};
|
|
253
|
+
export declare const documentReaderStatusByError: {
|
|
254
|
+
FILE_SIZE: documentReaderComplitionStatus;
|
|
255
|
+
WASM_ERROR: documentReaderComplitionStatus;
|
|
256
|
+
NOT_SUPPORTED: documentReaderComplitionStatus;
|
|
257
|
+
WASM_LICENSE: documentReaderComplitionStatus;
|
|
258
|
+
INCORRECT_FILE: documentReaderComplitionStatus;
|
|
259
|
+
};
|
|
260
|
+
export declare const faceLivenessStatusByError: {
|
|
261
|
+
WASM_ERROR: faceCaptureComplitionStatus;
|
|
262
|
+
NOT_SUPPORTED: faceCaptureComplitionStatus;
|
|
263
|
+
WASM_LICENSE: faceCaptureComplitionStatus;
|
|
264
|
+
};
|
|
265
|
+
export declare enum Method {
|
|
266
|
+
onRuntimeInitialized = "onRuntimeInitialized",
|
|
267
|
+
processImage = "processImage",
|
|
268
|
+
process = "process",
|
|
269
|
+
startNewPage = "startNewPage",
|
|
270
|
+
startNewDocument = "startNewDocument",
|
|
271
|
+
initializeService = "initializeService",
|
|
272
|
+
close = "close",
|
|
273
|
+
stderr = "strerr"
|
|
274
|
+
}
|
|
275
|
+
export declare const documentSupportedBrowsers: {
|
|
276
|
+
iOS: {
|
|
277
|
+
Chrome: number;
|
|
278
|
+
Firefox: number;
|
|
279
|
+
Opera: number;
|
|
280
|
+
Safari: number;
|
|
281
|
+
Edge: number;
|
|
282
|
+
Chromium: number;
|
|
283
|
+
IE: number;
|
|
284
|
+
'Internet Explorer': number;
|
|
285
|
+
'Mobile Safari': number;
|
|
286
|
+
'Samsung Browser': number;
|
|
287
|
+
};
|
|
288
|
+
Android: {
|
|
289
|
+
Chrome: number;
|
|
290
|
+
Firefox: number;
|
|
291
|
+
Opera: number;
|
|
292
|
+
Safari: number;
|
|
293
|
+
Edge: number;
|
|
294
|
+
Chromium: number;
|
|
295
|
+
IE: number;
|
|
296
|
+
'Internet Explorer': number;
|
|
297
|
+
'Mobile Safari': number;
|
|
298
|
+
'Samsung Browser': number;
|
|
299
|
+
};
|
|
300
|
+
desktop: {
|
|
301
|
+
Chrome: number;
|
|
302
|
+
Firefox: number;
|
|
303
|
+
Opera: number;
|
|
304
|
+
Safari: number;
|
|
305
|
+
Edge: number;
|
|
306
|
+
Chromium: number;
|
|
307
|
+
IE: number;
|
|
308
|
+
'Internet Explorer': number;
|
|
309
|
+
'Mobile Safari': number;
|
|
310
|
+
'Samsung Browser': number;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
export declare const faceSupportedBrowsers: {
|
|
314
|
+
iOS: {
|
|
315
|
+
Chrome: number;
|
|
316
|
+
Firefox: number;
|
|
317
|
+
Opera: number;
|
|
318
|
+
Safari: number;
|
|
319
|
+
Edge: number;
|
|
320
|
+
Chromium: number;
|
|
321
|
+
IE: number;
|
|
322
|
+
'Internet Explorer': number;
|
|
323
|
+
'Mobile Safari': number;
|
|
324
|
+
'Samsung Browser': number;
|
|
325
|
+
};
|
|
326
|
+
Android: {
|
|
327
|
+
Chrome: number;
|
|
328
|
+
Firefox: number;
|
|
329
|
+
Opera: number;
|
|
330
|
+
Safari: number;
|
|
331
|
+
Edge: number;
|
|
332
|
+
Chromium: number;
|
|
333
|
+
IE: number;
|
|
334
|
+
'Internet Explorer': number;
|
|
335
|
+
'Mobile Safari': number;
|
|
336
|
+
'Samsung Browser': number;
|
|
337
|
+
};
|
|
338
|
+
desktop: {
|
|
339
|
+
Chrome: number;
|
|
340
|
+
Firefox: number;
|
|
341
|
+
Opera: number;
|
|
342
|
+
Safari: number;
|
|
343
|
+
Edge: number;
|
|
344
|
+
Chromium: number;
|
|
345
|
+
IE: number;
|
|
346
|
+
'Internet Explorer': number;
|
|
347
|
+
'Mobile Safari': number;
|
|
348
|
+
'Samsung Browser': number;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
export declare enum logLevels {
|
|
352
|
+
OFF = 0,
|
|
353
|
+
LOG = 1,
|
|
354
|
+
INFO = 2,
|
|
355
|
+
WARN = 3,
|
|
356
|
+
ERROR = 4
|
|
357
|
+
}
|
|
358
|
+
export declare type DirectionType = 'rtl' | 'ltr';
|
|
359
|
+
export declare const DEFAULT_CAMERA_ID = 0;
|
|
360
|
+
export declare enum MediaElementReadyState {
|
|
361
|
+
HAVE_NOTHING = 0,
|
|
362
|
+
HAVE_METADATA = 1,
|
|
363
|
+
HAVE_CURRENT_DATA = 2,
|
|
364
|
+
HAVE_FUTURE_DATA = 3,
|
|
365
|
+
HAVE_ENOUGH_DATA = 4
|
|
366
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FaceDetectionResponseType, FaceLivenessResponseType } from '../types';
|
|
3
|
+
import { faceEventActions, WebComponentsError } from '../constants';
|
|
4
|
+
declare type FaceCallbackArgTypes = FaceLivenessResponseType | FaceDetectionResponseType;
|
|
5
|
+
export declare type FaceAttributesContextType = {
|
|
6
|
+
onAction: ({ manual, action }: {
|
|
7
|
+
manual: boolean;
|
|
8
|
+
action: faceEventActions;
|
|
9
|
+
}) => void;
|
|
10
|
+
onResponse: (response: FaceCallbackArgTypes) => void;
|
|
11
|
+
onFail: (reason: WebComponentsError) => void;
|
|
12
|
+
startScale?: number;
|
|
13
|
+
endScale?: number;
|
|
14
|
+
ovalOffset?: number;
|
|
15
|
+
locale?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
mode?: number;
|
|
19
|
+
headers?: Record<string, string>;
|
|
20
|
+
copyright?: boolean;
|
|
21
|
+
cameraId?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const FaceAttributesContext: React.Context<FaceAttributesContextType>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FaceAttributesContextType } from '../contexts/FaceAttributesContext';
|
|
3
|
+
declare function withFaceAttributesContext<T extends FaceAttributesContextType>(Component: React.ComponentType<T>): React.ComponentType<T>;
|
|
4
|
+
export default withFaceAttributesContext;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DirectionType } from '../constants';
|
|
3
|
+
interface Locale {
|
|
4
|
+
locale: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
declare function withLocalize<T>(Component: React.ComponentType<T>): React.ComponentType<T & Locale & DirectionType>;
|
|
7
|
+
export default withLocalize;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { eFL_Message, eFL_MessageStyle, eFL_ProcessingStage, eFL_Status, faceEventActions } from '../constants';
|
|
2
|
+
import { CustomErrorObjectType, FrameObject, VideoParamsType } from '../types';
|
|
3
|
+
import CameraModel from '../models/CameraModel';
|
|
4
|
+
declare type UseFaceDetectionProps = {
|
|
5
|
+
videoFrame: Uint8ClampedArray;
|
|
6
|
+
sourceCaptureFrame: FrameObject;
|
|
7
|
+
videoElementParams: VideoParamsType;
|
|
8
|
+
onAction: ({ manual, action }: {
|
|
9
|
+
manual: boolean;
|
|
10
|
+
action: faceEventActions;
|
|
11
|
+
}) => void;
|
|
12
|
+
cameraInfo: CameraModel;
|
|
13
|
+
uuid?: string;
|
|
14
|
+
mode?: number;
|
|
15
|
+
url?: string;
|
|
16
|
+
tryCount?: number;
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare type responseType = {
|
|
20
|
+
message: eFL_Message;
|
|
21
|
+
messageStyle: eFL_MessageStyle;
|
|
22
|
+
processingStage: eFL_ProcessingStage;
|
|
23
|
+
status: eFL_Status;
|
|
24
|
+
request: Uint8Array | null;
|
|
25
|
+
requestSize: number | null;
|
|
26
|
+
initialized: boolean;
|
|
27
|
+
debugOutput: Record<string, any>;
|
|
28
|
+
prepared: boolean;
|
|
29
|
+
images: Array<string>;
|
|
30
|
+
wasmError: CustomErrorObjectType | null;
|
|
31
|
+
};
|
|
32
|
+
declare function useFaceLiveness({ videoFrame, sourceCaptureFrame, videoElementParams, onAction, cameraInfo, uuid, mode, url, tryCount, debug, }: UseFaceDetectionProps): responseType;
|
|
33
|
+
export default useFaceLiveness;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cameraFacingMode, streamStatus } from '../constants';
|
|
2
|
+
import CameraModel from '../models/CameraModel';
|
|
3
|
+
interface StreamDataType {
|
|
4
|
+
status: streamStatus;
|
|
5
|
+
stream: MediaStream | null;
|
|
6
|
+
camera: CameraModel;
|
|
7
|
+
twoFacingModesAvailable: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface UseStreamReturnType extends StreamDataType {
|
|
10
|
+
onPlay: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare function useStream(mode?: cameraFacingMode, resolution?: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}, preferredCameraId?: string): UseStreamReturnType;
|
|
16
|
+
export default useStream;
|