80 lines
1.8 KiB
TypeScript
Raw Normal View History

2016-07-17 19:58:05 +02:00
import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';
2016-03-13 15:19:21 -04:00
/**
* @name Keyboard
* @description
* @usage
* ```typescript
* import { Keyboard } from 'ionic-native';
*
*
*
* ```
*/
2016-03-13 15:19:21 -04:00
@Plugin({
plugin: 'ionic-plugin-keyboard',
pluginRef: 'cordova.plugins.Keyboard',
repo: 'https://github.com/driftyco/ionic-plugin-keyboard'
})
export class Keyboard {
/**
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
*/
static hideKeyboardAccessoryBar(hide: boolean): void {
console.log('hideKeyboardAccessoryBar method has been removed temporarily.');
}
2016-03-13 15:19:21 -04:00
/**
* Force keyboard to be shown.
2016-03-13 15:19:21 -04:00
*/
@Cordova({
sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows']
2016-03-13 15:19:21 -04:00
})
2016-07-17 19:58:05 +02:00
static show(): void { }
2016-03-13 15:19:21 -04:00
/**
2016-05-10 17:49:21 -05:00
* Close the keyboard if open.
*/
2016-03-13 15:19:21 -04:00
@Cordova({
sync: true,
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
2016-03-13 15:19:21 -04:00
})
2016-07-17 19:58:05 +02:00
static close(): void { }
2016-03-13 15:19:21 -04:00
/**
* Prevents the native UIScrollView from moving when an input is focused.
* @param disable
*/
2016-03-13 15:19:21 -04:00
@Cordova({
sync: true,
platforms: ['iOS', 'Windows']
2016-03-13 15:19:21 -04:00
})
2016-07-17 19:58:05 +02:00
static disableScroll(disable: boolean): void { }
/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
*/
@Cordova({
eventObservable: true,
event: 'native.keyboardshow',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
2016-07-17 19:58:05 +02:00
static onKeyboardShow(): Observable<any> { return; }
2016-03-13 15:19:21 -04:00
/**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
*/
@Cordova({
eventObservable: true,
event: 'native.keyboardhide',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
})
2016-07-17 19:58:05 +02:00
static onKeyboardHide(): Observable<any> { return; }
2016-03-13 15:19:21 -04:00
2016-05-10 17:49:21 -05:00
}