kabua opened a new issue #346: Help: How to reference the definition file?
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/346
 
 
   I hope this is a dumb `TS 101` question, but we can't seem to figure it out.
   
   We are porting the the following code snippet to TypeScript: 
   ```
   this._popup = cordova.InAppBrowser.open(params.url, this.target, 
this.features);
   ```
   
   However, we are getting the following error:
   ```
   [ts] Property 'InAppBrowser' does not exist on type 'Cordova'. [2339]
   ```
   Therefore we ran:
   ```
   npm i -D cordova-plugin-inappbrowser
   ```
   Okay, we now have access to the `...\cordova-plugin-inappbrowser\index.d.ts` 
file but the issue still exists. We've tried all kinds of ways to using 
`import` but nothing seam to be working.
   
   What are we doing wrong? 
   
   As a work-a-round we are doing this:
   ```
   const localCordova = <any> cordova;
   this._popup = localCordova.InAppBrowser.open(params.url, this.target, 
this.features);
   ```
   
   
   Thanks.

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


With regards,
Apache Git Services

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

Reply via email to