@feltmaps/js-sdk 1.5.0-next.6 → 1.5.0-next.7

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.
@@ -378,7 +378,7 @@ declare const ImageCreateSchema: z.ZodObject<Omit<{
378
378
  attributes?: Record<string, unknown> | undefined;
379
379
  opacity?: number | undefined;
380
380
  }>;
381
- declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objectUtil.extendShape<{
381
+ declare const PlaceReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
382
382
  id: z.ZodString;
383
383
  groupId: z.ZodNullable<z.ZodString>;
384
384
  color: z.ZodString;
@@ -393,9 +393,10 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
393
393
  symbol: z.ZodString;
394
394
  frame: z.ZodNullable<z.ZodEnum<["frame-circle", "frame-square"]>>;
395
395
  hideLabel: z.ZodBoolean;
396
- }>, "coordinates">, "strip", z.ZodTypeAny, {
396
+ }>, "strip", z.ZodTypeAny, {
397
397
  symbol: string;
398
398
  type: "Place";
399
+ coordinates: [number, number];
399
400
  id: string;
400
401
  groupId: string | null;
401
402
  color: string;
@@ -408,6 +409,7 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
408
409
  }, {
409
410
  symbol: string;
410
411
  type: "Place";
412
+ coordinates: [number, number];
411
413
  id: string;
412
414
  groupId: string | null;
413
415
  color: string;
@@ -515,7 +517,7 @@ declare const PolygonReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obj
515
517
  fillOpacity: number;
516
518
  areaMarker: boolean;
517
519
  }>;
518
- declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
520
+ declare const CircleReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
519
521
  id: z.ZodString;
520
522
  groupId: z.ZodNullable<z.ZodString>;
521
523
  color: z.ZodString;
@@ -536,8 +538,9 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
536
538
  radiusDisplayUnit: z.ZodNullable<z.ZodEnum<["meter", "kilometer", "foot", "mile"]>>;
537
539
  fillOpacity: z.ZodNumber;
538
540
  radiusMarker: z.ZodBoolean;
