Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add typescript declaration file #27

Closed
wants to merge 1 commit into from
Closed

chore: add typescript declaration file #27

wants to merge 1 commit into from

Conversation

lextoc
Copy link

@lextoc lextoc commented Sep 26, 2021

Saw request for declaration file, does this look good?

#23

@jchook
Copy link

jchook commented Jan 3, 2022

Your type definition is slightly incorrect:

  1. export default corresponds to require('fuzzysearch').default
  2. both arguments have type string

Try this instead:

declare function fuzzysearch (needle: string, haystack: string): boolean;

export = fuzzysearch;

@ajoslin103
Copy link

ajoslin103 commented Dec 10, 2022

I added this when I wrapped search for my own uses

export type FuzzyResults = (string | object)[] | MatchData<string | object>[];

@remcohaszing
Copy link

@jchook is correct. A PR to add correct type definitions is available in #19. Such definitions are also available via @types/fuzzysearch. I suggest closing this PR.

@lextoc lextoc closed this by deleting the head repository Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants