mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
41 lines
1002 B
TypeScript
41 lines
1002 B
TypeScript
import { Cordova, Plugin } from './plugin';
|
|
|
|
|
|
/**
|
|
* @name Pin Dialog
|
|
* @description
|
|
*
|
|
* @usage
|
|
* ```typescript
|
|
* import { PinDialog } from 'ionic-native';
|
|
*
|
|
*
|
|
* PinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel'])
|
|
* .then(
|
|
* (result: any) => {
|
|
* if (result.buttonIndex == 1) console.log('User clicked OK, value is: ', result.input1);
|
|
* else if(result.buttonIndex == 2) console.log('User cancelled');
|
|
* }
|
|
* );
|
|
* ```
|
|
*/
|
|
@Plugin({
|
|
name: 'PinDialog',
|
|
plugin: 'cordova-plugin-pin-dialog',
|
|
pluginRef: 'plugins.pinDialog',
|
|
repo: 'https://github.com/Paldom/PinDialog'
|
|
})
|
|
export class PinDialog {
|
|
/**
|
|
* Show pin dialog
|
|
* @param {string} message Message to show the user
|
|
* @param {string} title Title of the dialog
|
|
* @param {string[]} buttons Buttons to show
|
|
*/
|
|
@Cordova({
|
|
successIndex: 1
|
|
})
|
|
static prompt(message: string, title: string, buttons: string[]): Promise<{ buttonIndex: number, input1: string }> { return; }
|
|
|
|
}
|