Skip to content

webvr-api: Make webvr-api consistent with latest lib.es6.d.ts#24690

Merged
sandersn merged 3 commits intoDefinitelyTyped:masterfrom
efokschaner:master
Apr 9, 2018
Merged

webvr-api: Make webvr-api consistent with latest lib.es6.d.ts#24690
sandersn merged 3 commits intoDefinitelyTyped:masterfrom
efokschaner:master

Conversation

@efokschaner
Copy link
Copy Markdown
Contributor

The old definition for addEventListener(type: "vrdisplaypresentchange" had tsc errors because it did not match the latest lib.es6.d.ts 's this declaration.

This alerted me to some other inconsistencies which the spec and with the builtin declarations that I've also fixed.

  • 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.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Apr 3, 2018

@efokschaner Thank you for submitting this PR!

🔔 @lostfictions - 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.

@lostfictions
Copy link
Copy Markdown
Contributor

don't really have time/availability/capacity to review most DT PRs these days, unfortunately :(

is there a way i can explicitly opt out of being tagged for review? it's been happening a few times a week for me for the last month or so and i'd love to help but i don't get paid for this and am already struggling to get by :(

@paulvanbrenk @sandersn @Andy-MS (sorry if you're not DT maintainers, there doesn't seem to be a maintainer list in the readme)

@sandersn
Copy link
Copy Markdown
Contributor

sandersn commented Apr 3, 2018

@lostfictions You can remove yourself from author lists, which is, unfortunately, another set of PRs to submit. In this case, @efokschaner can you remove @lostfictions from the author list and add yourself?

@efokschaner
Copy link
Copy Markdown
Contributor Author

I've gone ahead and changed the author.
Given these are defined in latest lib.es6.d.ts, these typings are effectively just a backport for users on older TS / ES versions. So there shouldn't be too many changes.

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Apr 9, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

new(): VRFrameData;
};

interface VRPose {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not make VRDisplayCapabalities, VREyeParameters, VRFieldOfView, VRPose and VRFrameData declare class instead? You could just change the interface lines and get rid of the new declare vars entirely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think i've done it precisely the same as they are in https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es6.d.ts

So although I agree it's a weird pattern I see no reason not to match the official defs to avoid confusion.

Does that seem sound?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fair enough. :)


// Typescript doesn't allow redefinition of type aliases even if they match,
// thus the _dt_alias to signal this being an alias for the use of DefinitelyTyped
type VRDisplayEventReason_dt_alias = "mounted" | "navigation" | "requested" | "unmounted";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

where are these defined? Can you just change the originals?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh nm this is in lib.dom.d.ts. I had no idea this stuff was built-in to the browser.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They're defined in https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es6.d.ts

We wouldn't want to change those. Think of this typing as a backport of the official definitions for TS versions that don't yet have them. And these typings in here need to work even when the official definitions are visible and doing it this way works. The type alias' don't conflict nor do the functions they're used by.

@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Unmerged The author did not merge the PR when it was ready. labels Apr 9, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

@efokschaner One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@sandersn sandersn merged commit d67a878 into DefinitelyTyped:master Apr 9, 2018
@efokschaner efokschaner mentioned this pull request Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Revision needed This PR needs code changes before it can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants