import { type SelectItem, type SelectOption, type SelectRow } from './types'; import Fuse from 'fuse.js'; export declare const isPrintableKey: (e: KeyboardEvent) => boolean; export declare const defaultCompare: (a: T, b: T) => boolean; export type FlatOption = { option: SelectOption; group?: string; }; export declare const flattenItems: (items: SelectItem[]) => FlatOption[]; export type GroupMeta = { value?: T; options: SelectOption[]; }; export declare const buildGroupMap: (items: SelectItem[]) => Map>; export declare const getNavigableIndices: (rows: SelectRow[]) => number[]; export declare const moveHighlightIndex: (indices: number[], current: number, delta: number) => number; /** * Builds a Fuse index over the flattened options. Used by sync wrappers to fuzzy-filter * locally inside their `loadOptions` shim. Async impls don't need this — the server does * the filtering. */ export declare const buildFuseIndex: (items: SelectItem[]) => Fuse>; /** * Runs a fuzzy search via the Fuse index and reconstructs the grouped `SelectItem[]` * shape so the core's group-header logic keeps working. Empty query returns the original * items untouched. * * Results are ordered by relevance, not by the original list order: matches rank * prefix > substring > scattered-fuzzy (the Fuse score breaks ties within a tier), groups * are ordered by their best hit, and options keep that order inside each group. Scattered * fuzzy hits are a typo fallback only — they are dropped whenever any prefix/substring hit * exists, so a real match is never buried under noise. * * Group labels participate in the match: when a group's label fuzzy-matches the query, the * entire group (header + every child) is included regardless of whether the children * themselves matched. */ export declare const runFuseSearch: (fuse: Fuse>, query: string, items: SelectItem[]) => SelectItem[];