@feltmaps/js-sdk 1.0.0

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.
@@ -0,0 +1,885 @@
1
+ import { ZodRawShape, objectOutputType, ZodTypeAny, z } from 'zod';
2
+
3
+ /**
4
+ * A selection of generic utility types
5
+ */
6
+
7
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
8
+ type PromiseOrNot<T> = T | Promise<T>;
9
+ /**
10
+ * A better type inference for zod schemas that retains the TSDoc comments
11
+ * from the members in the compiled output.
12
+ */
13
+ type zInfer<T extends {
14
+ shape: ZodRawShape;
15
+ }> = objectOutputType<T["shape"], ZodTypeAny, "strip">;
16
+
17
+ /**
18
+ * @group Elements
19
+ */
20
+ interface Element {
21
+ /**
22
+ * The string identifying the element
23
+ */
24
+ id: string;
25
+ /**
26
+ * The type of element, such as a Place, Polygon, Line, Route, etc.
27
+ */
28
+ type: string;
29
+ /**
30
+ * The ID of the element group that the element belongs to, or null
31
+ * if the element is not inside an element group.
32
+ */
33
+ groupId: string | null;
34
+ /**
35
+ * The name of the element can be displayed in the Legend, depending
36
+ * on how the element's legend is configured in its style.
37
+ */
38
+ name: string | null;
39
+ /**
40
+ * The element description forms part of the element's metadata. This is visible
41
+ * to users via the element info button in the legend.
42
+ */
43
+ description: string | null;
44
+ /**
45
+ * The attributes of the element, which can be added via the Element Inspector
46
+ * under the Detail tab.
47
+ */
48
+ attributes: Record<string, unknown>;
49
+ }
50
+ /**
51
+ * @group Element Groups
52
+ */
53
+ interface ElementGroup {
54
+ /**
55
+ * A string identifying the element group.
56
+ */
57
+ id: string;
58
+ /**
59
+ * The name of the element group. This is shown in the legend.
60
+ */
61
+ name: string;
62
+ /**
63
+ * The caption of the element group. This is shown in the legend.
64
+ */
65
+ caption: string | null;
66
+ /**
67
+ * The ids of the elements in the element group.
68
+ *
69
+ * @remarks
70
+ * You can use these ids to get the full element objects via the `getElements` method.
71
+ */
72
+ elementIds: Array<string>;
73
+ /**
74
+ * Whether the element group is visible or not.
75
+ */
76
+ visible: boolean;
77
+ /**
78
+ * Whether the element group is shown in the legend or not.
79
+ */
80
+ shownInLegend: boolean;
81
+ }
82
+ /**
83
+ * The constraints to apply when getting elements.
84
+ *
85
+ * @group Elements
86
+ */
87
+ interface GetElementsConstraint extends zInfer<typeof GetElementsConstraintSchema> {
88
+ }
89
+ declare const GetElementsConstraintSchema: z.ZodObject<{
90
+ /**
91
+ * The ids of the elements to get.
92
+ */
93
+ ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ ids?: string[] | undefined;
96
+ }, {
97
+ ids?: string[] | undefined;
98
+ }>;
99
+ /**
100
+ * The constraints to apply when getting element groups.
101
+ *
102
+ * @group Element Groups
103
+ */
104
+ interface GetElementGroupsConstraint extends zInfer<typeof GetElementGroupsConstraintSchema> {
105
+ }
106
+ /**
107
+ * @ignore
108
+ */
109
+ declare const GetElementGroupsConstraintSchema: z.ZodObject<{
110
+ /**
111
+ * The ids of the element groups to get.
112
+ */
113
+ ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ ids?: string[] | undefined;
116
+ }, {
117
+ ids?: string[] | undefined;
118
+ }>;
119
+ /**
120
+ * The parameters for the `onElementChange` listener.
121
+ *
122
+ * @group Elements
123
+ */
124
+ interface ElementChangeCallbackParams {
125
+ /**
126
+ * The new data for the element or null if the element was removed.
127
+ */
128
+ element: Element | null;
129
+ }
130
+ /**
131
+ * The parameters for the `onElementGroupChange` listener.
132
+ *
133
+ * @group Element Groups
134
+ */
135
+ interface ElementGroupChangeCallbackParams {
136
+ elementGroup: ElementGroup | null;
137
+ }
138
+
139
+ /**
140
+ * Represents a point in world coordinates.
141
+ */
142
+ interface LatLng {
143
+ latitude: number;
144
+ longitude: number;
145
+ }
146
+ /**
147
+ * A tuple representing a longitude and latitude coordinate.
148
+ *
149
+ * This is used hen serializing geometry because that's the standard used in
150
+ * GeoJSON.
151
+ */
152
+ type LngLatTuple = [longitude: number, latitude: number];
153
+ /**
154
+ * A GeoJSON-like point geometry.
155
+ */
156
+ type PointGeometry = {
157
+ type: "Point";
158
+ coordinates: LngLatTuple;
159
+ };
160
+ /**
161
+ * A GeoJSON-like polygon geometry.
162
+ */
163
+ type PolygonGeometry = {
164
+ type: "Polygon";
165
+ coordinates: LngLatTuple[][];
166
+ };
167
+ /**
168
+ * A GeoJSON-like multi-polygon geometry.
169
+ */
170
+ type MultiPolygonGeometry = {
171
+ type: "MultiPolygon";
172
+ coordinates: PolygonGeometry["coordinates"][];
173
+ };
174
+ /**
175
+ * A GeoJSON-like line string geometry.
176
+ */
177
+ type LineStringGeometry = {
178
+ type: "LineString";
179
+ coordinates: LngLatTuple[];
180
+ };
181
+ /**
182
+ * A GeoJSON-like multi-line string geometry.
183
+ */
184
+ type MultiLineStringGeometry = {
185
+ type: "MultiLineString";
186
+ coordinates: LineStringGeometry["coordinates"][];
187
+ };
188
+ /**
189
+ * A GeoJSON-like geometry of any type
190
+ */
191
+ type Geometry = PointGeometry | PolygonGeometry | LineStringGeometry | MultiLineStringGeometry | MultiPolygonGeometry;
192
+ /**
193
+ * @ignore
194
+ * @internal
195
+ */
196
+ declare const FeltZoomSchema: z.ZodNumber;
197
+ /**
198
+ * The zoom level of the map.
199
+ *
200
+ * It is a floating-point number between 1 and 23, where 1 is the most
201
+ * zoomed out and 23 is the most zoomed in.
202
+ *
203
+ * @group Types
204
+ * @public
205
+ */
206
+ type FeltZoom = z.infer<typeof FeltZoomSchema>;
207
+ /**
208
+ * @ignore
209
+ * @internal
210
+ */
211
+ declare const FeltBoundarySchema: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
212
+ /**
213
+ * The edges of the map in the form of a bounding box.
214
+ *
215
+ * The boundary is a tuple of the form `[west, south, east, north]`.
216
+ *
217
+ * @group Types
218
+ * @public
219
+ */
220
+ type FeltBoundary = z.infer<typeof FeltBoundarySchema>;
221
+ /**
222
+ * The parameters for the methods that change the visibility of entities.
223
+ *
224
+ * @public
225
+ * @category Visibility
226
+ */
227
+ interface SetVisibilityRequest extends zInfer<typeof SetVisibilityRequestSchema> {
228
+ }
229
+ /**
230
+ * @internal
231
+ */
232
+ declare const SetVisibilityRequestSchema: z.ZodObject<{
233
+ /**
234
+ * The ids of the entities you want to change the visibility of.
235
+ */
236
+ show: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
237
+ hide: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
238
+ }, "strip", z.ZodTypeAny, {
239
+ show?: string[] | undefined;
240
+ hide?: string[] | undefined;
241
+ }, {
242
+ show?: string[] | undefined;
243
+ hide?: string[] | undefined;
244
+ }>;
245
+
246
+ /**
247
+ * A feature is a single geographical item in a layer.
248
+ * The unique ID for a feature is a compound key made up of the layer ID and the feature ID.
249
+ */
250
+ interface Feature {
251
+ /**
252
+ * The identifier of the feature, unique within the layer.
253
+ */
254
+ id: string | number;
255
+ /**
256
+ * The identifier of the layer that the feature belongs to.
257
+ */
258
+ layerId: string;
259
+ /**
260
+ * The type of geometry of the feature.
261
+ */
262
+ geometryType: "Point" | "LineString" | "Polygon" | "MultiPolygon" | (string & {});
263
+ /**
264
+ * The properties of the feature, as a bag of attributes.
265
+ */
266
+ properties: Record<string, unknown>;
267
+ }
268
+ /**
269
+ * A raster pixel value for a specific layer.
270
+ *
271
+ * @interface
272
+ */
273
+ type RasterValue = {
274
+ /**
275
+ * The value of the pixel.
276
+ */
277
+ value: number;
278
+ /**
279
+ * The ID of the layer that the pixel belongs to.
280
+ */
281
+ layerId: string;
282
+ /**
283
+ * The name of the category that the pixel belongs to.
284
+ */
285
+ categoryName: null | string;
286
+ /**
287
+ * The color of the pixel. Each value is between 0 and 255.
288
+ */
289
+ color: null | {
290
+ r: number;
291
+ g: number;
292
+ b: number;
293
+ a: number;
294
+ };
295
+ };
296
+
297
+ /**
298
+ * This describes the processing status of a layer.
299
+ *
300
+ * The various values are:
301
+ * - `processing`: The layer has been uploaded or updated and is still processing.
302
+ * - `completed`: The layer has been processed and can be viewed on the map.
303
+ * - `failed`: The layer failed to process and cannot be viewed on the map.
304
+ * - `incomplete`: The layer has not been processed.
305
+ *
306
+ * @group Layers
307
+ */
308
+ type LayerProcessingStatus = z.infer<typeof LayerProcessingStatusSchema>;
309
+ declare const LayerProcessingStatusSchema: z.ZodEnum<["processing", "completed", "failed", "incomplete"]>;
310
+ /**
311
+ * @group Layers
312
+ */
313
+ interface Layer {
314
+ /**
315
+ * The string identifying the layer
316
+ */
317
+ id: string;
318
+ /**
319
+ * The ID of the layer group that the layer belongs to.
320
+ *
321
+ * Layers that appear at the root level in Felt will not have a group ID.
322
+ */
323
+ groupId: string | null;
324
+ /**
325
+ * The name of the layer can be displayed in the Legend, depending
326
+ * on how the layer's legend is configured in its style.
327
+ */
328
+ name: string;
329
+ /**
330
+ * The layer's caption is shown in the legend.
331
+ */
332
+ caption: string | null;
333
+ /**
334
+ * The layer description forms part of the layer's metadata. This is visible
335
+ * to users via the layer info button in the legend.
336
+ */
337
+ description: string | null;
338
+ /**
339
+ * Whether the layer is visible or not.
340
+ */
341
+ visible: boolean;
342
+ /**
343
+ * Whether the layer is shown in the legend or not.
344
+ */
345
+ shownInLegend: boolean;
346
+ /**
347
+ * The current processing status of the layer.
348
+ */
349
+ status: LayerProcessingStatus;
350
+ /**
351
+ * The geometry type of the layer.
352
+ *
353
+ * @remarks
354
+ * This will generally be one of:
355
+ * - `"Point"`
356
+ * - `"Line"`
357
+ * - `"Polygon"`
358
+ * - `"Raster"`
359
+ * - `null`
360
+ *
361
+ * When the layer is processing, or it is a data-only layer, it will be null. You should
362
+ * expect this to be able to be any string, however, as more geometry types can be added
363
+ * in the future.
364
+ */
365
+ geometryType: string | null;
366
+ /**
367
+ * The bounding box of the layer. If the layer is processing, or the bounds have otherwise
368
+ * not been calculated or are not available, this will be `null`.
369
+ *
370
+ * {@link FeltBoundary}
371
+ */
372
+ bounds: FeltBoundary | null;
373
+ }
374
+ /**
375
+ * @group Layer Groups
376
+ */
377
+ interface LayerGroup {
378
+ /**
379
+ * A string identifying the layer group.
380
+ */
381
+ id: string;
382
+ /**
383
+ * The name of the layer group. This is shown in the legend.
384
+ */
385
+ name: string;
386
+ /**
387
+ * The caption of the layer group. This is shown in the legend.
388
+ */
389
+ caption: string | null;
390
+ /**
391
+ * The ids of the layers in the layer group.
392
+ *
393
+ * @remarks
394
+ * You can use these ids to get the full layer objects via the `getLayers` method.
395
+ */
396
+ layerIds: Array<string>;
397
+ /**
398
+ * Whether the layer group is visible or not.
399
+ */
400
+ visible: boolean;
401
+ /**
402
+ * Whether the layer group is shown in the legend or not.
403
+ */
404
+ shownInLegend: boolean;
405
+ /**
406
+ * The bounding box of the layer group.
407
+ *
408
+ * {@link FeltBoundary}
409
+ */
410
+ bounds: FeltBoundary | null;
411
+ }
412
+ /**
413
+ * The constraints to apply when getting layers.
414
+ *
415
+ * @group Layers
416
+ */
417
+ interface GetLayersConstraint extends zInfer<typeof GetLayersConstraintSchema> {
418
+ }
419
+ /**
420
+ * @ignore
421
+ */
422
+ declare const GetLayersConstraintSchema: z.ZodObject<{
423
+ /**
424
+ * The ids of the layers to get.
425
+ */
426
+ ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ ids?: string[] | undefined;
429
+ }, {
430
+ ids?: string[] | undefined;
431
+ }>;
432
+ /**
433
+ * The constraints to apply when getting layer groups.
434
+ *
435
+ * @group Layer Groups
436
+ */
437
+ interface GetLayerGroupsConstraint extends zInfer<typeof GetLayerGroupsFilterSchema> {
438
+ }
439
+ /**
440
+ * @ignore
441
+ */
442
+ declare const GetLayerGroupsFilterSchema: z.ZodObject<{
443
+ /**
444
+ * The ids of the layer groups to get.
445
+ */
446
+ ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
447
+ }, "strip", z.ZodTypeAny, {
448
+ ids?: string[] | undefined;
449
+ }, {
450
+ ids?: string[] | undefined;
451
+ }>;
452
+ /**
453
+ * The parameters for the `onLayerChange` listener.
454
+ *
455
+ * @group Layers
456
+ */
457
+ interface LayerChangeCallbackParams {
458
+ /**
459
+ * The new data for the layer or null if the layer was removed.
460
+ */
461
+ layer: Layer | null;
462
+ }
463
+ /**
464
+ * The parameters for the `onLayerGroupChange` listener.
465
+ *
466
+ * @group Layer Groups
467
+ */
468
+ interface LayerGroupChangeCallbackParams {
469
+ layerGroup: LayerGroup | null;
470
+ }
471
+ /**
472
+ * A legend item, which often represents a sub-class of features in a
473
+ * layer in the case of categorical or classed layers.
474
+ *
475
+ * @group Legend Items
476
+ */
477
+ interface LegendItem extends LegendItemIdentifier {
478
+ /**
479
+ * The title of the legend item.
480
+ */
481
+ title: string | Array<string>;
482
+ /**
483
+ * Whether the title depends on the zoom level or not. If it does, you
484
+ * need to call `getLegendItem` when the zoom level changes.
485
+ *
486
+ * Note that as the zoom level changes, the `onLegendItemChange` handler
487
+ * will not be called, so you need to call `getLegendItem` yourself.
488
+ */
489
+ titleDependsOnZoom: boolean;
490
+ /**
491
+ * Whether the legend item is visible or not.
492
+ */
493
+ visible: boolean;
494
+ }
495
+ /**
496
+ * The identifier for a legend item. It is a compound key of the layer to
497
+ * which the legend item belongs and the legend item's own id.
498
+ *
499
+ * @group Legend Items
500
+ */
501
+ interface LegendItemIdentifier extends zInfer<typeof LegendItemIdentifierSchema> {
502
+ }
503
+ /** @ignore */
504
+ declare const LegendItemIdentifierSchema: z.ZodObject<{
505
+ /**
506
+ * The id of the legend item.
507
+ */
508
+ id: z.ZodString;
509
+ /**
510
+ * The id of the layer the legend item belongs to.
511
+ */
512
+ layerId: z.ZodString;
513
+ }, "strip", z.ZodTypeAny, {
514
+ id: string;
515
+ layerId: string;
516
+ }, {
517
+ id: string;
518
+ layerId: string;
519
+ }>;
520
+ /**
521
+ * Constraints for legend items. If nothing is passed, all legend items will be returned.
522
+ *
523
+ * @group Legend Items
524
+ */
525
+ interface LegendItemsConstraint extends zInfer<typeof LegendItemsConstraintSchema> {
526
+ }
527
+ /** @ignore */
528
+ declare const LegendItemsConstraintSchema: z.ZodObject<{
529
+ /**
530
+ * Array of legend item identifiers to constrain by.
531
+ */
532
+ ids: z.ZodOptional<z.ZodArray<z.ZodObject<{
533
+ /**
534
+ * The id of the legend item.
535
+ */
536
+ id: z.ZodString;
537
+ /**
538
+ * The id of the layer the legend item belongs to.
539
+ */
540
+ layerId: z.ZodString;
541
+ }, "strip", z.ZodTypeAny, {
542
+ id: string;
543
+ layerId: string;
544
+ }, {
545
+ id: string;
546
+ layerId: string;
547
+ }>, "many">>;
548
+ /**
549
+ * Array of layer ids to constrain legend items by.
550
+ */
551
+ layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
552
+ }, "strip", z.ZodTypeAny, {
553
+ ids?: {
554
+ id: string;
555
+ layerId: string;
556
+ }[] | undefined;
557
+ layerIds?: string[] | undefined;
558
+ }, {
559
+ ids?: {
560
+ id: string;
561
+ layerId: string;
562
+ }[] | undefined;
563
+ layerIds?: string[] | undefined;
564
+ }>;
565
+ /**
566
+ * The parameters for the `onLegendItemChange` listener.
567
+ *
568
+ * @group Legend Items
569
+ */
570
+ interface LegendItemChangeCallbackParams {
571
+ /**
572
+ * The new data for the legend item or null if the legend item was removed.
573
+ */
574
+ legendItem: LegendItem | null;
575
+ }
576
+ /**
577
+ * Constraints for the `getRenderedFeatures` method. If no constraints are
578
+ * provided, all rendered features will be returned.
579
+ *
580
+ * @group Layers
581
+ */
582
+ interface GetRenderedFeaturesConstraint extends zInfer<typeof GetRenderedFeaturesConstraintSchema> {
583
+ }
584
+ /** @ignore */
585
+ declare const GetRenderedFeaturesConstraintSchema: z.ZodObject<{
586
+ /**
587
+ * The ids of the layers to get rendered features for.
588
+ */
589
+ layerIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
590
+ }, "strip", z.ZodTypeAny, {
591
+ layerIds?: string[] | undefined;
592
+ }, {
593
+ layerIds?: string[] | undefined;
594
+ }>;
595
+
596
+ /**
597
+ * @group Filters
598
+ */
599
+ type FilterLogicGate = z.infer<typeof FilterLogicGateSchema>;
600
+ declare const FilterLogicGateSchema: z.ZodEnum<["and", "or"]>;
601
+ /**
602
+ * @group Filters
603
+ */
604
+ type FilterExpression = z.infer<typeof FilterExpressionSchema>;
605
+ declare const FilterExpressionSchema: z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["in", "ni"]>, z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>, "many">, z.ZodNull]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>], null>]>;
606
+ /**
607
+ * @group Filters
608
+ */
609
+ type FilterTernary = [
610
+ FilterTernary | FilterExpression | null | boolean,
611
+ FilterLogicGate,
612
+ FilterTernary | FilterExpression | null | boolean
613
+ ];
614
+ /**
615
+ *
616
+ * Filters can be used to change which features in a layer are rendered. Filters can be
617
+ * applied to a layer by the `setLayerFilters` method on the Felt controller.
618
+ *
619
+ * @remarks
620
+ * The possible operators are:
621
+ * - `lt`: Less than
622
+ * - `gt`: Greater than
623
+ * - `le`: Less than or equal to
624
+ * - `ge`: Greater than or equal to
625
+ * - `eq`: Equal to
626
+ * - `ne`: Not equal to
627
+ * - `cn`: Contains
628
+ * - `nc`: Does not contain
629
+ *
630
+ * The allowed boolean operators are:
631
+ * - `and`: Logical AND
632
+ * - `or`: Logical OR
633
+ *
634
+ * @example
635
+ * ```typescript
636
+ * // a simple filter
637
+ * felt.setLayerFilters({
638
+ * layerId: "layer-1",
639
+ * filters: ["AREA", "gt", 30_000],
640
+ * });
641
+ *
642
+ * // compound filters can be constructed using boolean logic:
643
+ * felt.setLayerFilters({
644
+ * layerId: "layer-1",
645
+ * filters: [["AREA", "gt", 30_000], "and", ["COLOR", "eq", "red"]]
646
+ * })
647
+ * ```
648
+ *
649
+ * @group Filters
650
+ */
651
+ type Filters = FilterTernary | FilterExpression | null | boolean;
652
+ /**
653
+ * The filters that are currently set on a layer.
654
+ *
655
+ * A layer's filters are the combination of various different places
656
+ * in which filters can be applied.
657
+ *
658
+ * @group Filters
659
+ */
660
+ interface LayerFilters {
661
+ /**
662
+ * Filters that are set in the layer's style. These are the lowest level
663
+ * of filters, and can only be set by editing the map.
664
+ */
665
+ style: Filters;
666
+ /**
667
+ * Filters that are set in the layer's components, which are interactive
668
+ * elements in the legend. These can be set by viewers for their own session,
669
+ * but their default value can be set by the map creator.
670
+ */
671
+ components: Filters;
672
+ /**
673
+ * Filters that are set ephemerally by viewers in their own session.
674
+ *
675
+ * These are the filters that are set when the `setLayerFilters` method is
676
+ * called. There is no way to set these in the Felt UI - they can only be
677
+ * set using the SDK.
678
+ */
679
+ ephemeral: Filters;
680
+ /**
681
+ * The combined result of all the filters set on the layer.
682
+ */
683
+ combined: Filters;
684
+ }
685
+
686
+ /**
687
+ * The event object passed to the interaction listeners.
688
+ */
689
+ interface MapInteractionEvent {
690
+ /**
691
+ * The cursor position in world coordinates.
692
+ */
693
+ coordinate: LatLng;
694
+ /**
695
+ * The vector features that are under the cursor.
696
+ */
697
+ features: Array<Feature>;
698
+ /**
699
+ * The raster pixel values that are under the cursor.
700
+ */
701
+ rasterValues: Array<RasterValue>;
702
+ }
703
+
704
+ /**
705
+ * A reference to any kind of entity in the map.
706
+ *
707
+ * @remarks
708
+ * EntityNodes are used when you have some collection of entities and you need to
709
+ *
710
+ * @group Entity Node
711
+ */
712
+ type EntityNode = ElementNode | ElementGroupNode | LayerNode | LayerGroupNode | FeatureNode;
713
+ /**
714
+ * References an element on the map.
715
+ *
716
+ * @interface
717
+ * @group Entity Nodes
718
+ */
719
+ type ElementNode = {
720
+ type: "element";
721
+ entity: Element;
722
+ };
723
+ /**
724
+ * References an element group.
725
+ *
726
+ * @interface
727
+ * @group Entity Nodes
728
+ */
729
+ type ElementGroupNode = {
730
+ type: "elementGroup";
731
+ entity: ElementGroup;
732
+ };
733
+ /**
734
+ * References a layer on the map.
735
+ *
736
+ * @interface
737
+ * @group Entity Nodes
738
+ */
739
+ type LayerNode = {
740
+ type: "layer";
741
+ entity: Layer;
742
+ };
743
+ /**
744
+ * References a layer group on the map.
745
+ *
746
+ * @interface
747
+ * @group Entity Nodes
748
+ */
749
+ type LayerGroupNode = {
750
+ type: "layerGroup";
751
+ entity: LayerGroup;
752
+ };
753
+ /**
754
+ * References a feature on the map.
755
+ *
756
+ * @interface
757
+ * @group Entity Nodes
758
+ */
759
+ type FeatureNode = {
760
+ type: "feature";
761
+ entity: Feature;
762
+ };
763
+
764
+ /**
765
+ * The input type for setting the viewport to a particular center and zoom.
766
+ *
767
+ * @group Types
768
+ */
769
+ interface ViewportCenterZoom extends zInfer<typeof ViewportCenterZoomSchema> {
770
+ /**
771
+ * The center of the viewport in latitude and longitude.
772
+ */
773
+ center: LatLng;
774
+ /**
775
+ * The zoom level of the viewport.
776
+ */
777
+ zoom: FeltZoom;
778
+ }
779
+ declare const ViewportCenterZoomSchema: z.ZodObject<{
780
+ center: z.ZodObject<{
781
+ latitude: z.ZodNumber;
782
+ longitude: z.ZodNumber;
783
+ }, "strip", z.ZodTypeAny, {
784
+ latitude: number;
785
+ longitude: number;
786
+ }, {
787
+ latitude: number;
788
+ longitude: number;
789
+ }>;
790
+ zoom: z.ZodNumber;
791
+ }, "strip", z.ZodTypeAny, {
792
+ center: {
793
+ latitude: number;
794
+ longitude: number;
795
+ };
796
+ zoom: number;
797
+ }, {
798
+ center: {
799
+ latitude: number;
800
+ longitude: number;
801
+ };
802
+ zoom: number;
803
+ }>;
804
+ /**
805
+ * @group Types
806
+ *
807
+ * The current state of the viewport, including the derived bounds.
808
+ */
809
+ interface ViewportState {
810
+ /**
811
+ * The center of the viewport in latitude and longitude.
812
+ *
813
+ * {@link LatLng}
814
+ */
815
+ center: LatLng;
816
+ /**
817
+ * The zoom level of the viewport.
818
+ *
819
+ * {@link FeltZoom}
820
+ */
821
+ zoom: FeltZoom;
822
+ /**
823
+ * The bounding box of the viewport.
824
+ *
825
+ * This is derived, and depends on the center and zoom of the viewport, as
826
+ * well as its size.
827
+ *
828
+ * {@link FeltBoundary}
829
+ */
830
+ bounds: FeltBoundary;
831
+ }
832
+ /**
833
+ * The parameters for the `setViewport` method.
834
+ *
835
+ * @group Types
836
+ */
837
+ interface SetViewportCenterZoomParams extends zInfer<typeof SetViewportCenterZoomParamsSchema> {
838
+ }
839
+ declare const SetViewportCenterZoomParamsSchema: z.ZodObject<{
840
+ center: z.ZodOptional<z.ZodObject<{
841
+ latitude: z.ZodNumber;
842
+ longitude: z.ZodNumber;
843
+ }, "strip", z.ZodTypeAny, {
844
+ latitude: number;
845
+ longitude: number;
846
+ }, {
847
+ latitude: number;
848
+ longitude: number;
849
+ }>>;
850
+ zoom: z.ZodOptional<z.ZodNumber>;
851
+ }, "strip", z.ZodTypeAny, {
852
+ center?: {
853
+ latitude: number;
854
+ longitude: number;
855
+ } | undefined;
856
+ zoom?: number | undefined;
857
+ }, {
858
+ center?: {
859
+ latitude: number;
860
+ longitude: number;
861
+ } | undefined;
862
+ zoom?: number | undefined;
863
+ }>;
864
+ /**
865
+ * The parameters for the `fitViewportToBounds` method.
866
+ *
867
+ * @group Types
868
+ */
869
+ interface ViewportFitBoundsParams extends zInfer<typeof ViewportFitBoundsParamsSchema> {
870
+ /**
871
+ * The bounds to fit the viewport to.
872
+ *
873
+ * {@link FeltBoundary}
874
+ */
875
+ bounds: FeltBoundary;
876
+ }
877
+ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
878
+ bounds: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
879
+ }, "strip", z.ZodTypeAny, {
880
+ bounds: [number, number, number, number];
881
+ }, {
882
+ bounds: [number, number, number, number];
883
+ }>;
884
+
885
+ export type { ElementGroupNode as A, ElementNode as B, FeatureNode as C, LayerGroupNode as D, Element as E, Filters as F, Geometry as G, LayerNode as H, FeltBoundary as I, FeltZoom as J, LatLng as K, Layer as L, MapInteractionEvent as M, LineStringGeometry as N, LngLatTuple as O, MultiLineStringGeometry as P, MultiPolygonGeometry as Q, RasterValue as R, SetVisibilityRequest as S, PointGeometry as T, PolygonGeometry as U, ViewportState as V, UnionToIntersection as W, PromiseOrNot as X, GetElementsConstraint as a, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, GetLayersConstraint as f, LayerChangeCallbackParams as g, LayerGroup as h, GetLayerGroupsConstraint as i, LayerGroupChangeCallbackParams as j, LegendItemIdentifier as k, LegendItem as l, LegendItemsConstraint as m, LegendItemChangeCallbackParams as n, LayerFilters as o, GetRenderedFeaturesConstraint as p, Feature as q, EntityNode as r, SetViewportCenterZoomParams as s, ViewportFitBoundsParams as t, ViewportCenterZoom as u, LayerProcessingStatus as v, FilterExpression as w, FilterLogicGate as x, FilterTernary as y, zInfer as z };