fix(fingerprint-aio) : Added optional parameters to isAvailable() (#4912)

* Update fingerprint-aio/index.ts

Added two optional parameters to FingerprintAIO.isAvailable to reflect the optional parameters of isAvailable in cordova-plugin-fingerprint-aio

* Update index.ts

Added documentation to isAvailable()

* Update index.ts

Added documentation to plugin

* Added "callbackOrder : 'reverse'" to isAvailable()
This commit is contained in:
Adrien Lombard 2025-03-10 18:20:38 +01:00 committed by GitHub
parent 562489a97e
commit 4411b182b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -157,6 +157,22 @@ export interface FingerprintSecretOptions extends FingerprintOptions {
invalidateOnEnrollment?: boolean;
}
export interface FingerprintAvailableOptions {
/**
* (Android): If true will only return success if Class 3 (BIOMETRIC_STRONG) Biometrics are enrolled on the device.
* It is reccomended you use this if planning on using the registerBiometricSecret and loadBiometricSecret methods.
*/
requireStrongBiometrics: boolean;
/**
* (iOS): If true checks if backup authentication option is available, e.g. passcode.
* Default: false, which means check for biometrics only.
*
* @default false
*/
allowBackup?: boolean;
}
/**
* @name Fingerprint AIO
* @description
@ -209,6 +225,7 @@ export interface FingerprintSecretOptions extends FingerprintOptions {
* @interfaces
* FingerprintOptions
* FingerprintSecretOptions
* FingerprintAvailableOptions
*/
@Plugin({
pluginName: 'FingerprintAIO',
@ -223,11 +240,14 @@ export class FingerprintAIO extends AwesomeCordovaNativePlugin {
/**
* Check if fingerprint authentication is available
*
* @param {FingerprintAvailableOptions} options Options for platform specific fingerprint API
* @returns {Promise<BIOMETRIC_TYPE>} Returns a promise with result which depends on device and os.
* iPhone X will return 'face' other Android or iOS devices will return 'finger' Android P+ will return 'biometric'
*/
@Cordova()
isAvailable(): Promise<BIOMETRIC_TYPE> {
@Cordova({
callbackOrder: 'reverse'
})
isAvailable(options: FingerprintAvailableOptions): Promise<BIOMETRIC_TYPE> {
return;
}