@maptiler/geocoding-control 3.0.0-rc.4 → 3.0.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,42 +1,71 @@
1
- import { Marker } from 'leaflet';
1
+ import { LeafletEvent, Marker } from 'leaflet';
2
+ import { MaptilerGeocoderEvent } from '../geocoder/geocoder-events';
2
3
  import { Feature } from '../types';
3
- import type * as Geocoder from "../geocoder/geocoder-events";
4
- export type ReverseToggleEvent = Geocoder.ReverseToggleEvent["detail"];
5
- export type QueryChangeEvent = Geocoder.QueryChangeEvent["detail"];
6
- export type FeaturesListedEvent = Geocoder.FeaturesListedEvent["detail"];
7
- export type RequestEvent = Geocoder.RequestEvent["detail"];
8
- export type ResponseEvent = Geocoder.ResponseEvent["detail"];
9
- export type SelectEvent = Geocoder.SelectEvent["detail"];
10
- export type PickEvent = Geocoder.PickEvent["detail"];
11
- export type MarkerClickEvent = {
12
- feature: Feature;
13
- marker: Marker;
14
- };
15
- export type MarkerMouseEnterEvent = {
16
- feature: Feature;
17
- marker: Marker;
18
- };
19
- export type MarkerMouseLeaveEvent = {
20
- feature: Feature;
21
- marker: Marker;
4
+ import { LeafletGeocodingControl } from './leaflet-control';
5
+ type BaseEvent = Pick<LeafletEvent, "type" | "target"> & {
6
+ target: LeafletGeocodingControl;
22
7
  };
8
+ export declare namespace LeafletGeocodingControlEvent {
9
+ type ReverseToggleEvent = BaseEvent & MaptilerGeocoderEvent.ReverseToggleEvent["detail"];
10
+ type QueryChangeEvent = BaseEvent & MaptilerGeocoderEvent.QueryChangeEvent["detail"];
11
+ type QueryClearEvent = BaseEvent;
12
+ type RequestEvent = BaseEvent & MaptilerGeocoderEvent.RequestEvent["detail"];
13
+ type ResponseEvent = BaseEvent & MaptilerGeocoderEvent.ResponseEvent["detail"];
14
+ type SelectEvent = BaseEvent & MaptilerGeocoderEvent.SelectEvent["detail"];
15
+ type PickEvent = BaseEvent & MaptilerGeocoderEvent.PickEvent["detail"];
16
+ type FeaturesShowEvent = BaseEvent;
17
+ type FeaturesHideEvent = BaseEvent;
18
+ type FeaturesListedEvent = BaseEvent & MaptilerGeocoderEvent.FeaturesListedEvent["detail"];
19
+ type FeaturesClearEvent = BaseEvent;
20
+ type FocusInEvent = BaseEvent;
21
+ type FocusOutEvent = BaseEvent;
22
+ type MarkerClickEvent = BaseEvent & {
23
+ feature: Feature;
24
+ marker: Marker;
25
+ };
26
+ type MarkerMouseEnterEvent = BaseEvent & {
27
+ feature: Feature;
28
+ marker: Marker;
29
+ };
30
+ type MarkerMouseLeaveEvent = BaseEvent & {
31
+ feature: Feature;
32
+ marker: Marker;
33
+ };
34
+ }
35
+ export type ReverseToggleEvent = LeafletGeocodingControlEvent.ReverseToggleEvent;
36
+ export type QueryChangeEvent = LeafletGeocodingControlEvent.QueryChangeEvent;
37
+ export type QueryClearEvent = LeafletGeocodingControlEvent.QueryClearEvent;
38
+ export type RequestEvent = LeafletGeocodingControlEvent.RequestEvent;
39
+ export type ResponseEvent = LeafletGeocodingControlEvent.ResponseEvent;
40
+ export type SelectEvent = LeafletGeocodingControlEvent.SelectEvent;
41
+ export type PickEvent = LeafletGeocodingControlEvent.PickEvent;
42
+ export type FeaturesShowEvent = LeafletGeocodingControlEvent.FeaturesShowEvent;
43
+ export type FeaturesHideEvent = LeafletGeocodingControlEvent.FeaturesHideEvent;
44
+ export type FeaturesListedEvent = LeafletGeocodingControlEvent.FeaturesListedEvent;
45
+ export type FeaturesClearEvent = LeafletGeocodingControlEvent.FeaturesClearEvent;
46
+ export type FocusInEvent = LeafletGeocodingControlEvent.FocusInEvent;
47
+ export type FocusOutEvent = LeafletGeocodingControlEvent.FocusOutEvent;
48
+ export type MarkerClickEvent = LeafletGeocodingControlEvent.MarkerClickEvent;
49
+ export type MarkerMouseEnterEvent = LeafletGeocodingControlEvent.MarkerMouseEnterEvent;
50
+ export type MarkerMouseLeaveEvent = LeafletGeocodingControlEvent.MarkerMouseLeaveEvent;
23
51
  export type LeafletGeocodingControlEventNameMap = {
24
52
  reversetoggle: ReverseToggleEvent;
25
53
  querychange: QueryChangeEvent;
26
- queryclear: never;
54
+ queryclear: QueryClearEvent;
27
55
  request: RequestEvent;
28
56
  response: ResponseEvent;
29
57
  select: SelectEvent;
30
58
  pick: PickEvent;
31
- featuresshow: never;
32
- featureshide: never;
59
+ featuresshow: FeaturesShowEvent;
60
+ featureshide: FeaturesHideEvent;
33
61
  featureslisted: FeaturesListedEvent;
34
- featuresclear: never;
35
- focusin: never;
36
- focusout: never;
62
+ featuresclear: FeaturesClearEvent;
63
+ focusin: FocusInEvent;
64
+ focusout: FocusOutEvent;
37
65
  markerclick: MarkerClickEvent;
38
66
  markermouseenter: MarkerMouseEnterEvent;
39
67
  markermouseleave: MarkerMouseLeaveEvent;
40
68
  };
41
69
  export type LeafletGeocodingControlEvent = LeafletGeocodingControlEventNameMap[keyof LeafletGeocodingControlEventNameMap];
42
70
  export type LeafletGeocodingControlEventName = keyof LeafletGeocodingControlEventNameMap;
71
+ export {};
@@ -1,40 +1,69 @@
1
1
  import { default as maplibregl } from 'maplibre-gl';
2
+ import { MaptilerGeocoderEvent } from '../geocoder/geocoder-events';
2
3
  import { Feature } from '../types';
4
+ import { MaplibreglGeocodingControl } from './maplibregl-control';
3
5
  type Marker = maplibregl.Marker;
4
- import type * as Geocoder from "../geocoder/geocoder-events";
5
- export type ReverseToggleEvent = Geocoder.ReverseToggleEvent["detail"];
6
- export type QueryChangeEvent = Geocoder.QueryChangeEvent["detail"];
7
- export type FeaturesListedEvent = Geocoder.FeaturesListedEvent["detail"];
8
- export type RequestEvent = Geocoder.RequestEvent["detail"];
9
- export type ResponseEvent = Geocoder.ResponseEvent["detail"];
10
- export type SelectEvent = Geocoder.SelectEvent["detail"];
11
- export type PickEvent = Geocoder.PickEvent["detail"];
12
- export type MarkerClickEvent = {
13
- feature: Feature;
14
- marker: Marker;
15
- };
16
- export type MarkerMouseEnterEvent = {
17
- feature: Feature;
18
- marker: Marker;
19
- };
20
- export type MarkerMouseLeaveEvent = {
21
- feature: Feature;
22
- marker: Marker;
6
+ type MLEvent = Extract<Parameters<maplibregl.Evented["fire"]>[0], object>;
7
+ type BaseEvent = MLEvent & {
8
+ target: MaplibreglGeocodingControl;
23
9
  };
10
+ export declare namespace MaplibreglGeocodingControlEvent {
11
+ type ReverseToggleEvent = BaseEvent & MaptilerGeocoderEvent.ReverseToggleEvent["detail"];
12
+ type QueryChangeEvent = BaseEvent & MaptilerGeocoderEvent.QueryChangeEvent["detail"];
13
+ type QueryClearEvent = BaseEvent;
14
+ type RequestEvent = BaseEvent & MaptilerGeocoderEvent.RequestEvent["detail"];
15
+ type ResponseEvent = BaseEvent & MaptilerGeocoderEvent.ResponseEvent["detail"];
16
+ type SelectEvent = BaseEvent & MaptilerGeocoderEvent.SelectEvent["detail"];
17
+ type PickEvent = BaseEvent & MaptilerGeocoderEvent.PickEvent["detail"];
18
+ type FeaturesShowEvent = BaseEvent;
19
+ type FeaturesHideEvent = BaseEvent;
20
+ type FeaturesListedEvent = BaseEvent & MaptilerGeocoderEvent.FeaturesListedEvent["detail"];
21
+ type FeaturesClearEvent = BaseEvent;
22
+ type FocusInEvent = BaseEvent;
23
+ type FocusOutEvent = BaseEvent;
24
+ type MarkerClickEvent = BaseEvent & {
25
+ feature: Feature;
26
+ marker: Marker;
27
+ };
28
+ type MarkerMouseEnterEvent = BaseEvent & {
29
+ feature: Feature;
30
+ marker: Marker;
31
+ };
32
+ type MarkerMouseLeaveEvent = BaseEvent & {
33
+ feature: Feature;
34
+ marker: Marker;
35
+ };
36
+ }
37
+ export type ReverseToggleEvent = MaplibreglGeocodingControlEvent.ReverseToggleEvent;
38
+ export type QueryChangeEvent = MaplibreglGeocodingControlEvent.QueryChangeEvent;
39
+ export type QueryClearEvent = MaplibreglGeocodingControlEvent.QueryClearEvent;
40
+ export type RequestEvent = MaplibreglGeocodingControlEvent.RequestEvent;
41
+ export type ResponseEvent = MaplibreglGeocodingControlEvent.ResponseEvent;
42
+ export type SelectEvent = MaplibreglGeocodingControlEvent.SelectEvent;
43
+ export type PickEvent = MaplibreglGeocodingControlEvent.PickEvent;
44
+ export type FeaturesShowEvent = MaplibreglGeocodingControlEvent.FeaturesShowEvent;
45
+ export type FeaturesHideEvent = MaplibreglGeocodingControlEvent.FeaturesHideEvent;
46
+ export type FeaturesListedEvent = MaplibreglGeocodingControlEvent.FeaturesListedEvent;
47
+ export type FeaturesClearEvent = MaplibreglGeocodingControlEvent.FeaturesClearEvent;
48
+ export type FocusInEvent = MaplibreglGeocodingControlEvent.FocusInEvent;
49
+ export type FocusOutEvent = MaplibreglGeocodingControlEvent.FocusOutEvent;
50
+ export type MarkerClickEvent = MaplibreglGeocodingControlEvent.MarkerClickEvent;
51
+ export type MarkerMouseEnterEvent = MaplibreglGeocodingControlEvent.MarkerMouseEnterEvent;
52
+ export type MarkerMouseLeaveEvent = MaplibreglGeocodingControlEvent.MarkerMouseLeaveEvent;
24
53
  export type MaplibreglGeocodingControlEventNameMap = {
25
54
  reversetoggle: ReverseToggleEvent;
26
55
  querychange: QueryChangeEvent;
27
- queryclear: never;
56
+ queryclear: QueryClearEvent;
28
57
  request: RequestEvent;
29
58
  response: ResponseEvent;
30
59
  select: SelectEvent;
31
60
  pick: PickEvent;
32
- featuresshow: never;
33
- featureshide: never;
61
+ featuresshow: FeaturesShowEvent;
62
+ featureshide: FeaturesHideEvent;
34
63
  featureslisted: FeaturesListedEvent;
35
- featuresclear: never;
36
- focusin: never;
37
- focusout: never;
64
+ featuresclear: FeaturesClearEvent;
65
+ focusin: FocusInEvent;
66
+ focusout: FocusOutEvent;
38
67
  markerclick: MarkerClickEvent;
39
68
  markermouseenter: MarkerMouseEnterEvent;
40
69
  markermouseleave: MarkerMouseLeaveEvent;
@@ -1,7 +1,13 @@
1
- import { Map as SDKMap } from '@maptiler/sdk';
1
+ import { Map as SDKMap, Subscription } from '@maptiler/sdk';
2
2
  import { GeocodingControlBase } from './base-control';
3
3
  import { MaplibreglGeocodingControl } from './maplibregl-control';
4
+ import { MaptilerGeocodingControlEventName, MaptilerGeocodingControlEventNameMap } from './maptilersdk-events';
4
5
  import { MaptilerGeocodingControlOptions } from './maptilersdk-options';
6
+ type EventHandlingMethod<Return> = <Type extends MaptilerGeocodingControlEventName>(type: Type, listener: (event: MaptilerGeocodingControlEventNameMap[Type]) => void) => Return;
7
+ interface EventOnceHandlingMethod<Return> {
8
+ <Type extends MaptilerGeocodingControlEventName>(type: Type, listener: (event: MaptilerGeocodingControlEventNameMap[Type]) => void): Return;
9
+ <Type extends MaptilerGeocodingControlEventName>(type: Type, listener?: undefined): Promise<MaptilerGeocodingControlEventNameMap[Type]>;
10
+ }
5
11
  export declare class MaptilerGeocodingControl extends MaplibreglGeocodingControl implements GeocodingControlBase<MaptilerGeocodingControlOptions> {
6
12
  #private;
7
13
  constructor(options?: MaptilerGeocodingControlOptions);
@@ -11,4 +17,8 @@ export declare class MaptilerGeocodingControl extends MaplibreglGeocodingControl
11
17
  onRemove(): void;
12
18
  getOptions: () => MaptilerGeocodingControlOptions;
13
19
  setOptions(options: MaptilerGeocodingControlOptions): void;
20
+ on: EventHandlingMethod<Subscription>;
21
+ off: EventHandlingMethod<this>;
22
+ once: EventOnceHandlingMethod<this>;
14
23
  }
24
+ export {};
@@ -1,2 +1,72 @@
1
- import { FeaturesListedEvent, MaplibreglGeocodingControlEvent, MaplibreglGeocodingControlEventName, MaplibreglGeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, PickEvent, QueryChangeEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent } from './maplibregl-events';
2
- export type { FeaturesListedEvent, MaplibreglGeocodingControlEvent as MaptilerGeocodingControlEvent, MaplibreglGeocodingControlEventName as MaptilerGeocodingControlEventName, MaplibreglGeocodingControlEventNameMap as MaptilerGeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, PickEvent, QueryChangeEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent, };
1
+ import { Marker, Map as SDKMap } from '@maptiler/sdk';
2
+ import { MaptilerGeocoderEvent } from '../geocoder/geocoder-events';
3
+ import { Feature } from '../types';
4
+ import { MaptilerGeocodingControl } from './maptilersdk-control';
5
+ type SDKEvent = Extract<Parameters<SDKMap["fire"]>[0], object>;
6
+ type BaseEvent = SDKEvent & {
7
+ target: MaptilerGeocodingControl;
8
+ };
9
+ export declare namespace MaptilerGeocodingControlEvent {
10
+ type ReverseToggleEvent = BaseEvent & MaptilerGeocoderEvent.ReverseToggleEvent["detail"];
11
+ type QueryChangeEvent = BaseEvent & MaptilerGeocoderEvent.QueryChangeEvent["detail"];
12
+ type QueryClearEvent = BaseEvent;
13
+ type RequestEvent = BaseEvent & MaptilerGeocoderEvent.RequestEvent["detail"];
14
+ type ResponseEvent = BaseEvent & MaptilerGeocoderEvent.ResponseEvent["detail"];
15
+ type SelectEvent = BaseEvent & MaptilerGeocoderEvent.SelectEvent["detail"];
16
+ type PickEvent = BaseEvent & MaptilerGeocoderEvent.PickEvent["detail"];
17
+ type FeaturesShowEvent = BaseEvent;
18
+ type FeaturesHideEvent = BaseEvent;
19
+ type FeaturesListedEvent = BaseEvent & MaptilerGeocoderEvent.FeaturesListedEvent["detail"];
20
+ type FeaturesClearEvent = BaseEvent;
21
+ type FocusInEvent = BaseEvent;
22
+ type FocusOutEvent = BaseEvent;
23
+ type MarkerClickEvent = BaseEvent & {
24
+ feature: Feature;
25
+ marker: Marker;
26
+ };
27
+ type MarkerMouseEnterEvent = BaseEvent & {
28
+ feature: Feature;
29
+ marker: Marker;
30
+ };
31
+ type MarkerMouseLeaveEvent = BaseEvent & {
32
+ feature: Feature;
33
+ marker: Marker;
34
+ };
35
+ }
36
+ export type ReverseToggleEvent = MaptilerGeocodingControlEvent.ReverseToggleEvent;
37
+ export type QueryChangeEvent = MaptilerGeocodingControlEvent.QueryChangeEvent;
38
+ export type QueryClearEvent = MaptilerGeocodingControlEvent.QueryClearEvent;
39
+ export type RequestEvent = MaptilerGeocodingControlEvent.RequestEvent;
40
+ export type ResponseEvent = MaptilerGeocodingControlEvent.ResponseEvent;
41
+ export type SelectEvent = MaptilerGeocodingControlEvent.SelectEvent;
42
+ export type PickEvent = MaptilerGeocodingControlEvent.PickEvent;
43
+ export type FeaturesShowEvent = MaptilerGeocodingControlEvent.FeaturesShowEvent;
44
+ export type FeaturesHideEvent = MaptilerGeocodingControlEvent.FeaturesHideEvent;
45
+ export type FeaturesListedEvent = MaptilerGeocodingControlEvent.FeaturesListedEvent;
46
+ export type FeaturesClearEvent = MaptilerGeocodingControlEvent.FeaturesClearEvent;
47
+ export type FocusInEvent = MaptilerGeocodingControlEvent.FocusInEvent;
48
+ export type FocusOutEvent = MaptilerGeocodingControlEvent.FocusOutEvent;
49
+ export type MarkerClickEvent = MaptilerGeocodingControlEvent.MarkerClickEvent;
50
+ export type MarkerMouseEnterEvent = MaptilerGeocodingControlEvent.MarkerMouseEnterEvent;
51
+ export type MarkerMouseLeaveEvent = MaptilerGeocodingControlEvent.MarkerMouseLeaveEvent;
52
+ export type MaptilerGeocodingControlEventNameMap = {
53
+ reversetoggle: ReverseToggleEvent;
54
+ querychange: QueryChangeEvent;
55
+ queryclear: QueryClearEvent;
56
+ request: RequestEvent;
57
+ response: ResponseEvent;
58
+ select: SelectEvent;
59
+ pick: PickEvent;
60
+ featuresshow: FeaturesShowEvent;
61
+ featureshide: FeaturesHideEvent;
62
+ featureslisted: FeaturesListedEvent;
63
+ featuresclear: FeaturesClearEvent;
64
+ focusin: FocusInEvent;
65
+ focusout: FocusOutEvent;
66
+ markerclick: MarkerClickEvent;
67
+ markermouseenter: MarkerMouseEnterEvent;
68
+ markermouseleave: MarkerMouseLeaveEvent;
69
+ };
70
+ export type MaptilerGeocodingControlEvent = MaptilerGeocodingControlEventNameMap[keyof MaptilerGeocodingControlEventNameMap];
71
+ export type MaptilerGeocodingControlEventName = keyof MaptilerGeocodingControlEventNameMap;
72
+ export {};
@@ -3,17 +3,17 @@ import { Types as ObjectEventTypes } from 'ol/ObjectEventType';
3
3
  import { EventTypes } from 'ol/Observable';
4
4
  import { Control } from 'ol/control';
5
5
  import { EventsKey } from 'ol/events';
6
- import { default as BaseEvent } from 'ol/events/Event';
6
+ import { default as OLEvent } from 'ol/events/Event';
7
7
  import { GeocodingControlBase } from './base-control';
8
8
  import { OpenLayersGeocodingControlEventName, OpenLayersGeocodingControlEventNameMap } from './openlayers-events';
9
9
  import { OpenLayersGeocodingControlOptions } from './openlayers-options';
10
- type TypedBaseEvent<Type extends OpenLayersGeocodingControlEventName> = BaseEvent & {
10
+ type TypedBaseEvent<Type extends OpenLayersGeocodingControlEventName> = OLEvent & {
11
11
  type: Type;
12
12
  } & OpenLayersGeocodingControlEventNameMap[Type];
13
13
  interface EventHandlingMethod {
14
- (type: EventTypes | ObjectEventTypes, listener: (event: BaseEvent) => unknown): EventsKey;
14
+ (type: EventTypes | ObjectEventTypes, listener: (event: OLEvent) => unknown): EventsKey;
15
15
  <Type extends OpenLayersGeocodingControlEventName>(type: Type, listener: (event: TypedBaseEvent<Type>) => unknown): EventsKey;
16
- (type: Array<EventTypes | ObjectEventTypes | OpenLayersGeocodingControlEventName>, listener: (event: BaseEvent) => unknown): EventsKey[];
16
+ (type: Array<EventTypes | ObjectEventTypes | OpenLayersGeocodingControlEventName>, listener: (event: OLEvent) => unknown): EventsKey[];
17
17
  }
18
18
  export declare class OpenLayersGeocodingControl extends Control implements GeocodingControlBase<OpenLayersGeocodingControlOptions> {
19
19
  #private;
@@ -1,43 +1,73 @@
1
1
  import { Feature as OlFeature } from 'ol';
2
+ import { default as OLEvent } from 'ol/events/Event';
2
3
  import { Point as OlPoint } from 'ol/geom';
4
+ import { MaptilerGeocoderEvent } from '../geocoder/geocoder-events';
3
5
  import { Feature } from '../types';
4
- import type * as Geocoder from "../geocoder/geocoder-events";
5
- export type ReverseToggleEvent = Geocoder.ReverseToggleEvent["detail"];
6
- export type QueryChangeEvent = Geocoder.QueryChangeEvent["detail"];
7
- export type FeaturesListedEvent = Geocoder.FeaturesListedEvent["detail"];
8
- export type RequestEvent = Geocoder.RequestEvent["detail"];
9
- export type ResponseEvent = Geocoder.ResponseEvent["detail"];
10
- export type SelectEvent = Geocoder.SelectEvent["detail"];
11
- export type PickEvent = Geocoder.PickEvent["detail"];
12
- export type MarkerClickEvent = {
13
- feature: Feature;
14
- marker: OlFeature<OlPoint>;
15
- };
16
- export type MarkerMouseEnterEvent = {
17
- feature: Feature;
18
- marker: OlFeature<OlPoint>;
19
- };
20
- export type MarkerMouseLeaveEvent = {
21
- feature: Feature;
22
- marker: OlFeature<OlPoint>;
6
+ import { OpenLayersGeocodingControl } from './openlayers-control';
7
+ type BaseEvent = OLEvent & {
8
+ target: OpenLayersGeocodingControl;
23
9
  };
10
+ export declare namespace OpenLayersGeocodingControlEvent {
11
+ type ReverseToggleEvent = BaseEvent & MaptilerGeocoderEvent.ReverseToggleEvent["detail"];
12
+ type QueryChangeEvent = BaseEvent & MaptilerGeocoderEvent.QueryChangeEvent["detail"];
13
+ type QueryClearEvent = BaseEvent;
14
+ type RequestEvent = BaseEvent & MaptilerGeocoderEvent.RequestEvent["detail"];
15
+ type ResponseEvent = BaseEvent & MaptilerGeocoderEvent.ResponseEvent["detail"];
16
+ type SelectEvent = BaseEvent & MaptilerGeocoderEvent.SelectEvent["detail"];
17
+ type PickEvent = BaseEvent & MaptilerGeocoderEvent.PickEvent["detail"];
18
+ type FeaturesShowEvent = BaseEvent;
19
+ type FeaturesHideEvent = BaseEvent;
20
+ type FeaturesListedEvent = BaseEvent & MaptilerGeocoderEvent.FeaturesListedEvent["detail"];
21
+ type FeaturesClearEvent = BaseEvent;
22
+ type FocusInEvent = BaseEvent;
23
+ type FocusOutEvent = BaseEvent;
24
+ type MarkerClickEvent = BaseEvent & {
25
+ feature: Feature;
26
+ marker: OlFeature<OlPoint>;
27
+ };
28
+ type MarkerMouseEnterEvent = BaseEvent & {
29
+ feature: Feature;
30
+ marker: OlFeature<OlPoint>;
31
+ };
32
+ type MarkerMouseLeaveEvent = BaseEvent & {
33
+ feature: Feature;
34
+ marker: OlFeature<OlPoint>;
35
+ };
36
+ }
37
+ export type ReverseToggleEvent = OpenLayersGeocodingControlEvent.ReverseToggleEvent;
38
+ export type QueryChangeEvent = OpenLayersGeocodingControlEvent.QueryChangeEvent;
39
+ export type QueryClearEvent = OpenLayersGeocodingControlEvent.QueryClearEvent;
40
+ export type RequestEvent = OpenLayersGeocodingControlEvent.RequestEvent;
41
+ export type ResponseEvent = OpenLayersGeocodingControlEvent.ResponseEvent;
42
+ export type SelectEvent = OpenLayersGeocodingControlEvent.SelectEvent;
43
+ export type PickEvent = OpenLayersGeocodingControlEvent.PickEvent;
44
+ export type FeaturesShowEvent = OpenLayersGeocodingControlEvent.FeaturesShowEvent;
45
+ export type FeaturesHideEvent = OpenLayersGeocodingControlEvent.FeaturesHideEvent;
46
+ export type FeaturesListedEvent = OpenLayersGeocodingControlEvent.FeaturesListedEvent;
47
+ export type FeaturesClearEvent = OpenLayersGeocodingControlEvent.FeaturesClearEvent;
48
+ export type FocusInEvent = OpenLayersGeocodingControlEvent.FocusInEvent;
49
+ export type FocusOutEvent = OpenLayersGeocodingControlEvent.FocusOutEvent;
50
+ export type MarkerClickEvent = OpenLayersGeocodingControlEvent.MarkerClickEvent;
51
+ export type MarkerMouseEnterEvent = OpenLayersGeocodingControlEvent.MarkerMouseEnterEvent;
52
+ export type MarkerMouseLeaveEvent = OpenLayersGeocodingControlEvent.MarkerMouseLeaveEvent;
24
53
  export type OpenLayersGeocodingControlEventNameMap = {
25
54
  reversetoggle: ReverseToggleEvent;
26
55
  querychange: QueryChangeEvent;
27
- queryclear: never;
56
+ queryclear: QueryClearEvent;
28
57
  request: RequestEvent;
29
58
  response: ResponseEvent;
30
59
  select: SelectEvent;
31
60
  pick: PickEvent;
32
- featuresshow: never;
33
- featureshide: never;
61
+ featuresshow: FeaturesShowEvent;
62
+ featureshide: FeaturesHideEvent;
34
63
  featureslisted: FeaturesListedEvent;
35
- featuresclear: never;
36
- focusin: never;
37
- focusout: never;
64
+ featuresclear: FeaturesClearEvent;
65
+ focusin: FocusInEvent;
66
+ focusout: FocusOutEvent;
38
67
  markerclick: MarkerClickEvent;
39
68
  markermouseenter: MarkerMouseEnterEvent;
40
69
  markermouseleave: MarkerMouseLeaveEvent;
41
70
  };
42
71
  export type OpenLayersGeocodingControlEvent = OpenLayersGeocodingControlEventNameMap[keyof OpenLayersGeocodingControlEventNameMap];
43
72
  export type OpenLayersGeocodingControlEventName = keyof OpenLayersGeocodingControlEventNameMap;
73
+ export {};
@@ -1,32 +1,45 @@
1
1
  import { convert } from 'geo-coordinates-parser';
2
2
  import { Feature, FeatureCollection } from '../types';
3
- export type ReverseToggleEvent = CustomEvent<{
4
- reverse: boolean;
5
- }>;
6
- export type QueryChangeEvent = CustomEvent<{
7
- query: string;
8
- reverseCoords: ReturnType<typeof convert> | false;
9
- }>;
10
- export type QueryClearEvent = CustomEvent<void>;
11
- export type RequestEvent = CustomEvent<{
12
- urlObj: URL;
13
- }>;
14
- export type ResponseEvent = CustomEvent<{
15
- url: string;
16
- featureCollection: FeatureCollection;
17
- }>;
18
- export type SelectEvent = CustomEvent<{
19
- feature: Feature | undefined;
20
- }>;
21
- export type PickEvent = CustomEvent<{
22
- feature: Feature | undefined;
23
- }>;
24
- export type FeaturesShowEvent = CustomEvent<void>;
25
- export type FeaturesHideEvent = CustomEvent<void>;
26
- export type FeaturesListedEvent = CustomEvent<{
27
- features: Feature[] | undefined;
28
- }>;
29
- export type FeaturesClearEvent = CustomEvent<void>;
3
+ export declare namespace MaptilerGeocoderEvent {
4
+ type ReverseToggleEvent = CustomEvent<{
5
+ reverse: boolean;
6
+ }>;
7
+ type QueryChangeEvent = CustomEvent<{
8
+ query: string;
9
+ reverseCoords: ReturnType<typeof convert> | false;
10
+ }>;
11
+ type QueryClearEvent = CustomEvent<void>;
12
+ type RequestEvent = CustomEvent<{
13
+ urlObj: URL;
14
+ }>;
15
+ type ResponseEvent = CustomEvent<{
16
+ url: string;
17
+ featureCollection: FeatureCollection;
18
+ }>;
19
+ type SelectEvent = CustomEvent<{
20
+ feature: Feature | undefined;
21
+ }>;
22
+ type PickEvent = CustomEvent<{
23
+ feature: Feature | undefined;
24
+ }>;
25
+ type FeaturesShowEvent = CustomEvent<void>;
26
+ type FeaturesHideEvent = CustomEvent<void>;
27
+ type FeaturesListedEvent = CustomEvent<{
28
+ features: Feature[] | undefined;
29
+ }>;
30
+ type FeaturesClearEvent = CustomEvent<void>;
31
+ }
32
+ export type ReverseToggleEvent = MaptilerGeocoderEvent.ReverseToggleEvent;
33
+ export type QueryChangeEvent = MaptilerGeocoderEvent.QueryChangeEvent;
34
+ export type QueryClearEvent = MaptilerGeocoderEvent.QueryClearEvent;
35
+ export type RequestEvent = MaptilerGeocoderEvent.RequestEvent;
36
+ export type ResponseEvent = MaptilerGeocoderEvent.ResponseEvent;
37
+ export type SelectEvent = MaptilerGeocoderEvent.SelectEvent;
38
+ export type PickEvent = MaptilerGeocoderEvent.PickEvent;
39
+ export type FeaturesShowEvent = MaptilerGeocoderEvent.FeaturesShowEvent;
40
+ export type FeaturesHideEvent = MaptilerGeocoderEvent.FeaturesHideEvent;
41
+ export type FeaturesListedEvent = MaptilerGeocoderEvent.FeaturesListedEvent;
42
+ export type FeaturesClearEvent = MaptilerGeocoderEvent.FeaturesClearEvent;
30
43
  export type MaptilerGeocoderEventNameMap = {
31
44
  reversetoggle: ReverseToggleEvent;
32
45
  querychange: QueryChangeEvent;
@@ -119,9 +119,7 @@ export type MaptilerGeocoderOptions = {
119
119
  /**
120
120
  * Base URL for POI icons.
121
121
  *
122
- * Default:
123
- * - `"icons/"` for Svelte apps.
124
- * - `"https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/icons/"` for others.
122
+ * Default: `"https://cdn.maptiler.com/maptiler-geocoding-control/v${version}/icons/"`
125
123
  */
126
124
  iconsBaseUrl?: string;
127
125
  /**
@@ -2,6 +2,6 @@ export * from '.';
2
2
  export * from './components/marker';
3
3
  export * from './controls/leaflet-control';
4
4
  export { LeafletGeocodingControl as GeocodingControl } from './controls/leaflet-control';
5
- export type * as GeocodingControlEvent from './controls/leaflet-events';
5
+ export type { FeaturesClearEvent, FeaturesHideEvent, FeaturesListedEvent, FeaturesShowEvent, FocusInEvent, FocusOutEvent, LeafletGeocodingControlEvent as GeocodingControlEvent, LeafletGeocodingControlEventName as GeocodingControlEventName, LeafletGeocodingControlEventNameMap as GeocodingControlEventNameMap, LeafletGeocodingControlEvent, LeafletGeocodingControlEventName, LeafletGeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, PickEvent, QueryChangeEvent, QueryClearEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent, } from './controls/leaflet-events';
6
6
  export * from './controls/leaflet-options';
7
7
  export type { LeafletGeocodingControlOptions as GeocodingControlOptions } from './controls/leaflet-options';
@@ -2,6 +2,6 @@ export * from '.';
2
2
  export * from './components/marker';
3
3
  export * from './controls/maplibregl-control';
4
4
  export { MaplibreglGeocodingControl as GeocodingControl } from './controls/maplibregl-control';
5
- export type * as GeocodingControlEvent from './controls/maplibregl-events';
5
+ export type { FeaturesClearEvent, FeaturesHideEvent, FeaturesListedEvent, FeaturesShowEvent, FocusInEvent, FocusOutEvent, MaplibreglGeocodingControlEvent as GeocodingControlEvent, MaplibreglGeocodingControlEventName as GeocodingControlEventName, MaplibreglGeocodingControlEventNameMap as GeocodingControlEventNameMap, MaplibreglGeocodingControlEvent, MaplibreglGeocodingControlEventName, MaplibreglGeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, PickEvent, QueryChangeEvent, QueryClearEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent, } from './controls/maplibregl-events';
6
6
  export * from './controls/maplibregl-options';
7
7
  export type { MaplibreglGeocodingControlOptions as GeocodingControlOptions } from './controls/maplibregl-options';
@@ -2,6 +2,6 @@ export * from '.';
2
2
  export * from './components/marker';
3
3
  export * from './controls/maptilersdk-control';
4
4
  export { MaptilerGeocodingControl as GeocodingControl } from './controls/maptilersdk-control';
5
- export type * as GeocodingControlEvent from './controls/maptilersdk-events';
5
+ export type { FeaturesClearEvent, FeaturesHideEvent, FeaturesListedEvent, FeaturesShowEvent, FocusInEvent, FocusOutEvent, MaptilerGeocodingControlEvent as GeocodingControlEvent, MaptilerGeocodingControlEventName as GeocodingControlEventName, MaptilerGeocodingControlEventNameMap as GeocodingControlEventNameMap, MaptilerGeocodingControlEvent, MaptilerGeocodingControlEventName, MaptilerGeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, PickEvent, QueryChangeEvent, QueryClearEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent, } from './controls/maptilersdk-events';
6
6
  export * from './controls/maptilersdk-options';
7
7
  export type { MaptilerGeocodingControlOptions as GeocodingControlOptions } from './controls/maptilersdk-options';
@@ -2,6 +2,6 @@ export * from '.';
2
2
  export * from './components/marker';
3
3
  export * from './controls/openlayers-control';
4
4
  export { OpenLayersGeocodingControl as GeocodingControl } from './controls/openlayers-control';
5
- export type * as GeocodingControlEvent from './controls/openlayers-events';
5
+ export type { FeaturesClearEvent, FeaturesHideEvent, FeaturesListedEvent, FeaturesShowEvent, FocusInEvent, FocusOutEvent, OpenLayersGeocodingControlEvent as GeocodingControlEvent, OpenLayersGeocodingControlEventName as GeocodingControlEventName, OpenLayersGeocodingControlEventNameMap as GeocodingControlEventNameMap, MarkerClickEvent, MarkerMouseEnterEvent, MarkerMouseLeaveEvent, OpenLayersGeocodingControlEvent, OpenLayersGeocodingControlEventName, OpenLayersGeocodingControlEventNameMap, PickEvent, QueryChangeEvent, QueryClearEvent, RequestEvent, ResponseEvent, ReverseToggleEvent, SelectEvent, } from './controls/openlayers-events';
6
6
  export * from './controls/openlayers-options';
7
7
  export type { OpenLayersGeocodingControlOptions as GeocodingControlOptions } from './controls/openlayers-options';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "3.0.0-rc.4",
3
+ "version": "3.0.0-rc.5",
4
4
  "description": "The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.",
5
5
  "type": "module",
6
6
  "author": {