[cordova-plugin-keyboard] Support for deprecated events

This commit is contained in:
Jochen Becker
2017-11-22 14:48:54 +01:00
parent 2d23c6a91b
commit 004b817c7c
2 changed files with 25 additions and 25 deletions
@@ -28,4 +28,4 @@ window.addEventListener('keyboardWillShow', () => console.log('keyboardWillShow'
window.addEventListener('keyboardWillHide', () => console.log('keyboardWillHide'));
window.addEventListener('keyboardHeightWillChange', (event) => console.log(`keyboardHeightWillChange - keyboard height: ${event.keyboardHeight}`));
window.addEventListener('keyboardHeightWillChange', (event: CordovaKeyboardEvent) => console.log(`keyboardHeightWillChange - keyboard height: ${event.keyboardHeight}`));
+24 -24
View File
@@ -136,7 +136,18 @@ interface Keyboard {
* </code>
*
*/
automaticScrollToTopOnHiding: boolean
automaticScrollToTopOnHiding: boolean,
/**
* Deprecated Events
*/
onshow(): void,
onhide(): void,
onhiding(): void,
onshowing(): void
}
interface CordovaKeyboardEvent extends Event {
@@ -144,42 +155,31 @@ interface CordovaKeyboardEvent extends Event {
keyboardHeight: number;
}
interface Window {
interface WindowEventMap {
/**
* @param type This event is fired when keyboard fully shown.
*
* @param callback Function is called when keyboard is shown.
* This event is fired when keyboard fully shown.
*/
addEventListener(type: 'keyboardDidShow', callback: () => any, useCapture?: boolean): void;
'keyboardDidShow': Event,
/**
* @param type This event is fired when the keyboard is fully closed.
*
* @param callback Function is called when keyboard is closed.
* This event is fired when the keyboard is fully closed.
*/
addEventListener(type: 'keyboardDidHide', callback: () => any, useCapture?: boolean): void;
'keyboardDidHide': Event,
/**
* @param type This event fires before keyboard will be shown.
*
* @param callback Function is called when keyboard is about to be shown on the screen.
* This event fires before keyboard will be shown.
*/
addEventListener(type: 'keyboardWillShow', callback: () => any, useCapture?: boolean): void;
'keyboardWillShow': Event,
/**
* @param type This event is fired when the keyboard is fully closed.
*
* @param callback Function is called when keyboard is about to be closed.
* This event is fired when the keyboard is fully closed.
*/
addEventListener(type: 'keyboardWillHide', callback: () => any, useCapture?: boolean): void;
'keyboardWillHide': Event,
/**
* @param type This event is fired when the keyboard is fully closed.
*
* @param callback Function is called when keyboard is about to be closed. The function is
* passed an InAppBrowserEvent object as a parameter.
* This event is fired when the keyboard is fully closed.
*/
addEventListener(type: 'keyboardHeightWillChange', callback: (event: CordovaKeyboardEvent) => any, useCapture?: boolean): void;
}
'keyboardHeightWillChange': CordovaKeyboardEvent
}
declare var Keyboard: Keyboard;