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 scoping of chromecast-caf-receiver to be a global const (since the cast sdk is loaded from a script tag) #28446

Closed
wants to merge 10 commits into from
Closed

Fix scoping of chromecast-caf-receiver to be a global const (since the cast sdk is loaded from a script tag) #28446

wants to merge 10 commits into from

Conversation

enjikaka
Copy link

  • [✔️] Use a meaningful title for the pull request. Include the name of the package modified.
  • [✔️] Test the change in your own code. (Compile and run.)
  • [ ✔️] Add or edit tests to reflect the change. (Run with npm test.)
  • [ ✔️] Follow the advice from the readme.
  • [ CAUSES ISSUES] Avoid common mistakes.
  • [✔️ ] Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • [ ✔️] Provide a URL to documentation or source code which provides context for the suggested changes: @types/chromecast-caf-receiver not correctly scoped #28190
  • [ -] Increase the version number in the header if appropriate.
  • [- ] If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

Common mistakes

interface Foo { new(): Foo; }: This defines a type of objects that are new-able. You probably want declare class Foo { constructor(); }.

When I changed QueueBase to be a newable interface instead of being a class tsc correctly lints my JS, but when it's a class it complains that Type 'QueueBase' is not a constructor function type.... Not sure what to do about that!?


This does some refactoring in the chromecast-caf-receiver folder to make sure it's correctly scoped so that the global cast object (which is imported by a script tag) gets the types from chromecast-caf-receiver.

import messages from './cast.framework.messages';
import ui from './cast.framework.ui';

interface CastReceiverFrameworkSDK {
Copy link
Author

Choose a reason for hiding this comment

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

This was an annoying manual process but without it tsc would not detect the imported interfaces... i.e.

interface CastReceiverFrameworkSDK {
    framework: framework;
}

did not work.

@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 28, 2018

@enjikaka Thank you for submitting this PR!

🔔 @craigrbruce - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot
Copy link
Contributor

@enjikaka The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 28, 2018

@enjikaka The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot
Copy link
Contributor

@enjikaka I haven't seen anything from you in a while and this PR currently has problems that prevent it from being merged. The PR will be closed tomorrow if there aren't new commits to fix the issues.

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Sep 4, 2018
@typescript-bot
Copy link
Contributor

@enjikaka To keep things tidy, we have to close PRs that aren't mergeable but don't have activity from their author. No worries, though - please open a new PR if you'd like to continue with this change. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned This PR had no activity for a long time, and is considered abandoned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants