@maptiler/geocoding-control 0.0.83 → 0.0.84

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.
package/mask.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Polygon, MultiPolygon, Feature as TurfFeature } from "@turf/helpers";
1
+ import type { MultiPolygon, Polygon, Feature as TurfFeature } from "@turf/helpers";
2
2
  import type { GeoJSON } from "geojson";
3
3
  export declare function setMask(picked: TurfFeature<Polygon | MultiPolygon>, setData: (data: GeoJSON) => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "0.0.83",
3
+ "version": "0.0.84",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Martin Ždila",
@@ -77,28 +77,29 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@sveltejs/package": "^2.0.2",
80
- "@sveltejs/vite-plugin-svelte": "^2.0.3",
80
+ "@sveltejs/vite-plugin-svelte": "^2.0.4",
81
81
  "@tsconfig/svelte": "^4.0.1",
82
82
  "@turf/buffer": "^6.5.0",
83
83
  "@turf/difference": "^6.5.0",
84
84
  "@turf/union": "^6.5.0",
85
85
  "@types/geojson": "^7946.0.10",
86
86
  "@types/leaflet": "^1.9.3",
87
- "@types/react": "^18.0.30",
87
+ "@types/react": "^18.0.31",
88
88
  "@types/react-dom": "^18.0.11",
89
- "concurrently": "^7.6.0",
89
+ "concurrently": "^8.0.1",
90
90
  "esm-env": "^1.0.0",
91
91
  "leaflet": "^1.9.3",
92
92
  "maplibre-gl": "^2.4.0",
93
93
  "prettier": "^2.8.7",
94
+ "prettier-plugin-organize-imports": "^3.2.2",
94
95
  "prettier-plugin-svelte": "^2.10.0",
95
96
  "react": "^18.2.0",
96
97
  "react-dom": "^18.2.0",
97
- "svelte": "^3.57.0",
98
+ "svelte": "^3.58.0",
98
99
  "svelte-check": "^3.1.4",
99
100
  "svelte-preprocess": "^5.0.3",
100
101
  "tslib": "^2.5.0",
101
- "typescript": "^5.0.2",
102
+ "typescript": "^5.0.3",
102
103
  "vite": "^4.2.1"
103
104
  },
104
105
  "peerDependencies": {
package/react.d.ts CHANGED
@@ -1,26 +1,19 @@
1
1
  /// <reference types="react" />
2
- import type { ControlOptions, Feature, MapController } from "./types";
3
- type CallbackProperties = {
4
- onSelect?: (feature: Feature | undefined) => void;
5
- onPick?: (feature: Feature | undefined) => void;
6
- onOptionsVisibilityChange?: (visible: boolean) => void;
7
- onFeaturesListed?: (visible: Feature[] | undefined) => void;
8
- onFeaturesMarked?: (visible: Feature[] | undefined) => void;
9
- onResponse?: (onResponse: {
10
- url: string;
11
- response: Response;
12
- }) => void;
13
- onReversetoggle?: (reverse: boolean) => void;
14
- onQuerychange?: (query: string) => void;
2
+ import type { DispatcherType } from "./DispatcherType";
3
+ import GeocodingControl from "./GeocodingControl.svelte";
4
+ import type { ControlOptions, MapController } from "./types";
5
+ type EventNames = keyof DispatcherType;
6
+ type EventHandlerFnName<T extends EventNames> = `on${Capitalize<T>}`;
7
+ type CallbackProperties<T> = {
8
+ [K in keyof T as EventHandlerFnName<Extract<K, EventNames>>]?: (event: T[K]) => void;
15
9
  };
16
10
  type MapControllerProp = {
17
11
  mapController?: MapController;
18
12
  };
19
- export type Props = ControlOptions & CallbackProperties & MapControllerProp;
13
+ export type Props = ControlOptions & CallbackProperties<DispatcherType> & MapControllerProp;
14
+ type MethodNames = "blur" | "focus" | "setQuery";
20
15
  export type Methods = {
21
- blur: () => void;
22
- focus: () => void;
23
- setQuery: (value: string, submit?: boolean) => void;
16
+ [T in MethodNames]: GeocodingControl[T];
24
17
  };
25
- declare const ReactGeocodingControl: import("react").ForwardRefExoticComponent<ControlOptions & CallbackProperties & MapControllerProp & import("react").RefAttributes<Methods>>;
18
+ declare const ReactGeocodingControl: import("react").ForwardRefExoticComponent<ControlOptions & CallbackProperties<DispatcherType> & MapControllerProp & import("react").RefAttributes<Methods>>;
26
19
  export { ReactGeocodingControl as GeocodingControl };