@arenarium/maps 1.0.41 → 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 +63 -44
- package/dist/index.js +33 -33
- package/dist/style.css +1 -1
- 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;
|
|
@@ -258,56 +310,23 @@ declare namespace Types {
|
|
|
258
310
|
number
|
|
259
311
|
][];
|
|
260
312
|
}
|
|
261
|
-
export interface Block {
|
|
262
|
-
id: string;
|
|
263
|
-
sw: {
|
|
264
|
-
lat: number;
|
|
265
|
-
lng: number;
|
|
266
|
-
};
|
|
267
|
-
ne: {
|
|
268
|
-
lat: number;
|
|
269
|
-
lng: number;
|
|
270
|
-
};
|
|
271
|
-
zs: number;
|
|
272
|
-
ze: number;
|
|
273
|
-
markers: Marker[];
|
|
274
|
-
}
|
|
275
313
|
}
|
|
276
314
|
export declare namespace MapComponent {
|
|
277
|
-
|
|
278
|
-
lat: number;
|
|
279
|
-
lng: number;
|
|
280
|
-
zoom: number;
|
|
281
|
-
}
|
|
282
|
-
interface Bounds {
|
|
283
|
-
sw: {
|
|
284
|
-
lat: number;
|
|
285
|
-
lng: number;
|
|
286
|
-
};
|
|
287
|
-
ne: {
|
|
288
|
-
lat: number;
|
|
289
|
-
lng: number;
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
type PopupContentCallback = (ids: string[]) => Promise<string[]>;
|
|
293
|
-
type SetPopupsContentCallbackFunction = (callback: PopupContentCallback) => void;
|
|
294
|
-
type SetPopupsFunction = (popups: Types.Popup[]) => void;
|
|
315
|
+
type MapPopupContentCallback = (id: string) => Promise<HTMLElement>;
|
|
295
316
|
}
|
|
296
317
|
export interface MapComponent {
|
|
297
|
-
getCenter: () =>
|
|
298
|
-
|
|
299
|
-
lng: number;
|
|
300
|
-
};
|
|
301
|
-
setCenter: (lat: number, lng: number) => void;
|
|
318
|
+
getCenter: () => MapCoordinate;
|
|
319
|
+
setCenter: (coordinate: MapCoordinate) => void;
|
|
302
320
|
getZoom: () => number;
|
|
303
321
|
setZoom: (zoom: number) => void;
|
|
304
|
-
getBounds: () =>
|
|
322
|
+
getBounds: () => MapBounds;
|
|
305
323
|
zoomIn: () => void;
|
|
306
324
|
zoomOut: () => void;
|
|
307
325
|
getStyle: () => MapStyle;
|
|
308
326
|
setStyle: (style: MapStyle) => void;
|
|
309
|
-
|
|
310
|
-
|
|
327
|
+
updatePopupsContentCallback: (callback: MapComponent.MapPopupContentCallback) => Promise<HTMLElement>;
|
|
328
|
+
updatePopups: (popups: Types.Popup[]) => Promise<void>;
|
|
329
|
+
removePopups: () => void;
|
|
311
330
|
}
|
|
312
331
|
export declare function mountMap(options: MapOptions): MapComponent;
|
|
313
332
|
export declare function unmountMap(map: ReturnType<typeof mountMap>): void;
|