UNPKG

2.03 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name Pin Dialog
11 * @description
12 *
13 * @usage
14 * ```typescript
15 * import { PinDialog } from 'ionic-native';
16 *
17 *
18 * PinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel'])
19 * .then(
20 * (result: any) => {
21 * if (result.buttonIndex == 1) console.log('User clicked OK, value is: ', result.input1);
22 * else if(result.buttonIndex == 2) console.log('User cancelled');
23 * }
24 * );
25 * ```
26 */
27var PinDialog = (function () {
28 function PinDialog() {
29 }
30 /**
31 * Show pin dialog
32 * @param {string} message Message to show the user
33 * @param {string} title Title of the dialog
34 * @param {string[]} buttons Buttons to show
35 * @returns {Promise<{ buttonIndex: number, input1: string }>}
36 */
37 PinDialog.prompt = function (message, title, buttons) { return; };
38 __decorate([
39 plugin_1.Cordova({
40 successIndex: 1,
41 errorIndex: 4 // no error callback
42 })
43 ], PinDialog, "prompt", null);
44 PinDialog = __decorate([
45 plugin_1.Plugin({
46 pluginName: 'PinDialog',
47 plugin: 'cordova-plugin-pin-dialog',
48 pluginRef: 'plugins.pinDialog',
49 repo: 'https://github.com/Paldom/PinDialog'
50 })
51 ], PinDialog);
52 return PinDialog;
53}());
54exports.PinDialog = PinDialog;
55//# sourceMappingURL=pin-dialog.js.map
\No newline at end of file