539
- }>, "coordinates">, "strip", z.ZodTypeAny, {
541
+ }>, "strip", z.ZodTypeAny, {
540
542
  type: "Circle";
543
+ coordinates: [number, number];
541
544
  id: string;
542
545
  groupId: string | null;
543
546
  color: string;
@@ -555,6 +558,7 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
555
558
  radiusMarker: boolean;
556
559
  }, {
557
560
  type: "Circle";
561
+ coordinates: [number, number];
558
562
  id: string;
559
563
  groupId: string | null;
560
564
  color: string;
@@ -1317,7 +1321,7 @@ declare const GetElementGroupsConstraintSchema: z.ZodObject<{
1317
1321
  ids?: string[] | undefined;
1318
1322
  }>;
1319
1323
  /**
1320
- * The parameters for the `onElementChange` listener.
1324
+ * The parameters for the `onElementChange` and the `onElementCreate` listeners.
1321
1325
  *
1322
1326
  * @group Elements
1323
1327
  */
@@ -1326,6 +1330,22 @@ interface ElementChangeCallbackParams {
1326
1330
  * The new data for the element or null if the element was removed.
1327
1331
  */
1328
1332
  element: Element | null;
1333
+ /**
1334
+ * Whether or not this element is still being created by a drawing tool.
1335
+ *
1336
+ * For example, if the user begins drawing a polygon, they need to place
1337
+ * multiple points until they've ultimately completed the polygon. All
1338
+ * the time they are still placing points, this will be true.
1339
+ *
1340
+ * For elements that require text entry (such as Places, Text and Notes)
1341
+ * this will be true all the time the user is typing text until the point
1342
+ * at which the user finishes, by pressing Escape for example.
1343
+ *
1344
+ * If the user is editing an existing element, this will be false.
1345
+ *
1346
+ * For elements that are created programatically, this will be false.
1347
+ */
1348
+ isBeingCreated: boolean;
1329
1349
  }
1330
1350
  /**
1331
1351
  * The parameters for the `onElementGroupChange` listener.
@@ -1464,6 +1484,40 @@ declare const SetVisibilityRequestSchema: z.ZodObject<{
1464
1484
  show?: string[] | undefined;
1465
1485
  hide?: string[] | undefined;
1466
1486
  }>;
1487
+ /**
1488
+ * Specifies the direction to sort data in
1489
+ *
1490
+ * @group Types
1491
+ */
1492
+ type SortDirection = z.infer<typeof SortDirectionSchema>;
1493
+ /** @ignore */
1494
+ declare const SortDirectionSchema: z.ZodEnum<["asc", "desc"]>;
1495
+ /**
1496
+ * Configuration for sorting data by a specific attribute
1497
+ *
1498
+ * @group Types
1499
+ */
1500
+ interface SortConfig extends zInfer<typeof SortConfigSchema> {
1501
+ }
1502
+ /** @ignore */
1503
+ declare const SortConfigSchema: z.ZodObject<{
1504
+ /**
1505
+ * The attribute to sort by. What this represents depends on the context.
1506
+ * For instance, when sorting features in a data table, the attribute is
1507
+ * the column to sort by.
1508
+ */
1509
+ attribute: z.ZodString;
1510
+ /**
1511
+ * The direction to sort in
1512
+ */
1513
+ direction: z.ZodEnum<["asc", "desc"]>;
1514
+ }, "strip", z.ZodTypeAny, {
1515
+ attribute: string;
1516
+ direction: "asc" | "desc";
1517
+ }, {
1518
+ attribute: string;
1519
+ direction: "asc" | "desc";
1520
+ }>;
1467
1521
 
1468
1522
  /**
1469
1523
  * A feature is a single geographical item in a layer.
@@ -1888,6 +1942,31 @@ declare const FilterLogicGateSchema: z.ZodEnum<["and", "or"]>;
1888
1942
  type FilterExpression = z.infer<typeof FilterExpressionSchema>;
1889
1943
  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>]>;
1890
1944
  /**
1945
+ * A `FilterTernary` is a tree structure for combining expressions with logical operators.
1946
+ *
1947
+ * When combining three or more conditions, you must use proper nesting rather than a flat list.
1948
+ *
1949
+ * @example
1950
+ * ```typescript
1951
+ * // A simple filter with a single condition
1952
+ * const filter = [
1953
+ * ["AREA", "gt", 30_000],
1954
+ * "and",
1955
+ * ["COLOR", "eq", "red"]
1956
+ * ]
1957
+ *
1958
+ * // A complex filter with multiple conditions
1959
+ * const filter = [
1960
+ * ["AREA", "gt", 30_000],
1961
+ * "and",
1962
+ * [
1963
+ * ["COLOR", "eq", "red"],
1964
+ * "or",
1965
+ * ["TYPE", "eq", "residential"]
1966
+ * ]
1967
+ * ]
1968
+ * ```
1969
+ *
1891
1970
  * @group Filters
1892
1971
  */
1893
1972
  type FilterTernary = [
@@ -1900,6 +1979,12 @@ type FilterTernary = [
1900
1979
  * Filters can be used to change which features in a layer are rendered. Filters can be
1901
1980
  * applied to a layer by the `setLayerFilters` method on the Felt controller.
1902
1981
  *
1982
+ * Filters use a tree structure for combining expressions with logical operators, called a
1983
+ * {@link FilterTernary}. When combining three or more conditions, you must use proper nesting
1984
+ * rather than a flat list.
1985
+ *
1986
+ * See the examples below for the correct structure to use when building complex filters.
1987
+ *
1903
1988
  * @remarks
1904
1989
  * The possible operators are:
1905
1990
  * - `lt`: Less than
@@ -1917,17 +2002,82 @@ type FilterTernary = [
1917
2002
  *
1918
2003
  * @example
1919
2004
  * ```typescript
1920
- * // a simple filter
2005
+ * // 1. Simple filter: single condition
1921
2006
  * felt.setLayerFilters({
1922
2007
  * layerId: "layer-1",
1923
2008
  * filters: ["AREA", "gt", 30_000],
1924
2009
  * });
1925
2010
  *
1926
- * // compound filters can be constructed using boolean logic:
2011
+ * // 2. Basic compound filter: two conditions with AND
2012
+ * felt.setLayerFilters({
2013
+ * layerId: "layer-1",
2014
+ * filters: [
2015
+ * ["AREA", "gt", 30_000], // First condition
2016
+ * "and", // Logic operator
2017
+ * ["COLOR", "eq", "red"] // Second condition
2018
+ * ]
2019
+ * });
2020
+ *
2021
+ * // 3. Complex filter: three or more conditions require nesting
2022
+ * // ⚠️ IMPORTANT: Filters use a tree structure, not a flat list
1927
2023
  * felt.setLayerFilters({
1928
2024
  * layerId: "layer-1",
1929
- * filters: [["AREA", "gt", 30_000], "and", ["COLOR", "eq", "red"]]
1930
- * })
2025
+ * filters: [
2026
+ * ["AREA", "gt", 30_000], // First condition
2027
+ * "and", // First logic operator
2028
+ * [ // Nested group starts
2029
+ * ["COLOR", "eq", "red"], // Second condition
2030
+ * "and", // Second logic operator
2031
+ * ["TYPE", "eq", "residential"] // Third condition
2032
+ * ] // Nested group ends
2033
+ * ]
2034
+ * });
2035
+ *
2036
+ * // 4. Even more complex: four conditions with proper nesting
2037
+ * // Visual structure:
2038
+ * // AND
2039
+ * // / \
2040
+ * // condition AND
2041
+ * // / \
2042
+ * // condition AND
2043
+ * // / \
2044
+ * // condition condition
2045
+ * felt.setLayerFilters({
2046
+ * layerId: "layer-1",
2047
+ * filters: [
2048
+ * ["AREA", "gt", 30_000], // First condition
2049
+ * "and",
2050
+ * [
2051
+ * ["COLOR", "eq", "red"], // Second condition
2052
+ * "and",
2053
+ * [
2054
+ * ["TYPE", "eq", "residential"], // Third condition
2055
+ * "and",
2056
+ * ["YEAR", "gt", 2000] // Fourth condition
2057
+ * ]
2058
+ * ]
2059
+ * ]
2060
+ * });
2061
+ *
2062
+ * // 5. Mixed operators: combining AND and OR
2063
+ * // Visual structure:
2064
+ * // AND
2065
+ * // / \
2066
+ * // condition OR
2067
+ * // / \
2068
+ * // condition condition
2069
+ * felt.setLayerFilters({
2070
+ * layerId: "layer-1",
2071
+ * filters: [
2072
+ * ["AREA", "gt", 30_000], // Must have large area
2073
+ * "and",
2074
+ * [
2075
+ * ["COLOR", "eq", "red"], // Must be either red
2076
+ * "or",
2077
+ * ["TYPE", "eq", "residential"] // OR residential type
2078
+ * ]
2079
+ * ]
2080
+ * });
1931
2081
  * ```
1932
2082
  *
1933
2083
  * @group Filters
@@ -2179,8 +2329,8 @@ declare const GetLayerCategoriesParamsSchema: z.ZodObject<{
2179
2329
  } | undefined;
2180
2330
  }>>;
2181
2331
  }, "strip", z.ZodTypeAny, {
2182
- layerId: string;
2183
2332
  attribute: string;
2333
+ layerId: string;
2184
2334
  values?: {
2185
2335
  boundary?: [number, number][] | {
2186
2336
  type: "Polygon";
@@ -2199,8 +2349,8 @@ declare const GetLayerCategoriesParamsSchema: z.ZodObject<{
2199
2349
  filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
2200
2350
  limit?: number | undefined;
2201
2351
  }, {
2202
- layerId: string;
2203
2352
  attribute: string;
2353
+ layerId: string;
2204
2354
  values?: {
2205
2355
  boundary?: [number, number][] | {
2206
2356
  type: "Polygon";
@@ -2370,8 +2520,8 @@ declare const GetLayerHistogramParamsSchema: z.ZodObject<{
2370
2520
  } | undefined;
2371
2521
  }>>;
2372
2522
  }, "strip", z.ZodTypeAny, {
2373
- layerId: string;
2374
2523
  attribute: string;
2524
+ layerId: string;
2375
2525
  steps: number[] | {
2376
2526
  type: "equal-intervals";
2377
2527
  count: number;
@@ -2396,8 +2546,8 @@ declare const GetLayerHistogramParamsSchema: z.ZodObject<{
2396
2546
  } | [number, number, number, number] | undefined;
2397
2547
  filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
2398
2548
  }, {
2399
- layerId: string;
2400
2549
  attribute: string;
2550
+ layerId: string;
2401
2551
  steps: number[] | {
2402
2552
  type: "equal-intervals";
2403
2553
  count: number;
@@ -3044,4 +3194,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
3044
3194
  bounds: [number, number, number, number];
3045
3195
  }>;
3046
3196
 
3047
- export type { ImageElementUpdate as $, AggregationMethod as A, FeatureSelection as B, ConfigurableToolType as C, ToolSettingsMap as D, Element as E, Filters as F, Geometry as G, ToolSettingsChangeEvent as H, InputToolSettings as I, zInfer as J, SetViewportCenterZoomParams as K, Layer as L, MapInteractionEvent as M, ViewportConstraints as N, ViewportFitBoundsParams as O, ViewportCenterZoom as P, CircleElementCreate as Q, CircleElementRead as R, SetVisibilityRequest as S, ToolType as T, CircleElementUpdate as U, ViewportState as V, HighlighterElementCreate as W, HighlighterElementRead as X, HighlighterElementUpdate as Y, ImageElementCreate as Z, ImageElementRead as _, GetElementsConstraint as a, LinkElementRead as a0, MarkerElementCreate as a1, MarkerElementRead as a2, MarkerElementUpdate as a3, NoteElementCreate as a4, NoteElementRead as a5, NoteElementUpdate as a6, PathElementCreate as a7, PathElementRead as a8, PathElementUpdate as a9, LngLatTuple as aA, MultiLineStringGeometry as aB, MultiPolygonGeometry as aC, PointGeometry as aD, PolygonGeometry as aE, CircleToolSettings as aF, HighlighterToolSettings as aG, LineToolSettings as aH, MarkerToolSettings as aI, NoteToolSettings as aJ, PinToolSettings as aK, PlaceFrame as aL, PlaceSymbol as aM, PolygonToolSettings as aN, RouteToolSettings as aO, TextToolSettings as aP, UnionToIntersection as aQ, PromiseOrNot as aR, PlaceElementCreate as aa, PlaceElementRead as ab, PlaceElementUpdate as ac, PolygonElementCreate as ad, PolygonElementRead as ae, PolygonElementUpdate as af, TextElementCreate as ag, TextElementRead as ah, TextElementUpdate as ai, LayerProcessingStatus as aj, RasterValue as ak, FilterExpression as al, FilterLogicGate as am, FilterTernary as an, AggregationConfig as ao, MultiAggregationConfig as ap, ValueConfiguration as aq, ElementGroupNode as ar, ElementNode as as, FeatureNode as at, LayerGroupNode as au, LayerNode as av, FeltBoundary as aw, FeltZoom as ax, LatLng as ay, LineStringGeometry as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, GetLayerCategoriesParams as t, GetLayerCategoriesGroup as u, GetLayerHistogramParams as v, GetLayerHistogramBin as w, GetLayerCalculationParams as x, MapDetails as y, EntityNode as z };
3197
+ export type { ImageElementRead as $, AggregationMethod as A, FeatureSelection as B, ConfigurableToolType as C, ToolSettingsMap as D, Element as E, Filters as F, Geometry as G, ToolSettingsChangeEvent as H, InputToolSettings as I, zInfer as J, SortConfig as K, Layer as L, MapInteractionEvent as M, SetViewportCenterZoomParams as N, ViewportConstraints as O, ViewportFitBoundsParams as P, ViewportCenterZoom as Q, CircleElementCreate as R, SetVisibilityRequest as S, ToolType as T, CircleElementRead as U, ViewportState as V, CircleElementUpdate as W, HighlighterElementCreate as X, HighlighterElementRead as Y, HighlighterElementUpdate as Z, ImageElementCreate as _, GetElementsConstraint as a, ImageElementUpdate as a0, LinkElementRead as a1, MarkerElementCreate as a2, MarkerElementRead as a3, MarkerElementUpdate as a4, NoteElementCreate as a5, NoteElementRead as a6, NoteElementUpdate as a7, PathElementCreate as a8, PathElementRead as a9, LineStringGeometry as aA, LngLatTuple as aB, MultiLineStringGeometry as aC, MultiPolygonGeometry as aD, PointGeometry as aE, PolygonGeometry as aF, SortDirection as aG, CircleToolSettings as aH, HighlighterToolSettings as aI, LineToolSettings as aJ, MarkerToolSettings as aK, NoteToolSettings as aL, PinToolSettings as aM, PlaceFrame as aN, PlaceSymbol as aO, PolygonToolSettings as aP, RouteToolSettings as aQ, TextToolSettings as aR, UnionToIntersection as aS, PromiseOrNot as aT, PathElementUpdate as aa, PlaceElementCreate as ab, PlaceElementRead as ac, PlaceElementUpdate as ad, PolygonElementCreate as ae, PolygonElementRead as af, PolygonElementUpdate as ag, TextElementCreate as ah, TextElementRead as ai, TextElementUpdate as aj, LayerProcessingStatus as ak, RasterValue as al, FilterExpression as am, FilterLogicGate as an, FilterTernary as ao, AggregationConfig as ap, MultiAggregationConfig as aq, ValueConfiguration as ar, ElementGroupNode as as, ElementNode as at, FeatureNode as au, LayerGroupNode as av, LayerNode as aw, FeltBoundary as ax, FeltZoom as ay, LatLng as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, GetLayerCategoriesParams as t, GetLayerCategoriesGroup as u, GetLayerHistogramParams as v, GetLayerHistogramBin as w, GetLayerCalculationParams as x, MapDetails as y, EntityNode as z };
@@ -378,7 +378,7 @@ declare const ImageCreateSchema: z.ZodObject<Omit<{
378
378
  attributes?: Record<string, unknown> | undefined;
379
379
  opacity?: number | undefined;
380
380
  }>;
381
- declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objectUtil.extendShape<{
381
+ declare const PlaceReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
382
382
  id: z.ZodString;
383
383
  groupId: z.ZodNullable<z.ZodString>;
384
384
  color: z.ZodString;
@@ -393,9 +393,10 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
393
393
  symbol: z.ZodString;
394
394
  frame: z.ZodNullable<z.ZodEnum<["frame-circle", "frame-square"]>>;
395
395
  hideLabel: z.ZodBoolean;
396
- }>, "coordinates">, "strip", z.ZodTypeAny, {
396
+ }>, "strip", z.ZodTypeAny, {
397
397
  symbol: string;
398
398
  type: "Place";
399
+ coordinates: [number, number];
399
400
  id: string;
400
401
  groupId: string | null;
401
402
  color: string;
@@ -408,6 +409,7 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
408
409
  }, {
409
410
  symbol: string;
410
411
  type: "Place";
412
+ coordinates: [number, number];
411
413
  id: string;
412
414
  groupId: string | null;
413
415
  color: string;
@@ -515,7 +517,7 @@ declare const PolygonReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obj
515
517
  fillOpacity: number;
516
518
  areaMarker: boolean;
517
519
  }>;
518
- declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
520
+ declare const CircleReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
519
521
  id: z.ZodString;
520
522
  groupId: z.ZodNullable<z.ZodString>;
521
523
  color: z.ZodString;
@@ -536,8 +538,9 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
536
538
  radiusDisplayUnit: z.ZodNullable<z.ZodEnum<["meter", "kilometer", "foot", "mile"]>>;
537
539
  fillOpacity: z.ZodNumber;
538
540
  radiusMarker: z.ZodBoolean;
539
- }>, "coordinates">, "strip", z.ZodTypeAny, {
541
+ }>, "strip", z.ZodTypeAny, {
540
542
  type: "Circle";
543
+ coordinates: [number, number];
541
544
  id: string;
542
545
  groupId: string | null;
543
546
  color: string;
@@ -555,6 +558,7 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
555
558
  radiusMarker: boolean;
556
559
  }, {
557
560
  type: "Circle";
561
+ coordinates: [number, number];
558
562
  id: string;
559
563
  groupId: string | null;
560
564
  color: string;
@@ -1317,7 +1321,7 @@ declare const GetElementGroupsConstraintSchema: z.ZodObject<{
1317
1321
  ids?: string[] | undefined;
1318
1322
  }>;
1319
1323
  /**
1320
- * The parameters for the `onElementChange` listener.
1324
+ * The parameters for the `onElementChange` and the `onElementCreate` listeners.
1321
1325
  *
1322
1326
  * @group Elements
1323
1327
  */
@@ -1326,6 +1330,22 @@ interface ElementChangeCallbackParams {
1326
1330
  * The new data for the element or null if the element was removed.
1327
1331
  */
1328
1332
  element: Element | null;
1333
+ /**
1334
+ * Whether or not this element is still being created by a drawing tool.
1335
+ *
1336
+ * For example, if the user begins drawing a polygon, they need to place
1337
+ * multiple points until they've ultimately completed the polygon. All
1338
+ * the time they are still placing points, this will be true.
1339
+ *
1340
+ * For elements that require text entry (such as Places, Text and Notes)
1341
+ * this will be true all the time the user is typing text until the point
1342
+ * at which the user finishes, by pressing Escape for example.
1343
+ *
1344
+ * If the user is editing an existing element, this will be false.
1345
+ *
1346
+ * For elements that are created programatically, this will be false.
1347
+ */
1348
+ isBeingCreated: boolean;
1329
1349
  }
1330
1350
  /**
1331
1351
  * The parameters for the `onElementGroupChange` listener.
@@ -1464,6 +1484,40 @@ declare const SetVisibilityRequestSchema: z.ZodObject<{
1464
1484
  show?: string[] | undefined;
1465
1485
  hide?: string[] | undefined;
1466
1486
  }>;
1487
+ /**
1488
+ * Specifies the direction to sort data in
1489
+ *
1490
+ * @group Types
1491
+ */
1492
+ type SortDirection = z.infer<typeof SortDirectionSchema>;
1493
+ /** @ignore */
1494
+ declare const SortDirectionSchema: z.ZodEnum<["asc", "desc"]>;
1495
+ /**
1496
+ * Configuration for sorting data by a specific attribute
1497
+ *
1498
+ * @group Types
1499
+ */
1500
+ interface SortConfig extends zInfer<typeof SortConfigSchema> {
1501
+ }
1502
+ /** @ignore */
1503
+ declare const SortConfigSchema: z.ZodObject<{
1504
+ /**
1505
+ * The attribute to sort by. What this represents depends on the context.
1506
+ * For instance, when sorting features in a data table, the attribute is
1507
+ * the column to sort by.
1508
+ */
1509
+ attribute: z.ZodString;
1510
+ /**
1511
+ * The direction to sort in
1512
+ */
1513
+ direction: z.ZodEnum<["asc", "desc"]>;
1514
+ }, "strip", z.ZodTypeAny, {
1515
+ attribute: string;
1516
+ direction: "asc" | "desc";
1517
+ }, {
1518
+ attribute: string;
1519
+ direction: "asc" | "desc";
1520
+ }>;
1467
1521
 
1468
1522
  /**
1469
1523
  * A feature is a single geographical item in a layer.
@@ -1888,6 +1942,31 @@ declare const FilterLogicGateSchema: z.ZodEnum<["and", "or"]>;
1888
1942
  type FilterExpression = z.infer<typeof FilterExpressionSchema>;
1889
1943
  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>]>;
1890
1944
  /**
1945
+ * A `FilterTernary` is a tree structure for combining expressions with logical operators.
1946
+ *
1947
+ * When combining three or more conditions, you must use proper nesting rather than a flat list.
1948
+ *
1949
+ * @example
1950
+ * ```typescript
1951
+ * // A simple filter with a single condition
1952
+ * const filter = [
1953
+ * ["AREA", "gt", 30_000],
1954
+ * "and",
1955
+ * ["COLOR", "eq", "red"]
1956
+ * ]
1957
+ *
1958
+ * // A complex filter with multiple conditions
1959
+ * const filter = [
1960
+ * ["AREA", "gt", 30_000],
1961
+ * "and",
1962
+ * [
1963
+ * ["COLOR", "eq", "red"],
1964
+ * "or",
1965
+ * ["TYPE", "eq", "residential"]
1966
+ * ]
1967
+ * ]
1968
+ * ```
1969
+ *
1891
1970
  * @group Filters
1892
1971
  */
1893
1972
  type FilterTernary = [
@@ -1900,6 +1979,12 @@ type FilterTernary = [
1900
1979
  * Filters can be used to change which features in a layer are rendered. Filters can be
1901
1980
  * applied to a layer by the `setLayerFilters` method on the Felt controller.
1902
1981
  *
1982
+ * Filters use a tree structure for combining expressions with logical operators, called a
1983
+ * {@link FilterTernary}. When combining three or more conditions, you must use proper nesting
1984
+ * rather than a flat list.
1985
+ *
1986
+ * See the examples below for the correct structure to use when building complex filters.
1987
+ *
1903
1988
  * @remarks
1904
1989
  * The possible operators are:
1905
1990
  * - `lt`: Less than
@@ -1917,17 +2002,82 @@ type FilterTernary = [
1917
2002
  *
1918
2003
  * @example
1919
2004
  * ```typescript
1920
- * // a simple filter
2005
+ * // 1. Simple filter: single condition
1921
2006
  * felt.setLayerFilters({
1922
2007
  * layerId: "layer-1",
1923
2008
  * filters: ["AREA", "gt", 30_000],
1924
2009
  * });
1925
2010
  *
1926
- * // compound filters can be constructed using boolean logic:
2011
+ * // 2. Basic compound filter: two conditions with AND
2012
+ * felt.setLayerFilters({
2013
+ * layerId: "layer-1",
2014
+ * filters: [
2015
+ * ["AREA", "gt", 30_000], // First condition
2016
+ * "and", // Logic operator
2017
+ * ["COLOR", "eq", "red"] // Second condition
2018
+ * ]
2019
+ * });
2020
+ *
2021
+ * // 3. Complex filter: three or more conditions require nesting
2022
+ * // ⚠️ IMPORTANT: Filters use a tree structure, not a flat list
1927
2023
  * felt.setLayerFilters({
1928
2024
  * layerId: "layer-1",
1929
- * filters: [["AREA", "gt", 30_000], "and", ["COLOR", "eq", "red"]]
1930
- * })
2025
+ * filters: [
2026
+ * ["AREA", "gt", 30_000], // First condition
2027
+ * "and", // First logic operator
2028
+ * [ // Nested group starts
2029
+ * ["COLOR", "eq", "red"], // Second condition
2030
+ * "and", // Second logic operator
2031
+ * ["TYPE", "eq", "residential"] // Third condition
2032
+ * ] // Nested group ends
2033
+ * ]
2034
+ * });
2035
+ *
2036
+ * // 4. Even more complex: four conditions with proper nesting
2037
+ * // Visual structure:
2038
+ * // AND
2039
+ * // / \
2040
+ * // condition AND
2041
+ * // / \
2042
+ * // condition AND
2043
+ * // / \
2044
+ * // condition condition
2045
+ * felt.setLayerFilters({
2046
+ * layerId: "layer-1",
2047
+ * filters: [
2048
+ * ["AREA", "gt", 30_000], // First condition
2049
+ * "and",
2050
+ * [
2051
+ * ["COLOR", "eq", "red"], // Second condition
2052
+ * "and",
2053
+ * [
2054
+ * ["TYPE", "eq", "residential"], // Third condition
2055
+ * "and",
2056
+ * ["YEAR", "gt", 2000] // Fourth condition
2057
+ * ]
2058
+ * ]
2059
+ * ]
2060
+ * });
2061
+ *
2062
+ * // 5. Mixed operators: combining AND and OR
2063
+ * // Visual structure:
2064
+ * // AND
2065
+ * // / \
2066
+ * // condition OR
2067
+ * // / \
2068
+ * // condition condition
2069
+ * felt.setLayerFilters({
2070
+ * layerId: "layer-1",
2071
+ * filters: [
2072
+ * ["AREA", "gt", 30_000], // Must have large area
2073
+ * "and",
2074
+ * [
2075
+ * ["COLOR", "eq", "red"], // Must be either red
2076
+ * "or",
2077
+ * ["TYPE", "eq", "residential"] // OR residential type
2078
+ * ]
2079
+ * ]
2080
+ * });
1931
2081
  * ```
1932
2082
  *
1933
2083
  * @group Filters
@@ -2179,8 +2329,8 @@ declare const GetLayerCategoriesParamsSchema: z.ZodObject<{
2179
2329
  } | undefined;
2180
2330
  }>>;
2181
2331
  }, "strip", z.ZodTypeAny, {
2182
- layerId: string;
2183
2332
  attribute: string;
2333
+ layerId: string;
2184
2334
  values?: {
2185
2335
  boundary?: [number, number][] | {
2186
2336
  type: "Polygon";
@@ -2199,8 +2349,8 @@ declare const GetLayerCategoriesParamsSchema: z.ZodObject<{
2199
2349
  filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
2200
2350
  limit?: number | undefined;
2201
2351
  }, {
2202
- layerId: string;
2203
2352
  attribute: string;
2353
+ layerId: string;
2204
2354
  values?: {
2205
2355
  boundary?: [number, number][] | {
2206
2356
  type: "Polygon";
@@ -2370,8 +2520,8 @@ declare const GetLayerHistogramParamsSchema: z.ZodObject<{
2370
2520
  } | undefined;
2371
2521
  }>>;
2372
2522
  }, "strip", z.ZodTypeAny, {
2373
- layerId: string;
2374
2523
  attribute: string;
2524
+ layerId: string;
2375
2525
  steps: number[] | {
2376
2526
  type: "equal-intervals";
2377
2527
  count: number;
@@ -2396,8 +2546,8 @@ declare const GetLayerHistogramParamsSchema: z.ZodObject<{
2396
2546
  } | [number, number, number, number] | undefined;
2397
2547
  filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
2398
2548
  }, {
2399
- layerId: string;
2400
2549
  attribute: string;
2550
+ layerId: string;
2401
2551
  steps: number[] | {
2402
2552
  type: "equal-intervals";
2403
2553
  count: number;
@@ -3044,4 +3194,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
3044
3194
  bounds: [number, number, number, number];
3045
3195
  }>;
3046
3196
 
3047
- export type { ImageElementUpdate as $, AggregationMethod as A, FeatureSelection as B, ConfigurableToolType as C, ToolSettingsMap as D, Element as E, Filters as F, Geometry as G, ToolSettingsChangeEvent as H, InputToolSettings as I, zInfer as J, SetViewportCenterZoomParams as K, Layer as L, MapInteractionEvent as M, ViewportConstraints as N, ViewportFitBoundsParams as O, ViewportCenterZoom as P, CircleElementCreate as Q, CircleElementRead as R, SetVisibilityRequest as S, ToolType as T, CircleElementUpdate as U, ViewportState as V, HighlighterElementCreate as W, HighlighterElementRead as X, HighlighterElementUpdate as Y, ImageElementCreate as Z, ImageElementRead as _, GetElementsConstraint as a, LinkElementRead as a0, MarkerElementCreate as a1, MarkerElementRead as a2, MarkerElementUpdate as a3, NoteElementCreate as a4, NoteElementRead as a5, NoteElementUpdate as a6, PathElementCreate as a7, PathElementRead as a8, PathElementUpdate as a9, LngLatTuple as aA, MultiLineStringGeometry as aB, MultiPolygonGeometry as aC, PointGeometry as aD, PolygonGeometry as aE, CircleToolSettings as aF, HighlighterToolSettings as aG, LineToolSettings as aH, MarkerToolSettings as aI, NoteToolSettings as aJ, PinToolSettings as aK, PlaceFrame as aL, PlaceSymbol as aM, PolygonToolSettings as aN, RouteToolSettings as aO, TextToolSettings as aP, UnionToIntersection as aQ, PromiseOrNot as aR, PlaceElementCreate as aa, PlaceElementRead as ab, PlaceElementUpdate as ac, PolygonElementCreate as ad, PolygonElementRead as ae, PolygonElementUpdate as af, TextElementCreate as ag, TextElementRead as ah, TextElementUpdate as ai, LayerProcessingStatus as aj, RasterValue as ak, FilterExpression as al, FilterLogicGate as am, FilterTernary as an, AggregationConfig as ao, MultiAggregationConfig as ap, ValueConfiguration as aq, ElementGroupNode as ar, ElementNode as as, FeatureNode as at, LayerGroupNode as au, LayerNode as av, FeltBoundary as aw, FeltZoom as ax, LatLng as ay, LineStringGeometry as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, GetLayerCategoriesParams as t, GetLayerCategoriesGroup as u, GetLayerHistogramParams as v, GetLayerHistogramBin as w, GetLayerCalculationParams as x, MapDetails as y, EntityNode as z };
3197
+ export type { ImageElementRead as $, AggregationMethod as A, FeatureSelection as B, ConfigurableToolType as C, ToolSettingsMap as D, Element as E, Filters as F, Geometry as G, ToolSettingsChangeEvent as H, InputToolSettings as I, zInfer as J, SortConfig as K, Layer as L, MapInteractionEvent as M, SetViewportCenterZoomParams as N, ViewportConstraints as O, ViewportFitBoundsParams as P, ViewportCenterZoom as Q, CircleElementCreate as R, SetVisibilityRequest as S, ToolType as T, CircleElementRead as U, ViewportState as V, CircleElementUpdate as W, HighlighterElementCreate as X, HighlighterElementRead as Y, HighlighterElementUpdate as Z, ImageElementCreate as _, GetElementsConstraint as a, ImageElementUpdate as a0, LinkElementRead as a1, MarkerElementCreate as a2, MarkerElementRead as a3, MarkerElementUpdate as a4, NoteElementCreate as a5, NoteElementRead as a6, NoteElementUpdate as a7, PathElementCreate as a8, PathElementRead as a9, LineStringGeometry as aA, LngLatTuple as aB, MultiLineStringGeometry as aC, MultiPolygonGeometry as aD, PointGeometry as aE, PolygonGeometry as aF, SortDirection as aG, CircleToolSettings as aH, HighlighterToolSettings as aI, LineToolSettings as aJ, MarkerToolSettings as aK, NoteToolSettings as aL, PinToolSettings as aM, PlaceFrame as aN, PlaceSymbol as aO, PolygonToolSettings as aP, RouteToolSettings as aQ, TextToolSettings as aR, UnionToIntersection as aS, PromiseOrNot as aT, PathElementUpdate as aa, PlaceElementCreate as ab, PlaceElementRead as ac, PlaceElementUpdate as ad, PolygonElementCreate as ae, PolygonElementRead as af, PolygonElementUpdate as ag, TextElementCreate as ah, TextElementRead as ai, TextElementUpdate as aj, LayerProcessingStatus as ak, RasterValue as al, FilterExpression as am, FilterLogicGate as an, FilterTernary as ao, AggregationConfig as ap, MultiAggregationConfig as aq, ValueConfiguration as ar, ElementGroupNode as as, ElementNode as at, FeatureNode as au, LayerGroupNode as av, LayerNode as aw, FeltBoundary as ax, FeltZoom as ay, LatLng as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, GetLayerCategoriesParams as t, GetLayerCategoriesGroup as u, GetLayerHistogramParams as v, GetLayerHistogramBin as w, GetLayerCalculationParams as x, MapDetails as y, EntityNode as z };