@arenarium/maps 1.0.42 → 1.0.43
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/dist/index.d.ts +62 -29
- package/dist/index.js +33 -33
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
+
declare const mapCoordinateSchema: z.ZodObject<{
|
|
6
|
+
lat: z.ZodNumber;
|
|
7
|
+
lng: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
lat: number;
|
|
10
|
+
lng: number;
|
|
11
|
+
}, {
|
|
12
|
+
lat: number;
|
|
13
|
+
lng: number;
|
|
14
|
+
}>;
|
|
15
|
+
declare const mapBoundsSchema: z.ZodObject<{
|
|
16
|
+
sw: z.ZodObject<{
|
|
17
|
+
lat: z.ZodNumber;
|
|
18
|
+
lng: z.ZodNumber;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
lat: number;
|
|
21
|
+
lng: number;
|
|
22
|
+
}, {
|
|
23
|
+
lat: number;
|
|
24
|
+
lng: number;
|
|
25
|
+
}>;
|
|
26
|
+
ne: z.ZodObject<{
|
|
27
|
+
lat: z.ZodNumber;
|
|
28
|
+
lng: z.ZodNumber;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
lat: number;
|
|
31
|
+
lng: number;
|
|
32
|
+
}, {
|
|
33
|
+
lat: number;
|
|
34
|
+
lng: number;
|
|
35
|
+
}>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
sw: {
|
|
38
|
+
lat: number;
|
|
39
|
+
lng: number;
|
|
40
|
+
};
|
|
41
|
+
ne: {
|
|
42
|
+
lat: number;
|
|
43
|
+
lng: number;
|
|
44
|
+
};
|
|
45
|
+
}, {
|
|
46
|
+
sw: {
|
|
47
|
+
lat: number;
|
|
48
|
+
lng: number;
|
|
49
|
+
};
|
|
50
|
+
ne: {
|
|
51
|
+
lat: number;
|
|
52
|
+
lng: number;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
5
55
|
declare const mapStyleSchema: z.ZodObject<{
|
|
6
56
|
name: z.ZodUnion<[
|
|
7
57
|
z.ZodLiteral<"dark">,
|
|
@@ -214,7 +264,7 @@ declare const mapOptionsSchema: z.ZodObject<{
|
|
|
214
264
|
}>;
|
|
215
265
|
declare const mapPopupSchema: z.ZodObject<{
|
|
216
266
|
id: z.ZodString;
|
|
217
|
-
|
|
267
|
+
rank: z.ZodNumber;
|
|
218
268
|
lat: z.ZodNumber;
|
|
219
269
|
lng: z.ZodNumber;
|
|
220
270
|
width: z.ZodNumber;
|
|
@@ -223,24 +273,26 @@ declare const mapPopupSchema: z.ZodObject<{
|
|
|
223
273
|
lat: number;
|
|
224
274
|
lng: number;
|
|
225
275
|
id: string;
|
|
226
|
-
|
|
276
|
+
rank: number;
|
|
227
277
|
width: number;
|
|
228
278
|
height: number;
|
|
229
279
|
}, {
|
|
230
280
|
lat: number;
|
|
231
281
|
lng: number;
|
|
232
282
|
id: string;
|
|
233
|
-
|
|
283
|
+
rank: number;
|
|
234
284
|
width: number;
|
|
235
285
|
height: number;
|
|
236
286
|
}>;
|
|
287
|
+
export type MapCoordinate = z.infer<typeof mapCoordinateSchema>;
|
|
288
|
+
export type MapBounds = z.infer<typeof mapBoundsSchema>;
|
|
237
289
|
export type MapOptions = z.infer<typeof mapOptionsSchema>;
|
|
238
290
|
export type MapStyle = z.infer<typeof mapStyleSchema>;
|
|
239
291
|
export type MapPopup = z.infer<typeof mapPopupSchema>;
|
|
240
292
|
declare namespace Types {
|
|
241
293
|
export interface Popup {
|
|
242
294
|
id: string;
|
|
243
|
-
|
|
295
|
+
rank: number;
|
|
244
296
|
lat: number;
|
|
245
297
|
lng: number;
|
|
246
298
|
width: number;
|
|
@@ -260,39 +312,20 @@ declare namespace Types {
|
|
|
260
312
|
}
|
|
261
313
|
}
|
|
262
314
|
export declare namespace MapComponent {
|
|
263
|
-
|
|
264
|
-
lat: number;
|
|
265
|
-
lng: number;
|
|
266
|
-
zoom: number;
|
|
267
|
-
}
|
|
268
|
-
interface Bounds {
|
|
269
|
-
sw: {
|
|
270
|
-
lat: number;
|
|
271
|
-
lng: number;
|
|
272
|
-
};
|
|
273
|
-
ne: {
|
|
274
|
-
lat: number;
|
|
275
|
-
lng: number;
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
type PopupContentCallback = (ids: string) => Promise<string>;
|
|
279
|
-
type SetPopupsContentCallbackFunction = (callback: PopupContentCallback) => void;
|
|
280
|
-
type SetPopupsFunction = (popups: Types.Popup[]) => void;
|
|
315
|
+
type MapPopupContentCallback = (id: string) => Promise<HTMLElement>;
|
|
281
316
|
}
|
|
282
317
|
export interface MapComponent {
|
|
283
|
-
getCenter: () =>
|
|
284
|
-
|
|
285
|
-
lng: number;
|
|
286
|
-
};
|
|
287
|
-
setCenter: (lat: number, lng: number) => void;
|
|
318
|
+
getCenter: () => MapCoordinate;
|
|
319
|
+
setCenter: (coordinate: MapCoordinate) => void;
|
|
288
320
|
getZoom: () => number;
|
|
289
321
|
setZoom: (zoom: number) => void;
|
|
290
|
-
getBounds: () =>
|
|
322
|
+
getBounds: () => MapBounds;
|
|
291
323
|
zoomIn: () => void;
|
|
292
324
|
zoomOut: () => void;
|
|
293
325
|
getStyle: () => MapStyle;
|
|
294
326
|
setStyle: (style: MapStyle) => void;
|
|
295
|
-
|
|
327
|
+
updatePopupsContentCallback: (callback: MapComponent.MapPopupContentCallback) => Promise<HTMLElement>;
|
|
328
|
+
updatePopups: (popups: Types.Popup[]) => Promise<void>;
|
|
296
329
|
removePopups: () => void;
|
|
297
330
|
}
|
|
298
331
|
export declare function mountMap(options: MapOptions): MapComponent;
|