UNPKG

@boindahood/react-native-biometrics

Version:
77 lines 2.79 kB
import type { TurboModule } from 'react-native'; export declare enum BiometricType { FINGERPRINT = "fingerprint", FACE_ID = "faceId", TOUCH_ID = "touchId", IRIS = "iris", NONE = "none" } export declare enum BiometricErrorCode { BIOMETRIC_NOT_AVAILABLE = "BIOMETRIC_NOT_AVAILABLE", BIOMETRIC_NOT_ENROLLED = "BIOMETRIC_NOT_ENROLLED", BIOMETRIC_PERMISSION_DENIED = "BIOMETRIC_PERMISSION_DENIED", BIOMETRIC_LOCKOUT = "BIOMETRIC_LOCKOUT", BIOMETRIC_LOCKOUT_PERMANENT = "BIOMETRIC_LOCKOUT_PERMANENT", BIOMETRIC_AUTH_FAILED = "BIOMETRIC_AUTH_FAILED", BIOMETRIC_USER_CANCEL = "BIOMETRIC_USER_CANCEL", BIOMETRIC_SYSTEM_CANCEL = "BIOMETRIC_SYSTEM_CANCEL", BIOMETRIC_PRESSED_OTHER_WAY = "BIOMETRIC_PRESSED_OTHER_WAY", BIOMETRIC_UNKNOWN_ERROR = "BIOMETRIC_UNKNOWN_ERROR" } export declare enum BiometricOtherwayMode { HIDE = "hide",// hide the other way option only on IOS CALLBACK = "callback",// callback return pressedOtherway = true to easy handle the case when user pressed other way PIN = "PIN" } export interface BiometricAvailability { isAvailable: boolean; allowAccess: boolean; biometricType: BiometricType; errorCode?: BiometricErrorCode; errorMessage?: string; } export interface BiometricAuthResult { success: boolean; pressedOtherway?: boolean; errorCode?: BiometricErrorCode; errorMessage?: string; } export interface BiometricPermissionResult { success: boolean; errorCode?: BiometricErrorCode; errorMessage?: string; } export interface BiometricAuthOptions { titlePrompt?: string; otherwayWith?: BiometricOtherwayMode; otherwayText?: string; } export interface BiometricKeyResult { success: boolean; errorCode?: BiometricErrorCode; errorMessage?: string; } export interface BiometricKeyExistsResult { exists: boolean; errorCode?: BiometricErrorCode; errorMessage?: string; } export interface BiometricSignatureResult { success: boolean; signature?: string; errorCode?: BiometricErrorCode; errorMessage?: string; } export interface Spec extends TurboModule { checkBiometricAvailability(): Promise<BiometricAvailability>; requestBiometricPermission(): Promise<BiometricPermissionResult>; authenticateBiometric(options?: BiometricAuthOptions): Promise<BiometricAuthResult>; authenticatePIN(): Promise<BiometricAuthResult>; createBiometricKey(): Promise<BiometricKeyResult>; biometricKeyExists(): Promise<BiometricKeyExistsResult>; deleteBiometricKey(): Promise<BiometricKeyResult>; createSignature(payload: string, options?: BiometricAuthOptions): Promise<BiometricSignatureResult>; } declare const _default: Spec; export default _default; //# sourceMappingURL=NativeBiometrics.d.ts.map