@giouwur/biometric-sdk 1.0.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 +215 -0
- package/bin/init.js +50 -0
- package/dist/index.d.mts +569 -0
- package/dist/index.d.ts +569 -0
- package/dist/index.js +4725 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4667 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -0
- package/templates/test-page.tsx +1219 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import * as zustand from 'zustand';
|
|
5
|
+
import * as axios from 'axios';
|
|
6
|
+
|
|
7
|
+
interface BiometricConfig {
|
|
8
|
+
/** WebSocket URL for the biometric device server */
|
|
9
|
+
wsUrl: string;
|
|
10
|
+
/** Optional API base URL — exposed via useBiometricConfig() for the consuming app */
|
|
11
|
+
apiBaseUrl?: string;
|
|
12
|
+
/** Device identifier */
|
|
13
|
+
deviceId?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hook to access the SDK configuration from any child component.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { apiBaseUrl } = useBiometricConfig();
|
|
21
|
+
* const res = await fetch(`${apiBaseUrl}/applicant/${id}`);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function useBiometricConfig(): BiometricConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Provider that initializes and configures the Biometric SDK.
|
|
27
|
+
* Wrap your application (or the section that uses biometric components) with this provider.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import { BiometricProvider } from '@intell/biometric-sdk';
|
|
32
|
+
*
|
|
33
|
+
* export default function Layout({ children }) {
|
|
34
|
+
* return (
|
|
35
|
+
* <BiometricProvider config={{
|
|
36
|
+
* wsUrl: "ws://localhost:5000/biometric",
|
|
37
|
+
* apiBaseUrl: "http://localhost:8080/api/v1",
|
|
38
|
+
* deviceId: "scanner_01"
|
|
39
|
+
* }}>
|
|
40
|
+
* {children}
|
|
41
|
+
* </BiometricProvider>
|
|
42
|
+
* );
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare function BiometricProvider({ config, children, }: {
|
|
47
|
+
config: BiometricConfig;
|
|
48
|
+
children: React__default.ReactNode;
|
|
49
|
+
}): react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
declare function FingerEnrollModule({ className }: {
|
|
52
|
+
className?: string;
|
|
53
|
+
}): react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
declare function FaceEnrollModule({ className }: {
|
|
56
|
+
className?: string;
|
|
57
|
+
}): react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
declare function PalmEnrollModule({ className }: {
|
|
60
|
+
className?: string;
|
|
61
|
+
}): react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
declare function IrisEnrollModule({ className }: {
|
|
64
|
+
className?: string;
|
|
65
|
+
}): react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
declare function FingerRollEnrollModule({ className }: {
|
|
68
|
+
className?: string;
|
|
69
|
+
}): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
interface FingerCaptureModalProps {
|
|
72
|
+
isOpen: boolean;
|
|
73
|
+
onCancel: () => void;
|
|
74
|
+
captureType: string;
|
|
75
|
+
previewImage: string | null;
|
|
76
|
+
previewQuality: number | null;
|
|
77
|
+
}
|
|
78
|
+
declare function FingerCaptureModal({ isOpen, onCancel, captureType, previewImage, previewQuality, }: FingerCaptureModalProps): react_jsx_runtime.JSX.Element;
|
|
79
|
+
|
|
80
|
+
interface FingerRollCaptureModalProps {
|
|
81
|
+
isOpen: boolean;
|
|
82
|
+
onCancel: () => void;
|
|
83
|
+
captureType: string;
|
|
84
|
+
previewImage: string | null;
|
|
85
|
+
previewQuality: number | null;
|
|
86
|
+
rollStatus: string;
|
|
87
|
+
}
|
|
88
|
+
declare function FingerRollCaptureModal({ isOpen, onCancel, captureType, previewImage, previewQuality, rollStatus, }: FingerRollCaptureModalProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
90
|
+
interface FaceCameraModalProps {
|
|
91
|
+
isOpen: boolean;
|
|
92
|
+
onClose: () => void;
|
|
93
|
+
onCaptured: (img: string, quality: number) => void;
|
|
94
|
+
}
|
|
95
|
+
declare function FaceCameraModal({ isOpen, onClose, onCaptured, }: FaceCameraModalProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
interface PalmCaptureModalProps {
|
|
98
|
+
isOpen: boolean;
|
|
99
|
+
onCancel: () => void;
|
|
100
|
+
onRetry: () => void;
|
|
101
|
+
captureType: string;
|
|
102
|
+
previewImage: string | null;
|
|
103
|
+
statusMessage: string;
|
|
104
|
+
errorState: boolean;
|
|
105
|
+
}
|
|
106
|
+
declare function PalmCaptureModal({ isOpen, onCancel, onRetry, captureType, previewImage, statusMessage, errorState, }: PalmCaptureModalProps): react_jsx_runtime.JSX.Element;
|
|
107
|
+
|
|
108
|
+
interface IrisCameraModalProps {
|
|
109
|
+
isOpen: boolean;
|
|
110
|
+
onClose: () => void;
|
|
111
|
+
onStartCapture: () => void;
|
|
112
|
+
onAbortCapture: () => void;
|
|
113
|
+
isCapturing: boolean;
|
|
114
|
+
statusMessage: string;
|
|
115
|
+
previewRight: string | null;
|
|
116
|
+
previewLeft: string | null;
|
|
117
|
+
distance: number | null;
|
|
118
|
+
cameraStatus: string;
|
|
119
|
+
}
|
|
120
|
+
declare function IrisCameraModal({ isOpen, onClose, onStartCapture, onAbortCapture, isCapturing, statusMessage, previewRight, previewLeft, distance, cameraStatus, }: IrisCameraModalProps): react_jsx_runtime.JSX.Element;
|
|
121
|
+
|
|
122
|
+
interface ModuleHeaderProps {
|
|
123
|
+
icon: React__default.ReactNode;
|
|
124
|
+
title: string;
|
|
125
|
+
subtitle: string;
|
|
126
|
+
progress?: {
|
|
127
|
+
current: number;
|
|
128
|
+
total: number;
|
|
129
|
+
};
|
|
130
|
+
children?: React__default.ReactNode;
|
|
131
|
+
}
|
|
132
|
+
declare function ModuleHeader({ icon, title, subtitle, progress, children, }: ModuleHeaderProps): react_jsx_runtime.JSX.Element;
|
|
133
|
+
|
|
134
|
+
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
135
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'ghost';
|
|
136
|
+
size?: 'sm' | 'md' | 'lg';
|
|
137
|
+
isLoading?: boolean;
|
|
138
|
+
icon?: React__default.ReactNode;
|
|
139
|
+
children: React__default.ReactNode;
|
|
140
|
+
}
|
|
141
|
+
declare function Button({ variant, size, isLoading, icon, className, children, disabled, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
|
|
143
|
+
interface CardProps {
|
|
144
|
+
variant?: 'subtle' | 'default' | 'medium' | 'strong' | 'modal' | 'glass' | 'glass-subtle' | 'glass-strong' | 'outlined';
|
|
145
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
146
|
+
rounded?: 'lg' | 'xl' | '2xl' | '3xl';
|
|
147
|
+
className?: string;
|
|
148
|
+
children: React__default.ReactNode;
|
|
149
|
+
}
|
|
150
|
+
declare function Card({ variant, padding, rounded, className, children }: CardProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
|
|
152
|
+
interface InputProps extends React__default.InputHTMLAttributes<HTMLInputElement> {
|
|
153
|
+
label?: string;
|
|
154
|
+
icon?: React__default.ReactNode;
|
|
155
|
+
error?: string;
|
|
156
|
+
}
|
|
157
|
+
declare function Input({ label, icon, error, className, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
158
|
+
|
|
159
|
+
interface SelectOption {
|
|
160
|
+
value: string;
|
|
161
|
+
label: string;
|
|
162
|
+
icon?: React.ReactNode;
|
|
163
|
+
}
|
|
164
|
+
interface SelectProps {
|
|
165
|
+
value: string;
|
|
166
|
+
onChange: (value: string) => void;
|
|
167
|
+
options: SelectOption[];
|
|
168
|
+
placeholder?: string;
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
className?: string;
|
|
171
|
+
}
|
|
172
|
+
declare function Select({ value, onChange, options, placeholder, disabled, className, }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
173
|
+
|
|
174
|
+
interface StatusChipProps {
|
|
175
|
+
status: 'success' | 'warning' | 'danger' | 'info' | 'neutral';
|
|
176
|
+
label: string;
|
|
177
|
+
icon?: React__default.ReactNode;
|
|
178
|
+
isLoading?: boolean;
|
|
179
|
+
size?: 'sm' | 'md';
|
|
180
|
+
showDot?: boolean;
|
|
181
|
+
}
|
|
182
|
+
declare function StatusChip({ status, label, icon, isLoading, size, showDot }: StatusChipProps): react_jsx_runtime.JSX.Element;
|
|
183
|
+
|
|
184
|
+
interface QualityBadgeProps {
|
|
185
|
+
quality: number | null | undefined;
|
|
186
|
+
className?: string;
|
|
187
|
+
}
|
|
188
|
+
declare function QualityBadge({ quality, className }: QualityBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
189
|
+
|
|
190
|
+
interface ProgressBarProps {
|
|
191
|
+
current: number;
|
|
192
|
+
total: number;
|
|
193
|
+
label?: string;
|
|
194
|
+
className?: string;
|
|
195
|
+
}
|
|
196
|
+
declare function ProgressBar({ current, total, label, className, }: ProgressBarProps): react_jsx_runtime.JSX.Element;
|
|
197
|
+
|
|
198
|
+
interface ModalProps {
|
|
199
|
+
isOpen: boolean;
|
|
200
|
+
onClose: () => void;
|
|
201
|
+
title: string;
|
|
202
|
+
children: React.ReactNode;
|
|
203
|
+
allowClose?: boolean;
|
|
204
|
+
}
|
|
205
|
+
declare function Modal({ isOpen, onClose, title, children, allowClose, }: ModalProps): React.ReactNode;
|
|
206
|
+
|
|
207
|
+
interface LoaderProps {
|
|
208
|
+
size?: number;
|
|
209
|
+
text?: string;
|
|
210
|
+
className?: string;
|
|
211
|
+
}
|
|
212
|
+
declare function Loader({ size, text, className }: LoaderProps): react_jsx_runtime.JSX.Element;
|
|
213
|
+
|
|
214
|
+
declare function Tabs({ defaultValue, value, // Agregado para soportar modo controlado si se necesita
|
|
215
|
+
className, children, onValueChange, }: {
|
|
216
|
+
defaultValue?: string;
|
|
217
|
+
value?: string;
|
|
218
|
+
className?: string;
|
|
219
|
+
children: React$1.ReactNode;
|
|
220
|
+
onValueChange?: (value: string) => void;
|
|
221
|
+
}): react_jsx_runtime.JSX.Element;
|
|
222
|
+
declare function TabsList({ className, children, }: {
|
|
223
|
+
className?: string;
|
|
224
|
+
children: React$1.ReactNode;
|
|
225
|
+
}): react_jsx_runtime.JSX.Element;
|
|
226
|
+
declare function TabsTrigger({ value, children, className, disabled, }: {
|
|
227
|
+
value: string;
|
|
228
|
+
children: React$1.ReactNode;
|
|
229
|
+
className?: string;
|
|
230
|
+
disabled?: boolean;
|
|
231
|
+
}): react_jsx_runtime.JSX.Element;
|
|
232
|
+
declare function TabsContent({ value, children, className, }: {
|
|
233
|
+
value: string;
|
|
234
|
+
children: React$1.ReactNode;
|
|
235
|
+
className?: string;
|
|
236
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
237
|
+
|
|
238
|
+
type SlotStatus = "pending" | "captured" | "error";
|
|
239
|
+
interface BiometricSlotProps {
|
|
240
|
+
title: string;
|
|
241
|
+
position: string;
|
|
242
|
+
status: SlotStatus;
|
|
243
|
+
quality?: number | null;
|
|
244
|
+
imageUrl?: string | null;
|
|
245
|
+
onCapture: () => void;
|
|
246
|
+
onRequestMissing?: () => void;
|
|
247
|
+
onRestore?: () => void;
|
|
248
|
+
onDelete?: () => void;
|
|
249
|
+
missingReason?: string | null;
|
|
250
|
+
iconType: "finger" | "face" | "palm" | "iris";
|
|
251
|
+
isDisabled?: boolean;
|
|
252
|
+
className?: string;
|
|
253
|
+
isLoadedFromBackend?: boolean;
|
|
254
|
+
}
|
|
255
|
+
declare function BiometricSlot({ title, position, status, quality, imageUrl, onCapture, onRequestMissing, onRestore, onDelete, missingReason: externalMissingReason, iconType, isDisabled, className, isLoadedFromBackend, }: BiometricSlotProps): react_jsx_runtime.JSX.Element;
|
|
256
|
+
|
|
257
|
+
type BiometricType = "finger" | "palm" | "iris" | "face";
|
|
258
|
+
interface MissingBiometricModalProps {
|
|
259
|
+
isOpen: boolean;
|
|
260
|
+
onClose: () => void;
|
|
261
|
+
onConfirm: (reason: string) => void;
|
|
262
|
+
positionName: string;
|
|
263
|
+
biometricType?: BiometricType;
|
|
264
|
+
}
|
|
265
|
+
declare const MissingBiometricModal: React__default.FC<MissingBiometricModalProps>;
|
|
266
|
+
declare const MissingFingerModal: React__default.FC<MissingBiometricModalProps>;
|
|
267
|
+
|
|
268
|
+
interface TableWrapperProps {
|
|
269
|
+
children: React__default.ReactNode;
|
|
270
|
+
className?: string;
|
|
271
|
+
variant?: 'default' | 'strong';
|
|
272
|
+
}
|
|
273
|
+
declare const TableWrapper: React__default.FC<TableWrapperProps>;
|
|
274
|
+
interface TableHeaderProps {
|
|
275
|
+
children: React__default.ReactNode;
|
|
276
|
+
className?: string;
|
|
277
|
+
}
|
|
278
|
+
declare const TableHeader: React__default.FC<TableHeaderProps>;
|
|
279
|
+
interface TableRowProps {
|
|
280
|
+
children: React__default.ReactNode;
|
|
281
|
+
onClick?: () => void;
|
|
282
|
+
className?: string;
|
|
283
|
+
}
|
|
284
|
+
declare const TableRow: React__default.FC<TableRowProps>;
|
|
285
|
+
|
|
286
|
+
type MessageHandler = (message: any) => void;
|
|
287
|
+
interface SocketMessage {
|
|
288
|
+
messageType: string;
|
|
289
|
+
[key: string]: any;
|
|
290
|
+
}
|
|
291
|
+
interface DeviceStatus {
|
|
292
|
+
fingerprintDevices: Array<{
|
|
293
|
+
deviceModel: string;
|
|
294
|
+
status: string;
|
|
295
|
+
}>;
|
|
296
|
+
irisDeviceOpen: boolean;
|
|
297
|
+
}
|
|
298
|
+
interface BiometricState {
|
|
299
|
+
socket: WebSocket | null;
|
|
300
|
+
isConnected: boolean;
|
|
301
|
+
deviceStatus: DeviceStatus | null;
|
|
302
|
+
lastMessage: SocketMessage | null;
|
|
303
|
+
handlers: Map<string, MessageHandler>;
|
|
304
|
+
missingFingers: Record<string, string>;
|
|
305
|
+
markFingerAsMissing: (position: string, reason: string) => void;
|
|
306
|
+
restoreFinger: (position: string) => void;
|
|
307
|
+
clearAllMissingFingers: () => void;
|
|
308
|
+
getExpectedFingers: (allPositions: string[]) => string[];
|
|
309
|
+
init: (wsUrl?: string, deviceId?: string) => void;
|
|
310
|
+
connect: () => void;
|
|
311
|
+
disconnect: () => void;
|
|
312
|
+
sendMessage: (message: object) => void;
|
|
313
|
+
registerHandler: (messageType: string, handler: MessageHandler) => void;
|
|
314
|
+
unregisterHandler: (messageType: string) => void;
|
|
315
|
+
resetSession: () => void;
|
|
316
|
+
}
|
|
317
|
+
declare const useBiometricStore: zustand.UseBoundStore<zustand.StoreApi<BiometricState>>;
|
|
318
|
+
|
|
319
|
+
declare enum FingerprintPosition {
|
|
320
|
+
RightThumb = "RightThumb",
|
|
321
|
+
RightIndex = "RightIndex",
|
|
322
|
+
RightMiddle = "RightMiddle",
|
|
323
|
+
RightRing = "RightRing",
|
|
324
|
+
RightLittle = "RightLittle",
|
|
325
|
+
LeftThumb = "LeftThumb",
|
|
326
|
+
LeftIndex = "LeftIndex",
|
|
327
|
+
LeftMiddle = "LeftMiddle",
|
|
328
|
+
LeftRing = "LeftRing",
|
|
329
|
+
LeftLittle = "LeftLittle",
|
|
330
|
+
RightUpperPalm = "RightUpperPalm",
|
|
331
|
+
RightLowerPalm = "RightLowerPalm",
|
|
332
|
+
RightWritersPalm = "RightWritersPalm",
|
|
333
|
+
LeftUpperPalm = "LeftUpperPalm",
|
|
334
|
+
LeftLowerPalm = "LeftLowerPalm",
|
|
335
|
+
LeftWritersPalm = "LeftWritersPalm"
|
|
336
|
+
}
|
|
337
|
+
declare enum FingerprintImpressionType {
|
|
338
|
+
LiveScanPlain = "LiveScanPlain",
|
|
339
|
+
LiveScanRolled = "LiveScanRolled",
|
|
340
|
+
RolledContact = "RolledContact",
|
|
341
|
+
NonLiveScanPlain = "NonLiveScanPlain",
|
|
342
|
+
NonLiveScanRolled = "NonLiveScanRolled",
|
|
343
|
+
LatentImpression = "LatentImpression",
|
|
344
|
+
LatentTracing = "LatentTracing",
|
|
345
|
+
LatentPhoto = "LatentPhoto",
|
|
346
|
+
LatentLift = "LatentLift",
|
|
347
|
+
LiveScanPalm = "LiveScanPalm",
|
|
348
|
+
NonLiveScanPalm = "NonLiveScanPalm",
|
|
349
|
+
LatentPalmImpression = "LatentPalmImpression",
|
|
350
|
+
LatentPalmTracing = "LatentPalmTracing",
|
|
351
|
+
LatentPalmPhoto = "LatentPalmPhoto",
|
|
352
|
+
LatentPalmLift = "LatentPalmLift",
|
|
353
|
+
LiveScanOpticalContactPlain = "LiveScanOpticalContactPlain",
|
|
354
|
+
LiveScanOpticalContactRolled = "LiveScanOpticalContactRolled",
|
|
355
|
+
LiveScanOpticalContactlessPlain = "LiveScanOpticalContactlessPlain",
|
|
356
|
+
LiveScanOpticalContactlessRolled = "LiveScanOpticalContactlessRolled",
|
|
357
|
+
LiveScanCapacitivePlain = "LiveScanCapacitivePlain",
|
|
358
|
+
LiveScanCapacitiveRolled = "LiveScanCapacitiveRolled",
|
|
359
|
+
LiveScanUltrasonicPlain = "LiveScanUltrasonicPlain",
|
|
360
|
+
LiveScanUltrasonicRolled = "LiveScanUltrasonicRolled",
|
|
361
|
+
LiveScanThermalPlain = "LiveScanThermalPlain",
|
|
362
|
+
LiveScanThermalRolled = "LiveScanThermalRolled",
|
|
363
|
+
LiveScanVerticalSwipe = "LiveScanVerticalSwipe",
|
|
364
|
+
LiveScanOpticalPalm = "LiveScanOpticalPalm",
|
|
365
|
+
NonLiveScanOpticalPalm = "NonLiveScanOpticalPalm",
|
|
366
|
+
Swipe = "Swipe",
|
|
367
|
+
LiveScanContactless = "LiveScanContactless"
|
|
368
|
+
}
|
|
369
|
+
declare enum IrisPosition {
|
|
370
|
+
Right = "Right",
|
|
371
|
+
Left = "Left"
|
|
372
|
+
}
|
|
373
|
+
interface BiometricImage {
|
|
374
|
+
dataBytes: string;
|
|
375
|
+
}
|
|
376
|
+
interface FingerprintItem {
|
|
377
|
+
position: FingerprintPosition;
|
|
378
|
+
impressionType?: FingerprintImpressionType;
|
|
379
|
+
image: BiometricImage;
|
|
380
|
+
}
|
|
381
|
+
interface MissingFingerprintItem {
|
|
382
|
+
position: FingerprintPosition;
|
|
383
|
+
missingReasonCode?: string;
|
|
384
|
+
missingReasonText?: string;
|
|
385
|
+
}
|
|
386
|
+
interface FaceItem {
|
|
387
|
+
image: BiometricImage;
|
|
388
|
+
}
|
|
389
|
+
interface MissingFaceItem {
|
|
390
|
+
index: number;
|
|
391
|
+
missingReasonCode?: string;
|
|
392
|
+
missingReasonText?: string;
|
|
393
|
+
}
|
|
394
|
+
interface IrisItem {
|
|
395
|
+
position: IrisPosition;
|
|
396
|
+
image: BiometricImage;
|
|
397
|
+
}
|
|
398
|
+
interface MissingIrisItem {
|
|
399
|
+
position: IrisPosition;
|
|
400
|
+
missingReasonCode?: string;
|
|
401
|
+
missingReasonText?: string;
|
|
402
|
+
}
|
|
403
|
+
interface EnrollAction {
|
|
404
|
+
enrollActionType: "Masterize" | "Verify";
|
|
405
|
+
}
|
|
406
|
+
interface CustomDetails {
|
|
407
|
+
fullName: string;
|
|
408
|
+
citizenship?: string;
|
|
409
|
+
dateOfBirth?: string;
|
|
410
|
+
gender?: string;
|
|
411
|
+
[key: string]: any;
|
|
412
|
+
}
|
|
413
|
+
interface EnrollApplicantRequest {
|
|
414
|
+
externalId: string;
|
|
415
|
+
enrolledBy?: string;
|
|
416
|
+
enrollAction: EnrollAction;
|
|
417
|
+
customDetails: CustomDetails;
|
|
418
|
+
fingerprintModality?: {
|
|
419
|
+
fingerprints: FingerprintItem[];
|
|
420
|
+
missingFingerprints: MissingFingerprintItem[];
|
|
421
|
+
};
|
|
422
|
+
faceModality?: {
|
|
423
|
+
faces: FaceItem[];
|
|
424
|
+
missingFaces?: MissingFaceItem[];
|
|
425
|
+
};
|
|
426
|
+
irisModality?: {
|
|
427
|
+
irises: IrisItem[];
|
|
428
|
+
missingIrises?: MissingIrisItem[];
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
interface BiometricItem {
|
|
433
|
+
image: string;
|
|
434
|
+
quality: number;
|
|
435
|
+
impressionType?: string;
|
|
436
|
+
}
|
|
437
|
+
interface OriginalSnapshot {
|
|
438
|
+
fingerprints: Record<string, BiometricItem>;
|
|
439
|
+
rolledFingerprints: Record<string, BiometricItem>;
|
|
440
|
+
missingFingers: Record<string, string>;
|
|
441
|
+
palms: Record<string, BiometricItem>;
|
|
442
|
+
missingPalms: Record<string, string>;
|
|
443
|
+
faces: BiometricItem[];
|
|
444
|
+
faceCaptures: (BiometricItem | null)[];
|
|
445
|
+
missingFaces: Record<number, string>;
|
|
446
|
+
irises: {
|
|
447
|
+
right?: BiometricItem;
|
|
448
|
+
left?: BiometricItem;
|
|
449
|
+
};
|
|
450
|
+
missingIrises: Record<string, string>;
|
|
451
|
+
}
|
|
452
|
+
interface EnrollmentState {
|
|
453
|
+
externalId: string;
|
|
454
|
+
fullName: string;
|
|
455
|
+
isUpdateMode: boolean;
|
|
456
|
+
isLoading: boolean;
|
|
457
|
+
fingerprints: Record<string, BiometricItem>;
|
|
458
|
+
rolledFingerprints: Record<string, BiometricItem>;
|
|
459
|
+
missingFingers: Record<string, string>;
|
|
460
|
+
palms: Record<string, BiometricItem>;
|
|
461
|
+
missingPalms: Record<string, string>;
|
|
462
|
+
faces: BiometricItem[];
|
|
463
|
+
faceCaptures: (BiometricItem | null)[];
|
|
464
|
+
missingFaces: Record<number, string>;
|
|
465
|
+
irises: {
|
|
466
|
+
right?: BiometricItem;
|
|
467
|
+
left?: BiometricItem;
|
|
468
|
+
};
|
|
469
|
+
missingIrises: Record<string, string>;
|
|
470
|
+
_originalSnapshot: OriginalSnapshot | null;
|
|
471
|
+
setDemographics: (id: string, name: string) => void;
|
|
472
|
+
addFingerprint: (pos: string, image: string, quality?: number) => void;
|
|
473
|
+
addRolledFingerprint: (pos: string, image: string, quality?: number) => void;
|
|
474
|
+
removeFingerprint: (pos: string) => void;
|
|
475
|
+
removeRolledFingerprint: (pos: string) => void;
|
|
476
|
+
addMissingFinger: (pos: string, reason: string) => void;
|
|
477
|
+
removeMissingFinger: (pos: string) => void;
|
|
478
|
+
addPalm: (pos: string, image: string, quality?: number) => void;
|
|
479
|
+
removePalm: (pos: string) => void;
|
|
480
|
+
addMissingPalm: (pos: string, reason: string) => void;
|
|
481
|
+
removeMissingPalm: (pos: string) => void;
|
|
482
|
+
setFaces: (items: {
|
|
483
|
+
image: string;
|
|
484
|
+
quality: number;
|
|
485
|
+
}[]) => void;
|
|
486
|
+
setFaceCaptures: (items: ({
|
|
487
|
+
image: string;
|
|
488
|
+
quality: number;
|
|
489
|
+
} | null)[]) => void;
|
|
490
|
+
removeFace: (index: number) => void;
|
|
491
|
+
addMissingFace: (index: number, reason: string) => void;
|
|
492
|
+
removeMissingFace: (index: number) => void;
|
|
493
|
+
setIrises: (right?: {
|
|
494
|
+
image: string;
|
|
495
|
+
quality: number;
|
|
496
|
+
}, left?: {
|
|
497
|
+
image: string;
|
|
498
|
+
quality: number;
|
|
499
|
+
}) => void;
|
|
500
|
+
removeIris: (side: "left" | "right") => void;
|
|
501
|
+
addMissingIris: (side: string, reason: string) => void;
|
|
502
|
+
removeMissingIris: (side: string) => void;
|
|
503
|
+
loadApplicantData: (data: any) => Promise<void>;
|
|
504
|
+
buildEnrollmentRequest: () => EnrollApplicantRequest;
|
|
505
|
+
buildUpdateRequest: () => Partial<EnrollApplicantRequest>;
|
|
506
|
+
getDirtyModalities: () => Set<string>;
|
|
507
|
+
resetEnrollment: () => void;
|
|
508
|
+
}
|
|
509
|
+
declare const useEnrollmentStore: zustand.UseBoundStore<zustand.StoreApi<EnrollmentState>>;
|
|
510
|
+
|
|
511
|
+
interface UiState {
|
|
512
|
+
messages: string[];
|
|
513
|
+
isConsoleOpen: boolean;
|
|
514
|
+
addMessage: (message: string) => void;
|
|
515
|
+
toggleConsole: () => void;
|
|
516
|
+
clearMessages: () => void;
|
|
517
|
+
}
|
|
518
|
+
declare const useUiStore: zustand.UseBoundStore<zustand.StoreApi<UiState>>;
|
|
519
|
+
|
|
520
|
+
declare function normalizeImageForStorage(imageString: string | undefined | null): string;
|
|
521
|
+
declare function getImageSrcForDisplay(imageString: string | undefined | null, format?: "png" | "jpeg" | "jpg" | "bmp" | "jp2"): string | undefined;
|
|
522
|
+
declare function isRemoteImage(imageString: string | undefined | null): boolean;
|
|
523
|
+
/**
|
|
524
|
+
* Descarga una imagen remota y la convierte a base64.
|
|
525
|
+
* Sigue el patrón de `Utils.downloadResource` de los ABIS training samples.
|
|
526
|
+
* Para usar en el navegador con fetch + FileReader.
|
|
527
|
+
*/
|
|
528
|
+
declare function downloadImageAsBase64(url: string): Promise<string>;
|
|
529
|
+
declare function canvasToBase64(canvas: HTMLCanvasElement, format?: "image/jpeg" | "image/png", quality?: number): string;
|
|
530
|
+
declare function base64toBlob(base64Data: string): Blob | null;
|
|
531
|
+
declare function detectImageFormat(base64Data: string | undefined | null): string;
|
|
532
|
+
declare function isValidBase64(str: string): boolean;
|
|
533
|
+
|
|
534
|
+
declare const FINGER_NAMES: Record<string, string>;
|
|
535
|
+
declare const RIGHT_FINGERS: string[];
|
|
536
|
+
declare const LEFT_FINGERS: string[];
|
|
537
|
+
|
|
538
|
+
declare function setApiBaseUrl(url: string): void;
|
|
539
|
+
declare const api: axios.AxiosInstance;
|
|
540
|
+
|
|
541
|
+
declare const AuthService: {
|
|
542
|
+
login: (credentials: {
|
|
543
|
+
username: string;
|
|
544
|
+
password: string;
|
|
545
|
+
}) => Promise<any>;
|
|
546
|
+
};
|
|
547
|
+
declare const BiometricService: {
|
|
548
|
+
enrollApplicant: (payload: EnrollApplicantRequest) => Promise<any>;
|
|
549
|
+
updateApplicant: (externalId: string, payload: Partial<EnrollApplicantRequest>) => Promise<any>;
|
|
550
|
+
getApplicant: (externalId: string) => Promise<any>;
|
|
551
|
+
verifyIdentity: (externalId: string, biometricData: any) => Promise<any>;
|
|
552
|
+
identifyProbe: (biometricData: any) => Promise<any>;
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
interface User {
|
|
556
|
+
id: string;
|
|
557
|
+
username: string;
|
|
558
|
+
role: string;
|
|
559
|
+
}
|
|
560
|
+
interface AuthState {
|
|
561
|
+
token: string | null;
|
|
562
|
+
user: User | null;
|
|
563
|
+
login: (token: string, user: User) => void;
|
|
564
|
+
logout: () => void;
|
|
565
|
+
initializeAuth: () => void;
|
|
566
|
+
}
|
|
567
|
+
declare const useAuthStore: zustand.UseBoundStore<zustand.StoreApi<AuthState>>;
|
|
568
|
+
|
|
569
|
+
export { AuthService, type BiometricConfig, type BiometricImage, type BiometricItem, BiometricProvider, BiometricService, BiometricSlot, type BiometricSlotProps, type BiometricState, Button, type ButtonProps, Card, type CardProps, type CustomDetails, type DeviceStatus, type EnrollAction, type EnrollApplicantRequest, type EnrollmentState, FINGER_NAMES, FaceCameraModal, FaceEnrollModule, type FaceItem, FingerCaptureModal, FingerEnrollModule, FingerRollCaptureModal, FingerRollEnrollModule, FingerprintImpressionType, type FingerprintItem, FingerprintPosition, Input, type InputProps, IrisCameraModal, IrisEnrollModule, type IrisItem, IrisPosition, LEFT_FINGERS, Loader, type MessageHandler, MissingBiometricModal, type MissingFaceItem, MissingFingerModal, type MissingFingerprintItem, type MissingIrisItem, Modal, type ModalProps, ModuleHeader, type OriginalSnapshot, PalmCaptureModal, PalmEnrollModule, ProgressBar, QualityBadge, RIGHT_FINGERS, Select, type SocketMessage, StatusChip, TableHeader, TableRow, TableWrapper, Tabs, TabsContent, TabsList, TabsTrigger, type UiState, api, base64toBlob, canvasToBase64, detectImageFormat, downloadImageAsBase64, getImageSrcForDisplay, isRemoteImage, isValidBase64, normalizeImageForStorage, setApiBaseUrl, useAuthStore, useBiometricConfig, useBiometricStore, useEnrollmentStore, useUiStore };
|