typescript support so that we get type completion from objects returned in `find`
See original GitHub issueProblem
- I want to ensure type completion on objects returned in
find
- I want to make sure the correct type of doc is passed in an insert
Context
I looked at the type definition file for nedb in DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/nedb/index.d.ts)
I see passing of type T
in a few places there. I was unsure where to pass types during instantiation because new object creation of nedb doesn’t take in type information.
Please let me know if I can use types with nedb or pass in type information into nedb to get some type goodness.
If nedb doesn’t support types, I’m sure I can just create a wrapper class for this, so no worries. Also, thanks for making such a neat library 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
Documentation - Advanced Types - TypeScript
This page lists some of the more advanced ways in which you can model types, it works in tandem with the Utility Types...
Read more >How can I see the full expanded contract of a Typescript type?
Here is a type alias I sometimes use to try to expand a type in the way you're talking about: // expands object...
Read more >Announcing TypeScript 4.9 - Microsoft Developer Blogs
Today we are excited to announce the availability of TypeScript 4.9! If you're not familiar with TypeScript, it's a language that builds on ......
Read more >TypeScript Types Explained – A Mental Model to Help You ...
"Hm, it is a list of integers, so I'll need to filter only the even numbers and return a new list"; "This is...
Read more >typescript-cheatsheet - GitHub Pages
In TypeScript, we support much the same types as you would expect in ... In JavaScript, so as in TypeScript, Objects are comprised...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dheerajbhaskar Myself and another developer are currently working on a TypeScript replacement. I just finished the AVL Btree for it last week. It is still in development. teDB the db, and binary-type-tree the btree
That I understand about indices, but I’m unable to see how that’s relevant from the types and autocomplete perspective.
Typescript does allow that, it’s called type assertion, see http://stackoverflow.com/a/35362350/1311745
I’ll contribute back here or as another package if I end up implementing this.
Thanks for taking the time all 🙂👍