import { FuzzyOptions, Fuzzy } from './types.mjs'; /** * Performs a fuzzy search on a collection of items and returns a function that can be used to query the collection. * * @template T - The type of the items in the collection. * @template U - The type of the items in the search results (defaults to `T`). * * @param collection - The array of items to search through. * @param options - Configuration options for the fuzzy search. * @param options.getKey - A function that extracts an array of strings (keys) from each item in the collection. * If not provided, the items themselves are converted to strings. * @param options.debug - If `true`, logs debug information about the search process to the console. * @param options.limit - The maximum number of results to return. Defaults to `Number.MAX_SAFE_INTEGER`. * @param options.maxScore - The maximum score a result can have to be included in the results. Defaults to `100`. * @param options.mapResult - A function to map each result item to a different type. * * @returns A function that takes a query string and returns a `FuzzyResponse` containing the search results. * * @example * ```typescript * const collection = ['apple', 'banana', 'cherry']; * const search = fuzzySearch(collection, { limit: 2 }); * const results = search('app'); * console.log(results); * ``` */ declare function fuzzy(collection: T[], options?: FuzzyOptions): Fuzzy; export { fuzzy };