UNPKG

rn-biometric-authentication

Version:
43 lines 1.86 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var react_native_1 = require("react-native"); var bridge = react_native_1.NativeModules.ReactNativeBiometricAuth; var ReactNativeBiometricAuth; (function (ReactNativeBiometricAuth) { /** * Enum for touch id sensor type */ ReactNativeBiometricAuth.TouchID = 'TouchID'; /** * Enum for face id sensor type */ ReactNativeBiometricAuth.FaceID = 'FaceID'; /** * Enum for generic biometrics (this is the only value available on android) */ ReactNativeBiometricAuth.Biometrics = 'Biometrics'; /** * Returns promise that resolves to an object with object.biometryType = Biometrics | TouchID | FaceID * @returns {Promise<Object>} Promise that resolves to an object with details about biometrics available */ function isSensorAvailable() { return bridge.isSensorAvailable(); } ReactNativeBiometricAuth.isSensorAvailable = isSensorAvailable; /** * Prompts user with biometrics dialog using the passed in prompt message and * returns promise that resolves to an object with object.success = true if the user passes, * object.success = false if the user cancels, and rejects if anything fails * @param {Object} simplePromptOption * @returns {Promise<Object>} Promise that resolves an object with details about the biometrics result */ function simplePrompt(simplePromptOption) { if (!simplePromptOption.cancelButtonText) { simplePromptOption.cancelButtonText = 'Cancel'; } return bridge.simplePrompt(simplePromptOption); } ReactNativeBiometricAuth.simplePrompt = simplePrompt; })(ReactNativeBiometricAuth || (ReactNativeBiometricAuth = {})); exports.default = ReactNativeBiometricAuth; //# sourceMappingURL=index.js.map