ionic-native
Version:
Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support
97 lines • 3.39 kB
JavaScript
"use strict";
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 plugin_1 = require('./plugin');
/**
* @name Keyboard
* @description
* @usage
* ```typescript
* import { Keyboard } from 'ionic-native';
*
*
*
* ```
*/
var Keyboard = (function () {
function Keyboard() {
}
/**
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
*/
Keyboard.hideKeyboardAccessoryBar = function (hide) { };
/**
* Force keyboard to be shown.
*/
Keyboard.show = function () { };
/**
* Close the keyboard if open.
*/
Keyboard.close = function () { };
/**
* Prevents the native UIScrollView from moving when an input is focused.
* @param disable
*/
Keyboard.disableScroll = function (disable) { };
/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
Keyboard.onKeyboardShow = function () { return; };
/**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
Keyboard.onKeyboardHide = function () { return; };
__decorate([
plugin_1.Cordova({ sync: true })
], Keyboard, "hideKeyboardAccessoryBar", null);
__decorate([
plugin_1.Cordova({
sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows']
})
], Keyboard, "show", null);
__decorate([
plugin_1.Cordova({
sync: true,
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
], Keyboard, "close", null);
__decorate([
plugin_1.Cordova({
sync: true,
platforms: ['iOS', 'Windows']
})
], Keyboard, "disableScroll", null);
__decorate([
plugin_1.Cordova({
eventObservable: true,
event: 'native.keyboardshow',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
], Keyboard, "onKeyboardShow", null);
__decorate([
plugin_1.Cordova({
eventObservable: true,
event: 'native.keyboardhide',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
], Keyboard, "onKeyboardHide", null);
Keyboard = __decorate([
plugin_1.Plugin({
pluginName: 'Keyboard',
plugin: 'ionic-plugin-keyboard',
pluginRef: 'cordova.plugins.Keyboard',
repo: 'https://github.com/driftyco/ionic-plugin-keyboard'
})
], Keyboard);
return Keyboard;
}());
exports.Keyboard = Keyboard;
//# sourceMappingURL=keyboard.js.map