krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.89k stars 759 forks source link

FuseIndex type isn't exported in Fuse namespace #519

Closed yunyu closed 3 years ago

yunyu commented 3 years ago

Describe the bug

The type for FuseIndex isn't exported in the Fuse namespace

Version

6.4.1

Is this a regression?

No

🔬Minimal Reproduction

import { FuseIndex } from "fuse.js"

Additional context

This makes it impossible to type the result of Fuse.createIndex without actually calling the method (say, storing the value in a map or loading from disk).

A non-obvious workaround is to do:

ReturnType<Fuse<GenericArgument>["getIndex"]>
krisk commented 3 years ago

Good point. Will address this. You'll be able to use it with Fuse.FuseIndex