@feltmaps/js-sdk 1.6.0-next.0 → 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/client.cjs +1 -1
- package/dist/client.d.cts +3 -1012
- package/dist/client.d.ts +3 -1012
- package/dist/client.js +1 -1
- package/dist/{types-B241Rd9q.d.cts → controller-C5gGWnaM.d.cts} +1124 -3
- package/dist/{types-B241Rd9q.d.ts → controller-C5gGWnaM.d.ts} +1124 -3
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +165 -64
- package/dist/handler.d.ts +165 -64
- package/dist/handler.js +1 -1
- package/package.json +3 -3
- package/handler.d.ts +0 -4229
- package/handler.js +0 -1
- package/types-B241Rd9q.d.ts +0 -7395
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 dr={};ct(dr,{createMessageHandler:()=>sr});module.exports=gt(dr);var y=require("zod");var d=require("zod");var f=require("zod");function t(r,l){return f.z.strictObject({type:f.z.literal(r),params:l})}function S(r,l){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string(),options:l})}function p(r){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string()})}var s=require("zod"),J=s.z.number(),B=s.z.number(),Z=s.z.object({latitude:B,longitude:J}),G=s.z.tuple([J,B]),v=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(v.shape.coordinates)}),dt=s.z.object({type:s.z.literal("LineString"),coordinates:s.z.array(G).min(2)}),w=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([J,B,J,B]),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 h=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"]),_=h.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()}),U=h.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Path"),coordinates:w.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),O=h.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Polygon"),coordinates:v.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),Q=h.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=h.extend({type:e.z.literal("Marker"),coordinates:w.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=h.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=h.extend(Se.shape).extend({type:e.z.literal("Text")}),ne=h.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),N=h.extend({type:e.z.literal("Image"),coordinates:w.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),ft=h.extend({type:e.z.literal("Link"),coordinates:w.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},L={id:!0},ie=_.partial().extend(_.pick(F).shape).omit(L),K=U.partial().extend(U.pick(F).shape).omit(L),se=O.partial().extend(O.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()}),ye=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,ye]);var Lr=U.omit({coordinates:!0}),br=O.omit({coordinates:!0});var Mr=j.omit({coordinates:!0}),Cr=R.omit({coordinates:!0});var Gr=N.omit({coordinates:!0}),Ir=ft.omit({coordinates:!0}),b={type:!0,id:!0},xt=_.partial().extend(_.pick(b).shape),Lt=U.partial().extend(U.pick(b).shape),bt=O.partial().extend(O.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()),vt=t("setElementGroupVisibility",E),wt=S("onElementChange",d.z.object({id:d.z.string()})),Ut=p("onElementCreate"),Ot=p("onElementCreateEnd"),jt=S("onElementDelete",d.z.object({id:d.z.string()})),Rt=S("onElementGroupChange",d.z.object({id:d.z.string()})),Nt=t("createElement",xe),At=t("updateElement",Le),Dt=t("deleteElement",d.z.string()),Ce={methods:[zt,Pt,Ft,kt,Vt,vt,Nt,At,Dt],listeners:[wt,Ut,Ot,jt,Rt]};var Ht=p("onPointerClick"),Jt=p("onPointerMove"),Ge={methods:null,listeners:[Ht,Jt]};var i=require("zod");var a=require("zod");var Bt=a.z.enum(["in","ni"]),Zt=a.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),wr=a.z.enum(["and","or"]),Ie=a.z.union([a.z.number(),a.z.string(),a.z.boolean(),a.z.null()]),Te=a.z.string().or(a.z.null()),qt=a.z.tuple([Te,Bt,a.z.array(Ie).or(a.z.null())]),Wt=a.z.tuple([Te,Zt,Ie]),ge=a.z.union([qt,Wt]),de=a.z.tuple([a.z.lazy(()=>a.z.union([de,ge,a.z.null(),a.z.boolean()])),a.z.enum(["and","or"]),a.z.lazy(()=>a.z.union([de,ge,a.z.null(),a.z.boolean()]))]),I=a.z.union([de,ge,a.z.null(),a.z.boolean()]),z=a.z.union([x,v,q,a.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()}),jr=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()}),Rr=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 Dr=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:x.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()}),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,ve,we]),name:o.z.string(),bounds:x.optional(),caption:o.z.string().optional(),description:o.z.string().optional(),geometryStyles:Xt.optional()});var Yt=t("getLayer",i.z.string()),eo=t("getLayers",Oe.optional()),to=t("setLayerVisibility",E),oo=S("onLayerChange",i.z.object({id:i.z.string()})),ro=t("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",E),ao=t("createLayersFromGeoJson",Ae),io=t("updateLayer",Ue),so=t("deleteLayer",i.z.string()),lo=t("getLayerGroup",i.z.string()),po=t("getLayerGroups",je.optional()),mo=t("setLayerGroupVisibility",E),co=t("setLayerGroupLegendVisibility",E),yo=S("onLayerGroupChange",i.z.object({id:i.z.string()})),go=t("getLegendItem",k),uo=t("getLegendItems",Re.optional()),ho=S("onLegendItemChange",k),fo=t("setLegendItemVisibility",i.z.object({show:k.array().optional(),hide:k.array().optional()})),So=t("getLayerFilters",i.z.string()),xo=t("setLayerFilters",i.z.object({layerId:i.z.string(),filters:I,note:i.z.string().optional()})),Lo=S("onLayerFiltersChange",i.z.object({layerId:i.z.string()})),bo=t("getRenderedFeatures",Ne.optional()),Mo=t("getFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Co=t("getFeatures",i.z.object({layerId:i.z.string(),filters:I.optional(),sorting:W.optional(),boundary:z.optional(),search:i.z.string().optional(),pagination:i.z.string().optional().nullish()})),Go=t("getGeoJsonFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Io=t("getCategoryData",Pe),To=t("getHistogramData",Fe),Eo=t("getAggregates",ke),zo=t("getLayerSchema",i.z.string()),De={methods:[Yt,eo,to,ro,no,ao,so,io,lo,po,mo,co,go,uo,fo,So,xo,bo,Mo,Co,Go,Io,To,Eo,zo],listeners:[oo,yo,ho,Lo]};var He=require("zod");var Po=t("getMapDetails",He.z.undefined()),Je={methods:[Po],listeners:[]};var A=require("zod");var M=require("zod"),Be=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 Fo=t("getSelection",A.z.undefined()),ko=p("onSelectionChange"),Vo=t("selectFeature",Be),vo=t("clearSelection",A.z.object({features:A.z.boolean().optional(),elements:A.z.boolean().optional()}).optional()),Ze={methods:[Fo,Vo,vo],listeners:[ko]};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),wo=ie.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Uo=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Oo=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),jo=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Ro=le.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),No=pe.pick({color:!0,opacity:!0,size:!0}).required(),Ao=me.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),Do=ce.pick({color:!0,align:!0,style:!0}).required(),Ho=ye.pick({color:!0,align:!0,style:!0}).required(),Qe=m.z.discriminatedUnion("tool",[wo.partial().extend({tool:m.z.literal("pin")}),Uo.partial().extend({tool:m.z.literal("line")}),Oo.partial().extend({tool:m.z.literal("route")}),jo.partial().extend({tool:m.z.literal("polygon")}),Ro.partial().extend({tool:m.z.literal("circle")}),No.partial().extend({tool:m.z.literal("marker")}),Ao.partial().extend({tool:m.z.literal("highlighter")}),Do.partial().extend({tool:m.z.literal("text")}),Ho.partial().extend({tool:m.z.literal("note")})]);var Jo=t("setTool",We.nullable()),Bo=t("getTool",$e.z.undefined()),Zo=p("onToolChange"),qo=t("setToolSettings",Qe),Wo=t("getToolSettings",_e),_o=p("onToolSettingsChange"),Ke={methods:[Jo,Bo,qo,Wo],listeners:[Zo,_o]};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 Qo=t("updateUiControls",Xe),$o=t("setOnMapInteractionsUi",Ye),Ko=t("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:W.optional()}).optional()),Xo=t("hideLayerDataTable",X.z.undefined()),et={methods:[Qo,$o,Ko,Xo],listeners:null};var ue=require("zod");var D=require("zod");var Y=D.z.object({center:Z,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:x.nullish()}).nullable(),rt=D.z.object({bounds:x});var Yo=t("getViewport",ue.z.undefined()),er=t("setViewport",tt),tr=t("getViewportConstraints",ue.z.undefined()),or=t("setViewportConstraints",ot),rr=t("fitViewportToBounds",rt),nr=p("onViewportMove"),ar=p("onViewportMoveEnd"),ir=p("onMapIdle"),nt={methods:[er,Yo,tr,or,rr],listeners:[nr,ar,ir]};var he=[et,nt,De,Ce,Ze,Ge,Ke,Je];function sr(r,l,T){let P=new Map;async function C(u){if(!yr.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()},lr=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...it.listeners]),pr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:lr}),mr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),cr=y.z.strictObject({type:y.z.literal("felt.ready")}),st=y.z.discriminatedUnion("type",[cr,pr,mr,...it.methods]),yr=y.z.object({type:y.z.enum(st.options.map(r=>r.shape.type.value))});function at(r){return{__error__:gr(r)}}function gr(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});
|
package/dist/handler.d.cts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { z, ZodError } from 'zod';
|
|
2
|
-
import {
|
|
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:
|
|
6
|
+
type: keyof FeltControllerFunctions;
|
|
6
7
|
params?: any;
|
|
7
|
-
}
|
|
8
|
+
}> = {
|
|
8
9
|
request: TRequest;
|
|
9
|
-
response:
|
|
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
|
|
1793
|
-
getElementGeometry: Method<zInfer<typeof GetElementGeometryMessage
|
|
1794
|
-
getElements: Method<zInfer<typeof GetElementsMessage
|
|
1795
|
-
getElementGroup: Method<zInfer<typeof GetGroupMessage$1
|
|
1796
|
-
getElementGroups: Method<zInfer<typeof GetGroupsMessage$1
|
|
1797
|
-
setElementGroupVisibility: Method<zInfer<typeof SetElementGroupVisibilityMessage
|
|
1798
|
-
createElement: Method<zInfer<typeof CreateElementMessage
|
|
1799
|
-
updateElement: Method<zInfer<typeof UpdateElementMessage
|
|
1800
|
-
deleteElement: Method<zInfer<typeof DeleteElementMessage
|
|
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>;
|
|
@@ -2564,6 +2565,106 @@ declare const OnLayerFiltersChangeMessage: z.ZodObject<{
|
|
|
2564
2565
|
id: string;
|
|
2565
2566
|
eventName: "onLayerFiltersChange";
|
|
2566
2567
|
}>;
|
|
2568
|
+
declare const GetLayerBoundariesMessage: z.ZodObject<{
|
|
2569
|
+
type: z.ZodLiteral<"getLayerBoundaries">;
|
|
2570
|
+
params: z.ZodString;
|
|
2571
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
2572
|
+
params: string;
|
|
2573
|
+
type: "getLayerBoundaries";
|
|
2574
|
+
}, {
|
|
2575
|
+
params: string;
|
|
2576
|
+
type: "getLayerBoundaries";
|
|
2577
|
+
}>;
|
|
2578
|
+
declare const SetLayerBoundaryMessage: z.ZodObject<{
|
|
2579
|
+
type: z.ZodLiteral<"setLayerBoundary">;
|
|
2580
|
+
params: z.ZodObject<{
|
|
2581
|
+
layerIds: z.ZodArray<z.ZodString, "many">;
|
|
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<{
|
|
2592
|
+
type: z.ZodLiteral<"MultiPolygon">;
|
|
2593
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
|
|
2594
|
+
}, "strip", z.ZodTypeAny, {
|
|
2595
|
+
type: "MultiPolygon";
|
|
2596
|
+
coordinates: [number, number][][][];
|
|
2597
|
+
}, {
|
|
2598
|
+
type: "MultiPolygon";
|
|
2599
|
+
coordinates: [number, number][][][];
|
|
2600
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
2601
|
+
}, "strip", z.ZodTypeAny, {
|
|
2602
|
+
boundary: [number, number, number, number] | [number, number][] | {
|
|
2603
|
+
type: "Polygon";
|
|
2604
|
+
coordinates: [number, number][][];
|
|
2605
|
+
} | {
|
|
2606
|
+
type: "MultiPolygon";
|
|
2607
|
+
coordinates: [number, number][][][];
|
|
2608
|
+
} | null;
|
|
2609
|
+
layerIds: string[];
|
|
2610
|
+
}, {
|
|
2611
|
+
boundary: [number, number, number, number] | [number, number][] | {
|
|
2612
|
+
type: "Polygon";
|
|
2613
|
+
coordinates: [number, number][][];
|
|
2614
|
+
} | {
|
|
2615
|
+
type: "MultiPolygon";
|
|
2616
|
+
coordinates: [number, number][][][];
|
|
2617
|
+
} | null;
|
|
2618
|
+
layerIds: string[];
|
|
2619
|
+
}>;
|
|
2620
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
2621
|
+
params: {
|
|
2622
|
+
boundary: [number, number, number, number] | [number, number][] | {
|
|
2623
|
+
type: "Polygon";
|
|
2624
|
+
coordinates: [number, number][][];
|
|
2625
|
+
} | {
|
|
2626
|
+
type: "MultiPolygon";
|
|
2627
|
+
coordinates: [number, number][][][];
|
|
2628
|
+
} | null;
|
|
2629
|
+
layerIds: string[];
|
|
2630
|
+
};
|
|
2631
|
+
type: "setLayerBoundary";
|
|
2632
|
+
}, {
|
|
2633
|
+
params: {
|
|
2634
|
+
boundary: [number, number, number, number] | [number, number][] | {
|
|
2635
|
+
type: "Polygon";
|
|
2636
|
+
coordinates: [number, number][][];
|
|
2637
|
+
} | {
|
|
2638
|
+
type: "MultiPolygon";
|
|
2639
|
+
coordinates: [number, number][][][];
|
|
2640
|
+
} | null;
|
|
2641
|
+
layerIds: string[];
|
|
2642
|
+
};
|
|
2643
|
+
type: "setLayerBoundary";
|
|
2644
|
+
}>;
|
|
2645
|
+
declare const OnLayerBoundariesChangeMessage: z.ZodObject<{
|
|
2646
|
+
eventName: z.ZodLiteral<"onLayerBoundariesChange">;
|
|
2647
|
+
id: z.ZodString;
|
|
2648
|
+
options: z.ZodObject<{
|
|
2649
|
+
layerId: z.ZodString;
|
|
2650
|
+
}, "strip", z.ZodTypeAny, {
|
|
2651
|
+
layerId: string;
|
|
2652
|
+
}, {
|
|
2653
|
+
layerId: string;
|
|
2654
|
+
}>;
|
|
2655
|
+
}, "strict", z.ZodTypeAny, {
|
|
2656
|
+
options: {
|
|
2657
|
+
layerId: string;
|
|
2658
|
+
};
|
|
2659
|
+
id: string;
|
|
2660
|
+
eventName: "onLayerBoundariesChange";
|
|
2661
|
+
}, {
|
|
2662
|
+
options: {
|
|
2663
|
+
layerId: string;
|
|
2664
|
+
};
|
|
2665
|
+
id: string;
|
|
2666
|
+
eventName: "onLayerBoundariesChange";
|
|
2667
|
+
}>;
|
|
2567
2668
|
declare const GetRenderedFeaturesMessage: z.ZodObject<{
|
|
2568
2669
|
type: z.ZodLiteral<"getRenderedFeatures">;
|
|
2569
2670
|
params: z.ZodOptional<z.ZodObject<{
|
|
@@ -2707,7 +2808,6 @@ declare const GetFeaturesMessage: z.ZodObject<{
|
|
|
2707
2808
|
pagination: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
2708
2809
|
}, "strip", z.ZodTypeAny, {
|
|
2709
2810
|
layerId: string;
|
|
2710
|
-
search?: string | undefined;
|
|
2711
2811
|
boundary?: [number, number, number, number] | [number, number][] | {
|
|
2712
2812
|
type: "Polygon";
|
|
2713
2813
|
coordinates: [number, number][][];
|
|
@@ -2720,10 +2820,10 @@ declare const GetFeaturesMessage: z.ZodObject<{
|
|
|
2720
2820
|
attribute: string;
|
|
2721
2821
|
direction: "asc" | "desc";
|
|
2722
2822
|
} | undefined;
|
|
2823
|
+
search?: string | undefined;
|
|
2723
2824
|
pagination?: string | null | undefined;
|
|
2724
2825
|
}, {
|
|
2725
2826
|
layerId: string;
|
|
2726
|
-
search?: string | undefined;
|
|
2727
2827
|
boundary?: [number, number, number, number] | [number, number][] | {
|
|
2728
2828
|
type: "Polygon";
|
|
2729
2829
|
coordinates: [number, number][][];
|
|
@@ -2736,12 +2836,12 @@ declare const GetFeaturesMessage: z.ZodObject<{
|
|
|
2736
2836
|
attribute: string;
|
|
2737
2837
|
direction: "asc" | "desc";
|
|
2738
2838
|
} | undefined;
|
|
2839
|
+
search?: string | undefined;
|
|
2739
2840
|
pagination?: string | null | undefined;
|
|
2740
2841
|
}>;
|
|
2741
2842
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
2742
2843
|
params: {
|
|
2743
2844
|
layerId: string;
|
|
2744
|
-
search?: string | undefined;
|
|
2745
2845
|
boundary?: [number, number, number, number] | [number, number][] | {
|
|
2746
2846
|
type: "Polygon";
|
|
2747
2847
|
coordinates: [number, number][][];
|
|
@@ -2754,13 +2854,13 @@ declare const GetFeaturesMessage: z.ZodObject<{
|
|
|
2754
2854
|
attribute: string;
|
|
2755
2855
|
direction: "asc" | "desc";
|
|
2756
2856
|
} | undefined;
|
|
2857
|
+
search?: string | undefined;
|
|
2757
2858
|
pagination?: string | null | undefined;
|
|
2758
2859
|
};
|
|
2759
2860
|
type: "getFeatures";
|
|
2760
2861
|
}, {
|
|
2761
2862
|
params: {
|
|
2762
2863
|
layerId: string;
|
|
2763
|
-
search?: string | undefined;
|
|
2764
2864
|
boundary?: [number, number, number, number] | [number, number][] | {
|
|
2765
2865
|
type: "Polygon";
|
|
2766
2866
|
coordinates: [number, number][][];
|
|
@@ -2773,6 +2873,7 @@ declare const GetFeaturesMessage: z.ZodObject<{
|
|
|
2773
2873
|
attribute: string;
|
|
2774
2874
|
direction: "asc" | "desc";
|
|
2775
2875
|
} | undefined;
|
|
2876
|
+
search?: string | undefined;
|
|
2776
2877
|
pagination?: string | null | undefined;
|
|
2777
2878
|
};
|
|
2778
2879
|
type: "getFeatures";
|
|
@@ -3346,40 +3447,40 @@ declare const GetLayerSchemaMessage: z.ZodObject<{
|
|
|
3346
3447
|
}>;
|
|
3347
3448
|
type LayersSchema = {
|
|
3348
3449
|
methods: {
|
|
3349
|
-
getLayer: Method<zInfer<typeof GetLayerMessage
|
|
3350
|
-
getLayers: Method<zInfer<typeof GetLayersMessage
|
|
3351
|
-
setLayerVisibility: Method<zInfer<typeof SetLayerVisibilityMessage
|
|
3352
|
-
setLayerStyle: Method<zInfer<typeof SetLayerStyleMessage
|
|
3353
|
-
setLayerLegendVisibility: Method<zInfer<typeof SetLayerLegendVisibilityMessage
|
|
3354
|
-
createLayersFromGeoJson: Method<zInfer<typeof CreateLayersFromGeoJsonMessage
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
getFeatures: Method<zInfer<typeof GetFeaturesMessage
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
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>>;
|
|
3377
3477
|
};
|
|
3378
3478
|
listeners: {
|
|
3379
3479
|
onLayerChange: Listener<zInfer<typeof OnLayerChangeMessage.shape.options>, LayerChangeCallbackParams>;
|
|
3380
3480
|
onLayerGroupChange: Listener<zInfer<typeof OnLayerGroupChangeMessage.shape.options>, LayerGroupChangeCallbackParams>;
|
|
3381
3481
|
onLegendItemChange: Listener<zInfer<typeof OnLegendItemChangeMessage.shape.options>, LegendItemChangeCallbackParams>;
|
|
3382
3482
|
onLayerFiltersChange: Listener<zInfer<typeof OnLayerFiltersChangeMessage.shape.options>, LayerFilters>;
|
|
3483
|
+
onLayerBoundariesChange: Listener<zInfer<typeof OnLayerBoundariesChangeMessage.shape.options>, LayerBoundaries | null>;
|
|
3383
3484
|
};
|
|
3384
3485
|
};
|
|
3385
3486
|
|
|
@@ -3395,7 +3496,7 @@ declare const GetMapDetailsMessage: z.ZodObject<{
|
|
|
3395
3496
|
}>;
|
|
3396
3497
|
type MiscSchema = {
|
|
3397
3498
|
methods: {
|
|
3398
|
-
getMapDetails: Method<zInfer<typeof GetMapDetailsMessage
|
|
3499
|
+
getMapDetails: Method<zInfer<typeof GetMapDetailsMessage>>;
|
|
3399
3500
|
};
|
|
3400
3501
|
listeners: {};
|
|
3401
3502
|
};
|
|
@@ -3486,9 +3587,9 @@ declare const ClearSelectionMessage: z.ZodObject<{
|
|
|
3486
3587
|
}>;
|
|
3487
3588
|
type SelectionSchema = {
|
|
3488
3589
|
methods: {
|
|
3489
|
-
getSelection: Method<zInfer<typeof GetSelectionMessage
|
|
3490
|
-
selectFeature: Method<zInfer<typeof SelectFeatureMessage
|
|
3491
|
-
clearSelection: Method<zInfer<typeof ClearSelectionMessage
|
|
3590
|
+
getSelection: Method<zInfer<typeof GetSelectionMessage>>;
|
|
3591
|
+
selectFeature: Method<zInfer<typeof SelectFeatureMessage>>;
|
|
3592
|
+
clearSelection: Method<zInfer<typeof ClearSelectionMessage>>;
|
|
3492
3593
|
};
|
|
3493
3594
|
listeners: {
|
|
3494
3595
|
onSelectionChange: ListenerNoOptions<{
|
|
@@ -3501,10 +3602,10 @@ declare const SetToolMessage: z.ZodObject<{
|
|
|
3501
3602
|
type: z.ZodLiteral<"setTool">;
|
|
3502
3603
|
params: z.ZodNullable<z.ZodEnum<["pin", "line", "route", "polygon", "circle", "marker", "highlighter", "text", "note", "link"]>>;
|
|
3503
3604
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
3504
|
-
params: "text" | "
|
|
3605
|
+
params: "text" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "link" | null;
|
|
3505
3606
|
type: "setTool";
|
|
3506
3607
|
}, {
|
|
3507
|
-
params: "text" | "
|
|
3608
|
+
params: "text" | "note" | "pin" | "line" | "route" | "polygon" | "circle" | "marker" | "highlighter" | "link" | null;
|
|
3508
3609
|
type: "setTool";
|
|
3509
3610
|
}>;
|
|
3510
3611
|
declare const GetToolMessage: z.ZodObject<{
|
|
@@ -3843,10 +3944,10 @@ declare const GetToolSettingsMessage: z.ZodObject<{
|
|
|
3843
3944
|
}>;
|
|
3844
3945
|
type ToolsSchema = {
|
|
3845
3946
|
methods: {
|
|
3846
|
-
setTool: Method<zInfer<typeof SetToolMessage
|
|
3847
|
-
getTool: Method<zInfer<typeof GetToolMessage
|
|
3848
|
-
setToolSettings: Method<zInfer<typeof SetToolSettingsMessage
|
|
3849
|
-
getToolSettings: Method<zInfer<typeof GetToolSettingsMessage
|
|
3947
|
+
setTool: Method<zInfer<typeof SetToolMessage>>;
|
|
3948
|
+
getTool: Method<zInfer<typeof GetToolMessage>>;
|
|
3949
|
+
setToolSettings: Method<zInfer<typeof SetToolSettingsMessage>>;
|
|
3950
|
+
getToolSettings: Method<zInfer<typeof GetToolSettingsMessage>>;
|
|
3850
3951
|
};
|
|
3851
3952
|
listeners: {
|
|
3852
3953
|
onToolChange: ListenerNoOptions<ToolType | null>;
|
|
@@ -3997,10 +4098,10 @@ declare const HideLayerDataTableMessage: z.ZodObject<{
|
|
|
3997
4098
|
}>;
|
|
3998
4099
|
type UiSchema = {
|
|
3999
4100
|
methods: {
|
|
4000
|
-
updateUiControls: Method<zInfer<typeof UiControlsMessage
|
|
4001
|
-
setOnMapInteractionsUi: Method<zInfer<typeof OnMapInteractionsMessage
|
|
4002
|
-
showLayerDataTable: Method<zInfer<typeof ShowLayerDataTableMessage
|
|
4003
|
-
hideLayerDataTable: Method<zInfer<typeof HideLayerDataTableMessage
|
|
4101
|
+
updateUiControls: Method<zInfer<typeof UiControlsMessage>>;
|
|
4102
|
+
setOnMapInteractionsUi: Method<zInfer<typeof OnMapInteractionsMessage>>;
|
|
4103
|
+
showLayerDataTable: Method<zInfer<typeof ShowLayerDataTableMessage>>;
|
|
4104
|
+
hideLayerDataTable: Method<zInfer<typeof HideLayerDataTableMessage>>;
|
|
4004
4105
|
};
|
|
4005
4106
|
listeners: {};
|
|
4006
4107
|
};
|
|
@@ -4123,11 +4224,11 @@ declare const ViewportFitBoundsMessage: z.ZodObject<{
|
|
|
4123
4224
|
}>;
|
|
4124
4225
|
type ViewportSchema = {
|
|
4125
4226
|
methods: {
|
|
4126
|
-
getViewport: Method<zInfer<typeof GetViewportMessage
|
|
4127
|
-
setViewport: Method<zInfer<typeof GotoViewportMessage
|
|
4128
|
-
getViewportConstraints: Method<zInfer<typeof GetViewportConstraintsMessage
|
|
4129
|
-
setViewportConstraints: Method<zInfer<typeof SetViewportConstraintsMessage
|
|
4130
|
-
fitViewportToBounds: Method<zInfer<typeof ViewportFitBoundsMessage
|
|
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>>;
|
|
4131
4232
|
};
|
|
4132
4233
|
listeners: {
|
|
4133
4234
|
onViewportMove: ListenerNoOptions<ViewportState>;
|