-
Notifications
You must be signed in to change notification settings - Fork 482
Typescript definitions are outdated #467
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
Comments
Your right, collection find should return object[] or null. It should be just collection.chain() that returns a (Loki) 'Resultset'. @TeamworkGuy2 kindly provided those definitions. I've not yet had time to research this enough to be familiar with the syntax to fix any issues with them. If you are able to, it would be nice if you could help update those as our v1.4.x (main) branch is stable (maybe a few non-breaking extra constructor options we may want to add). Otherwise I will add this to my todo list for when I (or anyone interested in updating these) can get around it. |
If I ever have spare time I'll update it. But it's a 6+ hour process for me to extract accurate definitions from a library of loki.js' size and it's a very boring task :) |
Great... while my request was meant for @mnasyrov, if you ever get some time, it would be appreciated :) Would be nice if there was a way to leverage jsdoc/closure annotations to scaffold some definitions. |
Sorry guys, have no time right now. |
There are definition file generators from js like dtsmake, but they also require manual work to define type structures. |
Moving the whole of the project to TypeScript could be an option, since that could favor reading the code and submitting patches/issues/contributions. --R |
Any update on this? |
This project look pretty awesome, too bad there are no up-to-date TypeScript typings available. Just wanted to add my +1 for conversion to TypeScript or maintaining official typings. |
I found some time to update the definition; I'll hopefully be finished by the end of the weekend. |
Have a look at https://github.com/LokiJS-Forge/LokiJS2 - a official successor, converted to Typescript (but still beta). |
@Viatorus Thanks! Tried it but it seems the npm package doesn't include typing or do I miss something? |
Next update should have them - probably tomorrow.
…On Nov 25, 2017 13:06, "Thomas Deinhamer" ***@***.***> wrote:
@Viatorus <https://github.com/viatorus> Thanks! Tried it but it seems the
npm package doesn't include typing or do I miss something?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#467 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADeCl_WqEMpXL9E8WLW8wXhEU6b36aSnks5s6ALJgaJpZM4JtrFC>
.
|
Latest lokijs 1.5.1 definition just got merged to definitely typed (pull: DefinitelyTyped/DefinitelyTyped#21747, commit: DefinitelyTyped/DefinitelyTyped@766089f). |
I can't get how do I use LokiIndexedAdapter with typings now. :( |
@foxel I'm not sure how LokiIndexedAdapter works, I've never used it. I probably won't have time to analyze the code and write a definition in the near future. :/ |
@TeamworkGuy2 Will the typescript definitions for 1.5.2 work for loki 1.5.5 or are their too many changes? |
@Shiroikuma A quick diff of the src/lokijs.js files from releases version 1.5.2 zip to 1.5.5 zip shows there's several changes to method signatures and enumerations, for example |
I did update our typescript definitions but apparently i missed a versioning number somewhere because when i run :
it will report version 1.5.2, however the definitions are actually 1.5.3 which are latest. @TeamworkGuy2 : any idea why that might be? |
@obeliskos I'm not sure why it's wrong, version numbers of npm @types packages are controlled by the version string in the definitely typed definition file (for lokijs see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lokijs/index.d.ts) If you have time to dig in to it yourself, you could look at the types-publisher tool the definitely typed team use for publishing the packages: https://github.com/Microsoft/types-publisher |
For example, now
Collection.prototype.find(query)
returns an array while it is defined asLokiCollection.find(query: LokiQuery): LokiResultset<E>
in the typescript definitions.The text was updated successfully, but these errors were encountered: