farzher / fuzzysort

Fast SublimeText-like fuzzy search for JavaScript.

Home Page:https://rawgit.com/farzher/fuzzysort/master/test/test.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typscript error on npm run build

swallace21 opened this issue · comments

I have the index.d.ts file in the same directory as fuzzysort.js and my fuzzy.ts file.

fuzzy.ts file contains this:

import fuzzysort from './fuzzysort';

ERROR

TS7016: Could not find a declaration file for module './fuzzysort'. '/js/modules/fuzzy/fuzzysort.js' implicitly has an 'any' type.

I was able to get it to work with typescript.

npm install fuzzysort

my default options:

const fuzzySortOptions = {
threshold: -10000, // Don't return matches worse than this (higher is faster)
limit: 100, // Don't return more results than this (lower is faster)
allowTypo: true, // Allows a single transpose (false is faster)
key: "", // For when targets are objects (see its example usage)
keys: [] as string[], // For when targets are objects (see its example usage)
//scoreFn: null, // For use with keys (see its example usage)
// comment scoreFn to avoid TS errors
};