Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect TypeScript typings #515

Merged
merged 5 commits into from
Apr 3, 2020
Merged

Fix incorrect TypeScript typings #515

merged 5 commits into from
Apr 3, 2020

Conversation

kamilbrk
Copy link
Contributor

@kamilbrk kamilbrk commented Aug 1, 2019

Platforms affected

TypeScript based Cordova projects.

Motivation and Context

Fixes #514.

Description

There was a regression in 3.1.0 since 3.0.0, whereby typings did not allow for an arbitrary string type for event listeners. In case your TypeScript project contains anything else extending Window, it would cause the build to fail.

Testing

Ran official 3.1.0 from apache, build failures as described in linked issue.
Ran this fork, build succeeds.

Checklist

  • I've run the tests to see all new and existing tests pass (just eslint?)
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

Copy link
Member

@timbru31 timbru31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your PR, however let's first analyze the issue of #514

types/index.d.ts Outdated
@@ -6,7 +6,7 @@
// Copyright (c) Microsoft Open Technologies Inc
// Licensed under the MIT license.
// TypeScript Version: 2.3
type channel = "loadstart" | "loadstop" | "loaderror" | "exit" | "message";
type channel = "loadstart" | "loadstop" | "loaderror" | "exit" | "message" | string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes the type useless if we just use a string. Let's continue the discussion in #514 where I've added a question.

@timbru31 timbru31 self-assigned this Aug 1, 2019
@NiklasMerz NiklasMerz changed the title fix #514 Fix incorrect TypeScript typings Dec 30, 2019
@kamilbrk
Copy link
Contributor Author

kamilbrk commented Apr 3, 2020

Updated to an agreed solution in #514

Copy link
Member

@timbru31 timbru31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@timbru31 timbru31 merged commit c01f037 into apache:master Apr 3, 2020
expertanswerz pushed a commit to expertanswerz/cordova-plugin-inappbrowser that referenced this pull request Apr 9, 2020
* master:
  docs: replaces outdated transition and presentation style links (apache#662)
  chore: remove deprecated orientation methods (apache#666)
  Fix incorrect TypeScript typings (apache#515)
  [apacheGH-652] add check for openInSystem postNotification (apache#654)
  ci: updates Node.js versions (apache#659)
  chore(npm): improve ignore list (apache#658)
  fix(android): Reset lefttoright if not set (apache#442)
  [android] Correcting the documentation regarding lefttoright opt… (apache#648)
  (android) Added option to turn on/off fullscreen mode in Android (apache#634)
  Android apacheGH-470 InAppBrowser: java.lang.IllegalArgumentException (apache#616)
  breaking(ios): remove UIWebView (apache#635)
  chore(release): 3.2.1-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect TypeScript typings in version 3.1.0
2 participants