realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Typescript Interfaces

Open saniyusuf opened this issue 1 year ago • 2 comments

Problem

I use the realm web, but it's challenging to infer the build-in return types. For example, if I want to decorate a Promise to return the same return type of the findOne method, it's near impossible not as the current version does not support that.

Solution

This should work because users should be able to import the return types for all operations. For example, I should be able to get an interface to use as a return type for an UpdateOne method. It would also be nice to have the _id object ID as an interface to.

Alternatives

No response

How important is this improvement for you?

Would be a major improvement

Feature would mainly be used with

Atlas App Services: Auth or Functions etc

saniyusuf avatar Nov 27 '23 15:11 saniyusuf

@saniyusuf

Thank you for your suggestion. We have an upcoming project (starting soonish) which is about enhancing the data access. We can use your suggestion as part of the design.

kneth avatar Dec 01 '23 16:12 kneth

@kneth this is perfect. I actually think the Interfaces are already present internally however, I just don't think they are exported for use. If you can point me to that folder, I can manually export them in a file that can me made available for all.

saniyusuf avatar Dec 04 '23 09:12 saniyusuf