import { KeyboardEvent } from 'react'; import { PhoneCountryChoice } from './types'; /** * Matches on localized name **or** calling code, so both `"Norway"` and `"47"` narrow the list * to +47 (ASMA-7485). A leading `+` is ignored so pasting `+47` works. */ export declare function matchesCountryQuery(country: PhoneCountryChoice, query: string): boolean; export interface UseCountryPickerOptions { countries: readonly PhoneCountryChoice[]; selectedIso2: string; query: string; listId: string; onSelect: (iso2: string, close?: boolean) => void; onDismiss: () => void; } export interface CountryPicker { visible: readonly PhoneCountryChoice[]; activeIndex: number | null; optionId: (index: number) => string; openWithKeyboard: (direction: -1 | 1) => void; select: (iso2: string) => void; dismiss: () => void; handleKeyDown: (event: KeyboardEvent) => void; } /** * Filtering, active-row tracking and keyboard behaviour for the country picker — shared by the * desktop trigger (which is itself the combobox) and the mobile sheet (which has its own search * box), so the two presentations cannot drift apart on what typing or arrowing does. * * The active row is tracked by country rather than by index: filtering renumbers every index, and * an index would need an effect to stay in range — a re-render behind the list it describes. */ export declare function useCountryPicker({ countries, selectedIso2, query, listId, onSelect, onDismiss, }: UseCountryPickerOptions): CountryPicker;