/** * Unified error codes for biometric authentication * Using UPPER_CASE convention for enum values (more conventional). * * Adapters emit only the CANONICAL codes below. The alias members are kept for * backward compatibility but are @deprecated — switch on the canonical code instead. */ export declare enum BiometricErrorCode { /** Authentication attempt failed */ AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED", /** User cancelled the authentication */ USER_CANCELLED = "USER_CANCELLED", /** System cancelled the authentication */ SYSTEM_CANCELLED = "SYSTEM_CANCELLED", /** Biometric hardware not available (CANONICAL) */ NOT_AVAILABLE = "NOT_AVAILABLE", /** @deprecated Use {@link BiometricErrorCode.NOT_AVAILABLE}. */ BIOMETRIC_UNAVAILABLE = "BIOMETRIC_UNAVAILABLE", /** Permission denied by user */ PERMISSION_DENIED = "PERMISSION_DENIED", /** User is locked out due to too many failed attempts (CANONICAL) */ LOCKED_OUT = "LOCKED_OUT", /** @deprecated Use {@link BiometricErrorCode.LOCKED_OUT}. */ LOCKOUT = "LOCKOUT", /** Invalid context for authentication */ INVALID_CONTEXT = "INVALID_CONTEXT", /** No biometrics enrolled on device */ NOT_ENROLLED = "NOT_ENROLLED", /** Authentication timed out */ TIMEOUT = "TIMEOUT", /** Platform not supported */ PLATFORM_NOT_SUPPORTED = "PLATFORM_NOT_SUPPORTED", /** Secure context (HTTPS/localhost) required for WebAuthn but not present */ INSECURE_CONTEXT = "INSECURE_CONTEXT", /** No credential available to authenticate with (registration required first) */ NO_CREDENTIALS = "NO_CREDENTIALS", /** User chose the fallback (e.g. enter passcode) instead of biometrics (iOS) */ USER_FALLBACK = "USER_FALLBACK", /** Device passcode/PIN is not set (required for device-credential fallback) */ PASSCODE_NOT_SET = "PASSCODE_NOT_SET", /** Unknown error occurred (CANONICAL) */ UNKNOWN = "UNKNOWN", /** @deprecated Use {@link BiometricErrorCode.UNKNOWN}. */ UNKNOWN_ERROR = "UNKNOWN_ERROR" } /** * Biometric error interface */ export interface BiometricError { /** Error code */ code: BiometricErrorCode; /** Human-readable error message */ message: string; /** * Minimal, non-sensitive error context (e.g. `{ name: 'NotAllowedError' }`). * Never carries raw platform error objects, stack traces, or credential data. */ details?: { name?: string; } | string; } /** * Reasons why biometric authentication is unavailable */ export declare enum BiometricUnavailableReason { /** Device doesn't have biometric hardware */ NO_HARDWARE = "noHardware", /** Biometric hardware is unavailable */ HARDWARE_UNAVAILABLE = "hardwareUnavailable", /** No biometrics enrolled on device */ NO_ENROLLED_BIOMETRICS = "noEnrolledBiometrics", /** User denied permission */ PERMISSION_DENIED = "permissionDenied", /** Biometric not supported on this platform */ NOT_SUPPORTED = "notSupported", /** User locked out due to failed attempts */ LOCKED_OUT = "lockedOut", /** User disabled biometrics */ USER_DISABLED = "userDisabled" } /** * Map legacy camelCase error codes to UPPER_CASE * Used for backward compatibility */ export declare const errorCodeMapping: Record; /** * Normalize an error code string to the canonical UPPER_CASE enum value. */ export declare function normalizeErrorCode(code: string): BiometricErrorCode;