@ionic-native/pin-dialog
Version:
Ionic Native - Native plugins for ionic apps
70 lines (69 loc) • 2.65 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
/**
* @name Pin Dialog
* @description
*
* @usage
* ```typescript
* import { PinDialog } from '@ionic-native/pin-dialog';
*
*
* constructor(private pinDialog: PinDialog) { }
*
* ...
*
* this.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');
* }
* );
* ```
*/
export var PinDialog = (function () {
function 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
* @returns {Promise<{ buttonIndex: number, input1: string }>}
*/
PinDialog.prototype.prompt = function (message, title, buttons) { return; };
PinDialog.decorators = [
{ type: Injectable },
];
/** @nocollapse */
PinDialog.ctorParameters = function () { return []; };
__decorate([
Cordova({
successIndex: 1,
errorIndex: 4 // no error callback
}),
__metadata('design:type', Function),
__metadata('design:paramtypes', [String, String, Array]),
__metadata('design:returntype', Promise)
], PinDialog.prototype, "prompt", null);
PinDialog = __decorate([
Plugin({
pluginName: 'PinDialog',
plugin: 'cordova-plugin-pin-dialog',
pluginRef: 'plugins.pinDialog',
repo: 'https://github.com/Paldom/PinDialog'
}),
__metadata('design:paramtypes', [])
], PinDialog);
return PinDialog;
}());