UNPKG

@maptiler/geocoding-control

Version:

The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.

61 lines (60 loc) 2.42 kB
import { convert } from 'geo-coordinates-parser'; import { Feature, FeatureCollection } from '../types'; export declare namespace MaptilerGeocoderEvent { type ReverseToggleEvent = CustomEvent<{ reverse: boolean; }>; type QueryChangeEvent = CustomEvent<{ query: string; reverseCoords: ReturnType<typeof convert> | false; }>; type QueryClearEvent = CustomEvent<void>; type RequestEvent = CustomEvent<{ urlObj: URL; }>; type ResponseEvent = CustomEvent<{ url: string; featureCollection: FeatureCollection; }>; type SelectEvent = CustomEvent<{ feature: Feature | undefined; }>; type PickEvent = CustomEvent<{ feature: Feature | undefined; }>; type FeaturesShowEvent = CustomEvent<void>; type FeaturesHideEvent = CustomEvent<void>; type FeaturesListedEvent = CustomEvent<{ features: Feature[] | undefined; external: boolean; }>; type FeaturesClearEvent = CustomEvent<void>; } export type ReverseToggleEvent = MaptilerGeocoderEvent.ReverseToggleEvent; export type QueryChangeEvent = MaptilerGeocoderEvent.QueryChangeEvent; export type QueryClearEvent = MaptilerGeocoderEvent.QueryClearEvent; export type RequestEvent = MaptilerGeocoderEvent.RequestEvent; export type ResponseEvent = MaptilerGeocoderEvent.ResponseEvent; export type SelectEvent = MaptilerGeocoderEvent.SelectEvent; export type PickEvent = MaptilerGeocoderEvent.PickEvent; export type FeaturesShowEvent = MaptilerGeocoderEvent.FeaturesShowEvent; export type FeaturesHideEvent = MaptilerGeocoderEvent.FeaturesHideEvent; export type FeaturesListedEvent = MaptilerGeocoderEvent.FeaturesListedEvent; export type FeaturesClearEvent = MaptilerGeocoderEvent.FeaturesClearEvent; export type MaptilerGeocoderEventNameMap = { reversetoggle: ReverseToggleEvent; querychange: QueryChangeEvent; queryclear: QueryClearEvent; request: RequestEvent; response: ResponseEvent; select: SelectEvent; pick: PickEvent; featuresshow: FeaturesShowEvent; featureshide: FeaturesHideEvent; featureslisted: FeaturesListedEvent; featuresclear: FeaturesClearEvent; focusin: FocusEvent; focusout: FocusEvent; }; export type MaptilerGeocoderEvent = MaptilerGeocoderEventNameMap[keyof MaptilerGeocoderEventNameMap]; export type MaptilerGeocoderEventName = keyof MaptilerGeocoderEventNameMap;