UNPKG

@aparajita/capacitor-biometric-auth

Version:

Provides access to the native biometric auth & device security APIs for Capacitor apps

73 lines (72 loc) 2.68 kB
// noinspection JSUnusedGlobalSymbols /** * The type of biometry supported by the device. */ export var BiometryType; (function (BiometryType) { BiometryType[BiometryType["none"] = 0] = "none"; /** * iOS Touch ID */ BiometryType[BiometryType["touchId"] = 1] = "touchId"; /** * iOS Face ID */ BiometryType[BiometryType["faceId"] = 2] = "faceId"; /** * Android fingerprint authentication */ BiometryType[BiometryType["fingerprintAuthentication"] = 3] = "fingerprintAuthentication"; /** * Android face authentication */ BiometryType[BiometryType["faceAuthentication"] = 4] = "faceAuthentication"; /** * Android iris authentication */ BiometryType[BiometryType["irisAuthentication"] = 5] = "irisAuthentication"; })(BiometryType || (BiometryType = {})); export var AndroidBiometryStrength; (function (AndroidBiometryStrength) { /** * `authenticate()` will present any available biometry. */ AndroidBiometryStrength[AndroidBiometryStrength["weak"] = 0] = "weak"; /** * `authenticate()` will only present strong biometry. */ AndroidBiometryStrength[AndroidBiometryStrength["strong"] = 1] = "strong"; })(AndroidBiometryStrength || (AndroidBiometryStrength = {})); /** * If the `authenticate()` method throws an exception, the `BiometryError` * instance contains a `.code` property which will contain one of these strings, * indicating what the error was. * * See https://developer.apple.com/documentation/localauthentication/laerror * for a description of each error code. */ export var BiometryErrorType; (function (BiometryErrorType) { BiometryErrorType["none"] = ""; BiometryErrorType["appCancel"] = "appCancel"; BiometryErrorType["authenticationFailed"] = "authenticationFailed"; BiometryErrorType["invalidContext"] = "invalidContext"; BiometryErrorType["notInteractive"] = "notInteractive"; BiometryErrorType["passcodeNotSet"] = "passcodeNotSet"; BiometryErrorType["systemCancel"] = "systemCancel"; BiometryErrorType["userCancel"] = "userCancel"; BiometryErrorType["userFallback"] = "userFallback"; BiometryErrorType["biometryLockout"] = "biometryLockout"; BiometryErrorType["biometryNotAvailable"] = "biometryNotAvailable"; BiometryErrorType["biometryNotEnrolled"] = "biometryNotEnrolled"; BiometryErrorType["noDeviceCredential"] = "noDeviceCredential"; })(BiometryErrorType || (BiometryErrorType = {})); /** * `authenticate()` throws instances of this class. */ export class BiometryError { constructor(message, code) { this.message = message; this.code = code; } }