@arenarium/maps 1.0.84 → 1.0.87

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 CHANGED
@@ -78,42 +78,74 @@ declare const mapBoundsSchema: z.ZodObject<{
78
78
  lng: number;
79
79
  };
80
80
  }>;
81
- declare const mapStyleSchema: z.ZodObject<{
82
- name: z.ZodUnion<[
83
- z.ZodLiteral<"dark">,
84
- z.ZodLiteral<"light">
85
- ]>;
86
- url: z.ZodOptional<z.ZodString>;
87
- colors: z.ZodObject<{
88
- primary: z.ZodString;
89
- background: z.ZodString;
90
- text: z.ZodString;
81
+ declare const mapStyleSchema: z.ZodUnion<[
82
+ z.ZodObject<{
83
+ name: z.ZodUnion<[
84
+ z.ZodLiteral<"dark">,
85
+ z.ZodLiteral<"light">
86
+ ]>;
87
+ colors: z.ZodObject<{
88
+ primary: z.ZodString;
89
+ background: z.ZodString;
90
+ text: z.ZodString;
91
+ }, "strip", z.ZodTypeAny, {
92
+ primary: string;
93
+ background: string;
94
+ text: string;
95
+ }, {
96
+ primary: string;
97
+ background: string;
98
+ text: string;
99
+ }>;
91
100
  }, "strip", z.ZodTypeAny, {
92
- primary: string;
93
- background: string;
94
- text: string;
101
+ name: "dark" | "light";
102
+ colors: {
103
+ primary: string;
104
+ background: string;
105
+ text: string;
106
+ };
95
107
  }, {
96
- primary: string;
97
- background: string;
98
- text: string;
99
- }>;
100
- }, "strip", z.ZodTypeAny, {
101
- name: "dark" | "light";
102
- colors: {
103
- primary: string;
104
- background: string;
105
- text: string;
106
- };
107
- url?: string | undefined;
108
- }, {
109
- name: "dark" | "light";
110
- colors: {
111
- primary: string;
112
- background: string;
113
- text: string;
114
- };
115
- url?: string | undefined;
116
- }>;
108
+ name: "dark" | "light";
109
+ colors: {
110
+ primary: string;
111
+ background: string;
112
+ text: string;
113
+ };
114
+ }>,
115
+ z.ZodObject<{
116
+ name: z.ZodLiteral<"custom">;
117
+ url: z.ZodString;
118
+ colors: z.ZodObject<{
119
+ primary: z.ZodString;
120
+ background: z.ZodString;
121
+ text: z.ZodString;
122
+ }, "strip", z.ZodTypeAny, {
123
+ primary: string;
124
+ background: string;
125
+ text: string;
126
+ }, {
127
+ primary: string;
128
+ background: string;
129
+ text: string;
130
+ }>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ name: "custom";
133
+ colors: {
134
+ primary: string;
135
+ background: string;
136
+ text: string;
137
+ };
138
+ url: string;
139
+ }, {
140
+ name: "custom";
141
+ colors: {
142
+ primary: string;
143
+ background: string;
144
+ text: string;
145
+ };
146
+ url: string;
147
+ }>
148
+ ]>;
117
149
  declare const mapOptionsSchema: z.ZodObject<{
118
150
  container: z.ZodString;
119
151
  position: z.ZodObject<{
@@ -211,42 +243,74 @@ declare const mapOptionsSchema: z.ZodObject<{
211
243
  };
212
244
  } | undefined;
213
245
  }>>;
214
- style: z.ZodObject<{
215
- name: z.ZodUnion<[
216
- z.ZodLiteral<"dark">,
217
- z.ZodLiteral<"light">
218
- ]>;
219
- url: z.ZodOptional<z.ZodString>;
220
- colors: z.ZodObject<{
221
- primary: z.ZodString;
222
- background: z.ZodString;
223
- text: z.ZodString;
246
+ style: z.ZodUnion<[
247
+ z.ZodObject<{
248
+ name: z.ZodUnion<[
249
+ z.ZodLiteral<"dark">,
250
+ z.ZodLiteral<"light">
251
+ ]>;
252
+ colors: z.ZodObject<{
253
+ primary: z.ZodString;
254
+ background: z.ZodString;
255
+ text: z.ZodString;
256
+ }, "strip", z.ZodTypeAny, {
257
+ primary: string;
258
+ background: string;
259
+ text: string;
260
+ }, {
261
+ primary: string;
262
+ background: string;
263
+ text: string;
264
+ }>;
224
265
  }, "strip", z.ZodTypeAny, {
225
- primary: string;
226
- background: string;
227
- text: string;
266
+ name: "dark" | "light";
267
+ colors: {
268
+ primary: string;
269
+ background: string;
270
+ text: string;
271
+ };
228
272
  }, {
229
- primary: string;
230
- background: string;
231
- text: string;
232
- }>;
233
- }, "strip", z.ZodTypeAny, {
234
- name: "dark" | "light";
235
- colors: {
236
- primary: string;
237
- background: string;
238
- text: string;
239
- };
240
- url?: string | undefined;
241
- }, {
242
- name: "dark" | "light";
243
- colors: {
244
- primary: string;
245
- background: string;
246
- text: string;
247
- };
248
- url?: string | undefined;
249
- }>;
273
+ name: "dark" | "light";
274
+ colors: {
275
+ primary: string;
276
+ background: string;
277
+ text: string;
278
+ };
279
+ }>,
280
+ z.ZodObject<{
281
+ name: z.ZodLiteral<"custom">;
282
+ url: z.ZodString;
283
+ colors: z.ZodObject<{
284
+ primary: z.ZodString;
285
+ background: z.ZodString;
286
+ text: z.ZodString;
287
+ }, "strip", z.ZodTypeAny, {
288
+ primary: string;
289
+ background: string;
290
+ text: string;
291
+ }, {
292
+ primary: string;
293
+ background: string;
294
+ text: string;
295
+ }>;
296
+ }, "strip", z.ZodTypeAny, {
297
+ name: "custom";
298
+ colors: {
299
+ primary: string;
300
+ background: string;
301
+ text: string;
302
+ };
303
+ url: string;
304
+ }, {
305
+ name: "custom";
306
+ colors: {
307
+ primary: string;
308
+ background: string;
309
+ text: string;
310
+ };
311
+ url: string;
312
+ }>
313
+ ]>;
250
314
  }, "strip", z.ZodTypeAny, {
251
315
  container: string;
252
316
  position: {
@@ -263,7 +327,14 @@ declare const mapOptionsSchema: z.ZodObject<{
263
327
  background: string;
264
328
  text: string;
265
329
  };
266
- url?: string | undefined;
330
+ } | {
331
+ name: "custom";
332
+ colors: {
333
+ primary: string;
334
+ background: string;
335
+ text: string;
336
+ };
337
+ url: string;
267
338
  };
268
339
  restriction?: {
269
340
  minZoom?: number | undefined;
@@ -295,7 +366,14 @@ declare const mapOptionsSchema: z.ZodObject<{
295
366
  background: string;
296
367
  text: string;
297
368
  };
298
- url?: string | undefined;
369
+ } | {
370
+ name: "custom";
371
+ colors: {
372
+ primary: string;
373
+ background: string;
374
+ text: string;
375
+ };
376
+ url: string;
299
377
  };
300
378
  restriction?: {
301
379
  minZoom?: number | undefined;
@@ -317,6 +395,8 @@ export type MapPosition = z.infer<typeof mapPositionSchema>;
317
395
  export type MapBounds = z.infer<typeof mapBoundsSchema>;
318
396
  export type MapOptions = z.infer<typeof mapOptionsSchema>;
319
397
  export type MapStyle = z.infer<typeof mapStyleSchema>;
398
+ declare const mapEventLoadHandlerSchema: z.ZodFunction<z.ZodTuple<[
399
+ ], z.ZodUnknown>, z.ZodVoid>;
320
400
  declare const mapEventIdleHandlerSchema: z.ZodFunction<z.ZodTuple<[
321
401
  ], z.ZodUnknown>, z.ZodVoid>;
322
402
  declare const mapEventMoveHandlerSchema: z.ZodFunction<z.ZodTuple<[
@@ -358,21 +438,24 @@ declare const mapEventClickHandlerSchema: z.ZodFunction<z.ZodTuple<[
358
438
  lng: number;
359
439
  }>
360
440
  ], z.ZodUnknown>, z.ZodVoid>;
361
- export interface EventPayloadMap {
362
- idle: null;
363
- move: MapPosition;
364
- click: MapCoordinate;
365
- }
441
+ export type MapEventLoadHandler = z.infer<typeof mapEventLoadHandlerSchema>;
442
+ export type MapEventIdleHandler = z.infer<typeof mapEventIdleHandlerSchema>;
443
+ export type MapEventMoveHandler = z.infer<typeof mapEventMoveHandlerSchema>;
444
+ export type MapEventClickHandler = z.infer<typeof mapEventClickHandlerSchema>;
366
445
  export interface EventHandlerMap {
446
+ load: MapEventLoadHandler;
367
447
  idle: MapEventIdleHandler;
368
448
  move: MapEventMoveHandler;
369
449
  click: MapEventClickHandler;
370
450
  }
451
+ export interface EventPayloadMap {
452
+ load: null;
453
+ idle: null;
454
+ move: MapPosition;
455
+ click: MapCoordinate;
456
+ }
371
457
  export type EventId = keyof EventHandlerMap;
372
458
  export type EventHandler<E extends EventId> = (payload: EventPayloadMap[E]) => void;
373
- export type MapEventIdleHandler = z.infer<typeof mapEventIdleHandlerSchema>;
374
- export type MapEventMoveHandler = z.infer<typeof mapEventMoveHandlerSchema>;
375
- export type MapEventClickHandler = z.infer<typeof mapEventClickHandlerSchema>;
376
459
  declare const mapPopupDataSchema: z.ZodObject<{
377
460
  id: z.ZodString;
378
461
  rank: z.ZodNumber;
@@ -544,7 +627,7 @@ export declare namespace MapComponent {
544
627
  type MapPopupContentCallback = (id: string) => Promise<HTMLElement>;
545
628
  }
546
629
  export interface MapComponent {
547
- maplibreglMap: () => maplibregl$1.Map;
630
+ maplibre: () => maplibregl$1.Map;
548
631
  getCenter: () => MapCoordinate;
549
632
  getZoom: () => number;
550
633
  getBounds: () => MapBounds;