@feltmaps/js-sdk 1.6.0 → 1.7.0-next.1

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/client.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var x=(e,o)=>{for(var n in o)c(e,n,{get:o[n],enumerable:!0})},f=(e,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of b(o))!I.call(e,a)&&a!==n&&c(e,a,{get:()=>o[a],enumerable:!(s=S(o,a))||s.enumerable});return e};var k=e=>f(c({},"__esModule",{value:!0}),e);var O={};x(O,{Felt:()=>M});module.exports=k(O);function r(e,o){return n=>{let s=new MessageChannel,a=n.handler,i="options"in n?n.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:i?{eventName:o,id:m,options:i}:{eventName:o,id:m}},"*",[s.port2]),s.port1.onmessage=y=>{u(y)||a(y.data)},()=>{s.port1.onmessage=null,s.port1.close(),s.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,o,n){return async s=>{let a=new MessageChannel,i=s&&n?await n(s):s;return e.postMessage({type:o,params:i},"*",[a.port2]),new Promise((m,y)=>{a.port1.onmessage=g=>{u(g)?y(new Error(g.data.__error__)):m(g.data),a.port1.close(),a.port2.close()}})}}function u(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var C=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementCreate:r(e,"onElementCreate"),onElementCreateEnd:r(e,"onElementCreateEnd"),onElementDelete:r(e,"onElementDelete"),onElementGroupChange:r(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var L=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var P=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:r(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",h),updateLayer:t(e,"updateLayer",h),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:r(e,"onLayerFiltersChange"),getLayerBoundaries:t(e,"getLayerBoundaries"),setLayerBoundary:t(e,"setLayerBoundary"),onLayerBoundariesChange:r(e,"onLayerBoundariesChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getFeatures:t(e,"getFeatures"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getLayerSchema:t(e,"getLayerSchema")});async function h(e){let{source:o}=e;return o&&o.type==="geoJsonFile"?{...e,source:{type:"geoJsonData",data:JSON.parse(await o.file.text())}}:e}var T=e=>({getMapDetails:t(e,"getMapDetails")});var E=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var v=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:r(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:r(e,"onToolSettingsChange")});var F=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var G=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function V(e){return{iframe:null,...G(e),...F(e),...P(e),...C(e),...E(e),...L(e),...v(e),...T(e)}}var M={embed(e,o,n){let s={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},a=n?.origin??s.origin,i=new URL(`${a}/embed/map/${o}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},y={...s.uiControls,...n?.uiControls};for(let[p,d]of K(y))d!=null&&i.searchParams.set(m[p],d?"1":"0");if(n?.token&&i.searchParams.set("token",n.token),n?.initialViewport){let p=n.initialViewport;i.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let g=e.tagName==="IFRAME",l=g?e:e.ownerDocument.createElement("iframe");return l.src=i.toString(),g||(l.style.width="100%",l.style.height="100%",l.style.border="none",l.style.margin="0",e.appendChild(l)),l.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{l.addEventListener("load",()=>{l.contentWindow==null?d(new Error("Failed to load Felt map")):p(l.contentWindow)},{once:!0})}).then(M.connect).then(p=>(Object.defineProperties(p,{iframe:{value:l,writable:!1,configurable:!1}}),p))},connect(e){let o=V(e);return new Promise((n,s)=>{let a=setTimeout(()=>{s(new Error("Failed to load Felt map")),clearInterval(m)},5e3),i=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[i.port2])},100);i.port1.onmessage=y=>{y.data===!0&&(clearInterval(m),clearTimeout(a),i.port1.close(),i.port2.close(),n(o))}})}},K=Object.entries;0&&(module.exports={Felt});
1
+ "use strict";var u=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var x=(e,o)=>{for(var n in o)u(e,n,{get:o[n],enumerable:!0})},f=(e,o,n,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of S(o))!I.call(e,s)&&s!==n&&u(e,s,{get:()=>o[s],enumerable:!(a=b(o,s))||a.enumerable});return e};var k=e=>f(u({},"__esModule",{value:!0}),e);var A={};x(A,{Felt:()=>M});module.exports=k(A);function r(e,o){return n=>{let a=new MessageChannel,s=n.handler,i="options"in n?n.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:i?{eventName:o,id:m,options:i}:{eventName:o,id:m}},"*",[a.port2]),a.port1.onmessage=g=>{c(g)||s(g.data)},()=>{a.port1.onmessage=null,a.port1.close(),a.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,o,n){return async a=>{let s=new MessageChannel,i=a&&n?await n(a):a;return e.postMessage({type:o,params:i},"*",[s.port2]),new Promise((m,g)=>{s.port1.onmessage=y=>{c(y)?g(new Error(y.data.__error__)):m(y.data),s.port1.close(),s.port2.close()}})}}function c(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var C=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementCreate:r(e,"onElementCreate"),onElementCreateEnd:r(e,"onElementCreateEnd"),onElementDelete:r(e,"onElementDelete"),onElementGroupChange:r(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var L=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var P=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:r(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",h),updateLayer:t(e,"updateLayer",h),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:r(e,"onLayerFiltersChange"),getLayerBoundaries:t(e,"getLayerBoundaries"),setLayerBoundary:t(e,"setLayerBoundary"),onLayerBoundariesChange:r(e,"onLayerBoundariesChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getFeatures:t(e,"getFeatures"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getPrecomputedAggregates:t(e,"getPrecomputedAggregates"),getLayerSchema:t(e,"getLayerSchema")});async function h(e){let{source:o}=e;return o&&o.type==="geoJsonFile"?{...e,source:{type:"geoJsonData",data:JSON.parse(await o.file.text())}}:e}var T=e=>({getMapDetails:t(e,"getMapDetails")});var E=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var v=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:r(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:r(e,"onToolSettingsChange")});var F=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var G=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function V(e){return{iframe:null,...G(e),...F(e),...P(e),...C(e),...E(e),...L(e),...v(e),...T(e)}}var M={embed(e,o,n){let a={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},s=n?.origin??a.origin,i=new URL(`${s}/embed/map/${o}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},g={...a.uiControls,...n?.uiControls};for(let[p,d]of K(g))d!=null&&i.searchParams.set(m[p],d?"1":"0");if(n?.token&&i.searchParams.set("token",n.token),n?.initialViewport){let p=n.initialViewport;i.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let y=e.tagName==="IFRAME",l=y?e:e.ownerDocument.createElement("iframe");return l.src=i.toString(),y||(l.style.width="100%",l.style.height="100%",l.style.border="none",l.style.margin="0",e.appendChild(l)),l.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{l.addEventListener("load",()=>{l.contentWindow==null?d(new Error("Failed to load Felt map")):p(l.contentWindow)},{once:!0})}).then(M.connect).then(p=>(Object.defineProperties(p,{iframe:{value:l,writable:!1,configurable:!1}}),p))},connect(e){let o=V(e);return new Promise((n,a)=>{let s=setTimeout(()=>{a(new Error("Failed to load Felt map")),clearInterval(m)},5e3),i=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[i.port2])},100);i.port1.onmessage=g=>{g.data===!0&&(clearInterval(m),clearTimeout(s),i.port1.close(),i.port2.close(),n(o))}})}},K=Object.entries;0&&(module.exports={Felt});
package/dist/client.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-C5gGWnaM.cjs';
2
- export { au as AggregationConfig, av as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b2 as CircleToolSettings, b3 as ConfigurableToolType, K as CreateLayersFromGeoJsonParams, O as DataOnlyLayer, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aG as ElementGroupNode, aH as ElementNode, g as ElementUpdate, B as ElementsController, aI as EntityNode, aJ as FeatureNode, aK as FeatureSelection, aO as FeltBoundary, Q as FeltTiledVectorSource, aP as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aQ as GeoJsonFeature, S as GeoJsonFileVectorSource, aR as GeoJsonGeometry, aS as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, aw as GetLayerCalculationParams, ax as GetLayerCategoriesGroup, ay as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, az as GetLayerHistogramBin, aA as GetLayerHistogramParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, b4 as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, b5 as InputToolSettings, J as InteractionsController, aT as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aL as LayerGroupNode, aM as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aD as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, aU as LineStringGeometry, b6 as LineToolSettings, L as LinkElementRead, aV as LngLatTuple, aE as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, b7 as MarkerToolSettings, aF as MiscController, aB as MultiAggregationConfig, aW as MultiLineStringGeometry, aX as MultiPointGeometry, aY as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, b8 as NoteToolSettings, bj as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, b9 as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, ba as PlaceFrame, bb as PlaceSymbol, aZ as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, a_ as PolygonGeometry, bc as PolygonToolSettings, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bd as RouteToolSettings, aN as SelectionController, bl as SetViewportCenterZoomParams, a$ as SetVisibilityRequest, b0 as SortConfig, b1 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, be as TextToolSettings, bf as ToolSettingsChangeEvent, bg as ToolSettingsMap, bh as ToolType, bi as ToolsController, bk as UiController, ab as UpdateLayerParams, aC as ValueConfiguration, ac as VectorLayer, bm as ViewportConstraints, bp as ViewportController, bn as ViewportFitBoundsParams, bo as ViewportState } from './controller-C5gGWnaM.cjs';
1
+ import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-o3EwSJvB.cjs';
2
+ export { au as AggregatedGridConfig, av as AggregationConfig, aw as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b8 as CircleToolSettings, b9 as ConfigurableToolType, ax as CountGridConfig, K as CreateLayersFromGeoJsonParams, O as DataOnlyLayer, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aM as ElementGroupNode, aN as ElementNode, g as ElementUpdate, B as ElementsController, aO as EntityNode, aP as FeatureNode, aQ as FeatureSelection, aU as FeltBoundary, Q as FeltTiledVectorSource, aV as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aW as GeoJsonFeature, S as GeoJsonFileVectorSource, aX as GeoJsonGeometry, aY as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, ay as GetLayerCalculationParams, az as GetLayerCategoriesGroup, aA as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, aB as GetLayerHistogramBin, aC as GetLayerHistogramParams, aD as GetLayerPrecomputedCalculationParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, aE as GridConfig, aF as GridType, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, ba as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, bb as InputToolSettings, J as InteractionsController, aZ as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aR as LayerGroupNode, aS as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aJ as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, a_ as LineStringGeometry, bc as LineToolSettings, L as LinkElementRead, a$ as LngLatTuple, aK as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, bd as MarkerToolSettings, aL as MiscController, aG as MultiAggregationConfig, b0 as MultiLineStringGeometry, b1 as MultiPointGeometry, b2 as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, be as NoteToolSettings, bp as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, bf as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, bg as PlaceFrame, bh as PlaceSymbol, b3 as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, b4 as PolygonGeometry, bi as PolygonToolSettings, aH as PrecomputedAggregationMethod, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bj as RouteToolSettings, aT as SelectionController, br as SetViewportCenterZoomParams, b5 as SetVisibilityRequest, b6 as SortConfig, b7 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, bk as TextToolSettings, bl as ToolSettingsChangeEvent, bm as ToolSettingsMap, bn as ToolType, bo as ToolsController, bq as UiController, ab as UpdateLayerParams, aI as ValueConfiguration, ac as VectorLayer, bs as ViewportConstraints, bv as ViewportController, bt as ViewportFitBoundsParams, bu as ViewportState } from './controller-o3EwSJvB.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-C5gGWnaM.js';
2
- export { au as AggregationConfig, av as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b2 as CircleToolSettings, b3 as ConfigurableToolType, K as CreateLayersFromGeoJsonParams, O as DataOnlyLayer, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aG as ElementGroupNode, aH as ElementNode, g as ElementUpdate, B as ElementsController, aI as EntityNode, aJ as FeatureNode, aK as FeatureSelection, aO as FeltBoundary, Q as FeltTiledVectorSource, aP as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aQ as GeoJsonFeature, S as GeoJsonFileVectorSource, aR as GeoJsonGeometry, aS as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, aw as GetLayerCalculationParams, ax as GetLayerCategoriesGroup, ay as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, az as GetLayerHistogramBin, aA as GetLayerHistogramParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, b4 as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, b5 as InputToolSettings, J as InteractionsController, aT as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aL as LayerGroupNode, aM as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aD as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, aU as LineStringGeometry, b6 as LineToolSettings, L as LinkElementRead, aV as LngLatTuple, aE as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, b7 as MarkerToolSettings, aF as MiscController, aB as MultiAggregationConfig, aW as MultiLineStringGeometry, aX as MultiPointGeometry, aY as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, b8 as NoteToolSettings, bj as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, b9 as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, ba as PlaceFrame, bb as PlaceSymbol, aZ as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, a_ as PolygonGeometry, bc as PolygonToolSettings, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bd as RouteToolSettings, aN as SelectionController, bl as SetViewportCenterZoomParams, a$ as SetVisibilityRequest, b0 as SortConfig, b1 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, be as TextToolSettings, bf as ToolSettingsChangeEvent, bg as ToolSettingsMap, bh as ToolType, bi as ToolsController, bk as UiController, ab as UpdateLayerParams, aC as ValueConfiguration, ac as VectorLayer, bm as ViewportConstraints, bp as ViewportController, bn as ViewportFitBoundsParams, bo as ViewportState } from './controller-C5gGWnaM.js';
1
+ import { z as zInfer, U as UiControlsOptions, V as ViewportCenterZoom, F as FeltController } from './controller-o3EwSJvB.js';
2
+ export { au as AggregatedGridConfig, av as AggregationConfig, aw as AggregationMethod, C as CircleElementCreate, a as CircleElementRead, b as CircleElementUpdate, b8 as CircleToolSettings, b9 as ConfigurableToolType, ax as CountGridConfig, K as CreateLayersFromGeoJsonParams, O as DataOnlyLayer, E as Element, c as ElementChangeCallbackParams, d as ElementCreate, e as ElementGroup, f as ElementGroupChangeCallbackParams, aM as ElementGroupNode, aN as ElementNode, g as ElementUpdate, B as ElementsController, aO as EntityNode, aP as FeatureNode, aQ as FeatureSelection, aU as FeltBoundary, Q as FeltTiledVectorSource, aV as FeltZoom, an as FilterExpression, ao as FilterLogicGate, ap as FilterTernary, aq as Filters, R as GeoJsonDataVectorSource, aW as GeoJsonFeature, S as GeoJsonFileVectorSource, aX as GeoJsonGeometry, aY as GeoJsonProperties, W as GeoJsonUrlVectorSource, ar as GeometryFilter, G as GetElementGroupsConstraint, h as GetElementsConstraint, ay as GetLayerCalculationParams, az as GetLayerCategoriesGroup, aA as GetLayerCategoriesParams, X as GetLayerGroupsConstraint, aB as GetLayerHistogramBin, aC as GetLayerHistogramParams, aD as GetLayerPrecomputedCalculationParams, Y as GetLayersConstraint, Z as GetRenderedFeaturesConstraint, aE as GridConfig, aF as GridType, H as HighlighterElementCreate, i as HighlighterElementRead, j as HighlighterElementUpdate, ba as HighlighterToolSettings, I as ImageElementCreate, k as ImageElementRead, l as ImageElementUpdate, bb as InputToolSettings, J as InteractionsController, aZ as LatLng, _ as Layer, as as LayerBoundaries, $ as LayerChangeCallbackParams, a0 as LayerCommon, ad as LayerFeature, at as LayerFilters, a1 as LayerGroup, a2 as LayerGroupChangeCallbackParams, aR as LayerGroupNode, aS as LayerNode, a3 as LayerProcessingStatus, af as LayerSchema, ag as LayerSchemaAttribute, ah as LayerSchemaBooleanAttribute, ai as LayerSchemaCommonAttribute, aj as LayerSchemaDateAttribute, ak as LayerSchemaDateTimeAttribute, al as LayerSchemaNumericAttribute, am as LayerSchemaTextAttribute, aJ as LayersController, a4 as LegendItem, a5 as LegendItemChangeCallbackParams, a6 as LegendItemIdentifier, a7 as LegendItemsConstraint, a_ as LineStringGeometry, bc as LineToolSettings, L as LinkElementRead, a$ as LngLatTuple, aK as MapDetails, D as MapInteractionEvent, M as MarkerElementCreate, m as MarkerElementRead, n as MarkerElementUpdate, bd as MarkerToolSettings, aL as MiscController, aG as MultiAggregationConfig, b0 as MultiLineStringGeometry, b1 as MultiPointGeometry, b2 as MultiPolygonGeometry, N as NoteElementCreate, o as NoteElementRead, p as NoteElementUpdate, be as NoteToolSettings, bp as OnMapInteractionsOptions, P as PathElementCreate, q as PathElementRead, r as PathElementUpdate, bf as PinToolSettings, s as PlaceElementCreate, t as PlaceElementRead, u as PlaceElementUpdate, bg as PlaceFrame, bh as PlaceSymbol, b3 as PointGeometry, v as PolygonElementCreate, w as PolygonElementRead, x as PolygonElementUpdate, b4 as PolygonGeometry, bi as PolygonToolSettings, aH as PrecomputedAggregationMethod, a8 as RasterBand, a9 as RasterLayer, aa as RasterLayerSource, ae as RasterValue, bj as RouteToolSettings, aT as SelectionController, br as SetViewportCenterZoomParams, b5 as SetVisibilityRequest, b6 as SortConfig, b7 as SortDirection, T as TextElementCreate, y as TextElementRead, A as TextElementUpdate, bk as TextToolSettings, bl as ToolSettingsChangeEvent, bm as ToolSettingsMap, bn as ToolType, bo as ToolsController, bq as UiController, ab as UpdateLayerParams, aI as ValueConfiguration, ac as VectorLayer, bs as ViewportConstraints, bv as ViewportController, bt as ViewportFitBoundsParams, bu as ViewportState } from './controller-o3EwSJvB.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- function r(e,a){return o=>{let n=new MessageChannel,l=o.handler,s="options"in o?o.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:s?{eventName:a,id:m,options:s}:{eventName:a,id:m}},"*",[n.port2]),n.port1.onmessage=y=>{c(y)||l(y.data)},()=>{n.port1.onmessage=null,n.port1.close(),n.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,a,o){return async n=>{let l=new MessageChannel,s=n&&o?await o(n):n;return e.postMessage({type:a,params:s},"*",[l.port2]),new Promise((m,y)=>{l.port1.onmessage=g=>{c(g)?y(new Error(g.data.__error__)):m(g.data),l.port1.close(),l.port2.close()}})}}function c(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var u=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementCreate:r(e,"onElementCreate"),onElementCreateEnd:r(e,"onElementCreateEnd"),onElementDelete:r(e,"onElementDelete"),onElementGroupChange:r(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var C=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var h=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:r(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",L),updateLayer:t(e,"updateLayer",L),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:r(e,"onLayerFiltersChange"),getLayerBoundaries:t(e,"getLayerBoundaries"),setLayerBoundary:t(e,"setLayerBoundary"),onLayerBoundariesChange:r(e,"onLayerBoundariesChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getFeatures:t(e,"getFeatures"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getLayerSchema:t(e,"getLayerSchema")});async function L(e){let{source:a}=e;return a&&a.type==="geoJsonFile"?{...e,source:{type:"geoJsonData",data:JSON.parse(await a.file.text())}}:e}var P=e=>({getMapDetails:t(e,"getMapDetails")});var T=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var E=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:r(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:r(e,"onToolSettingsChange")});var v=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var F=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function G(e){return{iframe:null,...F(e),...v(e),...h(e),...u(e),...T(e),...C(e),...E(e),...P(e)}}var V={embed(e,a,o){let n={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},l=o?.origin??n.origin,s=new URL(`${l}/embed/map/${a}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},y={...n.uiControls,...o?.uiControls};for(let[p,d]of M(y))d!=null&&s.searchParams.set(m[p],d?"1":"0");if(o?.token&&s.searchParams.set("token",o.token),o?.initialViewport){let p=o.initialViewport;s.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let g=e.tagName==="IFRAME",i=g?e:e.ownerDocument.createElement("iframe");return i.src=s.toString(),g||(i.style.width="100%",i.style.height="100%",i.style.border="none",i.style.margin="0",e.appendChild(i)),i.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{i.addEventListener("load",()=>{i.contentWindow==null?d(new Error("Failed to load Felt map")):p(i.contentWindow)},{once:!0})}).then(V.connect).then(p=>(Object.defineProperties(p,{iframe:{value:i,writable:!1,configurable:!1}}),p))},connect(e){let a=G(e);return new Promise((o,n)=>{let l=setTimeout(()=>{n(new Error("Failed to load Felt map")),clearInterval(m)},5e3),s=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[s.port2])},100);s.port1.onmessage=y=>{y.data===!0&&(clearInterval(m),clearTimeout(l),s.port1.close(),s.port2.close(),o(a))}})}},M=Object.entries;export{V as Felt};
1
+ function r(e,s){return o=>{let n=new MessageChannel,l=o.handler,a="options"in o?o.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:a?{eventName:s,id:m,options:a}:{eventName:s,id:m}},"*",[n.port2]),n.port1.onmessage=g=>{u(g)||l(g.data)},()=>{n.port1.onmessage=null,n.port1.close(),n.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,s,o){return async n=>{let l=new MessageChannel,a=n&&o?await o(n):n;return e.postMessage({type:s,params:a},"*",[l.port2]),new Promise((m,g)=>{l.port1.onmessage=y=>{u(y)?g(new Error(y.data.__error__)):m(y.data),l.port1.close(),l.port2.close()}})}}function u(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var c=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementCreate:r(e,"onElementCreate"),onElementCreateEnd:r(e,"onElementCreateEnd"),onElementDelete:r(e,"onElementDelete"),onElementGroupChange:r(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var C=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var h=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:r(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",L),updateLayer:t(e,"updateLayer",L),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:r(e,"onLayerFiltersChange"),getLayerBoundaries:t(e,"getLayerBoundaries"),setLayerBoundary:t(e,"setLayerBoundary"),onLayerBoundariesChange:r(e,"onLayerBoundariesChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getFeatures:t(e,"getFeatures"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getPrecomputedAggregates:t(e,"getPrecomputedAggregates"),getLayerSchema:t(e,"getLayerSchema")});async function L(e){let{source:s}=e;return s&&s.type==="geoJsonFile"?{...e,source:{type:"geoJsonData",data:JSON.parse(await s.file.text())}}:e}var P=e=>({getMapDetails:t(e,"getMapDetails")});var T=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var E=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:r(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:r(e,"onToolSettingsChange")});var v=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var F=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function G(e){return{iframe:null,...F(e),...v(e),...h(e),...c(e),...T(e),...C(e),...E(e),...P(e)}}var V={embed(e,s,o){let n={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},l=o?.origin??n.origin,a=new URL(`${l}/embed/map/${s}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},g={...n.uiControls,...o?.uiControls};for(let[p,d]of M(g))d!=null&&a.searchParams.set(m[p],d?"1":"0");if(o?.token&&a.searchParams.set("token",o.token),o?.initialViewport){let p=o.initialViewport;a.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let y=e.tagName==="IFRAME",i=y?e:e.ownerDocument.createElement("iframe");return i.src=a.toString(),y||(i.style.width="100%",i.style.height="100%",i.style.border="none",i.style.margin="0",e.appendChild(i)),i.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{i.addEventListener("load",()=>{i.contentWindow==null?d(new Error("Failed to load Felt map")):p(i.contentWindow)},{once:!0})}).then(V.connect).then(p=>(Object.defineProperties(p,{iframe:{value:i,writable:!1,configurable:!1}}),p))},connect(e){let s=G(e);return new Promise((o,n)=>{let l=setTimeout(()=>{n(new Error("Failed to load Felt map")),clearInterval(m)},5e3),a=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[a.port2])},100);a.port1.onmessage=g=>{g.data===!0&&(clearInterval(m),clearTimeout(l),a.port1.close(),a.port2.close(),o(s))}})}},M=Object.entries;export{V as Felt};
@@ -5782,6 +5782,7 @@ interface LayerBoundaries {
5782
5782
  }
5783
5783
 
5784
5784
  declare const AggregateMethodSchema: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
5785
+ declare const PrecomputedAggregateMethodSchema: z.ZodEnum<["avg", "max", "min", "sum", "count"]>;
5785
5786
  declare const AggregationConfigSchema: z.ZodObject<{
5786
5787
  /**
5787
5788
  * The operation to use on the values from the features in the layer
@@ -5831,6 +5832,12 @@ interface AggregationConfig extends zInfer<typeof AggregationConfigSchema> {
5831
5832
  * @group Stats
5832
5833
  */
5833
5834
  type AggregationMethod = z.infer<typeof AggregateMethodSchema>;
5835
+ /**
5836
+ * The method to use for the precomputed aggregation.
5837
+ *
5838
+ * @group Stats
5839
+ */
5840
+ type PrecomputedAggregationMethod = z.infer<typeof PrecomputedAggregateMethodSchema>;
5834
5841
  /**
5835
5842
  * Defines how to aggregate a value across features in a layer with multiple aggregations
5836
5843
  * returned at once.
@@ -6468,6 +6475,227 @@ interface GetLayerCalculationParams<T extends AggregationMethod | "count"> exten
6468
6475
  */
6469
6476
  aggregation: MultiAggregationConfig<T>;
6470
6477
  }
6478
+ declare const GridTypeSchema: z.ZodEnum<["h3"]>;
6479
+ /**
6480
+ * The type of grid to use for precomputed aggregate values.
6481
+ *
6482
+ * @group Stats
6483
+ */
6484
+ type GridType = z.infer<typeof GridTypeSchema>;
6485
+ declare const CountGridConfigSchema: z.ZodObject<{
6486
+ type: z.ZodEnum<["h3"]>;
6487
+ /**
6488
+ * The resolution of the grid to use for the precomputed calculation.
6489
+ */
6490
+ resolution: z.ZodNumber;
6491
+ method: z.ZodEnum<["count"]>;
6492
+ }, "strip", z.ZodTypeAny, {
6493
+ type: "h3";
6494
+ method: "count";
6495
+ resolution: number;
6496
+ }, {
6497
+ type: "h3";
6498
+ method: "count";
6499
+ resolution: number;
6500
+ }>;
6501
+ /**
6502
+ * The grid configuration for a count-based precomputed aggregate value. Compared to the
6503
+ * {@link AggregatedGridConfig}, the `attribute` property is not required, because the count
6504
+ * is the same regardless of the attribute.
6505
+ *
6506
+ * Used inside {@link GetLayerPrecomputedCalculationParams}.
6507
+ *
6508
+ * @group Stats
6509
+ */
6510
+ interface CountGridConfig extends zInfer<typeof CountGridConfigSchema> {
6511
+ /**
6512
+ * The type of grid to use for the precomputed calculation.
6513
+ */
6514
+ type: GridType;
6515
+ /**
6516
+ * The method to use for the precomputed calculation, which in this case is always "count".
6517
+ */
6518
+ method: Extract<PrecomputedAggregationMethod, "count">;
6519
+ }
6520
+ declare const AggregatedGridConfigSchema: z.ZodObject<{
6521
+ type: z.ZodEnum<["h3"]>;
6522
+ /**
6523
+ * The resolution of the grid to use for the precomputed calculation.
6524
+ */
6525
+ resolution: z.ZodNumber;
6526
+ method: z.ZodEnum<["avg", "max", "min", "sum"]>;
6527
+ /**
6528
+ * The attribute to use for the precomputed calculation.
6529
+ *
6530
+ * This must be a numeric attribute;
6531
+ */
6532
+ attribute: z.ZodString;
6533
+ }, "strip", z.ZodTypeAny, {
6534
+ type: "h3";
6535
+ attribute: string;
6536
+ method: "avg" | "max" | "min" | "sum";
6537
+ resolution: number;
6538
+ }, {
6539
+ type: "h3";
6540
+ attribute: string;
6541
+ method: "avg" | "max" | "min" | "sum";
6542
+ resolution: number;
6543
+ }>;
6544
+ /**
6545
+ * The grid configuration for an aggregated precomputed aggregate value. This requires
6546
+ * an `attribute` property, because the numeric aggregation requires it.
6547
+ *
6548
+ * If you just want to count the features in each grid cell, use the {@link CountGridConfig}
6549
+ * instead, where you are not required to specify an `attribute`.
6550
+ *
6551
+ * Used inside {@link GetLayerPrecomputedCalculationParams}.
6552
+ *
6553
+ * @group Stats
6554
+ */
6555
+ interface AggregatedGridConfig extends zInfer<typeof AggregatedGridConfigSchema> {
6556
+ /**
6557
+ * The type of grid to use for the precomputed calculation.
6558
+ */
6559
+ type: GridType;
6560
+ /**
6561
+ * The method to use for the precomputed calculation.
6562
+ */
6563
+ method: Exclude<PrecomputedAggregationMethod, "count">;
6564
+ }
6565
+ /**
6566
+ * Describes the type of grid to use for precomputed aggregate values.
6567
+ *
6568
+ * @group Stats
6569
+ */
6570
+ type GridConfig = CountGridConfig | AggregatedGridConfig;
6571
+ declare const GetLayerPrecomputedCalculationParamsSchema: z.ZodObject<{
6572
+ /**
6573
+ * The ID of the layer to calculate an aggregate value for.
6574
+ */
6575
+ layerId: z.ZodString;
6576
+ boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
6577
+ type: z.ZodLiteral<"Polygon">;
6578
+ coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
6579
+ }, "strip", z.ZodTypeAny, {
6580
+ type: "Polygon";
6581
+ coordinates: [number, number][][];
6582
+ }, {
6583
+ type: "Polygon";
6584
+ coordinates: [number, number][][];
6585
+ }>, z.ZodObject<{
6586
+ type: z.ZodLiteral<"MultiPolygon">;
6587
+ coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
6588
+ }, "strip", z.ZodTypeAny, {
6589
+ type: "MultiPolygon";
6590
+ coordinates: [number, number][][][];
6591
+ }, {
6592
+ type: "MultiPolygon";
6593
+ coordinates: [number, number][][][];
6594
+ }>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
6595
+ filters: z.ZodOptional<z.ZodUnion<[z.ZodType<FilterTernary, z.ZodTypeDef, FilterTernary>, 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>]>, z.ZodNull, z.ZodBoolean]>>;
6596
+ /**
6597
+ * The type of grid to use for the precomputed calculation.
6598
+ */
6599
+ gridConfig: z.ZodUnion<[z.ZodObject<{
6600
+ type: z.ZodEnum<["h3"]>;
6601
+ /**
6602
+ * The resolution of the grid to use for the precomputed calculation.
6603
+ */
6604
+ resolution: z.ZodNumber;
6605
+ method: z.ZodEnum<["count"]>;
6606
+ }, "strip", z.ZodTypeAny, {
6607
+ type: "h3";
6608
+ method: "count";
6609
+ resolution: number;
6610
+ }, {
6611
+ type: "h3";
6612
+ method: "count";
6613
+ resolution: number;
6614
+ }>, z.ZodObject<{
6615
+ type: z.ZodEnum<["h3"]>;
6616
+ /**
6617
+ * The resolution of the grid to use for the precomputed calculation.
6618
+ */
6619
+ resolution: z.ZodNumber;
6620
+ method: z.ZodEnum<["avg", "max", "min", "sum"]>;
6621
+ /**
6622
+ * The attribute to use for the precomputed calculation.
6623
+ *
6624
+ * This must be a numeric attribute;
6625
+ */
6626
+ attribute: z.ZodString;
6627
+ }, "strip", z.ZodTypeAny, {
6628
+ type: "h3";
6629
+ attribute: string;
6630
+ method: "avg" | "max" | "min" | "sum";
6631
+ resolution: number;
6632
+ }, {
6633
+ type: "h3";
6634
+ attribute: string;
6635
+ method: "avg" | "max" | "min" | "sum";
6636
+ resolution: number;
6637
+ }>]>;
6638
+ }, "strip", z.ZodTypeAny, {
6639
+ layerId: string;
6640
+ gridConfig: {
6641
+ type: "h3";
6642
+ method: "count";
6643
+ resolution: number;
6644
+ } | {
6645
+ type: "h3";
6646
+ attribute: string;
6647
+ method: "avg" | "max" | "min" | "sum";
6648
+ resolution: number;
6649
+ };
6650
+ boundary?: [number, number, number, number] | [number, number][] | {
6651
+ type: "Polygon";
6652
+ coordinates: [number, number][][];
6653
+ } | {
6654
+ type: "MultiPolygon";
6655
+ coordinates: [number, number][][][];
6656
+ } | undefined;
6657
+ 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;
6658
+ }, {
6659
+ layerId: string;
6660
+ gridConfig: {
6661
+ type: "h3";
6662
+ method: "count";
6663
+ resolution: number;
6664
+ } | {
6665
+ type: "h3";
6666
+ attribute: string;
6667
+ method: "avg" | "max" | "min" | "sum";
6668
+ resolution: number;
6669
+ };
6670
+ boundary?: [number, number, number, number] | [number, number][] | {
6671
+ type: "Polygon";
6672
+ coordinates: [number, number][][];
6673
+ } | {
6674
+ type: "MultiPolygon";
6675
+ coordinates: [number, number][][][];
6676
+ } | undefined;
6677
+ 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;
6678
+ }>;
6679
+ /**
6680
+ * The parameters for calculating a single aggregate value for a layer, passed to
6681
+ * the {@link LayersController.getPrecomputedAggregates} method.
6682
+ *
6683
+ * @group Stats
6684
+ */
6685
+ interface GetLayerPrecomputedCalculationParams extends z.infer<typeof GetLayerPrecomputedCalculationParamsSchema> {
6686
+ /**
6687
+ * Attribute filters for the features to include when calculating the aggregate value.
6688
+ */
6689
+ filters?: Filters;
6690
+ /**
6691
+ * The spatial boundary for the features to include when calculating the aggregate value.
6692
+ */
6693
+ boundary?: GeometryFilter;
6694
+ /**
6695
+ * The grid configuration to use for the precomputed calculation.
6696
+ */
6697
+ gridConfig: GridConfig;
6698
+ }
6471
6699
 
6472
6700
  /**
6473
6701
  * The Layers controller allows you to get information about the layers on the
@@ -7236,6 +7464,33 @@ interface LayersController {
7236
7464
  * ```
7237
7465
  */
7238
7466
  getAggregates<T extends AggregationMethod | "count">(params: GetLayerCalculationParams<T>): Promise<Record<T, number | null>>;
7467
+ /**
7468
+ * Calculates aggregates for spatial cells of a layer.
7469
+ *
7470
+ * @remarks
7471
+ * Performs statistical calculations on spatial cells of a layer, returning min, max, avg, sum, and count. You can focus your calculation on specific areas or subsets
7472
+ * of your data using boundaries and filters. When using the count method, an attribute is not required.
7473
+ *
7474
+ * @example
7475
+ * ```typescript
7476
+ * const aggregates = await felt.getPrecomputedAggregates({
7477
+ * layerId: "buildings",
7478
+ * gridConfig: {
7479
+ * type: "h3",
7480
+ * resolution: 10,
7481
+ * method: "avg",
7482
+ * attribute: "assessed_value"
7483
+ * },
7484
+ * });
7485
+ * ```
7486
+ */
7487
+ getPrecomputedAggregates(params: GetLayerPrecomputedCalculationParams): Promise<{
7488
+ avg: number | null;
7489
+ max: number | null;
7490
+ min: number | null;
7491
+ sum: number | null;
7492
+ count: number | null;
7493
+ }>;
7239
7494
  /**
7240
7495
  * Get the schema for a layer.
7241
7496
  *
@@ -7597,9 +7852,8 @@ interface SelectionController {
7597
7852
  }): Promise<void>;
7598
7853
  }
7599
7854
 
7600
- declare const ToolSchema: z.ZodEnum<["pin", "line", "route", "polygon", "circle", "marker", "highlighter", "text", "note", "link"]>;
7601
- type ToolType = z.infer<typeof ToolSchema>;
7602
- type ConfigurableToolType = keyof ToolSettingsMap;
7855
+ type ToolType = "circle" | "highlighter" | "line" | "link" | "marker" | "note" | "pin" | "polygon" | "route" | "text";
7856
+ type ConfigurableToolType = Exclude<ToolType, "link">;
7603
7857
  declare const PinToolSettingsSchema: z.ZodObject<{
7604
7858
  symbol: z.ZodString;
7605
7859
  color: z.ZodString;
@@ -8513,4 +8767,4 @@ interface FeltController extends ViewportController, UiController, LayersControl
8513
8767
  iframe: HTMLIFrameElement | null;
8514
8768
  }
8515
8769
 
8516
- export type { LayerChangeCallbackParams as $, TextElementUpdate as A, ElementsController as B, CircleElementCreate as C, MapInteractionEvent as D, Element as E, FeltController as F, GetElementGroupsConstraint as G, HighlighterElementCreate as H, ImageElementCreate as I, InteractionsController as J, CreateLayersFromGeoJsonParams as K, LinkElementRead as L, MarkerElementCreate as M, NoteElementCreate as N, DataOnlyLayer as O, PathElementCreate as P, FeltTiledVectorSource as Q, GeoJsonDataVectorSource as R, GeoJsonFileVectorSource as S, TextElementCreate as T, UiControlsOptions as U, ViewportCenterZoom as V, GeoJsonUrlVectorSource as W, GetLayerGroupsConstraint as X, GetLayersConstraint as Y, GetRenderedFeaturesConstraint as Z, Layer as _, CircleElementRead as a, SetVisibilityRequest as a$, LayerCommon as a0, LayerGroup as a1, LayerGroupChangeCallbackParams as a2, LayerProcessingStatus as a3, LegendItem as a4, LegendItemChangeCallbackParams as a5, LegendItemIdentifier as a6, LegendItemsConstraint as a7, RasterBand as a8, RasterLayer as a9, GetLayerHistogramParams as aA, MultiAggregationConfig as aB, ValueConfiguration as aC, LayersController as aD, MapDetails as aE, MiscController as aF, ElementGroupNode as aG, ElementNode as aH, EntityNode as aI, FeatureNode as aJ, FeatureSelection as aK, LayerGroupNode as aL, LayerNode as aM, SelectionController as aN, FeltBoundary as aO, FeltZoom as aP, GeoJsonFeature as aQ, GeoJsonGeometry as aR, GeoJsonProperties as aS, LatLng as aT, LineStringGeometry as aU, LngLatTuple as aV, MultiLineStringGeometry as aW, MultiPointGeometry as aX, MultiPolygonGeometry as aY, PointGeometry as aZ, PolygonGeometry as a_, RasterLayerSource as aa, UpdateLayerParams as ab, VectorLayer as ac, LayerFeature as ad, RasterValue as ae, LayerSchema as af, LayerSchemaAttribute as ag, LayerSchemaBooleanAttribute as ah, LayerSchemaCommonAttribute as ai, LayerSchemaDateAttribute as aj, LayerSchemaDateTimeAttribute as ak, LayerSchemaNumericAttribute as al, LayerSchemaTextAttribute as am, FilterExpression as an, FilterLogicGate as ao, FilterTernary as ap, Filters as aq, GeometryFilter as ar, LayerBoundaries as as, LayerFilters as at, AggregationConfig as au, AggregationMethod as av, GetLayerCalculationParams as aw, GetLayerCategoriesGroup as ax, GetLayerCategoriesParams as ay, GetLayerHistogramBin as az, CircleElementUpdate as b, SortConfig as b0, SortDirection as b1, CircleToolSettings as b2, ConfigurableToolType as b3, HighlighterToolSettings as b4, InputToolSettings as b5, LineToolSettings as b6, MarkerToolSettings as b7, NoteToolSettings as b8, PinToolSettings as b9, PlaceFrame as ba, PlaceSymbol as bb, PolygonToolSettings as bc, RouteToolSettings as bd, TextToolSettings as be, ToolSettingsChangeEvent as bf, ToolSettingsMap as bg, ToolType as bh, ToolsController as bi, UiOnMapInteractionsOptions as bj, UiController as bk, SetViewportCenterZoomParams as bl, ViewportConstraints as bm, ViewportFitBoundsParams as bn, ViewportState as bo, ViewportController as bp, UnwrapPromise as bq, UnionToIntersection as br, PromiseOrNot as bs, ElementChangeCallbackParams as c, ElementCreate as d, ElementGroup as e, ElementGroupChangeCallbackParams as f, ElementUpdate as g, GetElementsConstraint as h, HighlighterElementRead as i, HighlighterElementUpdate as j, ImageElementRead as k, ImageElementUpdate as l, MarkerElementRead as m, MarkerElementUpdate as n, NoteElementRead as o, NoteElementUpdate as p, PathElementRead as q, PathElementUpdate as r, PlaceElementCreate as s, PlaceElementRead as t, PlaceElementUpdate as u, PolygonElementCreate as v, PolygonElementRead as w, PolygonElementUpdate as x, TextElementRead as y, zInfer as z };
8770
+ export type { LayerChangeCallbackParams as $, TextElementUpdate as A, ElementsController as B, CircleElementCreate as C, MapInteractionEvent as D, Element as E, FeltController as F, GetElementGroupsConstraint as G, HighlighterElementCreate as H, ImageElementCreate as I, InteractionsController as J, CreateLayersFromGeoJsonParams as K, LinkElementRead as L, MarkerElementCreate as M, NoteElementCreate as N, DataOnlyLayer as O, PathElementCreate as P, FeltTiledVectorSource as Q, GeoJsonDataVectorSource as R, GeoJsonFileVectorSource as S, TextElementCreate as T, UiControlsOptions as U, ViewportCenterZoom as V, GeoJsonUrlVectorSource as W, GetLayerGroupsConstraint as X, GetLayersConstraint as Y, GetRenderedFeaturesConstraint as Z, Layer as _, CircleElementRead as a, LngLatTuple as a$, LayerCommon as a0, LayerGroup as a1, LayerGroupChangeCallbackParams as a2, LayerProcessingStatus as a3, LegendItem as a4, LegendItemChangeCallbackParams as a5, LegendItemIdentifier as a6, LegendItemsConstraint as a7, RasterBand as a8, RasterLayer as a9, GetLayerCategoriesParams as aA, GetLayerHistogramBin as aB, GetLayerHistogramParams as aC, GetLayerPrecomputedCalculationParams as aD, GridConfig as aE, GridType as aF, MultiAggregationConfig as aG, PrecomputedAggregationMethod as aH, ValueConfiguration as aI, LayersController as aJ, MapDetails as aK, MiscController as aL, ElementGroupNode as aM, ElementNode as aN, EntityNode as aO, FeatureNode as aP, FeatureSelection as aQ, LayerGroupNode as aR, LayerNode as aS, SelectionController as aT, FeltBoundary as aU, FeltZoom as aV, GeoJsonFeature as aW, GeoJsonGeometry as aX, GeoJsonProperties as aY, LatLng as aZ, LineStringGeometry as a_, RasterLayerSource as aa, UpdateLayerParams as ab, VectorLayer as ac, LayerFeature as ad, RasterValue as ae, LayerSchema as af, LayerSchemaAttribute as ag, LayerSchemaBooleanAttribute as ah, LayerSchemaCommonAttribute as ai, LayerSchemaDateAttribute as aj, LayerSchemaDateTimeAttribute as ak, LayerSchemaNumericAttribute as al, LayerSchemaTextAttribute as am, FilterExpression as an, FilterLogicGate as ao, FilterTernary as ap, Filters as aq, GeometryFilter as ar, LayerBoundaries as as, LayerFilters as at, AggregatedGridConfig as au, AggregationConfig as av, AggregationMethod as aw, CountGridConfig as ax, GetLayerCalculationParams as ay, GetLayerCategoriesGroup as az, CircleElementUpdate as b, MultiLineStringGeometry as b0, MultiPointGeometry as b1, MultiPolygonGeometry as b2, PointGeometry as b3, PolygonGeometry as b4, SetVisibilityRequest as b5, SortConfig as b6, SortDirection as b7, CircleToolSettings as b8, ConfigurableToolType as b9, HighlighterToolSettings as ba, InputToolSettings as bb, LineToolSettings as bc, MarkerToolSettings as bd, NoteToolSettings as be, PinToolSettings as bf, PlaceFrame as bg, PlaceSymbol as bh, PolygonToolSettings as bi, RouteToolSettings as bj, TextToolSettings as bk, ToolSettingsChangeEvent as bl, ToolSettingsMap as bm, ToolType as bn, ToolsController as bo, UiOnMapInteractionsOptions as bp, UiController as bq, SetViewportCenterZoomParams as br, ViewportConstraints as bs, ViewportFitBoundsParams as bt, ViewportState as bu, ViewportController as bv, UnwrapPromise as bw, UnionToIntersection as bx, PromiseOrNot as by, ElementChangeCallbackParams as c, ElementCreate as d, ElementGroup as e, ElementGroupChangeCallbackParams as f, ElementUpdate as g, GetElementsConstraint as h, HighlighterElementRead as i, HighlighterElementUpdate as j, ImageElementRead as k, ImageElementUpdate as l, MarkerElementRead as m, MarkerElementUpdate as n, NoteElementRead as o, NoteElementUpdate as p, PathElementRead as q, PathElementUpdate as r, PlaceElementCreate as s, PlaceElementRead as t, PlaceElementUpdate as u, PolygonElementCreate as v, PolygonElementRead as w, PolygonElementUpdate as x, TextElementRead as y, zInfer as z };