Skip to content

Conversation

@coopbri
Copy link
Contributor

@coopbri coopbri commented Oct 31, 2025

Closes #14

Implemented TypeScript types for LocAR.js. There are some guesses, adjust as you see fit.

Also, I did not wrap the types into the bundle (dist/). They are present with npm pack. Let me know if you'd like this adjusted.

Based on an open-source, web-based XR React framework we are building at Omni called Reality Development Kit (LocAR.js types: https://github.com/omnidotdev/rdk/blob/3506933c996d2d9d78cf9a60d1590ddb12078b16/packages/rdk/src/lib/types/locar.d.ts)

@coopbri
Copy link
Contributor Author

coopbri commented Nov 1, 2025

A better approach would be to convert all of the JS to TS right in the source code instead of having this separate type file to maintain. Let me know if you are interested in that instead.

@nickw1
Copy link
Collaborator

nickw1 commented Nov 2, 2025

@coopbri many thanks. Yes, converting direct to TS would make sense, it's something I've been meaning to do for a while but haven't had the time yet.

By the way, rdk looks a very interesting project!

@coopbri
Copy link
Contributor Author

coopbri commented Nov 2, 2025

@coopbri many thanks. Yes, converting direct to TS would make sense, it's something I've been meaning to do for a while but haven't had the time yet.

By the way, rdk looks a very interesting project!

No problem. If TS is something you're looking for sooner than later, want me to migrate this repo to TS as part of this PR instead of just the raw declaration file?

Thanks man! I'm relatively new to the more advanced side of the XR space so deep learning mode right now. I am so excited to continue to contributing back to the eco, and thank you for working on such amazing projects in the space (AR.js and beyond)

@nickw1
Copy link
Collaborator

nickw1 commented Nov 3, 2025

Thanks! Glad you've chosen to use AR.js and locar.js!

That would be great, thanks! If you can do a full TS conversion on the code that would be most welcome. Only if you have the time though of course... no worries if not.

@coopbri
Copy link
Contributor Author

coopbri commented Nov 3, 2025

Thanks! Glad you've chosen to use AR.js and locar.js!

That would be great, thanks! If you can do a full TS conversion on the code that would be most welcome. Only if you have the time though of course... no worries if not.

You got it my friend :) Will circle back on this PR

@kalwalt
Copy link
Member

kalwalt commented Nov 4, 2025

@coopbri @nickw1 you could create Typescript definitions with the tsc compiler before converting all the project to TS. It will be less time consuming and maybe you can make the translation in another step?

@nickw1
Copy link
Collaborator

nickw1 commented Nov 4, 2025

@kalwalt good point.

@coopbri what I might do for now is merge your PR (once tested) and then we can do a full TS conversion later, or as soon as you are able to. That means there's no rush to do this immediately.

BTW what I have been meaning to do for a while is to convert my project hikar.js (https://github.com/nickw1/hikar.js) to use LocAR.js (currently it uses the older location-based part of AR.js, which lacks some of the recent iOS fixes - i.e. it doesn't really support iOS properly).

Having seen RDK I'm inclined to give that a go (i.e. use RDK with LocAR.js backend). I like the idea of being able to use React to develop AR webapps.

This will be an opportunity to try out RDK on a real project, which means I might be able to feed suggestions and PRs back to RDK, so both RDK and LocAR.js benefit.

@coopbri
Copy link
Contributor Author

coopbri commented Nov 4, 2025

Good point indeed. That incremental plan sounds good to me (test + merge -> full migration separate dev step).

Oh! That would be amazing. I partially guessed on how the API will look and be useful for users, so your feedback (especially with your expert experience in the XR space as a dev + user) would be monumentally helpful. RDK is so new that I imagine the way it is structured right now will change drastically (and be very buggy, of course).

Btw hikar.js is so cool, I explored it when I started tapping into location-based AR. I will share this project with my friends too now that you brought it up.

If you want to chat further feel free to DM, I have socials on https://github.com/coopbri

We are working on a project you might be interested in and we may have some funding around the corner, not sure if you're looking for work at the moment but would be fun to chat no matter what!

@nickw1
Copy link
Collaborator

nickw1 commented Nov 4, 2025

@coopbri thanks for your comments.

Would be good to DM, it would be certainly good to hear more about your project at least. I'm generally fairly low-profile on social media but I am on LinkedIn (haven't used it in a while though) so will probably message you there later in the week.

@nickw1
Copy link
Collaborator

nickw1 commented Nov 5, 2025

@coopbri have tested, will merge.

@nickw1 nickw1 merged commit 742c92c into AR-js-org:master Nov 5, 2025
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.

Types not included. Is there any plan for adding them?

3 participants