import type { SelectEntry, SelectOptionEntry } from './mud-select.types'; /** One choice, paired with its position in the flat option list. */ export interface SelectRowOption { option: SelectOptionEntry; index: number; } /** What the listbox lays out: a loose choice, a rule, or a labelled run of choices. */ export type SelectRow = ({ kind: 'option'; } & SelectRowOption) | { kind: 'separator'; } | { kind: 'group'; label: string; options: SelectRowOption[]; }; /** * Drops rules that have nothing to divide: at either end of the list, doubled * up, or against a group heading, which draws its own rule above its label. * A native `` would start on: the first selectable option * marked `selected`. Returns `undefined` when the markup marks none, so the * caller can leave `value` alone rather than guessing. */ export declare const markupSelectedValue: (entries: SelectEntry[]) => string | undefined; /** * Rebuilds the nesting the flat model threw away, so a group can render as one * `role="group"` around its own choices. * * A heading owns every choice up to the next heading or rule. `index` counts * choices in document order and ignores the nesting, which is what keeps it in * step with the flat list the keyboard walks. */ export declare const toRows: (entries: SelectEntry[]) => SelectRow[]; /** * Folds case and strips diacritics so a query matches text the user cannot * easily type. * * Decomposes and drops combining marks rather than carrying a character map: * that covers Romanian in both spellings — `ș`/`ț` written with the correct * comma below (U+0219, U+021B) and with the cedilla (U+015F, U+0163) that * legacy data still uses — without a table to maintain. */ export declare const foldForSearch: (value: string) => string; /** * Whether an option answers the query, following react-select's `createFilter` * defaults: the query is trimmed, case and accents are ignored, and the label * and value are searched together as one string. */ export declare const optionMatches: (option: SelectOptionEntry, query: string) => boolean; /** * Narrows the model to what answers the query. * * A group survives only while it still has a matching option — an empty heading * names nothing — and rules are re-collapsed afterwards, since removing the * options around one can leave it dividing nothing. */ export declare const filterEntries: (entries: SelectEntry[], query: string) => SelectEntry[];