Closed MariaSolOs closed 1 year ago
I should also mention that if this sounds like a reasonable feature, I would love to work on it!
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days
Description
It would be nice to have type information about the keys used for creating the
Fuse
instance when creatingFuse
expressions.As an example, say I have the following data set:
And I create the
Fuse
instance withconst fuse = new Fuse(data, { keys: [ 'title' ] })
. Then when writingfuse.search({ $or: [{ ;
, I would like to have a completion suggestion for'title'
as my key for the$or
clause.Describe the solution you'd like
I imagine the solution being something like creating a temporary union literal type that corresponds to allowed keys for these logical query operators.
Describe alternatives you've considered
I guess one could maintain the typings independently from the
Fuse
implementation, but these would just add extra setup to maintain which could easily be integrated with this wonderful library.