diff --git a/src/index.d.ts b/src/index.d.ts index b306f2d..190eec7 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -94,11 +94,13 @@ export type FuzzySearcher = (string) => Array> * * If you use React, use `useFuzzySearchList` hook for convenience. */ -export default function createFuzzySearch( +export function createFuzzySearch( list: Element[], options?: FuzzySearchOptions, ): FuzzySearcher +export default createFuzzySearch + /** * Runs a one-off fuzzy search matching on `text` against `queryText`. * diff --git a/src/index.js b/src/index.js index 4ebd7a8..868a240 100644 --- a/src/index.js +++ b/src/index.js @@ -96,13 +96,15 @@ export type FuzzySearcher = (string) => Array> * * If you use React, use `useFuzzySearchList` hook for convenience. */ -export default function createFuzzySearch( +export function createFuzzySearch( list: Element[], options?: FuzzySearchOptions = ({}: any), ): FuzzySearcher { return require('./impl').createFuzzySearchImpl(list, options) } +export default createFuzzySearch + /** * Runs a one-off fuzzy search matching on `text` against `queryText`. *