From b9473405cf3f4a0964f794a7c8078e8f6e41d2df Mon Sep 17 00:00:00 2001 From: Basti Ortiz <39114273+BastiDood@users.noreply.github.com> Date: Thu, 22 May 2025 15:40:07 +0800 Subject: [PATCH] feat: allow named imports --- src/index.d.ts | 4 +++- src/index.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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`. *