Fuse
Fuse copied to clipboard
Typescript definitions for fuse.basic are not being built and exported
Describe the bug
I was hoping to use fuse.basic because I don't need extended search.
But if you try to import fuse.basic like this in a node project:
import Fuse from "fuse.js/dist/fuse.basic";
You get the following typescript error:
Could not find a declaration file for module 'fuse.js/dist/fuse.basic'
It seems to me like a fuse.basic.d.ts
file should be available in the dist folder of the package. Or that there should be a separate fuse.basic
npm package that does export a type definition file.
Version
6.5.3
Is this a regression?
Doesn't seem like a regression
🔬Minimal Reproduction
Create a node typescript project, install fuse, try to import Fuse from the fuse.basic script.
I'm not sure how to deal with this problem either, any file which isn't fuse.js
will cause the same error.
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
While waiting for a fix, you could declare the module in your project using the declaration fuse.d.ts
.
In a file with the extension .d.ts
:
declare module 'fuse.js/dist/fuse.basic.esm' {
import Fuse from 'fuse.js'
export default Fuse
}