[cordova-plugin-inappbrowser] enable strictFunctionTypes

This commit is contained in:
Nicolas HENRY
2017-12-08 02:30:51 +01:00
parent 85c17c4f49
commit 701b125ab3
2 changed files with 13 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ interface InAppBrowser extends Window {
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: channel, callback: (event: InAppBrowserEvent) => void): void;
addEventListener(type: channel, callback: InAppBrowserEventListenerOrEventListenerObject): void;
// removeEventListener overloads
/**
* Removes a listener for an event from the InAppBrowser.
@@ -51,7 +51,7 @@ interface InAppBrowser extends Window {
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: channel, callback: (event: InAppBrowserEvent) => void): void;
removeEventListener(type: channel, callback: InAppBrowserEventListenerOrEventListenerObject): void;
/** Closes the InAppBrowser window. */
close(): void;
/** Hides the InAppBrowser window. Calling this has no effect if the InAppBrowser was already hidden. */
@@ -79,6 +79,14 @@ interface InAppBrowser extends Window {
insertCSS(css: { code: string } | { file: string }, callback: () => void): void;
}
type InAppBrowserEventListenerOrEventListenerObject = InAppBrowserEventListener | InAppBrowserEventListenerObject;
type InAppBrowserEventListener = (evt: InAppBrowserEvent) => void;
interface InAppBrowserEventListenerObject {
handleEvent(evt: InAppBrowserEvent): void;
}
interface InAppBrowserEvent extends Event {
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
type: string;

View File

@@ -5,10 +5,10 @@
"es6",
"dom"
],
"noImplicitAny": false,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"