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

Types for WebXR interfaces #20041

Closed
2 tasks done
repalash opened this issue Aug 8, 2020 · 6 comments
Closed
2 tasks done

Types for WebXR interfaces #20041

repalash opened this issue Aug 8, 2020 · 6 comments

Comments

@repalash
Copy link
Contributor

repalash commented Aug 8, 2020

Description of the problem

The WebXR API with typescript doesn't have an open types declaration file.
Some repositories including model-viewer and babylon.js have created their own, but it's not present in three.
It would really be helpful if it can be added.

Links:

Three.js version
  • Dev
  • r119
@mrdoob
Copy link
Owner

mrdoob commented Aug 8, 2020

It would really be helpful if it can be added.

Can you describe how it would be useful?

@repalash
Copy link
Contributor Author

repalash commented Aug 8, 2020

The documentation related to WebXR is pretty limited, so it's hard for a beginner to get around how to use the API. In the hit-test example for AR, we are using the functions getReferenceSpace, getSession, and frame.getHitTestResults which in WebXRManager.d.ts are typed as any. And there is no documentation mentioned in three that point what they are exactly and what can be done with them.
Also, the second parameter in the render function is an XRFrame object, which is just mentioned just in the r112 changelog.

If the types are mentioned in the declaration file, it gives a better way to understand what we are working with(wrt WebXR API) and what to google about further. Especially when using IDE autocomplete to explore the API.
Plus, I think these kinds of declaration files provide a good starting point to look for features to learn about.

@DefinitelyMaybe
Copy link
Contributor

oh right. would you like to make a PR with the changes you'd like to see in there?

@repalash
Copy link
Contributor Author

repalash commented Aug 8, 2020

Sure, will do.

@mrdoob
Copy link
Owner

mrdoob commented Aug 14, 2020

Thanks!

@repalash
Copy link
Contributor Author

Created a PR for this #20150

@Mugen87 Mugen87 closed this as completed Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants