mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-07 23:03:19 +08:00
refactor(keychain-touch-id): more specific return types (#3615)
* chore: fixing typescript return types * refactor(keychain-touch-id): more specific return types
This commit is contained in:
parent
4fb07fa809
commit
cc79a1edb7
@ -1,6 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
export type BiometryType = 'face' | 'touch';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Keychain Touch Id
|
* @name Keychain Touch Id
|
||||||
* @description
|
* @description
|
||||||
@ -37,7 +39,7 @@ export class KeychainTouchId extends IonicNativePlugin {
|
|||||||
* @return {Promise<any>} Returns a promise that resolves when there is hardware support
|
* @return {Promise<any>} Returns a promise that resolves when there is hardware support
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
isAvailable(): Promise<any> {
|
isAvailable(): Promise<BiometryType> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,10 +48,10 @@ export class KeychainTouchId extends IonicNativePlugin {
|
|||||||
* successful authentication using fingerprint
|
* successful authentication using fingerprint
|
||||||
* @param key {string} the key you want to store
|
* @param key {string} the key you want to store
|
||||||
* @param password {string} the password you want to encrypt and store
|
* @param password {string} the password you want to encrypt and store
|
||||||
* @return {Promise<any>} Returns a promise that resolves when there is a result
|
* @return {Promise<void>} Returns a promise that resolves when there is a result
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
save(key: string, password: string, userAuthenticationRequired: boolean): Promise<any> {
|
save(key: string, password: string, userAuthenticationRequired: boolean): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,30 +60,30 @@ export class KeychainTouchId extends IonicNativePlugin {
|
|||||||
* with the password stored in keychain or will resolve an error code, where -1 indicated not available.
|
* with the password stored in keychain or will resolve an error code, where -1 indicated not available.
|
||||||
* @param key {string} the key you want to retrieve from keychain
|
* @param key {string} the key you want to retrieve from keychain
|
||||||
* @param message {string} a message to the user
|
* @param message {string} a message to the user
|
||||||
* @return {Promise<any>} Returns a promise that resolves when the key value is successfully retrieved or an error
|
* @return {Promise<string>} Returns a promise that resolves when the key value is successfully retrieved or an error
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
verify(key: string, message: string): Promise<any> {
|
verify(key: string, message: string): Promise<string> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if there is a password stored within the keychain for the given key.
|
* Checks if there is a password stored within the keychain for the given key.
|
||||||
* @param key {string} the key you want to check from keychain
|
* @param key {string} the key you want to check from keychain
|
||||||
* @return {Promise<any>} Returns a promise that resolves with success if the key is available or failure if key is not.
|
* @return {Promise<void>} Returns a promise that resolves with success if the key is available or failure if key is not.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
has(key: string): Promise<any> {
|
has(key: string): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the password stored under given key from the keychain.
|
* Deletes the password stored under given key from the keychain.
|
||||||
* @param key {string} the key you want to delete from keychain
|
* @param key {string} the key you want to delete from keychain
|
||||||
* @return {Promise<any>} Returns a promise that resolves with success if the key is deleted or failure if key is not
|
* @return {Promise<void>} Returns a promise that resolves with success if the key is deleted or failure if key is not
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
delete(key: string): Promise<any> {
|
delete(key: string): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user