diff --git a/types/cordova-plugin-inappbrowser/index.d.ts b/types/cordova-plugin-inappbrowser/index.d.ts index 1cf2c67642..47c58eadfa 100644 --- a/types/cordova-plugin-inappbrowser/index.d.ts +++ b/types/cordova-plugin-inappbrowser/index.d.ts @@ -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; diff --git a/types/cordova-plugin-inappbrowser/tsconfig.json b/types/cordova-plugin-inappbrowser/tsconfig.json index ff0151160c..f3d3cb59d3 100644 --- a/types/cordova-plugin-inappbrowser/tsconfig.json +++ b/types/cordova-plugin-inappbrowser/tsconfig.json @@ -5,10 +5,10 @@ "es6", "dom" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../"