@feltmaps/js-sdk 1.5.0-next.6 → 1.5.0-next.8
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 +138 -11
- package/dist/client.d.ts +138 -11
- package/dist/client.js +1 -1
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +120 -31
- package/dist/handler.d.ts +120 -31
- package/dist/handler.js +1 -1
- package/dist/{types-CQwkpLq-.d.cts → types-BXCTpxot.d.cts} +177 -14
- package/dist/{types-CQwkpLq-.d.ts → types-BXCTpxot.d.ts} +177 -14
- package/handler.d.ts +120 -31
- package/handler.js +1 -1
- package/package.json +1 -1
- package/{types-CQwkpLq-.d.ts → types-BXCTpxot.d.ts} +177 -14
package/dist/handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as g}from"zod";import{z as y}from"zod";import{z as x}from"zod";function t(n,T){return x.strictObject({type:x.literal(n),params:T})}function M(n,T){return x.strictObject({eventName:x.literal(n),id:x.string(),options:T})}function s(n){return x.strictObject({eventName:x.literal(n),id:x.string()})}import{z as a}from"zod";var F=a.number(),k=a.number(),v=a.object({latitude:k,longitude:F}),b=a.tuple([F,k]),ce=a.object({type:a.literal("Point"),coordinates:b}),ge=a.object({type:a.literal("Polygon"),coordinates:a.array(a.array(b))}),Xe=a.object({type:a.literal("LineString"),coordinates:a.array(b)}),L=a.object({type:a.literal("MultiLineString"),coordinates:a.array(Xe.shape.coordinates)}),de=a.number().min(1).max(23),I=a.tuple([F,k,F,k]),G=a.object({show:a.array(a.string()).optional(),hide:a.array(a.string()).optional()});import{z as e}from"zod";var d=e.object({id:e.string(),groupId:e.string().nullable(),color:e.string(),name:e.union([e.string(),e.null()]),description:e.union([e.string(),e.null()]),attributes:e.record(e.string(),e.unknown())}),w=e.object({imageUrl:e.string().nullable()}),H=e.object({strokeOpacity:e.number(),strokeWidth:e.number(),strokeStyle:e.enum(["solid","dashed","dotted"])}),Ye=e.enum(["meter","kilometer","foot","mile"]),B=d.extend(w.shape).extend({type:e.literal("Place"),coordinates:ce.shape.coordinates,symbol:e.string(),frame:e.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.boolean()}),Z=d.extend(w.shape).extend(H.shape).extend({type:e.literal("Path"),coordinates:L.shape.coordinates,distanceMarker:e.boolean(),endCaps:e.boolean(),routingMode:e.enum(["driving","cycling","walking","flying"]).nullable()}),D=d.extend(w.shape).extend(H.shape).extend({type:e.literal("Polygon"),coordinates:L.shape.coordinates,fillOpacity:e.number().min(0).max(1),areaMarker:e.boolean()}),W=d.extend(w.shape).extend(H.shape).extend({type:e.literal("Circle"),coordinates:b,radius:e.number(),radiusDisplayAngle:e.number(),radiusDisplayUnit:Ye.nullable(),fillOpacity:e.number().min(0).max(1),radiusMarker:e.boolean()}),K=d.extend({type:e.literal("Marker"),coordinates:L.shape.coordinates,opacity:e.number().min(0).max(1),size:e.number().min(0).max(100),zoom:e.number().min(0).max(23)}),_=d.extend({type:e.literal("Highlighter"),coordinates:L.shape.coordinates,opacity:e.number().min(0).max(1)}),ye=e.object({position:b,rotation:e.number(),scale:e.number(),zoom:e.number().min(0).max(23),coordinates:L.shape.coordinates}),ue=e.object({text:e.string(),align:e.enum(["left","center","right"]),style:e.enum(["italic","light","regular","caps"]),name:e.string()}),Q=d.extend(ye.shape).extend(ue.shape).extend({type:e.literal("Text")}),$=d.extend(ye.shape).extend(ue.shape).extend({type:e.literal("Note"),widthScale:e.number().min(0)}),J=d.extend({type:e.literal("Image"),coordinates:L.shape.coordinates,imageUrl:e.string(),opacity:e.number().min(0).max(1)}).omit({color:!0}),et=d.extend({type:e.literal("Link"),coordinates:L.shape.coordinates,url:e.string()}),h={type:!0,coordinates:!0},f={id:!0},X=B.partial().required(h).omit(f),V=Z.partial().required(h).omit(f),Y=D.partial().required(h).omit(f),ee=W.partial().required(h).required({radius:!0}).omit(f),te=K.partial().required(h).omit(f),oe=_.partial().required(h).omit(f),re=Q.partial().required(h).required({text:!0}).omit(f).omit({coordinates:!0,name:!0}),ne=$.partial().required(h).required({text:!0}).omit(f).omit({coordinates:!0,name:!0}),tt=J.partial().required(h).required({imageUrl:!0}).omit(f),he=e.discriminatedUnion("type",[X,V,Y,ee,te,oe,tt,re,ne]),Ko=B.omit({coordinates:!0}),_o=Z.omit({coordinates:!0}),Qo=D.omit({coordinates:!0}),$o=W.omit({coordinates:!0}),Jo=K.omit({coordinates:!0}),Xo=_.omit({coordinates:!0}),Yo=Q.omit({coordinates:!0}),er=$.omit({coordinates:!0}),tr=J.omit({coordinates:!0}),or=et.omit({coordinates:!0}),S={type:!0,id:!0},ot=B.partial().required(S),rt=Z.partial().required(S),nt=D.partial().required(S),at=W.partial().required(S),it=K.partial().required(S),st=_.partial().required(S),lt=Q.partial().required(S).omit({coordinates:!0,name:!0}),pt=$.partial().required(S).omit({coordinates:!0,name:!0}),mt=J.partial().required(S),fe=e.discriminatedUnion("type",[ot,rt,nt,at,it,st,lt,pt,mt]),Se=e.object({ids:e.array(e.string()).optional()}),xe=e.object({ids:e.array(e.string()).optional()});var ct=t("getElement",y.string()),gt=t("getElementGeometry",y.string()),dt=t("getElements",Se.optional()),yt=t("getElementGroup",y.string()),ut=t("getElementGroups",xe.optional()),ht=t("setElementGroupVisibility",G),ft=M("onElementChange",y.object({id:y.string()})),St=s("onElementCreate"),xt=M("onElementDelete",y.object({id:y.string()})),Mt=M("onElementGroupChange",y.object({id:y.string()})),bt=t("createElement",he),Lt=t("updateElement",fe),Ct=t("deleteElement",y.string()),Me={methods:[ct,gt,dt,yt,ut,ht,bt,Lt,Ct],listeners:[ft,St,xt,Mt]};var It=s("onPointerClick"),Gt=s("onPointerMove"),be={methods:null,listeners:[It,Gt]};import{z as l}from"zod";import{z as r}from"zod";var Et=r.enum(["in","ni"]),Tt=r.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),gr=r.enum(["and","or"]),Le=r.union([r.number(),r.string(),r.boolean(),r.null()]),Ce=r.string().or(r.null()),zt=r.tuple([Ce,Et,r.array(Le).or(r.null())]),Pt=r.tuple([Ce,Tt,Le]),ae=r.union([zt,Pt]),ie=r.tuple([r.lazy(()=>r.union([ie,ae,r.null(),r.boolean()])),r.enum(["and","or"]),r.lazy(()=>r.union([ie,ae,r.null(),r.boolean()]))]),E=r.union([ie,ae,r.null(),r.boolean()]);import{z as o}from"zod";var Ie=o.enum(["avg","max","min","sum","median"]),Ft=o.object({method:Ie,attribute:o.string()}),kt=o.object({methods:o.array(o.union([Ie,o.literal("count")])),attribute:o.string().optional()}),O=o.union([I,ge,o.array(b)]),Ge=o.object({boundary:O.optional(),filters:E.optional(),aggregation:Ft.optional()}),Ee=o.object({layerId:o.string(),attribute:o.string(),limit:o.number().optional(),boundary:O.optional(),filters:E.optional(),values:Ge.optional()}),fr=o.object({key:o.union([o.number(),o.string(),o.boolean()]),value:o.number().nullable()}),vt=o.object({type:o.literal("equal-intervals"),count:o.number()}),wt=o.object({type:o.literal("time-interval"),interval:o.enum(["hour","day","week","month","year"])}),Te=o.object({layerId:o.string(),attribute:o.string(),steps:o.union([vt,wt,o.array(o.number())]),boundary:O.optional(),filters:E.optional(),values:Ge.optional()}),Sr=o.object({min:o.number(),max:o.number(),value:o.number()}),ze=o.object({layerId:o.string(),boundary:O.optional(),filters:E.optional(),aggregation:kt});import{z as i}from"zod";var Lr=i.enum(["processing","completed","failed","incomplete"]),Pe=i.object({ids:i.array(i.string()).optional()}),Fe=i.object({ids:i.array(i.string()).optional()}),z=i.object({id:i.string(),layerId:i.string()}),ke=i.object({ids:z.array().optional(),layerIds:i.string().array().optional()}),ve=i.object({layerIds:i.array(i.string()).optional(),areaQuery:i.union([i.object({coordinates:v}),i.object({boundary:I})]).optional()});var Vt=t("getLayer",l.string()),Ot=t("getLayers",Pe.optional()),Ut=t("setLayerVisibility",G),Rt=M("onLayerChange",l.object({id:l.string()})),Nt=t("setLayerStyle",l.object({id:l.string(),style:l.object({}).passthrough()})),jt=t("setLayerLegendVisibility",G),qt=t("getLayerGroup",l.string()),At=t("getLayerGroups",Fe.optional()),Ht=t("setLayerGroupVisibility",G),Bt=t("setLayerGroupLegendVisibility",G),Zt=M("onLayerGroupChange",l.object({id:l.string()})),Dt=t("getLegendItem",z),Wt=t("getLegendItems",ke.optional()),Kt=M("onLegendItemChange",z),_t=t("setLegendItemVisibility",l.object({show:z.array().optional(),hide:z.array().optional()})),Qt=t("getLayerFilters",l.string()),$t=t("setLayerFilters",l.object({layerId:l.string(),filters:E,note:l.string().optional()})),Jt=t("getRenderedFeatures",ve.optional()),Xt=t("getCategoryData",Ee),Yt=t("getHistogramData",Te),eo=t("getAggregates",ze),we={methods:[Vt,Ot,Ut,Nt,jt,qt,At,Ht,Bt,Dt,Wt,_t,Qt,$t,Jt,Xt,Yt,eo],listeners:[Rt,Zt,Kt]};import{z as to}from"zod";var oo=t("getMapDetails",to.undefined()),Ve={methods:[oo],listeners:[]};import{z as U}from"zod";import{z as C}from"zod";var Oe=C.object({id:C.string().or(C.number()),layerId:C.string(),showPopup:C.boolean().optional(),fitViewport:C.boolean().or(C.object({maxZoom:C.number()})).optional()});var ro=t("getSelection",U.undefined()),no=s("onSelectionChange"),ao=t("selectFeature",Oe),io=t("clearSelection",U.object({features:U.boolean().optional(),elements:U.boolean().optional()}).optional()),Ue={methods:[ro,ao,io],listeners:[no]};import{z as fo}from"zod";import{z as m}from"zod";var Re=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Ne=m.enum([...Re,"link"]),je=m.enum(Re),so=X.pick({color:!0,symbol:!0,frame:!0}).required(),lo=V.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),po=V.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),mo=Y.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),co=ee.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),go=te.pick({color:!0,opacity:!0,size:!0}).required(),yo=oe.pick({color:!0,opacity:!0}).extend({size:m.number().min(0).max(200)}).required(),uo=re.pick({color:!0,align:!0,style:!0}).required(),ho=ne.pick({color:!0,align:!0,style:!0}).required(),qe=m.discriminatedUnion("tool",[so.partial().extend({tool:m.literal("pin")}),lo.partial().extend({tool:m.literal("line")}),po.partial().extend({tool:m.literal("route")}),mo.partial().extend({tool:m.literal("polygon")}),co.partial().extend({tool:m.literal("circle")}),go.partial().extend({tool:m.literal("marker")}),yo.partial().extend({tool:m.literal("highlighter")}),uo.partial().extend({tool:m.literal("text")}),ho.partial().extend({tool:m.literal("note")})]);var So=t("setTool",Ne.nullable()),xo=t("getTool",fo.undefined()),Mo=s("onToolChange"),bo=t("setToolSettings",qe),Lo=t("getToolSettings",je),Co=s("onToolSettingsChange"),Ae={methods:[So,xo,bo,Lo],listeners:[Mo,Co]};import{z as c}from"zod";var He=c.object({showLegend:c.boolean().optional(),cooperativeGestures:c.boolean().optional(),fullScreenButton:c.boolean().optional(),geolocation:c.boolean().optional(),zoomControls:c.boolean().optional(),scaleBar:c.boolean().optional()}),Be=c.object({featureSelectPanel:c.boolean().optional(),featureHoverPanel:c.boolean().optional(),elementSelectPanel:c.boolean().optional(),linkClickOpen:c.boolean().optional(),imageLightboxOpen:c.boolean().optional()});var Io=t("updateUiControls",He),Go=t("setOnMapInteractionsUi",Be),Ze={methods:[Io,Go],listeners:null};import{z as _e}from"zod";import{z as N}from"zod";var R=N.object({center:v,zoom:de}),De=N.object({center:R.shape.center.optional(),zoom:R.shape.zoom.optional()}),We=N.object({minZoom:R.shape.zoom.nullish(),maxZoom:R.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),Ke=N.object({bounds:I});var Eo=t("getViewport",_e.undefined()),To=t("setViewport",De),zo=t("getViewportConstraints",_e.undefined()),Po=t("setViewportConstraints",We),Fo=t("fitViewportToBounds",Ke),ko=s("onViewportMove"),vo=s("onViewportMoveEnd"),wo=s("onMapIdle"),Qe={methods:[To,Eo,zo,Po,Fo],listeners:[ko,vo,wo]};var se=[Ze,Qe,we,Me,Ue,be,Ae,Ve];function fn(n,T,le){let j=new Map;async function pe(u){if(!jo.safeParse(u.data).success){le?.onUnknownMessage?.(u.data);return}let me=Je.safeParse(u.data);if(!me.success){le?.onInvalidMessage?.(u.data);return}let{data:p}=me;if(p.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(p.type==="felt.addListener"){if(p.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let P="options"in p.event?{options:"options"in p.event?p.event.options:void 0,handler:A=>{u.ports[0]?.postMessage(A)}}:{handler:A=>{u.ports[0]?.postMessage(A)}},q=T.listeners[p.event.eventName](P);j.set(p.event.id,q)}else if(p.type==="felt.removeListener")j.get(p.id)?.(),j.delete(p.id);else try{let P=T.methods[p.type],q=await P(p.params);u.ports[0]?.postMessage(q)}catch(P){u.ports[0]?.postMessage({__error__:Vo(P)})}}return n.addEventListener("message",pe),()=>{n.removeEventListener("message",pe)}}function Vo(n){return n instanceof Error?n.message:typeof n=="object"&&n!==null&&"message"in n?String(n.message):typeof n=="string"?n:"Unknown error"}var $e={methods:se.map(n=>n.methods??[]).flat(),listeners:se.map(n=>n.listeners??[]).flat()},Oo=g.discriminatedUnion("eventName",[g.strictObject({eventName:g.literal("")}),...$e.listeners]),Uo=g.strictObject({type:g.literal("felt.addListener"),event:Oo}),Ro=g.strictObject({type:g.literal("felt.removeListener"),id:g.string()}),No=g.strictObject({type:g.literal("felt.ready")}),Je=g.discriminatedUnion("type",[No,Uo,Ro,...$e.methods]),jo=g.object({type:g.enum(Je.options.map(n=>n.shape.type.value))});export{fn as createMessageHandler};
|
|
1
|
+
import{z as g}from"zod";import{z as y}from"zod";import{z as M}from"zod";function t(a,T){return M.strictObject({type:M.literal(a),params:T})}function h(a,T){return M.strictObject({eventName:M.literal(a),id:M.string(),options:T})}function l(a){return M.strictObject({eventName:M.literal(a),id:M.string()})}import{z as n}from"zod";var F=n.number(),k=n.number(),w=n.object({latitude:k,longitude:F}),b=n.tuple([F,k]),me=n.object({type:n.literal("Point"),coordinates:b}),ce=n.object({type:n.literal("Polygon"),coordinates:n.array(n.array(b))}),et=n.object({type:n.literal("LineString"),coordinates:n.array(b)}),L=n.object({type:n.literal("MultiLineString"),coordinates:n.array(et.shape.coordinates)}),ge=n.number().min(1).max(23),I=n.tuple([F,k,F,k]),G=n.object({show:n.array(n.string()).optional(),hide:n.array(n.string()).optional()}),tt=n.enum(["asc","desc"]),de=n.object({attribute:n.string(),direction:tt});import{z as e}from"zod";var d=e.object({id:e.string(),groupId:e.string().nullable(),color:e.string(),name:e.union([e.string(),e.null()]),description:e.union([e.string(),e.null()]),attributes:e.record(e.string(),e.unknown())}),v=e.object({imageUrl:e.string().nullable()}),H=e.object({strokeOpacity:e.number(),strokeWidth:e.number(),strokeStyle:e.enum(["solid","dashed","dotted"])}),ot=e.enum(["meter","kilometer","foot","mile"]),ye=d.extend(v.shape).extend({type:e.literal("Place"),coordinates:me.shape.coordinates,symbol:e.string(),frame:e.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.boolean()}),B=d.extend(v.shape).extend(H.shape).extend({type:e.literal("Path"),coordinates:L.shape.coordinates,distanceMarker:e.boolean(),endCaps:e.boolean(),routingMode:e.enum(["driving","cycling","walking","flying"]).nullable()}),D=d.extend(v.shape).extend(H.shape).extend({type:e.literal("Polygon"),coordinates:L.shape.coordinates,fillOpacity:e.number().min(0).max(1),areaMarker:e.boolean()}),ue=d.extend(v.shape).extend(H.shape).extend({type:e.literal("Circle"),coordinates:b,radius:e.number(),radiusDisplayAngle:e.number(),radiusDisplayUnit:ot.nullable(),fillOpacity:e.number().min(0).max(1),radiusMarker:e.boolean()}),Z=d.extend({type:e.literal("Marker"),coordinates:L.shape.coordinates,opacity:e.number().min(0).max(1),size:e.number().min(0).max(100),zoom:e.number().min(0).max(23)}),W=d.extend({type:e.literal("Highlighter"),coordinates:L.shape.coordinates,opacity:e.number().min(0).max(1)}),he=e.object({position:b,rotation:e.number(),scale:e.number(),zoom:e.number().min(0).max(23),coordinates:L.shape.coordinates}),fe=e.object({text:e.string(),align:e.enum(["left","center","right"]),style:e.enum(["italic","light","regular","caps"]),name:e.string()}),K=d.extend(he.shape).extend(fe.shape).extend({type:e.literal("Text")}),_=d.extend(he.shape).extend(fe.shape).extend({type:e.literal("Note"),widthScale:e.number().min(0)}),Q=d.extend({type:e.literal("Image"),coordinates:L.shape.coordinates,imageUrl:e.string(),opacity:e.number().min(0).max(1)}).omit({color:!0}),rt=d.extend({type:e.literal("Link"),coordinates:L.shape.coordinates,url:e.string()}),f={type:!0,coordinates:!0},S={id:!0},$=ye.partial().required(f).omit(S),V=B.partial().required(f).omit(S),J=D.partial().required(f).omit(S),X=ue.partial().required(f).required({radius:!0}).omit(S),Y=Z.partial().required(f).omit(S),ee=W.partial().required(f).omit(S),te=K.partial().required(f).required({text:!0}).omit(S).omit({coordinates:!0,name:!0}),oe=_.partial().required(f).required({text:!0}).omit(S).omit({coordinates:!0,name:!0}),nt=Q.partial().required(f).required({imageUrl:!0}).omit(S),Se=e.discriminatedUnion("type",[$,V,J,X,Y,ee,nt,te,oe]);var er=B.omit({coordinates:!0}),tr=D.omit({coordinates:!0});var or=Z.omit({coordinates:!0}),rr=W.omit({coordinates:!0}),nr=K.omit({coordinates:!0}),ar=_.omit({coordinates:!0}),ir=Q.omit({coordinates:!0}),sr=rt.omit({coordinates:!0}),x={type:!0,id:!0},at=ye.partial().required(x),it=B.partial().required(x),st=D.partial().required(x),lt=ue.partial().required(x),pt=Z.partial().required(x),mt=W.partial().required(x),ct=K.partial().required(x).omit({coordinates:!0,name:!0}),gt=_.partial().required(x).omit({coordinates:!0,name:!0}),dt=Q.partial().required(x),xe=e.discriminatedUnion("type",[at,it,st,lt,pt,mt,ct,gt,dt]),Me=e.object({ids:e.array(e.string()).optional()}),be=e.object({ids:e.array(e.string()).optional()});var yt=t("getElement",y.string()),ut=t("getElementGeometry",y.string()),ht=t("getElements",Me.optional()),ft=t("getElementGroup",y.string()),St=t("getElementGroups",be.optional()),xt=t("setElementGroupVisibility",G),Mt=h("onElementChange",y.object({id:y.string()})),bt=l("onElementCreate"),Lt=l("onElementCreateEnd"),Ct=h("onElementDelete",y.object({id:y.string()})),It=h("onElementGroupChange",y.object({id:y.string()})),Gt=t("createElement",Se),Et=t("updateElement",xe),Tt=t("deleteElement",y.string()),Le={methods:[yt,ut,ht,ft,St,xt,Gt,Et,Tt],listeners:[Mt,bt,Lt,Ct,It]};var zt=l("onPointerClick"),Pt=l("onPointerMove"),Ce={methods:null,listeners:[zt,Pt]};import{z as s}from"zod";import{z as r}from"zod";var Ft=r.enum(["in","ni"]),kt=r.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),fr=r.enum(["and","or"]),Ie=r.union([r.number(),r.string(),r.boolean(),r.null()]),Ge=r.string().or(r.null()),wt=r.tuple([Ge,Ft,r.array(Ie).or(r.null())]),vt=r.tuple([Ge,kt,Ie]),re=r.union([wt,vt]),ne=r.tuple([r.lazy(()=>r.union([ne,re,r.null(),r.boolean()])),r.enum(["and","or"]),r.lazy(()=>r.union([ne,re,r.null(),r.boolean()]))]),E=r.union([ne,re,r.null(),r.boolean()]);import{z as o}from"zod";var Ee=o.enum(["avg","max","min","sum","median"]),Vt=o.object({method:Ee,attribute:o.string()}),Ot=o.object({methods:o.array(o.union([Ee,o.literal("count")])),attribute:o.string().optional()}),O=o.union([I,ce,o.array(b)]),Te=o.object({boundary:O.optional(),filters:E.optional(),aggregation:Vt.optional()}),ze=o.object({layerId:o.string(),attribute:o.string(),limit:o.number().optional(),boundary:O.optional(),filters:E.optional(),values:Te.optional()}),Lr=o.object({key:o.union([o.number(),o.string(),o.boolean()]),value:o.number().nullable()}),Ut=o.object({type:o.literal("equal-intervals"),count:o.number()}),Rt=o.object({type:o.literal("time-interval"),interval:o.enum(["hour","day","week","month","year"])}),Pe=o.object({layerId:o.string(),attribute:o.string(),steps:o.union([Ut,Rt,o.array(o.number())]),boundary:O.optional(),filters:E.optional(),values:Te.optional()}),Cr=o.object({min:o.number(),max:o.number(),value:o.number()}),Fe=o.object({layerId:o.string(),boundary:O.optional(),filters:E.optional(),aggregation:Ot});import{z as i}from"zod";var Tr=i.enum(["processing","completed","failed","incomplete"]),ke=i.object({ids:i.array(i.string()).optional()}),we=i.object({ids:i.array(i.string()).optional()}),z=i.object({id:i.string(),layerId:i.string()}),ve=i.object({ids:z.array().optional(),layerIds:i.string().array().optional()}),Ve=i.object({layerIds:i.array(i.string()).optional(),areaQuery:i.union([i.object({coordinates:w}),i.object({boundary:I})]).optional()});var Nt=t("getLayer",s.string()),jt=t("getLayers",ke.optional()),qt=t("setLayerVisibility",G),At=h("onLayerChange",s.object({id:s.string()})),Ht=t("setLayerStyle",s.object({id:s.string(),style:s.object({}).passthrough()})),Bt=t("setLayerLegendVisibility",G),Dt=t("getLayerGroup",s.string()),Zt=t("getLayerGroups",we.optional()),Wt=t("setLayerGroupVisibility",G),Kt=t("setLayerGroupLegendVisibility",G),_t=h("onLayerGroupChange",s.object({id:s.string()})),Qt=t("getLegendItem",z),$t=t("getLegendItems",ve.optional()),Jt=h("onLegendItemChange",z),Xt=t("setLegendItemVisibility",s.object({show:z.array().optional(),hide:z.array().optional()})),Yt=t("getLayerFilters",s.string()),eo=t("setLayerFilters",s.object({layerId:s.string(),filters:E,note:s.string().optional()})),to=h("onLayerFiltersChange",s.object({layerId:s.string()})),oo=t("getRenderedFeatures",Ve.optional()),ro=t("getCategoryData",ze),no=t("getHistogramData",Pe),ao=t("getAggregates",Fe),Oe={methods:[Nt,jt,qt,Ht,Bt,Dt,Zt,Wt,Kt,Qt,$t,Xt,Yt,eo,oo,ro,no,ao],listeners:[At,_t,Jt,to]};import{z as io}from"zod";var so=t("getMapDetails",io.undefined()),Ue={methods:[so],listeners:[]};import{z as U}from"zod";import{z as C}from"zod";var Re=C.object({id:C.string().or(C.number()),layerId:C.string(),showPopup:C.boolean().optional(),fitViewport:C.boolean().or(C.object({maxZoom:C.number()})).optional()});var lo=t("getSelection",U.undefined()),po=l("onSelectionChange"),mo=t("selectFeature",Re),co=t("clearSelection",U.object({features:U.boolean().optional(),elements:U.boolean().optional()}).optional()),Ne={methods:[lo,mo,co],listeners:[po]};import{z as Lo}from"zod";import{z as p}from"zod";var je=["pin","line","route","polygon","circle","marker","highlighter","text","note"],qe=p.enum([...je,"link"]),Ae=p.enum(je),go=$.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:p.enum(["enter name","add another","select"])}).required(),yo=V.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),uo=V.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),ho=J.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),fo=X.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),So=Y.pick({color:!0,opacity:!0,size:!0}).required(),xo=ee.pick({color:!0,opacity:!0}).extend({size:p.number().min(0).max(200)}).required(),Mo=te.pick({color:!0,align:!0,style:!0}).required(),bo=oe.pick({color:!0,align:!0,style:!0}).required(),He=p.discriminatedUnion("tool",[go.partial().extend({tool:p.literal("pin")}),yo.partial().extend({tool:p.literal("line")}),uo.partial().extend({tool:p.literal("route")}),ho.partial().extend({tool:p.literal("polygon")}),fo.partial().extend({tool:p.literal("circle")}),So.partial().extend({tool:p.literal("marker")}),xo.partial().extend({tool:p.literal("highlighter")}),Mo.partial().extend({tool:p.literal("text")}),bo.partial().extend({tool:p.literal("note")})]);var Co=t("setTool",qe.nullable()),Io=t("getTool",Lo.undefined()),Go=l("onToolChange"),Eo=t("setToolSettings",He),To=t("getToolSettings",Ae),zo=l("onToolSettingsChange"),Be={methods:[Co,Io,Eo,To],listeners:[Go,zo]};import{z as ae}from"zod";import{z as c}from"zod";var De=c.object({showLegend:c.boolean().optional(),cooperativeGestures:c.boolean().optional(),fullScreenButton:c.boolean().optional(),geolocation:c.boolean().optional(),zoomControls:c.boolean().optional(),scaleBar:c.boolean().optional()}),Ze=c.object({featureSelectPanel:c.boolean().optional(),featureHoverPanel:c.boolean().optional(),elementSelectPanel:c.boolean().optional(),linkClickOpen:c.boolean().optional(),imageLightboxOpen:c.boolean().optional()});var Po=t("updateUiControls",De),Fo=t("setOnMapInteractionsUi",Ze),ko=t("showLayerDataTable",ae.object({layerId:ae.string(),sorting:de.optional()}).optional()),wo=t("hideLayerDataTable",ae.undefined()),We={methods:[Po,Fo,ko,wo],listeners:null};import{z as $e}from"zod";import{z as N}from"zod";var R=N.object({center:w,zoom:ge}),Ke=N.object({center:R.shape.center.optional(),zoom:R.shape.zoom.optional()}),_e=N.object({minZoom:R.shape.zoom.nullish(),maxZoom:R.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),Qe=N.object({bounds:I});var vo=t("getViewport",$e.undefined()),Vo=t("setViewport",Ke),Oo=t("getViewportConstraints",$e.undefined()),Uo=t("setViewportConstraints",_e),Ro=t("fitViewportToBounds",Qe),No=l("onViewportMove"),jo=l("onViewportMoveEnd"),qo=l("onMapIdle"),Je={methods:[Vo,vo,Oo,Uo,Ro],listeners:[No,jo,qo]};var ie=[We,Je,Oe,Le,Ne,Ce,Be,Ue];function In(a,T,se){let j=new Map;async function le(u){if(!Wo.safeParse(u.data).success){se?.onUnknownMessage?.(u.data);return}let pe=Ye.safeParse(u.data);if(!pe.success){se?.onInvalidMessage?.(u.data);return}let{data:m}=pe;if(m.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(m.type==="felt.addListener"){if(m.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let P="options"in m.event?{options:"options"in m.event?m.event.options:void 0,handler:A=>{u.ports[0]?.postMessage(A)}}:{handler:A=>{u.ports[0]?.postMessage(A)}},q=T.listeners[m.event.eventName](P);j.set(m.event.id,q)}else if(m.type==="felt.removeListener")j.get(m.id)?.(),j.delete(m.id);else try{let P=T.methods[m.type],q=await P(m.params);u.ports[0]?.postMessage(q)}catch(P){u.ports[0]?.postMessage({__error__:Ao(P)})}}return a.addEventListener("message",le),()=>{a.removeEventListener("message",le)}}function Ao(a){return a instanceof Error?a.message:typeof a=="object"&&a!==null&&"message"in a?String(a.message):typeof a=="string"?a:"Unknown error"}var Xe={methods:ie.map(a=>a.methods??[]).flat(),listeners:ie.map(a=>a.listeners??[]).flat()},Ho=g.discriminatedUnion("eventName",[g.strictObject({eventName:g.literal("")}),...Xe.listeners]),Bo=g.strictObject({type:g.literal("felt.addListener"),event:Ho}),Do=g.strictObject({type:g.literal("felt.removeListener"),id:g.string()}),Zo=g.strictObject({type:g.literal("felt.ready")}),Ye=g.discriminatedUnion("type",[Zo,Bo,Do,...Xe.methods]),Wo=g.object({type:g.enum(Ye.options.map(a=>a.shape.type.value))});export{In as createMessageHandler};
|
|
@@ -378,7 +378,7 @@ declare const ImageCreateSchema: z.ZodObject<Omit<{
|
|
|
378
378
|
attributes?: Record<string, unknown> | undefined;
|
|
379
379
|
opacity?: number | undefined;
|
|
380
380
|
}>;
|
|
381
|
-
declare const PlaceReadSchema: z.ZodObject<
|
|
381
|
+
declare const PlaceReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
382
382
|
id: z.ZodString;
|
|
383
383
|
groupId: z.ZodNullable<z.ZodString>;
|
|
384
384
|
color: z.ZodString;
|
|
@@ -393,9 +393,10 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
|
|
|
393
393
|
symbol: z.ZodString;
|
|
394
394
|
frame: z.ZodNullable<z.ZodEnum<["frame-circle", "frame-square"]>>;
|
|
395
395
|
hideLabel: z.ZodBoolean;
|
|
396
|
-
}>, "
|
|
396
|
+
}>, "strip", z.ZodTypeAny, {
|
|
397
397
|
symbol: string;
|
|
398
398
|
type: "Place";
|
|
399
|
+
coordinates: [number, number];
|
|
399
400
|
id: string;
|
|
400
401
|
groupId: string | null;
|
|
401
402
|
color: string;
|
|
@@ -408,6 +409,7 @@ declare const PlaceReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.objec
|
|
|
408
409
|
}, {
|
|
409
410
|
symbol: string;
|
|
410
411
|
type: "Place";
|
|
412
|
+
coordinates: [number, number];
|
|
411
413
|
id: string;
|
|
412
414
|
groupId: string | null;
|
|
413
415
|
color: string;
|
|
@@ -515,7 +517,7 @@ declare const PolygonReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obj
|
|
|
515
517
|
fillOpacity: number;
|
|
516
518
|
areaMarker: boolean;
|
|
517
519
|
}>;
|
|
518
|
-
declare const CircleReadSchema: z.ZodObject<
|
|
520
|
+
declare const CircleReadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
519
521
|
id: z.ZodString;
|
|
520
522
|
groupId: z.ZodNullable<z.ZodString>;
|
|
521
523
|
color: z.ZodString;
|
|
@@ -536,8 +538,9 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
|
|
|
536
538
|
radiusDisplayUnit: z.ZodNullable<z.ZodEnum<["meter", "kilometer", "foot", "mile"]>>;
|
|
537
539
|
fillOpacity: z.ZodNumber;
|
|
538
540
|
radiusMarker: z.ZodBoolean;
|
|
539
|
-
}>, "
|
|
541
|
+
}>, "strip", z.ZodTypeAny, {
|
|
540
542
|
type: "Circle";
|
|
543
|
+
coordinates: [number, number];
|
|
541
544
|
id: string;
|
|
542
545
|
groupId: string | null;
|
|
543
546
|
color: string;
|
|
@@ -555,6 +558,7 @@ declare const CircleReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.obje
|
|
|
555
558
|
radiusMarker: boolean;
|
|
556
559
|
}, {
|
|
557
560
|
type: "Circle";
|
|
561
|
+
coordinates: [number, number];
|
|
558
562
|
id: string;
|
|
559
563
|
groupId: string | null;
|
|
560
564
|
color: string;
|
|
@@ -1317,7 +1321,7 @@ declare const GetElementGroupsConstraintSchema: z.ZodObject<{
|
|
|
1317
1321
|
ids?: string[] | undefined;
|
|
1318
1322
|
}>;
|
|
1319
1323
|
/**
|
|
1320
|
-
* The parameters for the `onElementChange`
|
|
1324
|
+
* The parameters for the `onElementChange` and the `onElementCreate` listeners.
|
|
1321
1325
|
*
|
|
1322
1326
|
* @group Elements
|
|
1323
1327
|
*/
|
|
@@ -1326,6 +1330,22 @@ interface ElementChangeCallbackParams {
|
|
|
1326
1330
|
* The new data for the element or null if the element was removed.
|
|
1327
1331
|
*/
|
|
1328
1332
|
element: Element | null;
|
|
1333
|
+
/**
|
|
1334
|
+
* Whether or not this element is still being created by a drawing tool.
|
|
1335
|
+
*
|
|
1336
|
+
* For example, if the user begins drawing a polygon, they need to place
|
|
1337
|
+
* multiple points until they've ultimately completed the polygon. All
|
|
1338
|
+
* the time they are still placing points, this will be true.
|
|
1339
|
+
*
|
|
1340
|
+
* For elements that require text entry (such as Places, Text and Notes)
|
|
1341
|
+
* this will be true all the time the user is typing text until the point
|
|
1342
|
+
* at which the user finishes, by pressing Escape for example.
|
|
1343
|
+
*
|
|
1344
|
+
* If the user is editing an existing element, this will be false.
|
|
1345
|
+
*
|
|
1346
|
+
* For elements that are created programatically, this will be false.
|
|
1347
|
+
*/
|
|
1348
|
+
isBeingCreated: boolean;
|
|
1329
1349
|
}
|
|
1330
1350
|
/**
|
|
1331
1351
|
* The parameters for the `onElementGroupChange` listener.
|
|
@@ -1464,6 +1484,40 @@ declare const SetVisibilityRequestSchema: z.ZodObject<{
|
|
|
1464
1484
|
show?: string[] | undefined;
|
|
1465
1485
|
hide?: string[] | undefined;
|
|
1466
1486
|
}>;
|
|
1487
|
+
/**
|
|
1488
|
+
* Specifies the direction to sort data in
|
|
1489
|
+
*
|
|
1490
|
+
* @group Types
|
|
1491
|
+
*/
|
|
1492
|
+
type SortDirection = z.infer<typeof SortDirectionSchema>;
|
|
1493
|
+
/** @ignore */
|
|
1494
|
+
declare const SortDirectionSchema: z.ZodEnum<["asc", "desc"]>;
|
|
1495
|
+
/**
|
|
1496
|
+
* Configuration for sorting data by a specific attribute
|
|
1497
|
+
*
|
|
1498
|
+
* @group Types
|
|
1499
|
+
*/
|
|
1500
|
+
interface SortConfig extends zInfer<typeof SortConfigSchema> {
|
|
1501
|
+
}
|
|
1502
|
+
/** @ignore */
|
|
1503
|
+
declare const SortConfigSchema: z.ZodObject<{
|
|
1504
|
+
/**
|
|
1505
|
+
* The attribute to sort by. What this represents depends on the context.
|
|
1506
|
+
* For instance, when sorting features in a data table, the attribute is
|
|
1507
|
+
* the column to sort by.
|
|
1508
|
+
*/
|
|
1509
|
+
attribute: z.ZodString;
|
|
1510
|
+
/**
|
|
1511
|
+
* The direction to sort in
|
|
1512
|
+
*/
|
|
1513
|
+
direction: z.ZodEnum<["asc", "desc"]>;
|
|
1514
|
+
}, "strip", z.ZodTypeAny, {
|
|
1515
|
+
attribute: string;
|
|
1516
|
+
direction: "asc" | "desc";
|
|
1517
|
+
}, {
|
|
1518
|
+
attribute: string;
|
|
1519
|
+
direction: "asc" | "desc";
|
|
1520
|
+
}>;
|
|
1467
1521
|
|
|
1468
1522
|
/**
|
|
1469
1523
|
* A feature is a single geographical item in a layer.
|
|
@@ -1888,6 +1942,31 @@ declare const FilterLogicGateSchema: z.ZodEnum<["and", "or"]>;
|
|
|
1888
1942
|
type FilterExpression = z.infer<typeof FilterExpressionSchema>;
|
|
1889
1943
|
declare const FilterExpressionSchema: z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["in", "ni"]>, z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>, "many">, z.ZodNull]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>], null>]>;
|
|
1890
1944
|
/**
|
|
1945
|
+
* A `FilterTernary` is a tree structure for combining expressions with logical operators.
|
|
1946
|
+
*
|
|
1947
|
+
* When combining three or more conditions, you must use proper nesting rather than a flat list.
|
|
1948
|
+
*
|
|
1949
|
+
* @example
|
|
1950
|
+
* ```typescript
|
|
1951
|
+
* // A simple filter with a single condition
|
|
1952
|
+
* const filter = [
|
|
1953
|
+
* ["AREA", "gt", 30_000],
|
|
1954
|
+
* "and",
|
|
1955
|
+
* ["COLOR", "eq", "red"]
|
|
1956
|
+
* ]
|
|
1957
|
+
*
|
|
1958
|
+
* // A complex filter with multiple conditions
|
|
1959
|
+
* const filter = [
|
|
1960
|
+
* ["AREA", "gt", 30_000],
|
|
1961
|
+
* "and",
|
|
1962
|
+
* [
|
|
1963
|
+
* ["COLOR", "eq", "red"],
|
|
1964
|
+
* "or",
|
|
1965
|
+
* ["TYPE", "eq", "residential"]
|
|
1966
|
+
* ]
|
|
1967
|
+
* ]
|
|
1968
|
+
* ```
|
|
1969
|
+
*
|
|
1891
1970
|
* @group Filters
|
|
1892
1971
|
*/
|
|
1893
1972
|
type FilterTernary = [
|
|
@@ -1900,6 +1979,12 @@ type FilterTernary = [
|
|
|
1900
1979
|
* Filters can be used to change which features in a layer are rendered. Filters can be
|
|
1901
1980
|
* applied to a layer by the `setLayerFilters` method on the Felt controller.
|
|
1902
1981
|
*
|
|
1982
|
+
* Filters use a tree structure for combining expressions with logical operators, called a
|
|
1983
|
+
* {@link FilterTernary}. When combining three or more conditions, you must use proper nesting
|
|
1984
|
+
* rather than a flat list.
|
|
1985
|
+
*
|
|
1986
|
+
* See the examples below for the correct structure to use when building complex filters.
|
|
1987
|
+
*
|
|
1903
1988
|
* @remarks
|
|
1904
1989
|
* The possible operators are:
|
|
1905
1990
|
* - `lt`: Less than
|
|
@@ -1917,17 +2002,82 @@ type FilterTernary = [
|
|
|
1917
2002
|
*
|
|
1918
2003
|
* @example
|
|
1919
2004
|
* ```typescript
|
|
1920
|
-
* //
|
|
2005
|
+
* // 1. Simple filter: single condition
|
|
1921
2006
|
* felt.setLayerFilters({
|
|
1922
2007
|
* layerId: "layer-1",
|
|
1923
2008
|
* filters: ["AREA", "gt", 30_000],
|
|
1924
2009
|
* });
|
|
1925
2010
|
*
|
|
1926
|
-
* //
|
|
2011
|
+
* // 2. Basic compound filter: two conditions with AND
|
|
1927
2012
|
* felt.setLayerFilters({
|
|
1928
2013
|
* layerId: "layer-1",
|
|
1929
|
-
* filters: [
|
|
1930
|
-
*
|
|
2014
|
+
* filters: [
|
|
2015
|
+
* ["AREA", "gt", 30_000], // First condition
|
|
2016
|
+
* "and", // Logic operator
|
|
2017
|
+
* ["COLOR", "eq", "red"] // Second condition
|
|
2018
|
+
* ]
|
|
2019
|
+
* });
|
|
2020
|
+
*
|
|
2021
|
+
* // 3. Complex filter: three or more conditions require nesting
|
|
2022
|
+
* // ⚠️ IMPORTANT: Filters use a tree structure, not a flat list
|
|
2023
|
+
* felt.setLayerFilters({
|
|
2024
|
+
* layerId: "layer-1",
|
|
2025
|
+
* filters: [
|
|
2026
|
+
* ["AREA", "gt", 30_000], // First condition
|
|
2027
|
+
* "and", // First logic operator
|
|
2028
|
+
* [ // Nested group starts
|
|
2029
|
+
* ["COLOR", "eq", "red"], // Second condition
|
|
2030
|
+
* "and", // Second logic operator
|
|
2031
|
+
* ["TYPE", "eq", "residential"] // Third condition
|
|
2032
|
+
* ] // Nested group ends
|
|
2033
|
+
* ]
|
|
2034
|
+
* });
|
|
2035
|
+
*
|
|
2036
|
+
* // 4. Even more complex: four conditions with proper nesting
|
|
2037
|
+
* // Visual structure:
|
|
2038
|
+
* // AND
|
|
2039
|
+
* // / \
|
|
2040
|
+
* // condition AND
|
|
2041
|
+
* // / \
|
|
2042
|
+
* // condition AND
|
|
2043
|
+
* // / \
|
|
2044
|
+
* // condition condition
|
|
2045
|
+
* felt.setLayerFilters({
|
|
2046
|
+
* layerId: "layer-1",
|
|
2047
|
+
* filters: [
|
|
2048
|
+
* ["AREA", "gt", 30_000], // First condition
|
|
2049
|
+
* "and",
|
|
2050
|
+
* [
|
|
2051
|
+
* ["COLOR", "eq", "red"], // Second condition
|
|
2052
|
+
* "and",
|
|
2053
|
+
* [
|
|
2054
|
+
* ["TYPE", "eq", "residential"], // Third condition
|
|
2055
|
+
* "and",
|
|
2056
|
+
* ["YEAR", "gt", 2000] // Fourth condition
|
|
2057
|
+
* ]
|
|
2058
|
+
* ]
|
|
2059
|
+
* ]
|
|
2060
|
+
* });
|
|
2061
|
+
*
|
|
2062
|
+
* // 5. Mixed operators: combining AND and OR
|
|
2063
|
+
* // Visual structure:
|
|
2064
|
+
* // AND
|
|
2065
|
+
* // / \
|
|
2066
|
+
* // condition OR
|
|
2067
|
+
* // / \
|
|
2068
|
+
* // condition condition
|
|
2069
|
+
* felt.setLayerFilters({
|
|
2070
|
+
* layerId: "layer-1",
|
|
2071
|
+
* filters: [
|
|
2072
|
+
* ["AREA", "gt", 30_000], // Must have large area
|
|
2073
|
+
* "and",
|
|
2074
|
+
* [
|
|
2075
|
+
* ["COLOR", "eq", "red"], // Must be either red
|
|
2076
|
+
* "or",
|
|
2077
|
+
* ["TYPE", "eq", "residential"] // OR residential type
|
|
2078
|
+
* ]
|
|
2079
|
+
* ]
|
|
2080
|
+
* });
|
|
1931
2081
|
* ```
|
|
1932
2082
|
*
|
|
1933
2083
|
* @group Filters
|
|
@@ -2179,8 +2329,8 @@ declare const GetLayerCategoriesParamsSchema: z.ZodObject<{
|
|
|
2179
2329
|
} | undefined;
|
|
2180
2330
|
}>>;
|
|
2181
2331
|
}, "strip", z.ZodTypeAny, {
|
|
2182
|
-
layerId: string;
|
|
2183
2332
|
attribute: string;
|
|
2333
|
+
layerId: string;
|
|
2184
2334
|
values?: {
|
|
2185
2335
|
boundary?: [number, number][] | {
|
|
2186
2336
|
type: "Polygon";
|
|
@@ -2199,8 +2349,8 @@ declare const GetLayerCategoriesParamsSchema: z.ZodObject<{
|
|
|
2199
2349
|
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
2200
2350
|
limit?: number | undefined;
|
|
2201
2351
|
}, {
|
|
2202
|
-
layerId: string;
|
|
2203
2352
|
attribute: string;
|
|
2353
|
+
layerId: string;
|
|
2204
2354
|
values?: {
|
|
2205
2355
|
boundary?: [number, number][] | {
|
|
2206
2356
|
type: "Polygon";
|
|
@@ -2370,8 +2520,8 @@ declare const GetLayerHistogramParamsSchema: z.ZodObject<{
|
|
|
2370
2520
|
} | undefined;
|
|
2371
2521
|
}>>;
|
|
2372
2522
|
}, "strip", z.ZodTypeAny, {
|
|
2373
|
-
layerId: string;
|
|
2374
2523
|
attribute: string;
|
|
2524
|
+
layerId: string;
|
|
2375
2525
|
steps: number[] | {
|
|
2376
2526
|
type: "equal-intervals";
|
|
2377
2527
|
count: number;
|
|
@@ -2396,8 +2546,8 @@ declare const GetLayerHistogramParamsSchema: z.ZodObject<{
|
|
|
2396
2546
|
} | [number, number, number, number] | undefined;
|
|
2397
2547
|
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
2398
2548
|
}, {
|
|
2399
|
-
layerId: string;
|
|
2400
2549
|
attribute: string;
|
|
2550
|
+
layerId: string;
|
|
2401
2551
|
steps: number[] | {
|
|
2402
2552
|
type: "equal-intervals";
|
|
2403
2553
|
count: number;
|
|
@@ -2705,17 +2855,30 @@ declare const PinToolSettingsSchema: z.ZodObject<{
|
|
|
2705
2855
|
symbol: z.ZodString;
|
|
2706
2856
|
color: z.ZodString;
|
|
2707
2857
|
frame: z.ZodNullable<z.ZodEnum<["frame-circle", "frame-square"]>>;
|
|
2858
|
+
afterCreation: z.ZodEnum<["enter name", "add another", "select"]>;
|
|
2708
2859
|
}, "strip", z.ZodTypeAny, {
|
|
2709
2860
|
symbol: string;
|
|
2710
2861
|
color: string;
|
|
2711
2862
|
frame: "frame-circle" | "frame-square" | null;
|
|
2863
|
+
afterCreation: "enter name" | "add another" | "select";
|
|
2712
2864
|
}, {
|
|
2713
2865
|
symbol: string;
|
|
2714
2866
|
color: string;
|
|
2715
2867
|
frame: "frame-circle" | "frame-square" | null;
|
|
2868
|
+
afterCreation: "enter name" | "add another" | "select";
|
|
2716
2869
|
}>;
|
|
2717
2870
|
interface PinToolSettings extends zInfer<typeof PinToolSettingsSchema> {
|
|
2718
2871
|
symbol: PlaceSymbol;
|
|
2872
|
+
/**
|
|
2873
|
+
* What to do after creating the Place element.
|
|
2874
|
+
*
|
|
2875
|
+
* - `"enter name"`: Enter a name for the Place, focusing the name input.
|
|
2876
|
+
* - `"add another"`: Add another Place, leaving the tool still selected.
|
|
2877
|
+
* - `"none"`: Puts the tool down and selects the new Place element.
|
|
2878
|
+
*
|
|
2879
|
+
* @defaultValue `"enter name"`
|
|
2880
|
+
*/
|
|
2881
|
+
afterCreation: "enter name" | "add another" | "select";
|
|
2719
2882
|
}
|
|
2720
2883
|
declare const LineToolSettingsSchema: z.ZodObject<{
|
|
2721
2884
|
color: z.ZodString;
|
|
@@ -3044,4 +3207,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
|
|
|
3044
3207
|
bounds: [number, number, number, number];
|
|
3045
3208
|
}>;
|
|
3046
3209
|
|
|
3047
|
-
export type {
|
|
3210
|
+
export type { ImageElementRead as $, AggregationMethod as A, FeatureSelection as B, ConfigurableToolType as C, ToolSettingsMap as D, Element as E, Filters as F, Geometry as G, ToolSettingsChangeEvent as H, InputToolSettings as I, zInfer as J, SortConfig as K, Layer as L, MapInteractionEvent as M, SetViewportCenterZoomParams as N, ViewportConstraints as O, ViewportFitBoundsParams as P, ViewportCenterZoom as Q, CircleElementCreate as R, SetVisibilityRequest as S, ToolType as T, CircleElementRead as U, ViewportState as V, CircleElementUpdate as W, HighlighterElementCreate as X, HighlighterElementRead as Y, HighlighterElementUpdate as Z, ImageElementCreate as _, GetElementsConstraint as a, ImageElementUpdate as a0, LinkElementRead as a1, MarkerElementCreate as a2, MarkerElementRead as a3, MarkerElementUpdate as a4, NoteElementCreate as a5, NoteElementRead as a6, NoteElementUpdate as a7, PathElementCreate as a8, PathElementRead as a9, LineStringGeometry as aA, LngLatTuple as aB, MultiLineStringGeometry as aC, MultiPolygonGeometry as aD, PointGeometry as aE, PolygonGeometry as aF, SortDirection as aG, CircleToolSettings as aH, HighlighterToolSettings as aI, LineToolSettings as aJ, MarkerToolSettings as aK, NoteToolSettings as aL, PinToolSettings as aM, PlaceFrame as aN, PlaceSymbol as aO, PolygonToolSettings as aP, RouteToolSettings as aQ, TextToolSettings as aR, UnionToIntersection as aS, PromiseOrNot as aT, PathElementUpdate as aa, PlaceElementCreate as ab, PlaceElementRead as ac, PlaceElementUpdate as ad, PolygonElementCreate as ae, PolygonElementRead as af, PolygonElementUpdate as ag, TextElementCreate as ah, TextElementRead as ai, TextElementUpdate as aj, LayerProcessingStatus as ak, RasterValue as al, FilterExpression as am, FilterLogicGate as an, FilterTernary as ao, AggregationConfig as ap, MultiAggregationConfig as aq, ValueConfiguration as ar, ElementGroupNode as as, ElementNode as at, FeatureNode as au, LayerGroupNode as av, LayerNode as aw, FeltBoundary as ax, FeltZoom as ay, LatLng as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, GetLayerCategoriesParams as t, GetLayerCategoriesGroup as u, GetLayerHistogramParams as v, GetLayerHistogramBin as w, GetLayerCalculationParams as x, MapDetails as y, EntityNode as z };
|