From 585d4ff37bc8f45e661887f443b0446b4cf36ca0 Mon Sep 17 00:00:00 2001 From: Ibby Date: Tue, 6 Dec 2016 08:33:03 -0500 Subject: [PATCH] refractor(android-fingerprint-auth): export options to interface --- src/plugins/android-fingerprint-auth.ts | 49 +++++++++++++++---------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/plugins/android-fingerprint-auth.ts b/src/plugins/android-fingerprint-auth.ts index b8baf546..0fe3c5e3 100644 --- a/src/plugins/android-fingerprint-auth.ts +++ b/src/plugins/android-fingerprint-auth.ts @@ -1,4 +1,29 @@ import { Cordova, Plugin } from './plugin'; + +export interface AndroidFingerprintAuthOptions { + + /** + * Used as the alias for your key in the Android Key Store. + */ + clientId: string; + + /** + * Used to encrypt the token returned upon successful fingerprint authentication. + */ + clientSecret: string; + + /** + * Set to true to remove the "USE BACKUP" button + */ + disableBackup?: boolean; + + /** + * Change the language. (en_US or es) + */ + locale?: string + +} + /** * @name Android Fingerprint Auth * @description @@ -28,6 +53,8 @@ import { Cordova, Plugin } from './plugin'; * }) * .catch(error => console.error(error)); * ``` + * @interfaces + * AndroidFingerprintAuthOptions */ @Plugin({ pluginName: 'AndroidFingerprintAuth', @@ -39,27 +66,11 @@ export class AndroidFingerprintAuth { /** * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. - * @param params {any} + * @param options {AndroidFingerprintAuthOptions} Options + * @returns {Promise} */ @Cordova() - static show(params: { - /** - * Used as the alias for your key in the Android Key Store. - */ - clientId: string; - /** - * Used to encrypt the token returned upon successful fingerprint authentication. - */ - clientSecret: string; - /** - * Set to true to remove the "USE BACKUP" button - */ - disableBackup?: boolean; - /** - * Change the language. (en_US or es) - */ - locale?: string - }): Promise<{ + static show(options: AndroidFingerprintAuthOptions): Promise<{ /** * Base64 encoded string */