import { type TextExtractor } from "../types.js";
import { type BaseSearchOptions } from "./types.js";
/**
 * @example
 * ```tsx
 * import { createFuzzyRegExp, toSearchQuery } from "@react-md/core":
 * import { useDeferredValue, useMemo, useState, type ReactElement } from "react";
 *
 * function Example(): ReactElement {
 *   const [value, setValue] = useState("");
 *   const deferredValue = useDeferredValue(value)
 *
 *   const match = useMemo(() => {
 *     const query = toSearchQuery(deferredValue);
 *     if (!query) {
 *       return;
 *     }
 *
 *     const fuzzyRegExp = createFuzzyRegExp(query);
 *     return options.find(option => fuzzyRegExp.test(option.label)):
 *   }, [options])
 *
 *   if (match) {
 *     // do something
 *   }
 * }
 *
 * ```
 *
 * @remarks \@since 6.0.0
 * @see {@link fuzzySearch}
 */
export declare function createFuzzyRegExp(query: string): RegExp;
/**
 * @remarks \@since 6.0.0
 */
export type FuzzySearchOptions<T> = BaseSearchOptions<T>;
/**
 * Filters a list by making sure that all the letters appear in order ignoring
 * case, punctuation, whitespace, and special characters. This is kind of the
 * same filtering that appears in text editors.
 *
 * @example
 * Simple Example
 * ```ts
 * const list = [
 *   "at",
 *   "charAt",
 *   "charCodeAt",
 *   "codePointAt",
 *   "concat",
 *   "constructor",
 *   "endsWith",
 *   "includes",
 *   "indexOf",
 *   "lastIndexOf",
 *   "length",
 *   "localeCompare",
 *   "match",
 *   "matchAll",
 *   "normalize",
 *   "padEnd",
 *   "padStart",
 *   "repeat",
 *   "replace",
 *   "replaceAll",
 *   "search",
 *   "slice",
 *   "split",
 *   "startsWith",
 *   "substring",
 *   "toLocaleLowerCase",
 *   "toLocaleUpperCase",
 *   "toLowerCase",
 *   "toString",
 *   "toUpperCase",
 *   "trim",
 *   "trimEnd",
 *   "trimStart",
 *   "valueOf",
 * ];
 *
 * fuzzySearch({
 *   list,
 *   query: "la",
 * });
 * // [
 * //   "lastIndexOf",
 * //    ^^
 * //   "localeCompare",
 * //    ^  ^
 * //   "replace",
 * //       ^^
 * //   "replaceAll",
 * //       ^^
 * //   "toLocaleLowerCase",
 * //      ^  ^
 * //   "toLocaleUpperCase",
 * //      ^  ^
 * //   "toLowerCase",
 * //      ^     ^
 * // ]
 *
 * fuzzySearch({
 *   list,
 *   query: "ad",
 *   type: "search",
 * });
 * // "charCodeAt"
 *  //    ^   ^
 * ```
 *
 * @remarks \@since 6.0.0
 */
export declare function fuzzySearch<T extends string>(options: Omit<FuzzySearchOptions<T>, "extractor"> & {
    type?: "filter";
}): readonly T[];
export declare function fuzzySearch<T extends string>(options: Omit<FuzzySearchOptions<T>, "extractor"> & {
    type?: "search";
}): T | undefined;
export declare function fuzzySearch<T>(option: FuzzySearchOptions<T> & {
    extractor: TextExtractor<T>;
    type?: "filter";
}): readonly T[];
export declare function fuzzySearch<T>(option: FuzzySearchOptions<T> & {
    extractor: TextExtractor<T>;
    type?: "search";
}): T | undefined;
