UNPKG

@maptiler/geocoding-control

Version:

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

72 lines (71 loc) 3.56 kB
import { LeafletEvent, Marker } from 'leaflet'; import { MaptilerGeocoderEvent } from '../geocoder/geocoder-events'; import { Feature } from '../types'; import { LeafletGeocodingControl } from './leaflet-control'; type BaseEvent = Pick<LeafletEvent, "type" | "target"> & { target: LeafletGeocodingControl; }; export declare namespace LeafletGeocodingControlEvent { type ReverseToggleEvent = BaseEvent & MaptilerGeocoderEvent.ReverseToggleEvent["detail"]; type QueryChangeEvent = BaseEvent & MaptilerGeocoderEvent.QueryChangeEvent["detail"]; type QueryClearEvent = BaseEvent; type RequestEvent = BaseEvent & MaptilerGeocoderEvent.RequestEvent["detail"]; type ResponseEvent = BaseEvent & MaptilerGeocoderEvent.ResponseEvent["detail"]; type SelectEvent = BaseEvent & MaptilerGeocoderEvent.SelectEvent["detail"]; type PickEvent = BaseEvent & MaptilerGeocoderEvent.PickEvent["detail"]; type FeaturesShowEvent = BaseEvent; type FeaturesHideEvent = BaseEvent; type FeaturesListedEvent = BaseEvent & MaptilerGeocoderEvent.FeaturesListedEvent["detail"]; type FeaturesClearEvent = BaseEvent; type FocusInEvent = BaseEvent; type FocusOutEvent = BaseEvent; type MarkerClickEvent = BaseEvent & { feature: Feature; marker: Marker; }; type MarkerMouseEnterEvent = BaseEvent & { feature: Feature; marker: Marker; }; type MarkerMouseLeaveEvent = BaseEvent & { feature: Feature; marker: Marker; }; } export type ReverseToggleEvent = LeafletGeocodingControlEvent.ReverseToggleEvent; export type QueryChangeEvent = LeafletGeocodingControlEvent.QueryChangeEvent; export type QueryClearEvent = LeafletGeocodingControlEvent.QueryClearEvent; export type RequestEvent = LeafletGeocodingControlEvent.RequestEvent; export type ResponseEvent = LeafletGeocodingControlEvent.ResponseEvent; export type SelectEvent = LeafletGeocodingControlEvent.SelectEvent; export type PickEvent = LeafletGeocodingControlEvent.PickEvent; export type FeaturesShowEvent = LeafletGeocodingControlEvent.FeaturesShowEvent; export type FeaturesHideEvent = LeafletGeocodingControlEvent.FeaturesHideEvent; export type FeaturesListedEvent = LeafletGeocodingControlEvent.FeaturesListedEvent; export type FeaturesClearEvent = LeafletGeocodingControlEvent.FeaturesClearEvent; export type FocusInEvent = LeafletGeocodingControlEvent.FocusInEvent; export type FocusOutEvent = LeafletGeocodingControlEvent.FocusOutEvent; export type MarkerClickEvent = LeafletGeocodingControlEvent.MarkerClickEvent; export type MarkerMouseEnterEvent = LeafletGeocodingControlEvent.MarkerMouseEnterEvent; export type MarkerMouseLeaveEvent = LeafletGeocodingControlEvent.MarkerMouseLeaveEvent; export type LeafletGeocodingControlEventNameMap = { reversetoggle: ReverseToggleEvent; querychange: QueryChangeEvent; queryclear: QueryClearEvent; request: RequestEvent; response: ResponseEvent; select: SelectEvent; pick: PickEvent; featuresshow: FeaturesShowEvent; featureshide: FeaturesHideEvent; featureslisted: FeaturesListedEvent; featuresclear: FeaturesClearEvent; focusin: FocusInEvent; focusout: FocusOutEvent; markerclick: MarkerClickEvent; markermouseenter: MarkerMouseEnterEvent; markermouseleave: MarkerMouseLeaveEvent; }; export type LeafletGeocodingControlEvent = LeafletGeocodingControlEventNameMap[keyof LeafletGeocodingControlEventNameMap]; export type LeafletGeocodingControlEventName = keyof LeafletGeocodingControlEventNameMap; export {};