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

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/handler.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var oe=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ct=(r,l)=>{for(var T in l)oe(r,T,{get:l[T],enumerable:!0})},yt=(r,l,T,P)=>{if(l&&typeof l=="object"||typeof l=="function")for(let C of pt(l))!mt.call(r,C)&&C!==T&&oe(r,C,{get:()=>l[C],enumerable:!(P=lt(l,C))||P.enumerable});return r};var gt=r=>yt(oe({},"__esModule",{value:!0}),r);var fr={};ct(fr,{createMessageHandler:()=>mr});module.exports=gt(fr);var y=require("zod");var d=require("zod");var S=require("zod");function t(r,l){return S.z.strictObject({type:S.z.literal(r),params:l})}function h(r,l){return S.z.strictObject({eventName:S.z.literal(r),id:S.z.string(),options:l})}function p(r){return S.z.strictObject({eventName:S.z.literal(r),id:S.z.string()})}var s=require("zod"),J=s.z.number(),Z=s.z.number(),q=s.z.object({latitude:Z,longitude:J}),G=s.z.tuple([J,Z]),w=s.z.object({type:s.z.literal("Polygon"),coordinates:s.z.array(s.z.array(G).min(4).refine(r=>r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1],"The last point of each ring must be identical to the first"))}),F=s.z.object({type:s.z.literal("MultiPolygon"),coordinates:s.z.array(w.shape.coordinates)}),dt=s.z.object({type:s.z.literal("LineString"),coordinates:s.z.array(G).min(2)}),U=s.z.object({type:s.z.literal("MultiLineString"),coordinates:s.z.array(dt.shape.coordinates)}),fe=s.z.number().min(1).max(23),L=s.z.tuple([J,Z,J,Z]),E=s.z.object({show:s.z.array(s.z.string()).optional(),hide:s.z.array(s.z.string()).optional()}),ut=s.z.enum(["asc","desc"]),W=s.z.object({attribute:s.z.string(),direction:ut});var e=require("zod");var f=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ae=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),ht=e.z.enum(["meter","kilometer","foot","mile"]),_=f.extend($.shape).extend({type:e.z.literal("Place"),coordinates:G,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),O=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Path"),coordinates:U.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),j=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Polygon"),coordinates:w.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),Q=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Circle"),center:G,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:ht.nullable(),fillOpacity:e.z.number().min(0).max(1)}),R=f.extend({type:e.z.literal("Marker"),coordinates:U.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),N=f.extend({type:e.z.literal("Highlighter"),coordinates:F.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:G,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),re=f.extend(Se.shape).extend({type:e.z.literal("Text")}),ne=f.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),A=f.extend({type:e.z.literal("Image"),coordinates:U.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),ft=f.extend({type:e.z.literal("Link"),coordinates:U.shape.coordinates,url:e.z.string()}),k={type:!0,coordinates:!0},x={id:!0},ie=_.partial().extend(_.pick(k).shape).omit(x),K=O.partial().extend(O.pick(k).shape).omit(x),se=j.partial().extend(j.pick(k).shape).omit(x),le=Q.partial().extend(Q.pick({type:!0,center:!0,radius:!0}).shape).omit(x),pe=R.partial().extend(R.pick(k).shape).omit(x),me=N.partial().extend(N.pick(k).shape).omit(x),ce=re.partial().omit({...x,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ye=ne.partial().omit({...x,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),St=A.partial().extend(A.pick({...k,imageUrl:!0}).shape).omit(x),Le=e.z.discriminatedUnion("type",[ie,K,se,le,pe,me,St,ce,ye]);var Cr=O.omit({coordinates:!0}),Gr=j.omit({coordinates:!0});var Ir=R.omit({coordinates:!0}),Tr=N.omit({coordinates:!0});var Er=A.omit({coordinates:!0}),zr=ft.omit({coordinates:!0}),b={type:!0,id:!0},Lt=_.partial().extend(_.pick(b).shape),xt=O.partial().extend(O.pick(b).shape),bt=j.partial().extend(j.pick(b).shape),Mt=Q.partial().extend(Q.pick(b).shape),Ct=R.partial().extend(R.pick(b).shape),Gt=N.partial().extend(N.pick(b).shape),It=re.partial().extend(re.pick(b).shape).omit({name:!0}),Tt=ne.partial().extend(ne.pick(b).shape).omit({name:!0}),Et=A.partial().extend(A.pick(b).shape),xe=e.z.discriminatedUnion("type",[Lt,xt,bt,Mt,Ct,Gt,It,Tt,Et]),be=e.z.object({ids:e.z.array(e.z.string()).optional()}),Me=e.z.object({ids:e.z.array(e.z.string()).optional()});var zt=t("getElement",d.z.string()),Pt=t("getElementGeometry",d.z.string()),Ft=t("getElements",be.optional()),kt=t("getElementGroup",d.z.string()),Vt=t("getElementGroups",Me.optional()),vt=t("setElementGroupVisibility",E),wt=h("onElementChange",d.z.object({id:d.z.string()})),Ut=p("onElementCreate"),Ot=p("onElementCreateEnd"),jt=h("onElementDelete",d.z.object({id:d.z.string()})),Rt=h("onElementGroupChange",d.z.object({id:d.z.string()})),Nt=t("createElement",Le),At=t("updateElement",xe),Bt=t("deleteElement",d.z.string()),Ce={methods:[zt,Pt,Ft,kt,Vt,vt,Nt,At,Bt],listeners:[wt,Ut,Ot,jt,Rt]};var Dt=p("onPointerClick"),Ht=p("onPointerMove"),Ge={methods:null,listeners:[Dt,Ht]};var a=require("zod");var i=require("zod");var Jt=i.z.enum(["in","ni"]),Zt=i.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),jr=i.z.enum(["and","or"]),Ie=i.z.union([i.z.number(),i.z.string(),i.z.boolean(),i.z.null()]),Te=i.z.string().or(i.z.null()),qt=i.z.tuple([Te,Jt,i.z.array(Ie).or(i.z.null())]),Wt=i.z.tuple([Te,Zt,Ie]),ge=i.z.union([qt,Wt]),de=i.z.tuple([i.z.lazy(()=>i.z.union([de,ge,i.z.null(),i.z.boolean()])),i.z.enum(["and","or"]),i.z.lazy(()=>i.z.union([de,ge,i.z.null(),i.z.boolean()]))]),I=i.z.union([de,ge,i.z.null(),i.z.boolean()]),z=i.z.union([L,w,F,i.z.array(G)]);var n=require("zod");var Ee=n.z.enum(["avg","max","min","sum","median"]),_t=n.z.object({method:Ee,attribute:n.z.string()}),Qt=n.z.object({methods:n.z.array(n.z.union([Ee,n.z.literal("count")])),attribute:n.z.string().optional()}),ze=n.z.object({boundary:z.optional(),filters:I.optional(),aggregation:_t.optional()}),Pe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),limit:n.z.number().optional(),boundary:z.optional(),filters:I.optional(),values:ze.optional()}),Ar=n.z.object({key:n.z.union([n.z.number(),n.z.string(),n.z.boolean()]),value:n.z.number().nullable()}),$t=n.z.object({type:n.z.literal("equal-intervals"),count:n.z.number()}),Kt=n.z.object({type:n.z.literal("time-interval"),interval:n.z.enum(["hour","day","week","month","year"])}),Fe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),steps:n.z.union([$t,Kt,n.z.array(n.z.number())]),boundary:z.optional(),filters:I.optional(),values:ze.optional()}),Br=n.z.object({min:n.z.number(),max:n.z.number(),value:n.z.number()}),ke=n.z.object({layerId:n.z.string(),boundary:z.optional(),filters:I.optional(),aggregation:Qt});var o=require("zod");var Jr=o.z.enum(["processing","completed","failed","incomplete"]),Ve=o.z.object({type:o.z.literal("geoJsonUrl"),url:o.z.string().url(),refreshInterval:o.z.number().min(250).max(5*60*1e3).nullable().optional()}),ve=o.z.object({type:o.z.literal("geoJsonData"),data:o.z.object({}).passthrough().or(o.z.instanceof(ArrayBuffer))}),we=o.z.object({type:o.z.literal("geoJsonFile"),file:o.z.instanceof(File)}),Ue=o.z.object({id:o.z.string(),style:o.z.object({}).passthrough().optional(),shownInLegend:o.z.boolean().optional(),name:o.z.string().optional(),caption:o.z.string().optional(),description:o.z.string().optional(),bounds:L.optional(),source:o.z.union([Ve,ve,we]).optional()}),Oe=o.z.object({ids:o.z.array(o.z.string()).optional()}),je=o.z.object({ids:o.z.array(o.z.string()).optional()}),V=o.z.object({id:o.z.string(),layerId:o.z.string()}),Re=o.z.object({ids:V.array().optional(),layerIds:o.z.string().array().optional()}),Ne=o.z.object({layerIds:o.z.array(o.z.string()).optional(),areaQuery:o.z.union([o.z.object({coordinates:q}),o.z.object({boundary:L})]).optional()}),Xt=o.z.object({Point:o.z.object({}).passthrough().optional(),Line:o.z.object({}).passthrough().optional(),Polygon:o.z.object({}).passthrough().optional()}),Ae=o.z.object({source:o.z.union([Ve,ve,we]),name:o.z.string(),bounds:L.optional(),caption:o.z.string().optional(),description:o.z.string().optional(),geometryStyles:Xt.optional()});var Yt=t("getLayer",a.z.string()),eo=t("getLayers",Oe.optional()),to=t("setLayerVisibility",E),oo=h("onLayerChange",a.z.object({id:a.z.string()})),ro=t("setLayerStyle",a.z.object({id:a.z.string(),style:a.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",E),ao=t("createLayersFromGeoJson",Ae),io=t("updateLayer",Ue),so=t("deleteLayer",a.z.string()),lo=t("getLayerGroup",a.z.string()),po=t("getLayerGroups",je.optional()),mo=t("setLayerGroupVisibility",E),co=t("setLayerGroupLegendVisibility",E),yo=h("onLayerGroupChange",a.z.object({id:a.z.string()})),go=t("getLegendItem",V),uo=t("getLegendItems",Re.optional()),ho=h("onLegendItemChange",V),fo=t("setLegendItemVisibility",a.z.object({show:V.array().optional(),hide:V.array().optional()})),So=t("getLayerFilters",a.z.string()),Lo=t("setLayerFilters",a.z.object({layerId:a.z.string(),filters:I,note:a.z.string().optional()})),xo=h("onLayerFiltersChange",a.z.object({layerId:a.z.string()})),bo=t("getLayerBoundaries",a.z.string()),Mo=t("setLayerBoundary",a.z.object({layerIds:a.z.array(a.z.string()),boundary:F.nullable()})),Co=h("onLayerBoundariesChange",a.z.object({layerId:a.z.string()})),Go=t("getRenderedFeatures",Ne.optional()),Io=t("getFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),To=t("getFeatures",a.z.object({layerId:a.z.string(),filters:I.optional(),sorting:W.optional(),boundary:z.optional(),search:a.z.string().optional(),pagination:a.z.string().optional().nullish()})),Eo=t("getGeoJsonFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),zo=t("getCategoryData",Pe),Po=t("getHistogramData",Fe),Fo=t("getAggregates",ke),ko=t("getLayerSchema",a.z.string()),Be={methods:[Yt,eo,to,ro,no,ao,so,io,lo,po,mo,co,go,uo,fo,So,Lo,bo,Mo,Go,Io,To,Eo,zo,Po,Fo,ko],listeners:[oo,yo,ho,xo,Co]};var De=require("zod");var Vo=t("getMapDetails",De.z.undefined()),He={methods:[Vo],listeners:[]};var B=require("zod");var M=require("zod"),Je=M.z.object({id:M.z.string().or(M.z.number()),layerId:M.z.string(),showPopup:M.z.boolean().optional(),fitViewport:M.z.boolean().or(M.z.object({maxZoom:M.z.number()})).optional()});var vo=t("getSelection",B.z.undefined()),wo=p("onSelectionChange"),Uo=t("selectFeature",Je),Oo=t("clearSelection",B.z.object({features:B.z.boolean().optional(),elements:B.z.boolean().optional()}).optional()),Ze={methods:[vo,Uo,Oo],listeners:[wo]};var $e=require("zod");var m=require("zod");var qe=["pin","line","route","polygon","circle","marker","highlighter","text","note"],We=m.z.enum([...qe,"link"]),_e=m.z.enum(qe),jo=ie.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Ro=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),No=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Ao=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Bo=le.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Do=pe.pick({color:!0,opacity:!0,size:!0}).required(),Ho=me.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),Jo=ce.pick({color:!0,align:!0,style:!0}).required(),Zo=ye.pick({color:!0,align:!0,style:!0}).required(),Qe=m.z.discriminatedUnion("tool",[jo.partial().extend({tool:m.z.literal("pin")}),Ro.partial().extend({tool:m.z.literal("line")}),No.partial().extend({tool:m.z.literal("route")}),Ao.partial().extend({tool:m.z.literal("polygon")}),Bo.partial().extend({tool:m.z.literal("circle")}),Do.partial().extend({tool:m.z.literal("marker")}),Ho.partial().extend({tool:m.z.literal("highlighter")}),Jo.partial().extend({tool:m.z.literal("text")}),Zo.partial().extend({tool:m.z.literal("note")})]);var qo=t("setTool",We.nullable()),Wo=t("getTool",$e.z.undefined()),_o=p("onToolChange"),Qo=t("setToolSettings",Qe),$o=t("getToolSettings",_e),Ko=p("onToolSettingsChange"),Ke={methods:[qo,Wo,Qo,$o],listeners:[_o,Ko]};var X=require("zod");var c=require("zod"),Xe=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Ye=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var Xo=t("updateUiControls",Xe),Yo=t("setOnMapInteractionsUi",Ye),er=t("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:W.optional()}).optional()),tr=t("hideLayerDataTable",X.z.undefined()),et={methods:[Xo,Yo,er,tr],listeners:null};var ue=require("zod");var D=require("zod");var Y=D.z.object({center:q,zoom:fe}),tt=D.z.object({center:Y.shape.center.optional(),zoom:Y.shape.zoom.optional()}),ot=D.z.object({minZoom:Y.shape.zoom.nullish(),maxZoom:Y.shape.zoom.nullish(),bounds:L.nullish()}).nullable(),rt=D.z.object({bounds:L});var or=t("getViewport",ue.z.undefined()),rr=t("setViewport",tt),nr=t("getViewportConstraints",ue.z.undefined()),ar=t("setViewportConstraints",ot),ir=t("fitViewportToBounds",rt),sr=p("onViewportMove"),lr=p("onViewportMoveEnd"),pr=p("onMapIdle"),nt={methods:[rr,or,nr,ar,ir],listeners:[sr,lr,pr]};var he=[et,nt,Be,Ce,Ze,Ge,Ke,He];function mr(r,l,T){let P=new Map;async function C(u){if(!ur.safeParse(u.data).success){T?.onUnknownMessage?.(u.data);return}let H=st.safeParse(u.data);if(!H.success){T?.onInvalidMessage?.(u.data,H.error),u.ports[0]?.postMessage(at(H.error.message));return}let{data:g}=H;if(g.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let v="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:te=>{u.ports[0]?.postMessage(te)}}:{handler:te=>{u.ports[0]?.postMessage(te)}},ee=l.listeners[g.event.eventName](v);P.set(g.event.id,ee)}else if(g.type==="felt.removeListener")P.get(g.id)?.(),P.delete(g.id);else try{let v=l.methods[g.type],ee=await v(g.params);u.ports[0]?.postMessage(ee)}catch(v){u.ports[0]?.postMessage(at(v))}}return r.addEventListener("message",C),()=>{r.removeEventListener("message",C)}}var it={methods:he.map(r=>r.methods??[]).flat(),listeners:he.map(r=>r.listeners??[]).flat()},cr=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...it.listeners]),yr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:cr}),gr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),dr=y.z.strictObject({type:y.z.literal("felt.ready")}),st=y.z.discriminatedUnion("type",[dr,yr,gr,...it.methods]),ur=y.z.object({type:y.z.enum(st.options.map(r=>r.shape.type.value))});function at(r){return{__error__:hr(r)}}function hr(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}0&&(module.exports={createMessageHandler});
1
+ "use strict";var oe=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ct=(r,l)=>{for(var E in l)oe(r,E,{get:l[E],enumerable:!0})},gt=(r,l,E,P)=>{if(l&&typeof l=="object"||typeof l=="function")for(let C of pt(l))!mt.call(r,C)&&C!==E&&oe(r,C,{get:()=>l[C],enumerable:!(P=lt(l,C))||P.enumerable});return r};var yt=r=>gt(oe({},"__esModule",{value:!0}),r);var fr={};ct(fr,{createMessageHandler:()=>mr});module.exports=yt(fr);var g=require("zod");var d=require("zod");var S=require("zod");function t(r,l){return S.z.strictObject({type:S.z.literal(r),params:l})}function h(r,l){return S.z.strictObject({eventName:S.z.literal(r),id:S.z.string(),options:l})}function p(r){return S.z.strictObject({eventName:S.z.literal(r),id:S.z.string()})}var s=require("zod"),H=s.z.number(),J=s.z.number(),Z=s.z.object({latitude:J,longitude:H}),G=s.z.tuple([H,J]),w=s.z.object({type:s.z.literal("Polygon"),coordinates:s.z.array(s.z.array(G).min(4).refine(r=>r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1],"The last point of each ring must be identical to the first"))}),q=s.z.object({type:s.z.literal("MultiPolygon"),coordinates:s.z.array(w.shape.coordinates)}),dt=s.z.object({type:s.z.literal("LineString"),coordinates:s.z.array(G).min(2)}),U=s.z.object({type:s.z.literal("MultiLineString"),coordinates:s.z.array(dt.shape.coordinates)}),fe=s.z.number().min(1).max(23),x=s.z.tuple([H,J,H,J]),z=s.z.object({show:s.z.array(s.z.string()).optional(),hide:s.z.array(s.z.string()).optional()}),ut=s.z.enum(["asc","desc"]),W=s.z.object({attribute:s.z.string(),direction:ut});var e=require("zod");var f=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ae=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),ht=e.z.enum(["meter","kilometer","foot","mile"]),_=f.extend($.shape).extend({type:e.z.literal("Place"),coordinates:G,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),O=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Path"),coordinates:U.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),v=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Polygon"),coordinates:w.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),Q=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Circle"),center:G,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:ht.nullable(),fillOpacity:e.z.number().min(0).max(1)}),j=f.extend({type:e.z.literal("Marker"),coordinates:U.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),R=f.extend({type:e.z.literal("Highlighter"),coordinates:q.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:G,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),re=f.extend(Se.shape).extend({type:e.z.literal("Text")}),ne=f.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),N=f.extend({type:e.z.literal("Image"),coordinates:U.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),ft=f.extend({type:e.z.literal("Link"),coordinates:U.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},L={id:!0},ie=_.partial().extend(_.pick(F).shape).omit(L),K=O.partial().extend(O.pick(F).shape).omit(L),se=v.partial().extend(v.pick(F).shape).omit(L),le=Q.partial().extend(Q.pick({type:!0,center:!0,radius:!0}).shape).omit(L),pe=j.partial().extend(j.pick(F).shape).omit(L),me=R.partial().extend(R.pick(F).shape).omit(L),ce=re.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ge=ne.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),St=N.partial().extend(N.pick({...F,imageUrl:!0}).shape).omit(L),xe=e.z.discriminatedUnion("type",[ie,K,se,le,pe,me,St,ce,ge]);var Cr=O.omit({coordinates:!0}),Gr=v.omit({coordinates:!0});var Ir=j.omit({coordinates:!0}),Tr=R.omit({coordinates:!0});var Er=N.omit({coordinates:!0}),zr=ft.omit({coordinates:!0}),b={type:!0,id:!0},xt=_.partial().extend(_.pick(b).shape),Lt=O.partial().extend(O.pick(b).shape),bt=v.partial().extend(v.pick(b).shape),Mt=Q.partial().extend(Q.pick(b).shape),Ct=j.partial().extend(j.pick(b).shape),Gt=R.partial().extend(R.pick(b).shape),It=re.partial().extend(re.pick(b).shape).omit({name:!0}),Tt=ne.partial().extend(ne.pick(b).shape).omit({name:!0}),Et=N.partial().extend(N.pick(b).shape),Le=e.z.discriminatedUnion("type",[xt,Lt,bt,Mt,Ct,Gt,It,Tt,Et]),be=e.z.object({ids:e.z.array(e.z.string()).optional()}),Me=e.z.object({ids:e.z.array(e.z.string()).optional()});var zt=t("getElement",d.z.string()),Pt=t("getElementGeometry",d.z.string()),Ft=t("getElements",be.optional()),kt=t("getElementGroup",d.z.string()),Vt=t("getElementGroups",Me.optional()),wt=t("setElementGroupVisibility",z),Ut=h("onElementChange",d.z.object({id:d.z.string()})),Ot=p("onElementCreate"),vt=p("onElementCreateEnd"),jt=h("onElementDelete",d.z.object({id:d.z.string()})),Rt=h("onElementGroupChange",d.z.object({id:d.z.string()})),Nt=t("createElement",xe),At=t("updateElement",Le),Bt=t("deleteElement",d.z.string()),Ce={methods:[zt,Pt,Ft,kt,Vt,wt,Nt,At,Bt],listeners:[Ut,Ot,vt,jt,Rt]};var Dt=p("onPointerClick"),Ht=p("onPointerMove"),Ge={methods:null,listeners:[Dt,Ht]};var a=require("zod");var i=require("zod");var Jt=i.z.enum(["in","ni"]),Zt=i.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),jr=i.z.enum(["and","or"]),Ie=i.z.union([i.z.number(),i.z.string(),i.z.boolean(),i.z.null()]),Te=i.z.string().or(i.z.null()),qt=i.z.tuple([Te,Jt,i.z.array(Ie).or(i.z.null())]),Wt=i.z.tuple([Te,Zt,Ie]),ye=i.z.union([qt,Wt]),de=i.z.tuple([i.z.lazy(()=>i.z.union([de,ye,i.z.null(),i.z.boolean()])),i.z.enum(["and","or"]),i.z.lazy(()=>i.z.union([de,ye,i.z.null(),i.z.boolean()]))]),I=i.z.union([de,ye,i.z.null(),i.z.boolean()]),T=i.z.union([x,w,q,i.z.array(G)]);var n=require("zod");var Ee=n.z.enum(["avg","max","min","sum","median"]),_t=n.z.object({method:Ee,attribute:n.z.string()}),Qt=n.z.object({methods:n.z.array(n.z.union([Ee,n.z.literal("count")])),attribute:n.z.string().optional()}),ze=n.z.object({boundary:T.optional(),filters:I.optional(),aggregation:_t.optional()}),Pe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),limit:n.z.number().optional(),boundary:T.optional(),filters:I.optional(),values:ze.optional()}),Ar=n.z.object({key:n.z.union([n.z.number(),n.z.string(),n.z.boolean()]),value:n.z.number().nullable()}),$t=n.z.object({type:n.z.literal("equal-intervals"),count:n.z.number()}),Kt=n.z.object({type:n.z.literal("time-interval"),interval:n.z.enum(["hour","day","week","month","year"])}),Fe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),steps:n.z.union([$t,Kt,n.z.array(n.z.number())]),boundary:T.optional(),filters:I.optional(),values:ze.optional()}),Br=n.z.object({min:n.z.number(),max:n.z.number(),value:n.z.number()}),ke=n.z.object({layerId:n.z.string(),boundary:T.optional(),filters:I.optional(),aggregation:Qt});var o=require("zod");var Jr=o.z.enum(["processing","completed","failed","incomplete"]),Ve=o.z.object({type:o.z.literal("geoJsonUrl"),url:o.z.string().url(),refreshInterval:o.z.number().min(250).max(5*60*1e3).nullable().optional()}),we=o.z.object({type:o.z.literal("geoJsonData"),data:o.z.object({}).passthrough().or(o.z.instanceof(ArrayBuffer))}),Ue=o.z.object({type:o.z.literal("geoJsonFile"),file:o.z.instanceof(File)}),Oe=o.z.object({id:o.z.string(),style:o.z.object({}).passthrough().optional(),shownInLegend:o.z.boolean().optional(),name:o.z.string().optional(),caption:o.z.string().optional(),description:o.z.string().optional(),bounds:x.optional(),source:o.z.union([Ve,we,Ue]).optional()}),ve=o.z.object({ids:o.z.array(o.z.string()).optional()}),je=o.z.object({ids:o.z.array(o.z.string()).optional()}),k=o.z.object({id:o.z.string(),layerId:o.z.string()}),Re=o.z.object({ids:k.array().optional(),layerIds:o.z.string().array().optional()}),Ne=o.z.object({layerIds:o.z.array(o.z.string()).optional(),areaQuery:o.z.union([o.z.object({coordinates:Z}),o.z.object({boundary:x})]).optional()}),Xt=o.z.object({Point:o.z.object({}).passthrough().optional(),Line:o.z.object({}).passthrough().optional(),Polygon:o.z.object({}).passthrough().optional()}),Ae=o.z.object({source:o.z.union([Ve,we,Ue]),name:o.z.string(),bounds:x.optional(),caption:o.z.string().optional(),description:o.z.string().optional(),geometryStyles:Xt.optional()});var Yt=t("getLayer",a.z.string()),eo=t("getLayers",ve.optional()),to=t("setLayerVisibility",z),oo=h("onLayerChange",a.z.object({id:a.z.string()})),ro=t("setLayerStyle",a.z.object({id:a.z.string(),style:a.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",z),ao=t("createLayersFromGeoJson",Ae),io=t("updateLayer",Oe),so=t("deleteLayer",a.z.string()),lo=t("getLayerGroup",a.z.string()),po=t("getLayerGroups",je.optional()),mo=t("setLayerGroupVisibility",z),co=t("setLayerGroupLegendVisibility",z),go=h("onLayerGroupChange",a.z.object({id:a.z.string()})),yo=t("getLegendItem",k),uo=t("getLegendItems",Re.optional()),ho=h("onLegendItemChange",k),fo=t("setLegendItemVisibility",a.z.object({show:k.array().optional(),hide:k.array().optional()})),So=t("getLayerFilters",a.z.string()),xo=t("setLayerFilters",a.z.object({layerId:a.z.string(),filters:I,note:a.z.string().optional()})),Lo=h("onLayerFiltersChange",a.z.object({layerId:a.z.string()})),bo=t("getLayerBoundaries",a.z.string()),Mo=t("setLayerBoundary",a.z.object({layerIds:a.z.array(a.z.string()),boundary:T.nullable()})),Co=h("onLayerBoundariesChange",a.z.object({layerId:a.z.string()})),Go=t("getRenderedFeatures",Ne.optional()),Io=t("getFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),To=t("getFeatures",a.z.object({layerId:a.z.string(),filters:I.optional(),sorting:W.optional(),boundary:T.optional(),search:a.z.string().optional(),pagination:a.z.string().optional().nullish()})),Eo=t("getGeoJsonFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),zo=t("getCategoryData",Pe),Po=t("getHistogramData",Fe),Fo=t("getAggregates",ke),ko=t("getLayerSchema",a.z.string()),Be={methods:[Yt,eo,to,ro,no,ao,so,io,lo,po,mo,co,yo,uo,fo,So,xo,bo,Mo,Go,Io,To,Eo,zo,Po,Fo,ko],listeners:[oo,go,ho,Lo,Co]};var De=require("zod");var Vo=t("getMapDetails",De.z.undefined()),He={methods:[Vo],listeners:[]};var A=require("zod");var M=require("zod"),Je=M.z.object({id:M.z.string().or(M.z.number()),layerId:M.z.string(),showPopup:M.z.boolean().optional(),fitViewport:M.z.boolean().or(M.z.object({maxZoom:M.z.number()})).optional()});var wo=t("getSelection",A.z.undefined()),Uo=p("onSelectionChange"),Oo=t("selectFeature",Je),vo=t("clearSelection",A.z.object({features:A.z.boolean().optional(),elements:A.z.boolean().optional()}).optional()),Ze={methods:[wo,Oo,vo],listeners:[Uo]};var $e=require("zod");var m=require("zod");var qe=["pin","line","route","polygon","circle","marker","highlighter","text","note"],We=m.z.enum([...qe,"link"]),_e=m.z.enum(qe),jo=ie.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Ro=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),No=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Ao=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Bo=le.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Do=pe.pick({color:!0,opacity:!0,size:!0}).required(),Ho=me.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),Jo=ce.pick({color:!0,align:!0,style:!0}).required(),Zo=ge.pick({color:!0,align:!0,style:!0}).required(),Qe=m.z.discriminatedUnion("tool",[jo.partial().extend({tool:m.z.literal("pin")}),Ro.partial().extend({tool:m.z.literal("line")}),No.partial().extend({tool:m.z.literal("route")}),Ao.partial().extend({tool:m.z.literal("polygon")}),Bo.partial().extend({tool:m.z.literal("circle")}),Do.partial().extend({tool:m.z.literal("marker")}),Ho.partial().extend({tool:m.z.literal("highlighter")}),Jo.partial().extend({tool:m.z.literal("text")}),Zo.partial().extend({tool:m.z.literal("note")})]);var qo=t("setTool",We.nullable()),Wo=t("getTool",$e.z.undefined()),_o=p("onToolChange"),Qo=t("setToolSettings",Qe),$o=t("getToolSettings",_e),Ko=p("onToolSettingsChange"),Ke={methods:[qo,Wo,Qo,$o],listeners:[_o,Ko]};var X=require("zod");var c=require("zod"),Xe=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Ye=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var Xo=t("updateUiControls",Xe),Yo=t("setOnMapInteractionsUi",Ye),er=t("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:W.optional()}).optional()),tr=t("hideLayerDataTable",X.z.undefined()),et={methods:[Xo,Yo,er,tr],listeners:null};var ue=require("zod");var B=require("zod");var Y=B.z.object({center:Z,zoom:fe}),tt=B.z.object({center:Y.shape.center.optional(),zoom:Y.shape.zoom.optional()}),ot=B.z.object({minZoom:Y.shape.zoom.nullish(),maxZoom:Y.shape.zoom.nullish(),bounds:x.nullish()}).nullable(),rt=B.z.object({bounds:x});var or=t("getViewport",ue.z.undefined()),rr=t("setViewport",tt),nr=t("getViewportConstraints",ue.z.undefined()),ar=t("setViewportConstraints",ot),ir=t("fitViewportToBounds",rt),sr=p("onViewportMove"),lr=p("onViewportMoveEnd"),pr=p("onMapIdle"),nt={methods:[rr,or,nr,ar,ir],listeners:[sr,lr,pr]};var he=[et,nt,Be,Ce,Ze,Ge,Ke,He];function mr(r,l,E){let P=new Map;async function C(u){if(!ur.safeParse(u.data).success){E?.onUnknownMessage?.(u.data);return}let D=st.safeParse(u.data);if(!D.success){E?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(at(D.error.message));return}let{data:y}=D;if(y.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(y.type==="felt.addListener"){if(y.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let V="options"in y.event?{options:"options"in y.event?y.event.options:void 0,handler:te=>{u.ports[0]?.postMessage(te)}}:{handler:te=>{u.ports[0]?.postMessage(te)}},ee=l.listeners[y.event.eventName](V);P.set(y.event.id,ee)}else if(y.type==="felt.removeListener")P.get(y.id)?.(),P.delete(y.id);else try{let V=l.methods[y.type],ee=await V(y.params);u.ports[0]?.postMessage(ee)}catch(V){u.ports[0]?.postMessage(at(V))}}return r.addEventListener("message",C),()=>{r.removeEventListener("message",C)}}var it={methods:he.map(r=>r.methods??[]).flat(),listeners:he.map(r=>r.listeners??[]).flat()},cr=g.z.discriminatedUnion("eventName",[g.z.strictObject({eventName:g.z.literal("")}),...it.listeners]),gr=g.z.strictObject({type:g.z.literal("felt.addListener"),event:cr}),yr=g.z.strictObject({type:g.z.literal("felt.removeListener"),id:g.z.string()}),dr=g.z.strictObject({type:g.z.literal("felt.ready")}),st=g.z.discriminatedUnion("type",[dr,gr,yr,...it.methods]),ur=g.z.object({type:g.z.enum(st.options.map(r=>r.shape.type.value))});function at(r){return{__error__:hr(r)}}function hr(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}0&&(module.exports={createMessageHandler});
@@ -1,12 +1,13 @@
1
1
  import { z, ZodError } from 'zod';
2
- import { z as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, aa as Layer, ad as LayerGroup, ag as LegendItem, aE as LayerFilters, aF as LayerBoundaries, ap as LayerFeature, bh as UnwrapPromise, L as LayersController, aX as GeoJsonFeature, aK as GetLayerCategoriesGroup, aM as GetLayerHistogramBin, aI as AggregationMethod, ar as LayerSchema, ab as LayerChangeCallbackParams, ae as LayerGroupChangeCallbackParams, ah as LegendItemChangeCallbackParams, aB as FilterTernary, h as MapDetails, i as EntityNode, T as ToolType, j as ToolSettingsMap, k as ToolSettingsChangeEvent, V as ViewportState, n as ViewportConstraints, bi as UnionToIntersection, bj as PromiseOrNot } from './types-0PFYQhMS.cjs';
2
+ import { bq as UnwrapPromise, F as FeltController, z as zInfer, c as ElementChangeCallbackParams, f as ElementGroupChangeCallbackParams, E as Element, D as MapInteractionEvent, $ as LayerChangeCallbackParams, a2 as LayerGroupChangeCallbackParams, a5 as LegendItemChangeCallbackParams, at as LayerFilters, as as LayerBoundaries, ap as FilterTernary, aI as EntityNode, bh as ToolType, bf as ToolSettingsChangeEvent, bo as ViewportState, br as UnionToIntersection, bs as PromiseOrNot } from './controller-C5gGWnaM.cjs';
3
3
 
4
+ type FeltControllerFunctions = Omit<FeltController, "iframe">;
4
5
  type Method<TRequest extends {
5
- type: string;
6
+ type: keyof FeltControllerFunctions;
6
7
  params?: any;
7
- }, TResponse> = {
8
+ }> = {
8
9
  request: TRequest;
9
- response: TResponse;
10
+ response: UnwrapPromise<ReturnType<FeltControllerFunctions[TRequest["type"]]>>;
10
11
  };
11
12
  type Listener<TOptions, TParams> = {
12
13
  options: TOptions;
@@ -1789,15 +1790,15 @@ declare const DeleteElementMessage: z.ZodObject<{
1789
1790
  }>;
1790
1791
  type ElementsSchema = {
1791
1792
  methods: {
1792
- getElement: Method<zInfer<typeof GetElementMessage>, Element | null>;
1793
- getElementGeometry: Method<zInfer<typeof GetElementGeometryMessage>, GeoJsonGeometry | null>;
1794
- getElements: Method<zInfer<typeof GetElementsMessage>, Array<Element | null>>;
1795
- getElementGroup: Method<zInfer<typeof GetGroupMessage$1>, ElementGroup | null>;
1796
- getElementGroups: Method<zInfer<typeof GetGroupsMessage$1>, Array<ElementGroup | null>>;
1797
- setElementGroupVisibility: Method<zInfer<typeof SetElementGroupVisibilityMessage>, void>;
1798
- createElement: Method<zInfer<typeof CreateElementMessage>, Element>;
1799
- updateElement: Method<zInfer<typeof UpdateElementMessage>, Element>;
1800
- deleteElement: Method<zInfer<typeof DeleteElementMessage>, void>;
1793
+ getElement: Method<zInfer<typeof GetElementMessage>>;
1794
+ getElementGeometry: Method<zInfer<typeof GetElementGeometryMessage>>;
1795
+ getElements: Method<zInfer<typeof GetElementsMessage>>;
1796
+ getElementGroup: Method<zInfer<typeof GetGroupMessage$1>>;
1797
+ getElementGroups: Method<zInfer<typeof GetGroupsMessage$1>>;
1798
+ setElementGroupVisibility: Method<zInfer<typeof SetElementGroupVisibilityMessage>>;
1799
+ createElement: Method<zInfer<typeof CreateElementMessage>>;
1800
+ updateElement: Method<zInfer<typeof UpdateElementMessage>>;
1801
+ deleteElement: Method<zInfer<typeof DeleteElementMessage>>;
1801
1802
  };
1802
1803
  listeners: {
1803
1804
  onElementChange: Listener<zInfer<typeof OnElementChangeMessage.shape.options>, ElementChangeCallbackParams>;
@@ -2578,7 +2579,16 @@ declare const SetLayerBoundaryMessage: z.ZodObject<{
2578
2579
  type: z.ZodLiteral<"setLayerBoundary">;
2579
2580
  params: z.ZodObject<{
2580
2581
  layerIds: z.ZodArray<z.ZodString, "many">;
2581
- boundary: z.ZodNullable<z.ZodObject<{
2582
+ boundary: z.ZodNullable<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
2583
+ type: z.ZodLiteral<"Polygon">;
2584
+ coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
2585
+ }, "strip", z.ZodTypeAny, {
2586
+ type: "Polygon";
2587
+ coordinates: [number, number][][];
2588
+ }, {
2589
+ type: "Polygon";
2590
+ coordinates: [number, number][][];
2591
+ }>, z.ZodObject<{
2582
2592
  type: z.ZodLiteral<"MultiPolygon">;
2583
2593
  coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
2584
2594
  }, "strip", z.ZodTypeAny, {
@@ -2587,15 +2597,21 @@ declare const SetLayerBoundaryMessage: z.ZodObject<{
2587
2597
  }, {
2588
2598
  type: "MultiPolygon";
2589
2599
  coordinates: [number, number][][][];
2590
- }>>;
2600
+ }>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
2591
2601
  }, "strip", z.ZodTypeAny, {
2592
- boundary: {
2602
+ boundary: [number, number, number, number] | [number, number][] | {
2603
+ type: "Polygon";
2604
+ coordinates: [number, number][][];
2605
+ } | {
2593
2606
  type: "MultiPolygon";
2594
2607
  coordinates: [number, number][][][];
2595
2608
  } | null;
2596
2609
  layerIds: string[];
2597
2610
  }, {
2598
- boundary: {
2611
+ boundary: [number, number, number, number] | [number, number][] | {
2612
+ type: "Polygon";
2613
+ coordinates: [number, number][][];
2614
+ } | {
2599
2615
  type: "MultiPolygon";
2600
2616
  coordinates: [number, number][][][];
2601
2617
  } | null;
@@ -2603,7 +2619,10 @@ declare const SetLayerBoundaryMessage: z.ZodObject<{
2603
2619
  }>;
2604
2620
  }, z.UnknownKeysParam, z.ZodTypeAny, {
2605
2621
  params: {
2606
- boundary: {
2622
+ boundary: [number, number, number, number] | [number, number][] | {
2623
+ type: "Polygon";
2624
+ coordinates: [number, number][][];
2625
+ } | {
2607
2626
  type: "MultiPolygon";
2608
2627
  coordinates: [number, number][][][];
2609
2628
  } | null;
@@ -2612,7 +2631,10 @@ declare const SetLayerBoundaryMessage: z.ZodObject<{
2612
2631
  type: "setLayerBoundary";
2613
2632
  }, {
2614
2633
  params: {
2615
- boundary: {
2634
+ boundary: [number, number, number, number] | [number, number][] | {
2635
+ type: "Polygon";
2636
+ coordinates: [number, number][][];
2637
+ } | {
2616
2638
  type: "MultiPolygon";
2617
2639
  coordinates: [number, number][][][];
2618
2640
  } | null;
@@ -2786,7 +2808,6 @@ declare const GetFeaturesMessage: z.ZodObject<{
2786
2808
  pagination: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
2787
2809
  }, "strip", z.ZodTypeAny, {
2788
2810
  layerId: string;
2789
- search?: string | undefined;
2790
2811
  boundary?: [number, number, number, number] | [number, number][] | {
2791
2812
  type: "Polygon";
2792
2813
  coordinates: [number, number][][];
@@ -2799,10 +2820,10 @@ declare const GetFeaturesMessage: z.ZodObject<{
2799
2820
  attribute: string;
2800
2821
  direction: "asc" | "desc";
2801
2822
  } | undefined;
2823
+ search?: string | undefined;
2802
2824
  pagination?: string | null | undefined;
2803
2825
  }, {
2804
2826
  layerId: string;
2805
- search?: string | undefined;
2806
2827
  boundary?: [number, number, number, number] | [number, number][] | {
2807
2828
  type: "Polygon";
2808
2829
  coordinates: [number, number][][];
@@ -2815,12 +2836,12 @@ declare const GetFeaturesMessage: z.ZodObject<{
2815
2836
  attribute: string;
2816
2837
  direction: "asc" | "desc";
2817
2838
  } | undefined;
2839
+ search?: string | undefined;
2818
2840
  pagination?: string | null | undefined;
2819
2841
  }>;
2820
2842
  }, z.UnknownKeysParam, z.ZodTypeAny, {
2821
2843
  params: {
2822
2844
  layerId: string;
2823
- search?: string | undefined;
2824
2845
  boundary?: [number, number, number, number] | [number, number][] | {
2825
2846
  type: "Polygon";
2826
2847
  coordinates: [number, number][][];
@@ -2833,13 +2854,13 @@ declare const GetFeaturesMessage: z.ZodObject<{
2833
2854
  attribute: string;
2834
2855
  direction: "asc" | "desc";
2835
2856
  } | undefined;
2857
+ search?: string | undefined;
2836
2858
  pagination?: string | null | undefined;
2837
2859
  };
2838
2860
  type: "getFeatures";
2839
2861
  }, {
2840
2862
  params: {
2841
2863
  layerId: string;
2842
- search?: string | undefined;
2843
2864
  boundary?: [number, number, number, number] | [number, number][] | {
2844
2865
  type: "Polygon";
2845
2866
  coordinates: [number, number][][];
@@ -2852,6 +2873,7 @@ declare const GetFeaturesMessage: z.ZodObject<{
2852
2873
  attribute: string;
2853
2874
  direction: "asc" | "desc";
2854
2875
  } | undefined;
2876
+ search?: string | undefined;
2855
2877
  pagination?: string | null | undefined;
2856
2878
  };
2857
2879
  type: "getFeatures";
@@ -3425,36 +3447,33 @@ declare const GetLayerSchemaMessage: z.ZodObject<{
3425
3447
  }>;
3426
3448
  type LayersSchema = {
3427
3449
  methods: {
3428
- getLayer: Method<zInfer<typeof GetLayerMessage>, Layer | null>;
3429
- getLayers: Method<zInfer<typeof GetLayersMessage>, Array<Layer | null>>;
3430
- setLayerVisibility: Method<zInfer<typeof SetLayerVisibilityMessage>, void>;
3431
- setLayerStyle: Method<zInfer<typeof SetLayerStyleMessage>, void>;
3432
- setLayerLegendVisibility: Method<zInfer<typeof SetLayerLegendVisibilityMessage>, void>;
3433
- createLayersFromGeoJson: Method<zInfer<typeof CreateLayersFromGeoJsonMessage>, {
3434
- layerGroup: LayerGroup;
3435
- layers: Array<Layer>;
3436
- } | null>;
3437
- updateLayer: Method<zInfer<typeof UpdateLayerMessage>, Layer>;
3438
- deleteLayer: Method<zInfer<typeof DeleteLayerMessage>, void>;
3439
- getLayerGroup: Method<zInfer<typeof GetGroupMessage>, LayerGroup | null>;
3440
- getLayerGroups: Method<zInfer<typeof GetGroupsMessage>, Array<LayerGroup | null>>;
3441
- setLayerGroupVisibility: Method<zInfer<typeof SetLayerGroupVisibilityMessage>, void>;
3442
- setLayerGroupLegendVisibility: Method<zInfer<typeof SetLayerGroupLegendVisibilityMessage>, void>;
3443
- getLegendItem: Method<zInfer<typeof GetLegendItemMessage>, LegendItem | null>;
3444
- getLegendItems: Method<zInfer<typeof GetLegendItemsMessage>, Array<LegendItem | null>>;
3445
- setLegendItemVisibility: Method<zInfer<typeof SetLegendItemVisibilityMessage>, void>;
3446
- getLayerFilters: Method<zInfer<typeof GetFiltersMessage>, LayerFilters | null>;
3447
- setLayerFilters: Method<zInfer<typeof SetFiltersMessage>, void>;
3448
- getLayerBoundaries: Method<zInfer<typeof GetLayerBoundariesMessage>, LayerBoundaries | null>;
3449
- setLayerBoundary: Method<zInfer<typeof SetLayerBoundaryMessage>, void>;
3450
- getRenderedFeatures: Method<zInfer<typeof GetRenderedFeaturesMessage>, Array<LayerFeature>>;
3451
- getFeature: Method<zInfer<typeof GetFeatureMessage>, LayerFeature | null>;
3452
- getFeatures: Method<zInfer<typeof GetFeaturesMessage>, UnwrapPromise<ReturnType<LayersController["getFeatures"]>>>;
3453
- getGeoJsonFeature: Method<zInfer<typeof GetGeoJsonFeatureMessage>, GeoJsonFeature | null>;
3454
- getCategoryData: Method<zInfer<typeof GetLayerCategoriesMessage>, Array<GetLayerCategoriesGroup>>;
3455
- getHistogramData: Method<zInfer<typeof GetLayerHistogramMessage>, Array<GetLayerHistogramBin>>;
3456
- getAggregates: Method<zInfer<typeof GetLayerCalculationMessage>, Record<AggregationMethod | "count", number | null>>;
3457
- getLayerSchema: Method<zInfer<typeof GetLayerSchemaMessage>, LayerSchema>;
3450
+ getLayer: Method<zInfer<typeof GetLayerMessage>>;
3451
+ getLayers: Method<zInfer<typeof GetLayersMessage>>;
3452
+ setLayerVisibility: Method<zInfer<typeof SetLayerVisibilityMessage>>;
3453
+ setLayerStyle: Method<zInfer<typeof SetLayerStyleMessage>>;
3454
+ setLayerLegendVisibility: Method<zInfer<typeof SetLayerLegendVisibilityMessage>>;
3455
+ createLayersFromGeoJson: Method<zInfer<typeof CreateLayersFromGeoJsonMessage>>;
3456
+ updateLayer: Method<zInfer<typeof UpdateLayerMessage>>;
3457
+ deleteLayer: Method<zInfer<typeof DeleteLayerMessage>>;
3458
+ getLayerGroup: Method<zInfer<typeof GetGroupMessage>>;
3459
+ getLayerGroups: Method<zInfer<typeof GetGroupsMessage>>;
3460
+ setLayerGroupVisibility: Method<zInfer<typeof SetLayerGroupVisibilityMessage>>;
3461
+ setLayerGroupLegendVisibility: Method<zInfer<typeof SetLayerGroupLegendVisibilityMessage>>;
3462
+ getLegendItem: Method<zInfer<typeof GetLegendItemMessage>>;
3463
+ getLegendItems: Method<zInfer<typeof GetLegendItemsMessage>>;
3464
+ setLegendItemVisibility: Method<zInfer<typeof SetLegendItemVisibilityMessage>>;
3465
+ getLayerFilters: Method<zInfer<typeof GetFiltersMessage>>;
3466
+ setLayerFilters: Method<zInfer<typeof SetFiltersMessage>>;
3467
+ getRenderedFeatures: Method<zInfer<typeof GetRenderedFeaturesMessage>>;
3468
+ getFeature: Method<zInfer<typeof GetFeatureMessage>>;
3469
+ getGeoJsonFeature: Method<zInfer<typeof GetGeoJsonFeatureMessage>>;
3470
+ getLayerBoundaries: Method<zInfer<typeof GetLayerBoundariesMessage>>;
3471
+ setLayerBoundary: Method<zInfer<typeof SetLayerBoundaryMessage>>;
3472
+ getFeatures: Method<zInfer<typeof GetFeaturesMessage>>;
3473
+ getCategoryData: Method<zInfer<typeof GetLayerCategoriesMessage>>;
3474
+ getHistogramData: Method<zInfer<typeof GetLayerHistogramMessage>>;
3475
+ getAggregates: Method<zInfer<typeof GetLayerCalculationMessage>>;
3476
+ getLayerSchema: Method<zInfer<typeof GetLayerSchemaMessage>>;
3458
3477
  };
3459
3478
  listeners: {
3460
3479
  onLayerChange: Listener<zInfer<typeof OnLayerChangeMessage.shape.options>, LayerChangeCallbackParams>;
@@ -3477,7 +3496,7 @@ declare const GetMapDetailsMessage: z.ZodObject<{
3477
3496
  }>;
3478
3497
  type MiscSchema = {
3479
3498
  methods: {
3480
- getMapDetails: Method<zInfer<typeof GetMapDetailsMessage>, MapDetails>;
3499
+ getMapDetails: Method<zInfer<typeof GetMapDetailsMessage>>;
3481
3500
  };
3482
3501
  listeners: {};
3483
3502
  };
@@ -3568,9 +3587,9 @@ declare const ClearSelectionMessage: z.ZodObject<{
3568
3587
  }>;
3569
3588
  type SelectionSchema = {
3570
3589
  methods: {
3571
- getSelection: Method<zInfer<typeof GetSelectionMessage>, Array<EntityNode>>;
3572
- selectFeature: Method<zInfer<typeof SelectFeatureMessage>, void>;
3573
- clearSelection: Method<zInfer<typeof ClearSelectionMessage>, void>;
3590
+ getSelection: Method<zInfer<typeof GetSelectionMessage>>;
3591
+ selectFeature: Method<zInfer<typeof SelectFeatureMessage>>;
3592
+ clearSelection: Method<zInfer<typeof ClearSelectionMessage>>;
3574
3593
  };
3575
3594
  listeners: {
3576
3595
  onSelectionChange: ListenerNoOptions<{
@@ -3583,10 +3602,10 @@ declare const SetToolMessage: z.ZodObject<{
3583
3602
  type: z.ZodLiteral<"setTool">;
3584
3603
  params: z.ZodNullable<z.ZodEnum<["pin", "line", "route", "polygon", "circle", "marker", "highlighter", "text", "note", "link"]>>;
3585
3604
  }, z.UnknownKeysParam, z.ZodTypeAny, {
3586
- params: "text" | "link" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | null;
3605
+ params: "text" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "link" | null;
3587
3606
  type: "setTool";
3588
3607
  }, {
3589
- params: "text" | "link" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | null;
3608
+ params: "text" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "link" | null;
3590
3609
  type: "setTool";
3591
3610
  }>;
3592
3611
  declare const GetToolMessage: z.ZodObject<{
@@ -3925,10 +3944,10 @@ declare const GetToolSettingsMessage: z.ZodObject<{
3925
3944
  }>;
3926
3945
  type ToolsSchema = {
3927
3946
  methods: {
3928
- setTool: Method<zInfer<typeof SetToolMessage>, void>;
3929
- getTool: Method<zInfer<typeof GetToolMessage>, ToolType | null>;
3930
- setToolSettings: Method<zInfer<typeof SetToolSettingsMessage>, void>;
3931
- getToolSettings: Method<zInfer<typeof GetToolSettingsMessage>, ToolSettingsMap[keyof ToolSettingsMap]>;
3947
+ setTool: Method<zInfer<typeof SetToolMessage>>;
3948
+ getTool: Method<zInfer<typeof GetToolMessage>>;
3949
+ setToolSettings: Method<zInfer<typeof SetToolSettingsMessage>>;
3950
+ getToolSettings: Method<zInfer<typeof GetToolSettingsMessage>>;
3932
3951
  };
3933
3952
  listeners: {
3934
3953
  onToolChange: ListenerNoOptions<ToolType | null>;
@@ -4079,10 +4098,10 @@ declare const HideLayerDataTableMessage: z.ZodObject<{
4079
4098
  }>;
4080
4099
  type UiSchema = {
4081
4100
  methods: {
4082
- updateUiControls: Method<zInfer<typeof UiControlsMessage>, void>;
4083
- setOnMapInteractionsUi: Method<zInfer<typeof OnMapInteractionsMessage>, void>;
4084
- showLayerDataTable: Method<zInfer<typeof ShowLayerDataTableMessage>, void>;
4085
- hideLayerDataTable: Method<zInfer<typeof HideLayerDataTableMessage>, void>;
4101
+ updateUiControls: Method<zInfer<typeof UiControlsMessage>>;
4102
+ setOnMapInteractionsUi: Method<zInfer<typeof OnMapInteractionsMessage>>;
4103
+ showLayerDataTable: Method<zInfer<typeof ShowLayerDataTableMessage>>;
4104
+ hideLayerDataTable: Method<zInfer<typeof HideLayerDataTableMessage>>;
4086
4105
  };
4087
4106
  listeners: {};
4088
4107
  };
@@ -4205,11 +4224,11 @@ declare const ViewportFitBoundsMessage: z.ZodObject<{
4205
4224
  }>;
4206
4225
  type ViewportSchema = {
4207
4226
  methods: {
4208
- getViewport: Method<zInfer<typeof GetViewportMessage>, ViewportState>;
4209
- setViewport: Method<zInfer<typeof GotoViewportMessage>, void>;
4210
- getViewportConstraints: Method<zInfer<typeof GetViewportConstraintsMessage>, ViewportConstraints | null>;
4211
- setViewportConstraints: Method<zInfer<typeof SetViewportConstraintsMessage>, void>;
4212
- fitViewportToBounds: Method<zInfer<typeof ViewportFitBoundsMessage>, void>;
4227
+ getViewport: Method<zInfer<typeof GetViewportMessage>>;
4228
+ setViewport: Method<zInfer<typeof GotoViewportMessage>>;
4229
+ getViewportConstraints: Method<zInfer<typeof GetViewportConstraintsMessage>>;
4230
+ setViewportConstraints: Method<zInfer<typeof SetViewportConstraintsMessage>>;
4231
+ fitViewportToBounds: Method<zInfer<typeof ViewportFitBoundsMessage>>;
4213
4232
  };
4214
4233
  listeners: {
4215
4234
  onViewportMove: ListenerNoOptions<ViewportState>;