You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/08/01 12:51:21 UTC

[GitHub] [cordova-plugin-inappbrowser] kamilbrk opened a new issue #514: Incorrect TypeScript typings in version 3.1.0

kamilbrk opened a new issue #514: Incorrect TypeScript typings in version 3.1.0
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/514
 
 
   # Bug Report
   
   ## Problem
   
   Since the change to type definitions here https://github.com/apache/cordova-plugin-inappbrowser/commit/a0c267fe36be9a97c974f73b9d2160eca54b9828 the project does not compile.
   
   ### What is expected to happen?
   
   TypeScript project should compile without typings errors.
   
   ### What does actually happen?
   
   TypeScript project compilation fails due to typings errors.
   
   ## Information
   
   ```
   ERROR in /xyz/plugins/cordova-plugin-inappbrowser/types/index.d.ts(27,11):
   TS2430: Interface 'InAppBrowser' incorrectly extends interface 'Window'.
     Types of property 'addEventListener' are incompatible.
       Type '(type: channel, callback: InAppBrowserEventListenerOrEventListenerObject) => void' is not assignable to type '{ <K extends "load" | "abort" | "afterprint" | "beforeprint" | "beforeunload" | "blur" | "canplay" | "canplaythrough" | "change" | "click" | "compassneedscalibration" | "contextmenu" | "dblclick" | ... 120 more ... | "unhandledrejection">(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boo...'.
         Types of parameters 'type' and 'type' are incompatible.
           Type '"statusTap"' is not assignable to type 'channel'.
   ```
   
   Most likely due to the change whereby event listener types were extracted to a separate list of strings at the top of the file. PR incoming, need a ref number.
   
   ### Command or Code
   
   Usual `npm` tasks to build a TS project.
   
   ### Environment, Platform, Device
   
   macOS 10.14.6
   node 10.16.0
   npm 6.9.0
   
   ### Version information
   
   ```
       "cordova": "9.0.0",
       "cordova-android": "8.0.0",
       "cordova-plugin-inappbrowser": "3.0.0",
       "typescript": "3.5.3",
       "webpack": "4.38.0",
   ```
   
   ## Checklist
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org