UNPKG

capacitor-biometric-authentication

Version:

Framework-agnostic biometric authentication library. Works with React, Vue, Angular, or vanilla JS. No providers required!

40 lines (39 loc) 1.35 kB
/** * Unified error handling utilities for biometric authentication * * This module consolidates error mapping logic from multiple adapters * to provide consistent error handling across platforms. */ import { BiometricError, BiometricAuthResult } from '../types'; /** * Map a WebAuthn DOMException to a BiometricError */ export declare function mapDOMException(error: DOMException): BiometricError; /** * Map a generic Error to a BiometricError */ export declare function mapGenericError(error: Error): BiometricError; /** * Map any unknown error to a BiometricError */ export declare function mapWebAuthnError(error: unknown): BiometricError; /** * Map a native platform error (iOS/Android/Windows) to a BiometricError */ export declare function mapNativeError(error: Error, platform: string): BiometricError; /** * Create a failed BiometricAuthResult from an error */ export declare function createErrorResult(error: unknown, platform?: string): BiometricAuthResult; /** * Check if an error is a user cancellation */ export declare function isUserCancellation(error: unknown): boolean; /** * Check if an error is a timeout */ export declare function isTimeout(error: unknown): boolean; /** * Check if an error indicates biometrics are unavailable */ export declare function isBiometricUnavailable(error: unknown): boolean;