import { type PropertyValues } from 'lit'; import { RoxyLocalizedElement } from '../i18n/localized-element.js'; /** * Stateful location search input. Calls /location/search and emits * `roxy-location-select` CustomEvent with the chosen city. Required for any * chart endpoint. * * Behavior: 300ms input debounce, click-outside dismiss, keyboard navigation * with arrow keys / Enter / Escape, AbortController on stale requests. A search * that fails prints the reason under the field and keeps it there until the * query changes, so a key or quota fault is legible where it happens instead of * surfacing later as a missing field on submit. * * Attributes: * api-key optional. Direct call to roxyapi.com when set. * publishable-key optional. Browser-safe pk_* key with allowed_origins. * endpoint optional. Where the search sends its request. Absolute, or relative to the * page, so a site that routes API traffic through its own server names that * route here. Defaults to the public location endpoint. * placeholder optional. Input placeholder. Translated when it is the default (see below). * default-value optional. Pre-filled query. * lang optional. Display language. Resolves from the page when absent, EXCEPT * inside another component shadow root, which is why the form forwards it. * * The words this box writes (its placeholder, its empty state, its busy label, its refusal * message) read the page language. The CITY NAMES do not: they are the values the location API * returned and are printed as they came back, so the box and the response can never disagree. */ export declare class RoxyLocationSearch extends RoxyLocalizedElement { static styles: import("lit").CSSResult[]; apiKey?: string; publishableKey?: string; /** Where the search sends its request. Built from {@link DEFAULT_BASE_URL} rather than written out again, so this box and every data request name one origin. */ endpoint: string; /** Input placeholder. The default is a catalogue entry and renders in the page language; a caller-supplied one is printed as given, because a miss returns the source string unchanged. */ placeholder: string; defaultValue: string; private query; private results; private isOpen; private isLoading; private highlight; /** True when a non-publishable key is present, so the search fail-closes: no network call, a visible error, matching {@link FetchController}. */ private keyBlocked; /** Message from the last failed search, or null. Rendered under the field and outliving the dropdown, so a failed request reads as a failure rather than as a city that does not exist. */ private error; private clickOutsideHandler?; private abortController?; private debouncedFetch; connectedCallback(): void; protected willUpdate(changed: PropertyValues): void; disconnectedCallback(): void; private fetchResults; private onInput; private select; private onKeyDown; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'roxy-location-search': RoxyLocationSearch; } } //# sourceMappingURL=location-search.d.ts.map