import type { TextExtractor } from "../types.js";
/**
 * @remarks \@since 6.0.0
 */
export interface BaseFilterOptions<T> {
    list: readonly T[];
    /**
     * The current query string. i.e. `"SeArch"`
     */
    query: string;
    /**
     * This is required if the list includes anything other than strings.
     * @see {@link TextExtractor}
     */
    extractor?: TextExtractor<T>;
    /**
     * @defaultValue `"keep"`
     */
    whitespace?: "ignore" | "trim" | "keep";
}
/**
 * @internal
 * @remarks \@since 6.0.0
 */
export interface FilterOptions<T> extends BaseFilterOptions<T> {
    filter(query: string, value: string): boolean;
    extractor: TextExtractor<T>;
}
/**
 * @remarks \@since 6.0.0
 */
export interface CaseInsensitiveOptions<T> extends BaseFilterOptions<T> {
    /**
     * Set this to `true` if the item in the list must start with the query
     * instead of only including it.
     *
     * @example
     * ```ts
     * const fruits = ["Apple", "Banana", "Grape", "Orange"];
     *
     * caseInsensitiveFilter({
     *   list: fruits,
     *   query: "ap",
     * });
     * // ["Apple", "Grape"]
     *
     * caseInsensitiveFilter({
     *   list: fruits,
     *   query: "ap",
     *   startsWith: true,
     * });
     * // ["Apple"]
     * ```
     *
     * @defaultValue `false`
     */
    startsWith?: boolean;
}
/**
 * @example
 * String list
 * ```ts
 * const fruits = ["Apple", "Banana", "Grape", "Orange"];
 *
 * caseInsensitiveFilter({
 *   list: fruits,
 *   query: "ap",
 * });
 * // ["Apple", "Grape"]
 *
 * caseInsensitiveFilter({
 *   list: fruits,
 *   query: "ap",
 *   startsWith: true,
 * });
 * // ["Apple"]
 *
 * caseInsensitiveFilter({
 *   list: fruits,
 *   query: "  a p",
 * });
 * // []
 *
 * caseInsensitiveFilter({
 *   list: fruits,
 *   query: "  a p",
 *   whitespace: "ignore",
 * });
 * // ["Apple", "Grape"]
 *
 * caseInsensitiveFilter({
 *   list: fruits,
 *   query: "  ap  ",
 *   whitespace: "trim",
 * });
 * // ["Apple", "Grape"]
 * ```
 *
 * @example
 * Objects
 * ```ts
 * const fruits = [
 *   { name: "Apple", value: 0 },
 *   { name: "Banana", value: 1 },
 *   { name: "Grape", value: 2 },
 *   { name: "Orange", value: 3 },
 * ];
 *
 * caseInsensitiveFilter({
 *   list: fruits,
 *   query: "ap",
 *   extractor: (item) => item.name,
 * });
 * // [{ name: "Apple", value: 0 }, { name: "Grape", value: 2 }]
 * ```
 *
 * @remarks \@since 6.0.0
 */
export declare function caseInsensitiveFilter<T extends string>(options: Omit<CaseInsensitiveOptions<T>, "extractor">): readonly T[];
export declare function caseInsensitiveFilter<T>(options: CaseInsensitiveOptions<T> & {
    extractor: TextExtractor<T>;
}): readonly T[];
/**
 * @remarks \@since 6.0.0
 */
export type FuzzyFilterOptions<T> = BaseFilterOptions<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",
 * ];
 *
 * fuzzyFilter({ list: list, query: "la" });
 * // [
 * //   "lastIndexOf",
 * //    ^^
 * //   "localeCompare",
 * //    ^  ^
 * //   "replace",
 * //       ^^
 * //   "replaceAll",
 * //       ^^
 * //   "toLocaleLowerCase",
 * //      ^  ^
 * //   "toLocaleUpperCase",
 * //      ^  ^
 * //   "toLowerCase",
 * //      ^     ^
 * // ]
 * ```
 *
 * @remarks \@since 6.0.0
 */
export declare function fuzzyFilter<T extends string>(options: Omit<FuzzyFilterOptions<T>, "extractor">): readonly T[];
export declare function fuzzyFilter<T>(option: FuzzyFilterOptions<T> & {
    extractor: TextExtractor<T>;
}): readonly T[];
