Skip to content

Commit

Permalink
fix(keyboard): Update types with new 2.2.0 methods (#3187)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored and danielsogl committed Oct 4, 2019
1 parent a575233 commit a1fb937
Showing 1 changed file with 64 additions and 2 deletions.
66 changes: 64 additions & 2 deletions src/@ionic-native/plugins/keyboard/index.ts
Expand Up @@ -2,6 +2,19 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs';

export enum KeyboardStyle {
Light = 'light',
Dark = 'dark'
}

export enum KeyboardResizeMode {
Native = 'native',
Ionic = 'ionic',
Body = 'body',
None = 'none'
}


/**
* @name Keyboard
* @description
Expand Down Expand Up @@ -43,7 +56,10 @@ export class Keyboard extends IonicNativePlugin {
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
*/
@Cordova({ sync: true })
@Cordova({
sync: true,
platforms: ['iOS']
})
hideFormAccessoryBar(hide: boolean): void {}

/**
Expand Down Expand Up @@ -72,7 +88,27 @@ export class Keyboard extends IonicNativePlugin {
sync: true,
platforms: ['iOS']
})
setResizeMode(mode: string): void {}
setResizeMode(mode: KeyboardResizeMode): void {}

/**
* Programatically set Keyboard style
* @param mode {string}
*/
@Cordova({
sync: true,
platforms: ['iOS']
})
setKeyboardStyle(style: KeyboardStyle): void {}

/**
* Programatically enable or disable the WebView scroll
* @param mode {string}
*/
@Cordova({
sync: true,
platforms: ['iOS']
})
disableScroll(disable: boolean): void {}

/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
Expand Down Expand Up @@ -100,6 +136,19 @@ export class Keyboard extends IonicNativePlugin {
return;
}

/**
* Creates an observable that notifies you when the keyboard did show. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
@Cordova({
eventObservable: true,
event: 'keyboardDidShow',
platforms: ['iOS', 'Android']
})
onKeyboardDidShow(): Observable<any> {
return;
}

/**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
Expand All @@ -125,4 +174,17 @@ export class Keyboard extends IonicNativePlugin {
onKeyboardWillHide(): Observable<any> {
return;
}

/**
* Creates an observable that notifies you when the keyboard did hide. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
@Cordova({
eventObservable: true,
event: 'keyboardDidHide',
platforms: ['iOS', 'Android']
})
onKeyboardDidHide(): Observable<any> {
return;
}
}

0 comments on commit a1fb937

Please sign in to comment.