@geolibre/core 3.2.0 → 3.4.0

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/index.d.mts CHANGED
@@ -1,2646 +1,6 @@
1
+ import { $ as collectTransitiveJoinSourceIds, $n as LegendCustomEntry, $r as SQL_QUERY_SOURCE_KIND, $t as CollaborationParticipant, A as normalizeMapViewState, Ai as scrubPrintLayoutForRemovedLayers, An as IndicatorAggregation, Ar as PopupFieldConfig, At as getActiveBodyRadiusRatio, B as normalizeWidgets, Bi as CesiumBasemapImagery, Bn as LayerGroup, Br as ProjectBookmark, Bt as AppCapabilities, C as isSessionOnlyLayer, Ci as PrintLayoutLegendEntry, Cn as EditorTrackingConfig, Cr as NonGeographicCoordinates, Ct as PLANET_SWITCHER_OPTIONS, D as normalizeDashboardColumns, Di as normalizePrintLayoutConfig, Dn as GeoLibreProject, Dr as ParticipantIdentity, Dt as bodyLengthToEarth, E as normalizeBookmarks, Ei as isDefaultPrintLayout, En as GeoLibreLayer, Er as PROTOMAPS_BASEMAPS, Et as PlanetaryBasemapSectionId, F as normalizeProcessingHistory, Fi as MultiPolygon, Fn as LabelStyle, Fr as ProcessingModelStep, Ft as getPlanetaryBasemapById, G as serializeProject, Gn as LayerMetadataLink, Gr as ProjectPluginState, Gt as AttributeFormValueMapEntry, H as portableWmsTileUrl, Hi as basemapToCesiumImagery, Hn as LayerJoinStats, Hr as ProjectComment, Ht as AppRole, I as normalizeProjectComments, Ii as Point, In as LabelTransform, Ir as ProcessingRerunRequest, It as getPlanetaryBasemapByStyleUrl, J as storyMapHasContent, Jn as LayerQuickFilter, Jr as QuickFilterDateKind, Jt as BLEND_MODES, K as serializeProjectWithLayerCache, Kn as LayerMetadataTemporalExtent, Kr as ProjectPreferences, Kt as AttributeFormWidget, L as normalizeProjectInteraction, Li as Polygon, Ln as LayerCapabilities, Lr as ProcessingRun, Lt as meanRadiusMeters, M as normalizeModels, Mi as FeatureCollection, Mn as LAYER_TYPES, Mr as PopupFieldKind, Mt as getActiveMeanRadiusMeters, N as normalizeObiaWorkbench, Ni as Geometry, Nn as LabelAnchor, Nr as ProcessingModel, Nt as getActiveSemiMajorAxisMeters, O as normalizeLegendConfig, Oi as printLayoutConfigsEqual, On as GeocodingPreferences, Or as PointRenderer, Ot as earthAreaToBody, P as normalizePrimaryRenderer, Pi as LineString, Pn as LabelDedupe, Pr as ProcessingModelGraph, Pt as getEllipsoid, Q as cascadeLayerJoinRefresh, Qn as LegendConfig, Qr as RuntimeEnvironmentVariable, Qt as CollaborationMode, R as normalizeSecondaryMapViews, Ri as CESIUM_BASEMAPS, Rn as LayerConnection, Rr as ProcessingRunKind, Rt as setActiveEllipsoidId, S as isAllowedPluginManifestUrl, Si as PrintLayoutCorner, Sn as DiagramType, Sr as NETCDF_IMAGE_SOURCE_KIND, St as PLANETARY_BASEMAP_SENTINEL_PREFIX, T as normalizeBookmarkGroups, Ti as createDefaultPrintLayout, Tn as FillPattern, Tr as PROJECT_VERSION, Tt as PlanetaryBasemapGroup, U as projectFromStore, Ui as normalizeCesiumBasemap, Un as LayerLibraryEntry, Ur as ProjectInteraction, Ut as AttributeFormConfig, V as parseProject, Vi as availableCesiumBasemap, Vn as LayerJoin, Vr as ProjectBookmarkGroup, Vt as AppPrivilege, W as resolveMapGrid, Wi as sameCesiumImagery, Wn as LayerMetadataContact, Wr as ProjectPluginControlPosition, Wt as AttributeFormFieldConfig, X as applyJoinsToLayer, Xn as LayerType, Xr as QuickFilterTextOperator, Xt as CollabInvite, Y as ApplyLayerJoinsResult, Yn as LayerStyle, Yr as QuickFilterKind, Yt as BlendMode, Z as applyLayerJoins, Zn as LayerVirtualField, Zr as RecentProjectEntry, Zt as CollaborationChatMessage, _ as createEmptyProject, _i as isDuckDBQueryLayer, _n as DashboardWidget, _r as ModelGraphNode, _t as ELLIPSOIDS, a as ProjectDiffOptions, ai as StoryChapterLocation, an as CommentReply, ar as MAX_DASHBOARD_COLUMNS, at as batchDecodePolylines, b as detachProjectCopy, bi as DEFAULT_PRINT_LAYOUT, bn as DiagramField, br as ModelPortKind, bt as PLANETARY_BASEMAPS, c as diffProjects, ci as StoryMap, cn as DEFAULT_DASHBOARD_COLUMNS, cr as MIN_DASHBOARD_COLUMNS, ct as encodePolyline, d as CreateProjectOptions, di as StyleLibraryEntry, dn as DEFAULT_MAP_GRID_LAYOUT, dr as MapProjection, dt as unescapePolyline, ei as SecondaryMapView, en as CollaborationPresence, er as LegendCustomItem, et as layerJoinKey, f as DEFAULT_PROJECT_NAME, fi as StyleLibraryEntryKind, fn as DEFAULT_PRIMARY_RENDERER, fr as MapRendererKind, ft as geojsonHasZCoordinates, g as createDefaultMapView, gi as detectNonGeographicCoordinates, gn as DUCKDB_VECTOR_ROUTE_BYTES, gr as ModelGraphEdge, gt as EARTH_MEAN_RADIUS_METERS, h as applyProjectToStore, hi as VectorStyleStop, hn as DUCKDB_VECTOR_FEATURE_WARN_COUNT, hr as MarkerShape, ht as DEFAULT_ELLIPSOID_ID, i as ProjectDiff, ii as StoryChapterAnimation, in as CommentAuthor, ir as LineDecoration, it as PolylineDecodeResult, j as normalizeModelGraph, ji as Feature, jn as LARGE_VECTOR_FEATURE_THRESHOLD, jr as PopupFieldFormat, jt as getActiveEllipsoid, k as normalizeMapLayout, ki as scrubPrintLayoutForLayers, kn as GeometryGeneratorType, kr as PopupDateFormat, kt as earthLengthToBody, l as jsonValuesEqual, li as StorySlideMode, ln as DEFAULT_LAYER_STYLE, lr as MapGridLayout, lt as geoJSONToPolylineStr, m as ProjectLayerSerializationCache, mi as VectorStyleMode, mn as DEFAULT_STORY_MAP, mr as MapViewState, mt as transformGeojsonElevation, n as LayerDiff, ni as StoryChapter, nn as CollaborationState, nr as LegendItemOverride, nt as stripJoinFields, o as ProjectValueChange, oi as StoryInsetPosition, on as DEFAULT_BASEMAP, or as MAX_MAP_GRID_DIM, ot as decodePolyline, p as MAX_PROJECT_BOOKMARKS, pi as VectorRule, pn as DEFAULT_PROJECT_PREFERENCES, pr as MapScaleUnit, pt as horizontalBbox, q as serializeProjectWithLayerCacheAsync, qn as LayerPopupConfig, qr as ProjectTemplateEntry, qt as BLANK_BASEMAP, r as PluginDiff, ri as StoryChapterAlignment, rn as CommentAnchor, rr as LegendPanelPosition, rt as PolylineBatchOptions, s as diffFeatureCollections, si as StoryLayerOpacityChange, sn as DEFAULT_BLEND_MODE, sr as MAX_PROCESSING_HISTORY, st as decodePolylineDetailed, t as FeatureChangeSummary, ti as StoryActiveSlideMode, tn as CollaborationRole, tr as LegendCustomShape, tt as reapplyLayerJoins, u as previewValue, ui as StrokeWidthUnit, un as DEFAULT_LEGEND_CONFIG, ur as MapPreferences, ut as polylineStrToGeoJSON, v as createProjectLayerSerializationCache, vi as shouldUseTiledRendering, vn as DashboardWidgetAggregation, vr as ModelGraphNodeKind, vt as Ellipsoid, w as normalizeBlankBackgroundColor, wi as PrintLayoutPageFilter, wn as FieldVisibility, wr as OPENFREEMAP_BASEMAPS, wt as PlanetaryBasemap, x as hydrateProjectLayer, xi as PrintLayoutConfig, xn as DiagramSizeMode, xr as ModelToolProvider, xt as PLANETARY_BASEMAP_GROUPS, y as createProjectTemplate, yi as styleValue, yn as DashboardWidgetType, yr as ModelGraphPort, yt as EllipsoidId, z as normalizeStoryMap, zi as CesiumBasemapId, zn as LayerDescriptiveMetadata, zr as ProcessingRunStatus, zt as AddTileLayerOptions } from "./project-diff-BD23T4xv.mjs";
1
2
  import "zustand";
2
3
  import "zundo";
3
- //#region src/cesium-imagery.d.ts
4
- /**
5
- * Maps the project's basemap onto imagery the Cesium globe can render.
6
- *
7
- * The 2D panes render `basemapStyleUrl` through MapLibre, which understands
8
- * vector GL styles and GeoLibre's `geolibre://` sentinels. Cesium understands
9
- * neither: it draws imagery from tile providers only. So a globe pane that
10
- * simply mounted the store basemap would show nothing, which is why the pane
11
- * used to hardcode Ion World Imagery (with a token) or OpenStreetMap (without)
12
- * and ignore the user's choice entirely — leaving a bright globe beside dark 2D
13
- * panes and breaking the "same map, different projection" promise the multi-map
14
- * grid makes.
15
- *
16
- * This module is the translation. It is deliberately **engine-free** — it
17
- * returns a plain descriptor and never imports Cesium — so it lives in
18
- * `@geolibre/core` beside the basemap catalogs it reads, the 2D and 3D
19
- * renderers share one source of truth, and the Cesium chunk boundary in
20
- * `vite.config.ts` stays intact.
21
- *
22
- * Three outcomes are possible, and the caller has to handle all three (see
23
- * {@link CesiumBasemapImagery}): tiles to draw, nothing to draw, or "no raster
24
- * equivalent exists — pick your own default".
25
- */
26
- /** Stable project IDs and the corresponding Cesium bundled thumbnails / ion assets. */
27
- export declare const CESIUM_BASEMAPS: readonly [{
28
- readonly id: "project";
29
- readonly name: "Project basemap";
30
- readonly icon: "naturalEarthII.png";
31
- }, {
32
- readonly id: "natural-earth";
33
- readonly name: "Natural Earth II";
34
- readonly icon: "naturalEarthII.png";
35
- }, {
36
- readonly id: "bing-aerial";
37
- readonly name: "Bing Maps Aerial";
38
- readonly icon: "bingAerial.png";
39
- readonly assetId: 2;
40
- }, {
41
- readonly id: "bing-labels";
42
- readonly name: "Bing Maps Aerial with Labels";
43
- readonly icon: "bingAerialLabels.png";
44
- readonly assetId: 3;
45
- }, {
46
- readonly id: "bing-roads";
47
- readonly name: "Bing Maps Roads";
48
- readonly icon: "bingRoads.png";
49
- readonly assetId: 4;
50
- }, {
51
- readonly id: "sentinel-2";
52
- readonly name: "Sentinel-2";
53
- readonly icon: "sentinel-2.png";
54
- readonly assetId: 3954;
55
- }, {
56
- readonly id: "blue-marble";
57
- readonly name: "Blue Marble";
58
- readonly icon: "blueMarble.png";
59
- readonly assetId: 3845;
60
- }, {
61
- readonly id: "earth-at-night";
62
- readonly name: "Earth at night";
63
- readonly icon: "earthAtNight.png";
64
- readonly assetId: 3812;
65
- }, {
66
- readonly id: "google-satellite";
67
- readonly name: "Google Maps Satellite";
68
- readonly icon: "googleSatellite.png";
69
- readonly assetId: 3830182;
70
- }, {
71
- readonly id: "google-labels";
72
- readonly name: "Google Maps Satellite with Labels";
73
- readonly icon: "googleSatelliteLabels.png";
74
- readonly assetId: 3830183;
75
- }, {
76
- readonly id: "google-roads";
77
- readonly name: "Google Maps Roadmap";
78
- readonly icon: "googleRoadmap.png";
79
- readonly assetId: 3830184;
80
- }, {
81
- readonly id: "google-contour";
82
- readonly name: "Google Maps Contour";
83
- readonly icon: "googleContour.png";
84
- readonly assetId: 3830186;
85
- }, {
86
- readonly id: "azure-aerial";
87
- readonly name: "Azure Maps Aerial";
88
- readonly icon: "azureAerial.png";
89
- readonly assetId: 3891168;
90
- }, {
91
- readonly id: "azure-roads";
92
- readonly name: "Azure Maps Roads";
93
- readonly icon: "azureRoads.png";
94
- readonly assetId: 3891169;
95
- }, {
96
- readonly id: "esri-imagery";
97
- readonly name: "ArcGIS World Imagery";
98
- readonly icon: "ArcGisMapServiceWorldImagery.png";
99
- readonly category: "Other";
100
- readonly service: "World_Imagery";
101
- }, {
102
- readonly id: "esri-hillshade";
103
- readonly name: "ArcGIS World Hillshade";
104
- readonly icon: "ArcGisMapServiceWorldHillshade.png";
105
- readonly category: "Other";
106
- readonly service: "Elevation/World_Hillshade";
107
- }, {
108
- readonly id: "esri-ocean";
109
- readonly name: "Esri World Ocean";
110
- readonly icon: "ArcGisMapServiceWorldOcean.png";
111
- readonly category: "Other";
112
- readonly service: "Ocean/World_Ocean_Base";
113
- }, {
114
- readonly id: "osm";
115
- readonly name: "OpenStreetMap";
116
- readonly icon: "openStreetMap.png";
117
- readonly category: "Other";
118
- }];
119
- export type CesiumBasemapId = (typeof CESIUM_BASEMAPS)[number]["id"];
120
- export declare function normalizeCesiumBasemap(value: unknown): CesiumBasemapId;
121
- /**
122
- * Missing credentials fall back to keyless imagery without changing the saved
123
- * choice.
124
- *
125
- * The fallback is ArcGIS World Imagery rather than the project background: a
126
- * globe wants to look like the Earth, and the project's own basemap is usually
127
- * a vector street style whose raster analogue is mostly empty ocean from
128
- * orbit. It needs no key, so the globe looks the same with or without an Ion
129
- * token — only terrain and the Ion-only basemaps are lost.
130
- */
131
- export declare function availableCesiumBasemap(value: unknown, hasIonToken: boolean): CesiumBasemapId;
132
- /**
133
- * What the globe should draw underneath the project's data layers.
134
- *
135
- * - `xyz` — a tile template to render, with the credit and zoom bounds that go
136
- * with it.
137
- * - `none` — the user chose the blank basemap; draw a bare ellipsoid.
138
- * - `default` — this basemap has no raster equivalent (a custom style URL, a
139
- * provider style, an offline archive). The renderer falls back to whatever it
140
- * can offer, which is Ion World Imagery when a token is configured and
141
- * OpenStreetMap otherwise.
142
- */
143
- export type CesiumBasemapImagery = {
144
- kind: "none";
145
- } | {
146
- kind: "default";
147
- } | {
148
- kind: "ion";
149
- assetId: number;
150
- } | {
151
- kind: "natural-earth";
152
- } | {
153
- kind: "arcgis";
154
- url: string;
155
- } | {
156
- kind: "xyz";
157
- /** Tile template with `{z}`/`{x}`/`{y}` placeholders. */
158
- template: string;
159
- /** Credit to show on the globe, as the HTML the 2D map already uses. */
160
- attribution: string;
161
- /** Max native zoom of the source, so the globe overzooms rather than 404s. */
162
- maximumLevel?: number;
163
- /**
164
- * Tile row ordering. `"tms"` numbers rows from the bottom; absent means
165
- * standard XYZ. Cesium has no `scheme` option, so a TMS template needs
166
- * `{y}` swapped for its `{reverseY}` placeholder at render time.
167
- */
168
- scheme?: "tms";
169
- /**
170
- * A transparent overlay drawn directly above {@link template} — the
171
- * roads-and-labels tiles a hybrid basemap (Amap Hybrid) bakes in, so one
172
- * basemap selection still yields a labelled satellite globe.
173
- */
174
- overlayTemplate?: string;
175
- };
176
- /**
177
- * Whether two descriptors would draw the same thing.
178
- *
179
- * Descriptors are built fresh on every call, so two basemaps resolving to the
180
- * same analogue — OpenFreeMap `liberty` and `bright` are both the streets
181
- * tone — yield equal but distinct objects. A renderer that remembers the
182
- * descriptor it drew (to skip redundant work) must compare by value: a
183
- * reference check would miss that case and tear down and re-add an identical
184
- * tile provider, costing a flash and a round of re-requested tiles for no
185
- * visible change.
186
- */
187
- export declare function sameCesiumImagery(a: CesiumBasemapImagery, b: CesiumBasemapImagery): boolean;
188
- /**
189
- * Translate a basemap style URL into imagery for the Cesium globe.
190
- *
191
- * Planetary and regional basemaps are already raster tile sets, so they carry
192
- * straight over — the globe shows the same Mars/Moon/Amap tiles the 2D panes
193
- * do. GeoLibre's own vector styles map to a keyless raster basemap of matching
194
- * tone, so switching the project to a dark basemap darkens the globe too.
195
- * Everything else reports `default`, leaving the choice of fallback imagery to
196
- * the renderer (which knows whether an Ion token is configured).
197
- *
198
- * A `geolibre://` sentinel that no longer resolves is treated as the default
199
- * basemap, mirroring what `resolveMapStyle` does for the 2D map rather than
200
- * handing the sentinel onward as if it were fetchable.
201
- *
202
- * @param styleUrl - The project's `basemapStyleUrl`.
203
- * @returns What the globe should draw beneath the data layers.
204
- */
205
- export declare function basemapToCesiumImagery(styleUrl: string | undefined, cesiumBasemap?: CesiumBasemapId): CesiumBasemapImagery;
206
- //#endregion
207
- //#region ../../node_modules/@types/geojson/index.d.ts
208
- /**
209
- * The value values for the "type" property of GeoJSON Objects.
210
- * https://tools.ietf.org/html/rfc7946#section-1.4
211
- */
212
- type GeoJsonTypes = GeoJSON$1["type"];
213
- /**
214
- * Bounding box
215
- * https://tools.ietf.org/html/rfc7946#section-5
216
- */
217
- type BBox = [number, number, number, number] | [number, number, number, number, number, number];
218
- /**
219
- * A Position is an array of coordinates.
220
- * https://tools.ietf.org/html/rfc7946#section-3.1.1
221
- * Array should contain between two and three elements.
222
- * The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
223
- * but the current specification only allows X, Y, and (optionally) Z to be defined.
224
- *
225
- * Note: the type will not be narrowed down to `[number, number] | [number, number, number]` due to
226
- * marginal benefits and the large impact of breaking change.
227
- *
228
- * See previous discussions on the type narrowing:
229
- * - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590|Nov 2017}
230
- * - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773|Dec 2023}
231
- * - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441| Dec 2024}
232
- *
233
- * One can use a
234
- * {@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates|user-defined type guard that returns a type predicate}
235
- * to determine if a position is a 2D or 3D position.
236
- *
237
- * @example
238
- * import type { Position } from 'geojson';
239
- *
240
- * type StrictPosition = [x: number, y: number] | [x: number, y: number, z: number]
241
- *
242
- * function isStrictPosition(position: Position): position is StrictPosition {
243
- * return position.length === 2 || position.length === 3
244
- * };
245
- *
246
- * let position: Position = [-116.91, 45.54];
247
- *
248
- * let x: number;
249
- * let y: number;
250
- * let z: number | undefined;
251
- *
252
- * if (isStrictPosition(position)) {
253
- * // `tsc` would throw an error if we tried to destructure a fourth parameter
254
- * [x, y, z] = position;
255
- * } else {
256
- * throw new TypeError("Position is not a 2D or 3D point");
257
- * }
258
- */
259
- type Position = number[];
260
- /**
261
- * The base GeoJSON object.
262
- * https://tools.ietf.org/html/rfc7946#section-3
263
- * The GeoJSON specification also allows foreign members
264
- * (https://tools.ietf.org/html/rfc7946#section-6.1)
265
- * Developers should use "&" type in TypeScript or extend the interface
266
- * to add these foreign members.
267
- */
268
- interface GeoJsonObject {
269
- // Don't include foreign members directly into this type def.
270
- // in order to preserve type safety.
271
- // [key: string]: any;
272
- /**
273
- * Specifies the type of GeoJSON object.
274
- */
275
- type: GeoJsonTypes;
276
- /**
277
- * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
278
- * The value of the bbox member is an array of length 2*n where n is the number of dimensions
279
- * represented in the contained geometries, with all axes of the most southwesterly point
280
- * followed by all axes of the more northeasterly point.
281
- * The axes order of a bbox follows the axes order of geometries.
282
- * https://tools.ietf.org/html/rfc7946#section-5
283
- */
284
- bbox?: BBox | undefined;
285
- }
286
- /**
287
- * Union of GeoJSON objects.
288
- */
289
- type GeoJSON$1<G extends Geometry | null = Geometry, P = GeoJsonProperties> = G | Feature<G, P> | FeatureCollection<G, P>;
290
- /**
291
- * Geometry object.
292
- * https://tools.ietf.org/html/rfc7946#section-3
293
- */
294
- type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
295
- /**
296
- * Point geometry object.
297
- * https://tools.ietf.org/html/rfc7946#section-3.1.2
298
- */
299
- interface Point extends GeoJsonObject {
300
- type: "Point";
301
- coordinates: Position;
302
- }
303
- /**
304
- * MultiPoint geometry object.
305
- * https://tools.ietf.org/html/rfc7946#section-3.1.3
306
- */
307
- interface MultiPoint extends GeoJsonObject {
308
- type: "MultiPoint";
309
- coordinates: Position[];
310
- }
311
- /**
312
- * LineString geometry object.
313
- * https://tools.ietf.org/html/rfc7946#section-3.1.4
314
- */
315
- interface LineString extends GeoJsonObject {
316
- type: "LineString";
317
- coordinates: Position[];
318
- }
319
- /**
320
- * MultiLineString geometry object.
321
- * https://tools.ietf.org/html/rfc7946#section-3.1.5
322
- */
323
- interface MultiLineString extends GeoJsonObject {
324
- type: "MultiLineString";
325
- coordinates: Position[][];
326
- }
327
- /**
328
- * Polygon geometry object.
329
- * https://tools.ietf.org/html/rfc7946#section-3.1.6
330
- */
331
- interface Polygon extends GeoJsonObject {
332
- type: "Polygon";
333
- coordinates: Position[][];
334
- }
335
- /**
336
- * MultiPolygon geometry object.
337
- * https://tools.ietf.org/html/rfc7946#section-3.1.7
338
- */
339
- interface MultiPolygon extends GeoJsonObject {
340
- type: "MultiPolygon";
341
- coordinates: Position[][][];
342
- }
343
- /**
344
- * Geometry Collection
345
- * https://tools.ietf.org/html/rfc7946#section-3.1.8
346
- */
347
- interface GeometryCollection<G extends Geometry = Geometry> extends GeoJsonObject {
348
- type: "GeometryCollection";
349
- geometries: G[];
350
- }
351
- type GeoJsonProperties = {
352
- [name: string]: any;
353
- } | null;
354
- /**
355
- * A feature object which contains a geometry and associated properties.
356
- * https://tools.ietf.org/html/rfc7946#section-3.2
357
- */
358
- interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
359
- type: "Feature";
360
- /**
361
- * The feature's geometry
362
- */
363
- geometry: G;
364
- /**
365
- * A value that uniquely identifies this feature in a
366
- * https://tools.ietf.org/html/rfc7946#section-3.2.
367
- */
368
- id?: string | number | undefined;
369
- /**
370
- * Properties associated with this feature.
371
- */
372
- properties: P;
373
- }
374
- /**
375
- * A collection of feature objects.
376
- * https://tools.ietf.org/html/rfc7946#section-3.3
377
- */
378
- interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
379
- type: "FeatureCollection";
380
- features: Array<Feature<G, P>>;
381
- }
382
- //#endregion
383
- //#region src/print-layout-config.d.ts
384
- /**
385
- * Print Layout composer settings that belong to a project.
386
- *
387
- * The Print Layout dialog composes a printable page out of the current map:
388
- * a title block, page size and orientation, the cartographic furniture
389
- * (legend, scale bar, north arrow), optional data blocks, and an atlas /
390
- * map-series definition. All of that describes the *project's* map document,
391
- * so it round-trips through `.geolibre.json` (GeoLibre discussion #1992 —
392
- * before this, reopening a project lost the title, page format and
393
- * orientation, and the dialog kept showing the previous project's settings).
394
- *
395
- * Deliberately **not** in here: everything that is per-session rather than
396
- * part of the document — the captured map image, export progress, error and
397
- * clipboard notices, the current atlas page, and the dialog's own chrome
398
- * (panel widths, dialog size).
399
- *
400
- * The unions below are the storage contract. Their app-side counterparts
401
- * (`PaperSizeId`, `Orientation`, `BodyCorner`, ... in
402
- * `apps/geolibre-desktop/src/lib/`) are checked against these by ordinary
403
- * assignment in the dialog's snapshot/restore paths, so adding a paper size or
404
- * a corner on one side without the other fails the build.
405
- */
406
- /** A page corner an overlay block can be pinned to. */
407
- export type PrintLayoutCorner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
408
- /** Which features a data block covers when the atlas paginates the map. */
409
- export type PrintLayoutPageFilter = "all" | "contained" | "intersecting";
410
- /** One hand-authored swatch in the composer's user-defined legend. */
411
- export interface PrintLayoutLegendEntry {
412
- id: string;
413
- label: string;
414
- color: string;
415
- }
416
- export interface PrintLayoutConfig {
417
- title: string;
418
- subtitle: string;
419
- titlePlacement: "outside" | "inside";
420
- titleAlign: "left" | "center" | "right";
421
- paperSize: "a4" | "a3" | "letter" | "legal" | "tabloid" | "fullhd" | "hd" | "uhd4k" | "square" | "custom";
422
- orientation: "portrait" | "landscape";
423
- customWidth: number;
424
- customHeight: number;
425
- customUnit: "mm" | "px";
426
- pageMargin: "normal" | "narrow" | "none";
427
- showPageBorder: boolean;
428
- pageBorderColor: string;
429
- pageBorderWidth: number;
430
- mapBorderColor: string;
431
- mapBorderWidth: number;
432
- mapBackground: string;
433
- showTitle: boolean;
434
- showSubtitle: boolean;
435
- showLegend: boolean;
436
- showScaleBar: boolean;
437
- showNorthArrow: boolean;
438
- navigationGrouped: boolean;
439
- showFooter: boolean;
440
- footerText: string;
441
- showDate: boolean;
442
- /** Blank means "today", resolved when the page is drawn. */
443
- dateText: string;
444
- showAttribution: boolean;
445
- showColorbar: boolean;
446
- colorbarRamp: string;
447
- /** Kept as typed text so a half-entered value survives a round trip. */
448
- colorbarMin: string;
449
- colorbarMax: string;
450
- colorbarLabel: string;
451
- colorbarOrientation: "vertical" | "horizontal";
452
- colorbarLength: number;
453
- colorbarPosition: PrintLayoutCorner;
454
- showCustomLegend: boolean;
455
- customLegendTitle: string;
456
- customLegendEntries: PrintLayoutLegendEntry[];
457
- customLegendPosition: PrintLayoutCorner;
458
- showDataTable: boolean;
459
- tableLayerId: string;
460
- tableTitle: string;
461
- tableColumns: string[];
462
- tableSortField: string;
463
- tableSortDesc: boolean;
464
- tableMaxRows: number;
465
- tableFitRows: boolean;
466
- tablePosition: PrintLayoutCorner;
467
- tablePageFilter: PrintLayoutPageFilter;
468
- tableFilterToAtlasFeature: boolean;
469
- showDataChart: boolean;
470
- chartLayerId: string;
471
- chartTitle: string;
472
- chartType: "bar" | "pie" | "line";
473
- chartCategoryField: string;
474
- chartAggregation: "count" | "sum" | "mean";
475
- chartValueField: string;
476
- chartPosition: PrintLayoutCorner;
477
- chartPageFilter: PrintLayoutPageFilter;
478
- showInfoBlock: boolean;
479
- author: string;
480
- projectNumber: string;
481
- crs: string;
482
- revision: string;
483
- captureMode: "viewport" | "extent";
484
- /** Drawn print extent as `[west, south, east, north]`; null when unset. */
485
- extentBbox: [number, number, number, number] | null;
486
- atlasEnabled: boolean;
487
- atlasLayerId: string;
488
- atlasCoverage: "features" | "line";
489
- atlasSegmentKm: string;
490
- atlasNameField: string;
491
- atlasExtentMode: "margin" | "scale";
492
- atlasMarginPct: number;
493
- atlasMaskEnabled: boolean;
494
- atlasScale: string;
495
- atlasSortField: string;
496
- atlasSortDescending: boolean;
497
- atlasFilter: string;
498
- atlasFilenamePattern: string;
499
- }
500
- /**
501
- * Settings a project starts with, and the shape every partial or hand-edited
502
- * `printLayout` is filled out against. Also the dialog's initial state, so
503
- * "new project" and "a project saved before this feature" compose identically.
504
- */
505
- export declare const DEFAULT_PRINT_LAYOUT: PrintLayoutConfig;
506
- /** A fresh copy of the defaults, safe to hand to a store or a component. */
507
- export declare function createDefaultPrintLayout(): PrintLayoutConfig;
508
- /**
509
- * Coerce an untrusted (possibly hand-edited, possibly partial) `printLayout`
510
- * into a complete {@link PrintLayoutConfig}, filling every missing or
511
- * malformed field from {@link DEFAULT_PRINT_LAYOUT}.
512
- *
513
- * @param value - The raw `printLayout` value read from a project file.
514
- * @returns The normalized config, or null when the project carries none, so
515
- * callers can tell "absent" from "explicitly default".
516
- */
517
- export declare function normalizePrintLayoutConfig(value: unknown): PrintLayoutConfig | null;
518
- /**
519
- * Whether a config is still the untouched default, so a project that never
520
- * opened the composer serializes without a `printLayout` key and stays
521
- * byte-identical to one saved before this feature.
522
- */
523
- export declare function isDefaultPrintLayout(config: PrintLayoutConfig): boolean;
524
- /**
525
- * Structural equality for two configs. Used to skip no-op store writes, so
526
- * merely opening the Print Layout dialog never marks a project dirty.
527
- */
528
- export declare function printLayoutConfigsEqual(a: PrintLayoutConfig, b: PrintLayoutConfig): boolean;
529
- /**
530
- * Drop references to layers the project no longer carries, so a composer that
531
- * pointed at a since-deleted layer opens with the block cleared instead of
532
- * rendering nothing from a dangling id. Mirrors the widget/comment/legend
533
- * scrubbing in `applyProjectToStore`.
534
- *
535
- * @param config - The config to scrub.
536
- * @param existingLayerIds - Ids of the layers present in the project.
537
- * @returns The same object when nothing referenced a missing layer.
538
- */
539
- export declare function scrubPrintLayoutForLayers(config: PrintLayoutConfig, existingLayerIds: ReadonlySet<string>): PrintLayoutConfig;
540
- /**
541
- * The delete-time counterpart, matching `scrubLegendForRemovedLayers` and its
542
- * siblings: called when layers are removed from the open project so the saved
543
- * file never carries a block pointing at a layer that is already gone.
544
- *
545
- * @param config - The config to scrub.
546
- * @param layerIds - The removed layer id, or ids.
547
- * @returns The same object when no block referenced a removed layer.
548
- */
549
- export declare function scrubPrintLayoutForRemovedLayers(config: PrintLayoutConfig, layerIds: string | Iterable<string>): PrintLayoutConfig;
550
- //#endregion
551
- //#region src/types.d.ts
552
- export declare const OPENFREEMAP_BASEMAPS: readonly [{
553
- readonly id: "liberty";
554
- readonly name: "Liberty";
555
- readonly styleUrl: "https://tiles.openfreemap.org/styles/liberty";
556
- }, {
557
- readonly id: "liberty-3d";
558
- readonly name: "Liberty 3D";
559
- readonly styleUrl: "https://tiles.openfreemap.org/styles/liberty";
560
- }, {
561
- readonly id: "positron";
562
- readonly name: "Positron";
563
- readonly styleUrl: "https://tiles.openfreemap.org/styles/positron";
564
- }, {
565
- readonly id: "bright";
566
- readonly name: "Bright";
567
- readonly styleUrl: "https://tiles.openfreemap.org/styles/bright";
568
- }, {
569
- readonly id: "dark";
570
- readonly name: "Dark";
571
- readonly styleUrl: "https://tiles.openfreemap.org/styles/dark";
572
- }, {
573
- readonly id: "fiord";
574
- readonly name: "Fiord";
575
- readonly styleUrl: "https://tiles.openfreemap.org/styles/fiord";
576
- }];
577
- /**
578
- * Protomaps v5 basemap flavors. These are resolved to full style URLs at use
579
- * time by `getProtomapsStyleUrl`, which injects the `VITE_PROTOMAPS_API_KEY`
580
- * runtime env var. The key is only present in builds configured with it (e.g.
581
- * the GitHub Pages web demo), so consumers should hide these options when no
582
- * key is available.
583
- */
584
- export declare const PROTOMAPS_BASEMAPS: readonly [{
585
- readonly id: "protomaps-light";
586
- readonly name: "Light";
587
- readonly flavor: "light";
588
- }, {
589
- readonly id: "protomaps-dark";
590
- readonly name: "Dark";
591
- readonly flavor: "dark";
592
- }, {
593
- readonly id: "protomaps-white";
594
- readonly name: "White";
595
- readonly flavor: "white";
596
- }, {
597
- readonly id: "protomaps-grayscale";
598
- readonly name: "Grayscale";
599
- readonly flavor: "grayscale";
600
- }, {
601
- readonly id: "protomaps-black";
602
- readonly name: "Black";
603
- readonly flavor: "black";
604
- }];
605
- export declare const DEFAULT_BASEMAP = "https://tiles.openfreemap.org/styles/liberty";
606
- export declare const BLANK_BASEMAP = "";
607
- export declare const PROJECT_VERSION = "0.2.0";
608
- /**
609
- * Every layer type, as a runtime list so untrusted input (an imported Layer
610
- * Library bundle, a hand-edited project) can be validated against it.
611
- * {@link LayerType} is derived from this array, so the two cannot drift.
612
- */
613
- export declare const LAYER_TYPES: readonly ["geojson", "raster", "wms", "wmts", "xyz", "vector-tiles", "arcgis", "pmtiles", "mbtiles", "zarr", "lidar", "gaussian-splat", "3d-tiles", "cog", "flatgeobuf", "geoparquet", "duckdb-query", "deckgl-viz", "video", "image"];
614
- export type LayerType = (typeof LAYER_TYPES)[number];
615
- export type VectorStyleMode = "single" | "graduated" | "categorized" | "rule-based" | "expression";
616
- /**
617
- * One entry in a {@link LayerStyle.vectorRules} rule-based renderer. Each rule
618
- * pairs a MapLibre filter expression (a boolean expression array, serialized as
619
- * JSON) with a symbol color. Rules are evaluated top to bottom; the first whose
620
- * filter matches wins. The catch-all rule (`isElse`) has no filter and supplies
621
- * the color for features no other rule matched. Mirrors the QGIS/ArcGIS
622
- * rule-based renderer.
623
- */
624
- export interface VectorRule {
625
- id: string;
626
- /** Human-readable label shown in the editor and the legend. */
627
- label: string;
628
- /**
629
- * A MapLibre boolean filter expression serialized as JSON, e.g.
630
- * `["==", ["get", "TYPE"], "park"]`. Ignored when {@link isElse} is set or
631
- * the JSON is invalid.
632
- */
633
- filter: string;
634
- /** The symbol fill/circle color for features this rule matches (6-digit hex). */
635
- color: string;
636
- /**
637
- * When true this is the catch-all "else" rule: {@link filter} is unused and
638
- * the rule is an unconditional fallback for features no other rule matched,
639
- * so the {@link minZoom}/{@link maxZoom} and {@link parentId} fields are
640
- * ignored on it. Its symbol overrides and {@link enabled} toggle do apply.
641
- */
642
- isElse: boolean;
643
- /**
644
- * Whether the rule participates in rendering. `false` temporarily disables
645
- * the rule (and, for a group, its whole subtree) without deleting it,
646
- * mirroring the QGIS rule checkbox. Absent means enabled.
647
- */
648
- enabled?: boolean;
649
- /**
650
- * Lowest zoom (inclusive) the rule applies at, mirroring MapLibre's layer
651
- * `minzoom` convention. Absent means no lower bound.
652
- */
653
- minZoom?: number;
654
- /**
655
- * Zoom the rule stops applying at (exclusive, like MapLibre's layer
656
- * `maxzoom`). Absent means no upper bound. Together with {@link minZoom}
657
- * this is the QGIS per-rule "scale range".
658
- */
659
- maxZoom?: number;
660
- /**
661
- * The id of the parent rule when this rule is nested inside a group (QGIS
662
- * rule tree). A child rule matches only features that also match every
663
- * ancestor's filter, and inherits the intersection of the ancestors' zoom
664
- * ranges and enabled state. A rule that has children acts as a group: its
665
- * own symbol is not rendered; only leaf rules draw. Absent or dangling
666
- * means a top-level rule.
667
- */
668
- parentId?: string;
669
- /**
670
- * Per-rule stroke/outline color override (6-digit hex): the polygon outline
671
- * and circle stroke color for matching features. Absent inherits the layer
672
- * {@link LayerStyle.strokeColor}.
673
- */
674
- strokeColor?: string;
675
- /**
676
- * Per-rule stroke width override in pixels: the line width (lines and
677
- * polygon outlines) and circle stroke width for matching features. Absent
678
- * inherits the layer {@link LayerStyle.strokeWidth}.
679
- */
680
- strokeWidth?: number;
681
- /**
682
- * Per-rule fill/circle opacity override (0..1) for matching features.
683
- * Absent inherits the layer {@link LayerStyle.fillOpacity}.
684
- */
685
- fillOpacity?: number;
686
- /**
687
- * Per-rule circle radius override in pixels for matching point features.
688
- * Absent inherits the layer {@link LayerStyle.circleRadius}.
689
- */
690
- circleRadius?: number;
691
- }
692
- /**
693
- * The fill pattern applied to polygon layers. `"none"` keeps a flat fill; the
694
- * named patterns are generated as recolorable sprite tiles; `"svg"` rasterizes
695
- * the user-supplied markup in {@link LayerStyle.fillPatternSvg}.
696
- */
697
- export type FillPattern = "none" | "hatch" | "cross-hatch" | "horizontal" | "vertical" | "dots" | "svg";
698
- /**
699
- * The built-in marker shape for a point layer, or `"custom"` to rasterize the
700
- * user-supplied SVG in {@link LayerStyle.markerSvg}. Built-in shapes are drawn
701
- * on a sprite tile and recolored via {@link LayerStyle.markerColor}.
702
- */
703
- export type MarkerShape = "circle" | "square" | "triangle" | "diamond" | "star" | "cross" | "pin" | "custom";
704
- /**
705
- * How a point layer is rendered: as individual markers, a density heatmap, or
706
- * clustered bubbles. Only applies to point geometry.
707
- */
708
- export type PointRenderer = "single" | "heatmap" | "cluster";
709
- /**
710
- * The repeated decoration symbol drawn along line features (and polygon
711
- * outlines), or `"none"` when decorations are off. Mirrors the QGIS
712
- * marker-line / arrow symbol layers: `"arrow"` renders directional arrowheads
713
- * that follow the line, the other shapes render as repeated markers.
714
- */
715
- export type LineDecoration = "none" | "arrow" | "triangle" | "circle" | "square";
716
- /**
717
- * The per-feature derived geometry rendered by the geometry generator, or
718
- * `"none"` when the generator is off. Mirrors QGIS geometry-generator symbol
719
- * layers: each feature's derived geometry (its centroid, bounding box, convex
720
- * hull, or a buffer) is drawn as an extra symbol over the layer's normal
721
- * symbology. `"centroid"` derives points; the rest derive polygons.
722
- */
723
- export type GeometryGeneratorType = "none" | "centroid" | "bounding-box" | "convex-hull" | "buffer";
724
- /**
725
- * Unit a stroke/line width is measured in. `"pixels"` is constant screen space;
726
- * `"meters"` is ground distance, so the rendered width scales with the map
727
- * scale (zoom). See {@link LayerStyle.strokeWidthUnit}.
728
- */
729
- export type StrokeWidthUnit = "pixels" | "meters";
730
- /**
731
- * The chart drawn on top of each feature by the diagram renderer (QGIS-style
732
- * diagram symbology), or `"none"` when diagrams are off. Diagrams visualize
733
- * several numeric attributes per feature at once — e.g. election results by
734
- * party per county — and render through the shared deck.gl overlay on the
735
- * feature's point location or polygon centroid.
736
- */
737
- export type DiagramType = "none" | "pie" | "donut" | "bar" | "stacked-bar";
738
- /**
739
- * How the overall diagram size is determined.
740
- *
741
- * - `"fixed"`: every diagram renders at {@link LayerStyle.diagramSize} pixels.
742
- * - `"sum"`: scaled by the sum of the mapped attribute values, so the largest
743
- * total renders at {@link LayerStyle.diagramSize} pixels (area-true square
744
- * root scaling).
745
- * - `"attribute"`: scaled the same way by the single numeric attribute in
746
- * {@link LayerStyle.diagramSizeProperty}.
747
- */
748
- export type DiagramSizeMode = "fixed" | "sum" | "attribute";
749
- /** One attribute rendered as a slice/bar of a feature diagram. */
750
- export interface DiagramField {
751
- /** Numeric feature property visualized by this slice/bar. */
752
- property: string;
753
- /** Slice/bar color (6-digit hex). */
754
- color: string;
755
- }
756
- export interface VectorStyleStop {
757
- value: string | number;
758
- color: string;
759
- label?: string;
760
- }
761
- /** Attribute-driven labeling for a vector layer (rendered as a MapLibre symbol layer). */
762
- export interface LabelStyle {
763
- /** Whether labels are shown for the layer. */
764
- enabled: boolean;
765
- /** Attribute field whose value becomes the label text. */
766
- field: string;
767
- /**
768
- * Optional MapLibre expression (JSON string) for the label text, which
769
- * overrides {@link field} when non-empty (e.g. concatenating several fields).
770
- */
771
- expression: string;
772
- /** `"point"` labels at the feature/centroid; `"line"` places them along lines. */
773
- placement: "point" | "line";
774
- /** Label text size in pixels. */
775
- size: number;
776
- /** CSS color string for the label text. */
777
- color: string;
778
- /** CSS color string for the text halo drawn behind the label. */
779
- haloColor: string;
780
- /** Width of the text halo in pixels. */
781
- haloWidth: number;
782
- /** Scale range for labels; `0` / `24` inherit the layer's own zoom range. */
783
- minZoom: number;
784
- maxZoom: number;
785
- /** Let labels overlap instead of hiding colliding ones. */
786
- allowOverlap: boolean;
787
- /**
788
- * Where the label sits relative to its anchor point (MapLibre `text-anchor`),
789
- * e.g. `"top"` places the text above the point. Ignored for line placement.
790
- */
791
- anchor: LabelAnchor;
792
- /** Horizontal label offset in ems (MapLibre `text-offset` x). */
793
- offsetX: number;
794
- /** Vertical label offset in ems (MapLibre `text-offset` y; positive is down). */
795
- offsetY: number;
796
- /** Label rotation in degrees clockwise (MapLibre `text-rotate`). */
797
- rotation: number;
798
- /** Maximum line width in ems before the label wraps (MapLibre `text-max-width`). */
799
- maxWidth: number;
800
- /** Letter-case transform applied to the label text (MapLibre `text-transform`). */
801
- transform: LabelTransform;
802
- /**
803
- * Render a numeric {@link field} with the locale's thousands and decimal
804
- * separators (issue #2336), so `1234567.5` labels as `1,234,567.5` instead
805
- * of running together. Non-numeric values are unaffected, and it is not
806
- * applied to {@link expression}, which formats its own output (MapLibre's
807
- * `number-format`, offered in the Expression Builder).
808
- */
809
- numberFormatEnabled: boolean;
810
- /** Decimal places kept while {@link numberFormatEnabled} is on (0-10). */
811
- numberDecimals: number;
812
- /**
813
- * BCP 47 tag picking the separators for {@link numberFormatEnabled}, from
814
- * {@link LABEL_NUMBER_LOCALES}. Empty (the default) follows the app's own
815
- * language, the way popup number fields do.
816
- */
817
- numberLocale: string;
818
- /**
819
- * How to handle features that share a label.
820
- *
821
- * - `"off"`: every feature is labeled (the historical behavior).
822
- * - `"unique"`: features stacked at the same point are collapsed to a single
823
- * label, so co-located points (e.g. several antennas at one cell site) do not
824
- * stack overlapping text.
825
- * - `"concatenate"`: co-located points are merged into one label that joins
826
- * their distinct {@link field} values, one per line.
827
- *
828
- * Applies to point layers rendered through the inline GeoJSON path and uses
829
- * {@link field} (not {@link expression}) as the label value.
830
- */
831
- dedupe: LabelDedupe;
832
- /**
833
- * Data-defined override for {@link size}: a MapLibre expression (JSON
834
- * string) producing a number, e.g. sizing labels by population. Empty means
835
- * "use the literal {@link size}". Like the other data-defined overrides
836
- * below, it reads source feature attributes, so it is skipped while
837
- * {@link dedupe} collapsing is active (the aggregated features carry only
838
- * the label value).
839
- */
840
- sizeExpression: string;
841
- /**
842
- * Data-defined override for {@link color}: a MapLibre expression (JSON
843
- * string) producing a color, e.g. coloring labels by category.
844
- */
845
- colorExpression: string;
846
- /**
847
- * Data-defined label opacity: a MapLibre expression (JSON string) producing
848
- * a number in 0..1. When set it replaces the layer-wide opacity for labels
849
- * (wrapping it would invalidate top-level `["zoom"]` interpolations).
850
- */
851
- opacityExpression: string;
852
- /**
853
- * Per-feature label visibility: a MapLibre expression (JSON string)
854
- * producing a boolean. Features evaluating false get no label (e.g. hide
855
- * labels below an attribute threshold). Combined with the layer's other
856
- * feature filters.
857
- */
858
- visibilityExpression: string;
859
- /**
860
- * Per-feature placement priority: a MapLibre expression (JSON string)
861
- * producing a number, applied as `symbol-sort-key`. Labels with lower
862
- * values are placed first, so they win when space is tight.
863
- */
864
- priorityExpression: string;
865
- }
866
- /** MapLibre `text-anchor` positions offered for {@link LabelStyle.anchor}. */
867
- export type LabelAnchor = "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
868
- /** Letter-case transform offered for {@link LabelStyle.transform}. */
869
- export type LabelTransform = "none" | "uppercase" | "lowercase";
870
- /** Duplicate-label handling offered for {@link LabelStyle.dedupe}. */
871
- export type LabelDedupe = "off" | "unique" | "concatenate";
872
- /**
873
- * Cartographic blend modes offered for {@link LayerStyle.blendMode}.
874
- *
875
- * The list is bounded by what WebGL *fixed-function* blending can express --
876
- * one `blendFunc` factor pair plus one `blendEquation` -- because that is the
877
- * only blend state MapLibre's renderer exposes, and it applies to colour and
878
- * alpha together. Two consequences shaped this list:
879
- *
880
- * - Modes needing the destination colour inside a fragment shader (`overlay`,
881
- * `color-dodge`, `soft-light`, `difference`, and the non-separable HSL modes)
882
- * are absent. MapLibre draws straight into the map framebuffer, which a
883
- * shader cannot sample, so computing them would need an extra copy pass.
884
- * - `darken` and `subtract` are absent even though `MIN` and
885
- * `FUNC_REVERSE_SUBTRACT` look like they would serve. Both also apply to the
886
- * alpha channel, where they drive the map canvas transparent: `MIN` takes the
887
- * whole canvas to `min(0, dst) = 0` everywhere the layer does not cover, and
888
- * `FUNC_REVERSE_SUBTRACT` leaves `dstA - srcA` inside it. Correcting either
889
- * needs `blendEquationSeparate` / `blendFuncSeparate`, which MapLibre's state
890
- * tracker does not offer.
891
- *
892
- * Every mode here leaves the canvas opaque and leaves the map untouched
893
- * wherever the layer contributes nothing. See `docs/user-guide/layers.md`.
894
- */
895
- export declare const BLEND_MODES: readonly ["normal", "multiply", "screen", "lighten", "add"];
896
- /**
897
- * How a layer's pixels combine with the map beneath it. `"normal"` is ordinary
898
- * alpha compositing (the default, and what every layer did before blend modes
899
- * existed). See {@link BLEND_MODES}.
900
- */
901
- export type BlendMode = (typeof BLEND_MODES)[number];
902
- /**
903
- * The mode a layer renders with unless it says otherwise. Declared separately
904
- * from {@link DEFAULT_LAYER_STYLE} so consumers get a non-optional
905
- * {@link BlendMode} to fall back to: `blendMode` is optional on
906
- * {@link LayerStyle}, so `DEFAULT_LAYER_STYLE.blendMode` is typed
907
- * `BlendMode | undefined` however it is initialized.
908
- */
909
- export declare const DEFAULT_BLEND_MODE: BlendMode;
910
- export interface LayerStyle {
911
- minZoom: number;
912
- maxZoom: number;
913
- fillColor: string;
914
- strokeColor: string;
915
- strokeWidth: number;
916
- /**
917
- * Unit the {@link strokeWidth} value is expressed in.
918
- *
919
- * - `"pixels"` (default): a constant screen-space width that never changes
920
- * with zoom — the historical behavior.
921
- * - `"meters"`: a ground-distance width, so the rendered line stays
922
- * proportional to the map scale (thicker zoomed in, thinner zoomed out),
923
- * matching QGIS "map units". Only affects line/polygon-outline rendering;
924
- * point/circle outlines remain pixel-based.
925
- */
926
- strokeWidthUnit: StrokeWidthUnit;
927
- fillOpacity: number;
928
- circleRadius: number;
929
- textColor: string;
930
- textHaloColor: string;
931
- textHaloWidth: number;
932
- textSize: number;
933
- labels: LabelStyle;
934
- extrusionEnabled: boolean;
935
- extrusionColor: string;
936
- extrusionOpacity: number;
937
- extrusionHeightProperty: string;
938
- extrusionHeightScale: number;
939
- extrusionBase: number;
940
- extrusionAdvancedStyleEnabled: boolean;
941
- extrusionColorExpression: string;
942
- extrusionHeightExpression: string;
943
- /**
944
- * When true, a vector layer whose coordinates carry Z values (e.g. a GPX
945
- * track with elevations) renders in true 3D through the shared deck.gl
946
- * overlay instead of MapLibre's flat 2D layers, so features sit at their
947
- * own altitude. Orthogonal to {@link extrusionEnabled}, which extrudes flat
948
- * polygons by an attribute; only one of the two should be on at a time.
949
- */
950
- elevation3dEnabled: boolean;
951
- /** Multiplier applied to each coordinate's Z value (vertical exaggeration). */
952
- elevation3dVerticalScale: number;
953
- /** Constant altitude offset in meters added after the vertical scale. */
954
- elevation3dOffset: number;
955
- vectorStyleMode: VectorStyleMode;
956
- vectorStyleProperty: string;
957
- vectorStyleClassCount: number;
958
- vectorStyleColorRamp: string;
959
- vectorStyleClassificationScheme: string;
960
- vectorStyleStops: VectorStyleStop[];
961
- vectorStyleExpression: string;
962
- /**
963
- * Ordered rules for the `"rule-based"` {@link vectorStyleMode}. Compiled to a
964
- * MapLibre `case` color expression (first matching filter wins, catch-all
965
- * last). See {@link VectorRule}.
966
- */
967
- vectorRules: VectorRule[];
968
- /**
969
- * When true, the point circle radius (or line width) is sized by a numeric
970
- * field via an `interpolate` between {@link proportionalSizeMinValue} ..
971
- * {@link proportionalSizeMaxValue} mapped onto {@link proportionalSizeMinRadius}
972
- * .. {@link proportionalSizeMaxRadius} (QGIS "graduated → size" / proportional
973
- * symbols). Orthogonal to the color {@link vectorStyleMode}.
974
- */
975
- proportionalSizeEnabled: boolean;
976
- proportionalSizeProperty: string;
977
- proportionalSizeMinValue: number;
978
- proportionalSizeMaxValue: number;
979
- proportionalSizeMinRadius: number;
980
- proportionalSizeMaxRadius: number;
981
- /**
982
- * Polygon fill pattern. `"none"` keeps the flat fill; other values render a
983
- * recolorable sprite tile ({@link fillPatternColor}); `"svg"` rasterizes
984
- * {@link fillPatternSvg}. See {@link FillPattern}.
985
- */
986
- fillPattern: FillPattern;
987
- fillPatternColor: string;
988
- /** Raw SVG markup (or a data URL) used when {@link fillPattern} is `"svg"`. */
989
- fillPatternSvg: string;
990
- /**
991
- * When true, point features render as a marker icon ({@link markerShape})
992
- * instead of a plain circle. Built-in shapes are recolored via
993
- * {@link markerColor}; `"custom"` rasterizes {@link markerSvg}.
994
- */
995
- markerEnabled: boolean;
996
- markerShape: MarkerShape;
997
- markerColor: string;
998
- markerSize: number;
999
- /** Raw SVG markup (or a data URL) used when {@link markerShape} is `"custom"`. */
1000
- markerSvg: string;
1001
- /**
1002
- * When true, per-feature [simplestyle-spec](https://github.com/mapbox/simplestyle-spec)
1003
- * properties (`fill`, `fill-opacity`, `stroke`, `stroke-width`,
1004
- * `stroke-opacity`, `marker-color`) override the flat layer style on a
1005
- * per-feature basis. Set automatically when a GeoJSON layer is added whose
1006
- * features carry these properties (e.g. styled KML/KMZ), so embedded
1007
- * symbology renders without manual configuration.
1008
- */
1009
- simpleStyleEnabled: boolean;
1010
- /**
1011
- * Per-feature chart symbology (QGIS-style diagrams). `"none"` disables it;
1012
- * any other value renders one {@link DiagramType} chart per feature over the
1013
- * layer's normal symbology, built from the numeric attributes in
1014
- * {@link diagramFields}. See `@geolibre/core`'s `diagram.ts` helpers.
1015
- */
1016
- diagramType: DiagramType;
1017
- /** Attributes (and their colors) charted by the diagram renderer, in order. */
1018
- diagramFields: DiagramField[];
1019
- /** How the per-feature diagram size is determined. */
1020
- diagramSizeMode: DiagramSizeMode;
1021
- /**
1022
- * Diagram size in pixels: the rendered diameter/height for `"fixed"` sizing,
1023
- * or the diameter/height of the largest feature for scaled sizing.
1024
- */
1025
- diagramSize: number;
1026
- /** Numeric attribute driving `"attribute"` sizing (see {@link DiagramSizeMode}). */
1027
- diagramSizeProperty: string;
1028
- /** Minimum zoom at which diagrams are drawn, to avoid clutter when zoomed out. */
1029
- diagramMinZoom: number;
1030
- /**
1031
- * When true, diagrams that would overlap an already-placed diagram on screen
1032
- * are skipped (largest first), decluttering dense areas. Recomputed as the
1033
- * view changes.
1034
- */
1035
- diagramDeclutter: boolean;
1036
- pointRenderer: PointRenderer;
1037
- heatmapRadius: number;
1038
- heatmapIntensity: number;
1039
- /** Built-in color ramp used by the heatmap density renderer. */
1040
- heatmapColorRamp: string;
1041
- /** Numeric feature property used as heatmap weight; blank gives every point equal weight. */
1042
- heatmapWeightProperty: string;
1043
- clusterRadius: number;
1044
- clusterMaxZoom: number;
1045
- /**
1046
- * When true, the polygon fill renders *inverted*: the area outside the
1047
- * features is filled (with {@link fillColor}/{@link fillOpacity}) and the
1048
- * features themselves become holes, mirroring the QGIS "Inverted polygons"
1049
- * renderer. Feature outlines still render normally. Only applies to layers
1050
- * with polygon geometry; ignored while {@link extrusionEnabled} is on.
1051
- */
1052
- invertedFillEnabled: boolean;
1053
- /**
1054
- * Repeated decoration symbol drawn along line features and polygon outlines
1055
- * (QGIS marker-line / arrow lines). `"none"` disables it. See
1056
- * {@link LineDecoration}.
1057
- */
1058
- lineDecoration: LineDecoration;
1059
- /**
1060
- * Decoration symbol color (6-digit hex). An empty string inherits
1061
- * {@link strokeColor} so decorations follow the stroke by default.
1062
- */
1063
- lineDecorationColor: string;
1064
- /** Decoration symbol size in pixels. */
1065
- lineDecorationSize: number;
1066
- /** Distance between consecutive decoration symbols in pixels. */
1067
- lineDecorationSpacing: number;
1068
- /**
1069
- * Per-feature derived geometry drawn over the layer's normal symbology
1070
- * (QGIS geometry generator). `"none"` disables it. See
1071
- * {@link GeometryGeneratorType}.
1072
- */
1073
- geometryGenerator: GeometryGeneratorType;
1074
- /** Buffer distance in meters for the `"buffer"` generator. */
1075
- geometryGeneratorBufferDistance: number;
1076
- /**
1077
- * Attribute driving the `"buffer"` generator's distance, so each feature is
1078
- * buffered by its own value in meters (QGIS data-defined override on a
1079
- * geometry-generator symbol). An empty string buffers every feature by the
1080
- * flat {@link geometryGeneratorBufferDistance}, which also stands in for
1081
- * features whose value is missing or non-numeric.
1082
- */
1083
- geometryGeneratorBufferProperty: string;
1084
- /** Fill color (6-digit hex) for generated polygons and centroid points. */
1085
- geometryGeneratorFillColor: string;
1086
- /** Outline color (6-digit hex) for generated geometry. */
1087
- geometryGeneratorStrokeColor: string;
1088
- /** Outline width in pixels for generated geometry. */
1089
- geometryGeneratorStrokeWidth: number;
1090
- /** Fill opacity (0..1) for generated polygons and centroid points. */
1091
- geometryGeneratorOpacity: number;
1092
- /** Circle radius in pixels for generated centroid points. */
1093
- geometryGeneratorCircleRadius: number;
1094
- /**
1095
- * Attribute driving the radius of generated centroid points, scaling them
1096
- * between {@link geometryGeneratorSizeMinRadius} and
1097
- * {@link geometryGeneratorSizeMaxRadius} across
1098
- * {@link geometryGeneratorSizeMinValue} ..
1099
- * {@link geometryGeneratorSizeMaxValue} (proportional symbols on the derived
1100
- * centroids). An empty string draws every centroid at the flat
1101
- * {@link geometryGeneratorCircleRadius}.
1102
- *
1103
- * Deliberately separate from {@link proportionalSizeProperty}: that one also
1104
- * drives line width, so reusing it here would resize a polygon layer's
1105
- * outlines as a side effect of sizing its centroids.
1106
- */
1107
- geometryGeneratorSizeProperty: string;
1108
- geometryGeneratorSizeMinValue: number;
1109
- geometryGeneratorSizeMaxValue: number;
1110
- geometryGeneratorSizeMinRadius: number;
1111
- geometryGeneratorSizeMaxRadius: number;
1112
- rasterBrightnessMin: number;
1113
- rasterBrightnessMax: number;
1114
- rasterSaturation: number;
1115
- rasterContrast: number;
1116
- rasterHueRotate: number;
1117
- /**
1118
- * How this layer composites onto whatever is drawn beneath it. `"normal"`
1119
- * (the default) is ordinary alpha compositing; `"multiply"` is the classic
1120
- * cartographic case of laying colour over a hillshade so the relief still
1121
- * reads through. Applies to the layer's own rendered geometry and raster
1122
- * tiles, not to its labels, which stay legible on top. See
1123
- * {@link BLEND_MODES} for the available modes and why the list is what it is.
1124
- */
1125
- blendMode?: BlendMode;
1126
- }
1127
- export declare const DEFAULT_LAYER_STYLE: LayerStyle;
1128
- /**
1129
- * Read a layer style property, falling back to the shared default when the
1130
- * layer does not define it. Shared by `@geolibre/map` and the desktop app so
1131
- * the two consumers cannot drift.
1132
- */
1133
- export declare function styleValue<K extends keyof LayerStyle>(style: LayerStyle, key: K): LayerStyle[K];
1134
- /**
1135
- * Feature-count threshold above which a local vector (GeoJSON) layer is rendered
1136
- * through client-side vector tiles (geojson-vt / supercluster served by a custom
1137
- * MapLibre protocol) instead of one in-memory geojson source pushed via
1138
- * `setData`. Small layers stay on the simpler inline path. Mirrors the
1139
- * `MAX_CEREUS_FEATURES` precedent in the desktop SQL engine.
1140
- */
1141
- export declare const LARGE_VECTOR_FEATURE_THRESHOLD = 50000;
1142
- /**
1143
- * Decide whether a GeoJSON layer should use the tiled rendering path.
1144
- *
1145
- * @param geojson - The layer's feature collection (may be undefined for
1146
- * non-vector layers).
1147
- * @returns `true` when the collection exceeds
1148
- * {@link LARGE_VECTOR_FEATURE_THRESHOLD} features.
1149
- */
1150
- export declare function shouldUseTiledRendering(geojson: GeoJSON.FeatureCollection | undefined): boolean;
1151
- /**
1152
- * Match statistics from the last time a {@link LayerJoin} was applied, shown in
1153
- * the Joins UI so silent key mismatches are visible (mirrors QGIS's join
1154
- * feedback). Recomputed on every apply; persisted harmlessly with the join.
1155
- */
1156
- export interface LayerJoinStats {
1157
- /** Target features whose key matched a join-table row. */
1158
- matchedCount: number;
1159
- /** Target features with no matching join-table row (their joined columns are null). */
1160
- unmatchedTargetCount: number;
1161
- /** Join-table rows (with a non-empty key) that matched no target feature. */
1162
- unmatchedJoinCount: number;
1163
- }
1164
- /**
1165
- * A persistent attribute join attached to a layer (QGIS Layer Properties →
1166
- * Joins): a live left join that augments the layer's attribute table with
1167
- * columns from another layer (typically a geometry-less table added via
1168
- * Delimited Text with no coordinate fields) matched on a key field. Unlike the
1169
- * Processing → Vector attribute join, the layer keeps its identity — styles,
1170
- * labels, and position — and the joined columns refresh whenever the join
1171
- * table's data changes. Definitions persist in `.geolibre.json` and re-resolve
1172
- * on project load. See `joins.ts` for the engine.
1173
- */
1174
- export interface LayerJoin {
1175
- /** Stable id for list edits. */
1176
- id: string;
1177
- /** Id of the layer providing the joined columns (its geometry is ignored). */
1178
- joinLayerId: string;
1179
- /** Key field on the layer that owns this join. */
1180
- targetField: string;
1181
- /** Key field on the join layer. */
1182
- joinField: string;
1183
- /**
1184
- * Join-layer fields to bring over; `undefined` brings every field except the
1185
- * key. Names are the join layer's own (pre-prefix) field names.
1186
- */
1187
- fields?: string[];
1188
- /** Optional prefix prepended to every joined column name (as in QGIS). */
1189
- prefix?: string;
1190
- /** `false` detaches the joined columns without deleting the definition. */
1191
- enabled?: boolean;
1192
- /**
1193
- * Bookkeeping written by the engine: the output column names this join added
1194
- * to the layer's features. Applying joins strips these first, which makes
1195
- * re-application idempotent without keeping a duplicate copy of the base
1196
- * data (base columns always win a name collision, so a joined column never
1197
- * shadows one). Not user-editable.
1198
- */
1199
- addedFields?: string[];
1200
- /** Last-run match statistics; see {@link LayerJoinStats}. */
1201
- stats?: LayerJoinStats;
1202
- }
1203
- /** Edit-widget kinds the Attribute Form designer can assign to a field. */
1204
- export type AttributeFormWidget = "text" | "number" | "range" | "checkbox" | "date" | "valueMap";
1205
- /** One selectable entry of a `valueMap` widget (stored value + display label). */
1206
- export interface AttributeFormValueMapEntry {
1207
- /** The value written to the feature property (compared as a string). */
1208
- value: string;
1209
- /** Human-readable label shown in the dropdown; defaults to {@link value}. */
1210
- label?: string;
1211
- }
1212
- /**
1213
- * Per-field configuration authored in the Attribute Form designer (layer
1214
- * properties → Attributes Form, QGIS-style): which edit widget the attribute
1215
- * editing surfaces render for the field, plus optional expression-based
1216
- * constraints and conditional visibility. Consumed by the attribute table's
1217
- * inline editor and the Field Collection capture form; helpers live in
1218
- * `attribute-form.ts`.
1219
- */
1220
- export interface AttributeFormFieldConfig {
1221
- /** Feature property key this configuration applies to. */
1222
- field: string;
1223
- widget: AttributeFormWidget;
1224
- /** Display label override shown in forms instead of the raw field name. */
1225
- alias?: string;
1226
- /**
1227
- * When true, a null/empty value fails validation. Checkbox widgets are
1228
- * exempt: unchecked is a valid state, not a missing value.
1229
- */
1230
- required?: boolean;
1231
- /** Dropdown entries for the `valueMap` widget. */
1232
- valueMap?: AttributeFormValueMapEntry[];
1233
- /** Lower bound for `number`/`range` widgets (inclusive). */
1234
- min?: number;
1235
- /** Upper bound for `number`/`range` widgets (inclusive). */
1236
- max?: number;
1237
- /** Step for the `range` widget's input. */
1238
- step?: number;
1239
- /**
1240
- * Boolean MapLibre expression that must evaluate to `true` against the
1241
- * feature's (candidate) properties for the value to be accepted, e.g.
1242
- * `[">", ["get", "population"], 0]`. Stored as the expression source string
1243
- * the Expression Builder edits.
1244
- */
1245
- constraintExpression?: string;
1246
- /** Human-readable message shown when the constraint fails. */
1247
- constraintDescription?: string;
1248
- /**
1249
- * Boolean MapLibre expression controlling whether the field is shown in
1250
- * attribute forms; `false` hides the field (and skips its validation).
1251
- * Empty/invalid expressions fail open so a typo cannot hide data entry.
1252
- */
1253
- visibilityExpression?: string;
1254
- }
1255
- /** The Attribute Form designer's whole per-layer configuration. */
1256
- export interface AttributeFormConfig {
1257
- fields: AttributeFormFieldConfig[];
1258
- }
1259
- /**
1260
- * How a popup renders one field's value (issue #2113). `"auto"` reproduces the
1261
- * untyped rendering the Identify popup has always done — sanitized KML
1262
- * `description` markup, an inline `data:image/*;base64` value as a thumbnail,
1263
- * anything else stringified. The remaining kinds are explicit author choices
1264
- * so a popup never has to guess from the value.
1265
- */
1266
- export type PopupFieldKind = "auto" | "text" | "number" | "date" | "link" | "image";
1267
- /** How a `"date"` field's value is written out. */
1268
- export type PopupDateFormat = "date" | "datetime" | "time" | "iso" | "year";
1269
- /** Value formatting for one popup field. Every part is optional. */
1270
- export interface PopupFieldFormat {
1271
- /** Fixed number of decimals for a `"number"` field. */
1272
- decimals?: number;
1273
- /** Group thousands with the locale's separator (`"number"` fields). */
1274
- thousands?: boolean;
1275
- /** Date rendering for a `"date"` field; defaults to `"date"`. */
1276
- dateFormat?: PopupDateFormat;
1277
- /** Text placed before the formatted value. */
1278
- prefix?: string;
1279
- /** Text placed after the formatted value, e.g. a unit suffix. */
1280
- suffix?: string;
1281
- /** Link text for a `"link"` field; the value itself is used when unset. */
1282
- linkLabel?: string;
1283
- }
1284
- /** One field's entry in a layer's popup configuration. */
1285
- export interface PopupFieldConfig {
1286
- /** Feature property key. */
1287
- field: string;
1288
- /** Display label shown instead of the raw field name. */
1289
- label?: string;
1290
- /** How the value renders; defaults to `"auto"`. */
1291
- kind?: PopupFieldKind;
1292
- format?: PopupFieldFormat;
1293
- /** Include this field in the hover tooltip's short subset. */
1294
- hover?: boolean;
1295
- }
1296
- /**
1297
- * Per-layer configuration for what a viewer sees when they interact with a
1298
- * feature (issue #2113): which fields the Identify popup shows, in what order,
1299
- * under what labels and formatting, plus an optional hover tooltip.
1300
- *
1301
- * A layer with no `popup` block behaves exactly as it did before this existed:
1302
- * the layer name as the heading, then every property as a key/value row.
1303
- * {@link GeoLibreLayer.fieldVisibility} stays authoritative — a `"hidden"` or
1304
- * `"excluded"` field is dropped even when a popup config names it.
1305
- */
1306
- export interface LayerPopupConfig {
1307
- /** `false` suppresses the Identify popup for this layer. Defaults to `true`. */
1308
- click?: boolean;
1309
- /** `true` shows a hover tooltip built from the `hover` fields. Defaults to `false`. */
1310
- hover?: boolean;
1311
- /** Field whose value titles the popup instead of the layer name. */
1312
- titleField?: string;
1313
- /**
1314
- * MapLibre expression source producing the popup title. Wins over
1315
- * {@link titleField}; when it fails or produces nothing the title falls
1316
- * through to `titleField`, and only then to the layer name.
1317
- */
1318
- titleExpression?: string;
1319
- /**
1320
- * MapLibre expression source producing the whole popup body as text, for
1321
- * authors who want a sentence rather than a table. When it evaluates, it
1322
- * replaces the field rows.
1323
- */
1324
- bodyExpression?: string;
1325
- /** `false` drops the synthetic `id` row. Defaults to `true`. */
1326
- showFeatureId?: boolean;
1327
- /**
1328
- * Widest the click popup may grow, in CSS pixels. Unset keeps the default
1329
- * (520px, or 420px for a popup carrying an image). Clamped to the range
1330
- * `resolvePopupMaxWidth` enforces and always capped by the viewport, so a
1331
- * value wider than the window still leaves the map usable.
1332
- */
1333
- maxWidth?: number;
1334
- /**
1335
- * Tallest an `"image"` field's thumbnail may draw inside the popup, in CSS
1336
- * pixels. Unset keeps the default (`min(50vh, 420px)`). Clamped by
1337
- * `resolvePopupImageHeight`. Pair it with {@link maxWidth} for a
1338
- * bigger picture: the thumbnail keeps its aspect ratio, so widening the
1339
- * popup is what lets a landscape photo use the extra height.
1340
- */
1341
- imageHeight?: number;
1342
- /**
1343
- * The fields to show and their order. An empty or absent list keeps today's
1344
- * behavior: every visible property, in the feature's own key order.
1345
- */
1346
- fields?: PopupFieldConfig[];
1347
- }
1348
- /**
1349
- * A virtual field attached to a vector layer (QGIS Field Calculator → "Create
1350
- * virtual field", issue #1321): a column defined by a MapLibre expression that
1351
- * recomputes live instead of being written once as static values. The engine
1352
- * (`virtual-fields.ts`) materializes the computed values into the layer's
1353
- * feature properties — so the attribute table, Expression Builder,
1354
- * data-driven styling, labels, and selection all see the column with no
1355
- * further wiring — and re-derives them whenever the layer's data (or its
1356
- * joins) change. Definitions persist in `.geolibre.json` and re-resolve on
1357
- * project load; the expression is a declarative MapLibre expression (never
1358
- * arbitrary code), so re-evaluating it from a shared project file is safe.
1359
- */
1360
- export interface LayerVirtualField {
1361
- /** Stable id for list edits. */
1362
- id: string;
1363
- /** The output column name. A name already taken by a base column is skipped. */
1364
- name: string;
1365
- /**
1366
- * MapLibre expression source (JSON text, e.g. `["/", ["get", "pop"],
1367
- * ["get", "area_km2"]]`) evaluated against each feature.
1368
- */
1369
- expression: string;
1370
- /** `false` detaches the computed column without deleting the definition. */
1371
- enabled?: boolean;
1372
- /**
1373
- * Bookkeeping written by the engine: the column name actually materialized
1374
- * on the last apply, absent when the field was disabled, failed to compile,
1375
- * or was skipped because the name collided with an existing column.
1376
- * Applying virtual fields strips these first, which makes re-application
1377
- * idempotent (an existing column is never shadowed, so stripping exactly
1378
- * restores the pre-apply properties). Not user-editable.
1379
- */
1380
- addedField?: string;
1381
- /** Compile error from the last apply, when the expression failed to parse. */
1382
- error?: string;
1383
- /**
1384
- * Features whose evaluation threw at runtime on the last apply (their cell
1385
- * is null). Surfaced so the UI can warn without one bad feature aborting
1386
- * the whole column.
1387
- */
1388
- errorCount?: number;
1389
- }
1390
- /**
1391
- * Quick filters (issue #2114): the data-driven filter controls a layer offers
1392
- * in its Quick Filters section. What persists is the *control state* — field,
1393
- * kind, chosen values — not the compiled output; `quick-filters.ts` compiles it
1394
- * to a MapLibre filter at sync time so a saved filter can always be reopened
1395
- * and edited.
1396
- */
1397
- /** Which control a quick filter renders, and how it compiles. */
1398
- export type QuickFilterKind = "categorical" | "range" | "date" | "text";
1399
- /** The comparison a `text` quick filter applies (always case-insensitive). */
1400
- export type QuickFilterTextOperator = "contains" | "startsWith" | "equals";
1401
- /**
1402
- * How a date field stores its values, deciding whether a `date` quick filter
1403
- * compares ISO text or epoch numbers. `iso` covers both `YYYY-MM-DD` and full
1404
- * `YYYY-MM-DDTHH:MM:SSZ` timestamps: only the leading `YYYY-MM-DD` slice is
1405
- * compared, so a trailing time, a milliseconds fraction, or a `Z` cannot break
1406
- * a boundary. Mirrors (deliberately, in a smaller form) the value kinds the
1407
- * Time Slider's `detectValueKind` reports.
1408
- */
1409
- export type QuickFilterDateKind = "iso" | "epochMs" | "epochS";
1410
- /** A single filter control persisted on a layer. */
1411
- export interface LayerQuickFilter {
1412
- /** Stable id, used as the React key and for edits/removal. */
1413
- id: string;
1414
- /** The feature property this control narrows. */
1415
- field: string;
1416
- kind: QuickFilterKind;
1417
- /**
1418
- * `false` keeps the control configured but inert, so a filter can be muted
1419
- * without losing the values chosen for it. Defaults to enabled.
1420
- */
1421
- enabled?: boolean;
1422
- /**
1423
- * `categorical`: the chosen values. An empty (or omitted) selection means
1424
- * "every value" and compiles to nothing — unchecking the last box clears the
1425
- * filter rather than emptying the map.
1426
- */
1427
- values?: (string | number | boolean)[];
1428
- /** `range`: inclusive bounds. `null`/omitted leaves that side open. */
1429
- min?: number | null;
1430
- max?: number | null;
1431
- /**
1432
- * `date`: inclusive `YYYY-MM-DD` bounds. The end day is included in full, so
1433
- * a timestamp field filtered to a single day keeps that whole day.
1434
- */
1435
- start?: string | null;
1436
- end?: string | null;
1437
- /** `date`: how the field stores its values. Defaults to `iso`. */
1438
- dateKind?: QuickFilterDateKind;
1439
- /** `text`: the comparison. Defaults to `contains`. */
1440
- operator?: QuickFilterTextOperator;
1441
- /** `text`: the needle. Blank means no constraint. */
1442
- text?: string;
1443
- }
1444
- /** Persisted refresh policy and most recent synchronization result for a layer. */
1445
- export interface LayerConnection {
1446
- /** Owning layer id. Repeated here so records remain self-describing when exported. */
1447
- layerId: string;
1448
- /** Automatic refresh cadence in seconds, or null for manual synchronization only. */
1449
- interval: number | null;
1450
- /** ISO timestamp of the most recent successful synchronization. */
1451
- lastSyncedAt: string | null;
1452
- /** Most recent synchronization error. Cleared by a successful synchronization. */
1453
- lastError: string | null;
1454
- /** Whether a failed synchronization retains the last good data or clears it. */
1455
- onFailure: "keep-last" | "clear";
1456
- }
1457
- /**
1458
- * Configuration for automatic feature editor tracking (Issue #1677).
1459
- * Maintains `created_by`, `created_at`, `edited_by`, `edited_at` fields
1460
- * automatically when features are created or updated.
1461
- */
1462
- export interface EditorTrackingConfig {
1463
- /** `true` enables automatic creation/edit timestamp and author stamping. */
1464
- enabled: boolean;
1465
- /** Field name for creation author (default `"created_by"`). */
1466
- createdByField?: string;
1467
- /** Field name for creation timestamp (default `"created_at"`). */
1468
- createdAtField?: string;
1469
- /** Field name for last-edit author (default `"edited_by"`). */
1470
- editedByField?: string;
1471
- /** Field name for last-edit timestamp (default `"edited_at"`). */
1472
- editedAtField?: string;
1473
- }
1474
- /**
1475
- * Visibility of a layer's attribute field.
1476
- * - "hidden": Not shown in the attribute table, identify popup, tooltips, or field pickers, but remains in the data.
1477
- * - "excluded": Removed entirely from the data when the project is shared or exported.
1478
- */
1479
- export type FieldVisibility = "hidden" | "excluded";
1480
- /**
1481
- * Explicit capability flags defining what actions a user/session may perform on a layer.
1482
- * Any omitted capability falls back to the inferred default behavior for that layer's source.
1483
- */
1484
- export interface LayerCapabilities {
1485
- /** Can the layer's features or attributes be queried / identified. */
1486
- query?: boolean;
1487
- /** Can new features be created/added to the layer. */
1488
- create?: boolean;
1489
- /** Can existing features/attributes be modified. */
1490
- update?: boolean;
1491
- /** Can features be deleted from the layer. */
1492
- delete?: boolean;
1493
- /** Can the layer data/symbology be exported/downloaded. */
1494
- export?: boolean;
1495
- }
1496
- /**
1497
- * Application privilege identifiers defining discrete capabilities in GeoLibre.
1498
- */
1499
- export type AppPrivilege = "layers:edit" | "layers:add-remote" | "layers:add-local" | "processing:run" | "processing:sidecar" | "project:save" | "project:share" | "project:share-public" | "plugins:install" | "assistant:use" | "connections:manage" | "export:data" | "export:image" | "settings:manage";
1500
- /**
1501
- * Standard named roles bundling application privileges.
1502
- */
1503
- export type AppRole = "viewer" | "editor" | "publisher" | "administrator" | "custom";
1504
- /**
1505
- * Ephemeral application capabilities state defining the active role, effective privileges,
1506
- * and optional restriction reason for the current session/deployment.
1507
- */
1508
- export interface AppCapabilities {
1509
- /**
1510
- * The assigned application role. `custom` once an ad-hoc `grantAppPrivilege` /
1511
- * `revokeAppPrivilege` has moved the set away from the bundle a named role
1512
- * defines, so the role never claims a shape the privileges do not have.
1513
- */
1514
- role: AppRole;
1515
- /** List of granted privileges for the active role or custom configuration. */
1516
- privileges: AppPrivilege[];
1517
- /**
1518
- * Optional human-readable reason covering the whole set (e.g. "Action disabled
1519
- * by deployment policy"), used for any privilege without its own.
1520
- */
1521
- reason?: string;
1522
- /**
1523
- * Per-privilege reasons, and why they exist: two privileges can be withheld by
1524
- * different causes — a role bundle plus a licence limit, say — and a single
1525
- * `reason` would make the second revocation relabel the first, so every gate
1526
- * would explain itself with whichever cause happened to be recorded last.
1527
- * Takes precedence over `reason` for the privileges it names.
1528
- */
1529
- privilegeReasons?: Partial<Record<AppPrivilege, string>>;
1530
- }
1531
- export interface GeoLibreLayer {
1532
- id: string;
1533
- name: string;
1534
- type: LayerType;
1535
- source: Record<string, unknown>;
1536
- visible: boolean;
1537
- opacity: number;
1538
- style: LayerStyle;
1539
- metadata: Record<string, unknown>;
1540
- beforeId?: string;
1541
- geojson?: FeatureCollection;
1542
- /**
1543
- * Explicit capability set for the layer (query, create, update, delete, export).
1544
- * Unset capabilities default to the inferred behavior for the layer's source kind.
1545
- */
1546
- capabilities?: LayerCapabilities;
1547
- /**
1548
- * Automatic editor tracking configuration for feature creation/updates.
1549
- */
1550
- editorTracking?: EditorTrackingConfig;
1551
- /**
1552
- * Field-level visibility overrides. Fields marked as "excluded" are physically
1553
- * removed from the data during export and sharing.
1554
- */
1555
- fieldVisibility?: Record<string, FieldVisibility>;
1556
- /**
1557
- * Per-field edit-widget, constraint, and visibility configuration authored
1558
- * in the Attribute Form designer. Applied by the attribute editing surfaces
1559
- * (attribute table inline editor, Field Collection capture form); persists
1560
- * with the project like {@link joins}.
1561
- */
1562
- attributeForm?: AttributeFormConfig;
1563
- /**
1564
- * Popup and hover-tooltip design for this layer, authored in the Style
1565
- * panel's Popup section. Absent means the default full-property dump.
1566
- */
1567
- popup?: LayerPopupConfig;
1568
- /**
1569
- * Persistent attribute joins applied to this layer's features, in order.
1570
- * The joined columns are materialized into `geojson` feature properties (so
1571
- * the attribute table, Expression Builder, styling, and labels all see them)
1572
- * and re-derived whenever the layer's or a join table's data changes.
1573
- */
1574
- joins?: LayerJoin[];
1575
- /**
1576
- * Expression-backed virtual fields computed for this layer's features, in
1577
- * order. Applied after joins (so an expression can read joined columns) and
1578
- * materialized into `geojson` feature properties; re-derived whenever the
1579
- * layer's data changes. See {@link LayerVirtualField}.
1580
- */
1581
- virtualFields?: LayerVirtualField[];
1582
- /**
1583
- * Transient MapLibre filter expression applied on top of every rendered
1584
- * sub-layer's geometry filter. The Time Slider plugin sets this on a bound
1585
- * vector layer so scrubbing the timeline narrows the visible features to the
1586
- * current time window, while the layer's own styling and opacity stay
1587
- * untouched. It is derived from the slider's current date, so it is NOT
1588
- * persisted (stripped by `prepareLayerForSave`); the binding config lives in
1589
- * `metadata.timeBinding` and the filter is recomputed live on the next
1590
- * activation. `undefined` means no time filter is applied.
1591
- */
1592
- timeFilter?: unknown[];
1593
- /** Transient MapLibre expression applied by the iframe embed API. */
1594
- embedFilter?: unknown[];
1595
- /**
1596
- * Project-persisted boolean MapLibre expression that narrows the features
1597
- * rendered for this layer. Unlike a selection, this leaves the source data
1598
- * intact and keeps non-matching features hidden until the filter is cleared.
1599
- * It is composed with transient filters, quick filters, and rule visibility
1600
- * by the map renderers.
1601
- */
1602
- filterExpression?: unknown[];
1603
- /**
1604
- * Data-driven filter controls authored in the layer's Quick Filters section
1605
- * (issue #2114). Unlike {@link timeFilter} and {@link embedFilter} this is
1606
- * persisted control *state*, not a compiled expression: `@geolibre/map`
1607
- * compiles it at sync time (see `compileQuickFilters`) and combines the
1608
- * result with the transient filters and the rule-based visibility filter, so
1609
- * a host page's filter and a user's filter narrow the layer together.
1610
- */
1611
- quickFilters?: LayerQuickFilter[];
1612
- sourcePath?: string;
1613
- /**
1614
- * Id of the {@link LayerGroup} this layer belongs to, or `undefined` when the
1615
- * layer sits at the top level of the layer panel. Layers sharing a `groupId`
1616
- * are kept contiguous in the store's flat `layers` array so the group renders
1617
- * as one block; see `@geolibre/core`'s `layer-groups` helpers.
1618
- */
1619
- groupId?: string;
1620
- /**
1621
- * Project-persisted connection policy for reloadable layers. Runtime timers
1622
- * are reconstructed from this record when a project opens.
1623
- */
1624
- connection?: LayerConnection;
1625
- }
1626
- /**
1627
- * Options for {@link AppState.addTileLayer}: a native raster tile layer (XYZ,
1628
- * WMS, or WMTS) that appears in the Layers panel and persists with the project,
1629
- * just like a layer added through the Add Data dialog. Mirrors the raster
1630
- * `source` fields MapLibre understands so an external plugin can register tile
1631
- * layers without touching the map directly.
1632
- */
1633
- export interface AddTileLayerOptions {
1634
- /**
1635
- * One or more XYZ tile URL templates (with `{x}`/`{y}`/`{z}` placeholders).
1636
- * At least one non-empty template is required, or the layer renders nothing.
1637
- */
1638
- tiles: string[];
1639
- /**
1640
- * Layer discriminator, controlling how the layer is labelled and (for WMS)
1641
- * dev-server proxied. Defaults to `"xyz"`. The layer's `source.type` is
1642
- * always `"raster"`, so any other value (such as `"vector-tiles"` from an
1643
- * untyped JS caller) throws rather than persisting a mislabelled source.
1644
- */
1645
- type?: "xyz" | "wms" | "wmts" | "raster";
1646
- /** Service or base URL recorded on the source for display and restore. */
1647
- url?: string;
1648
- /** Tile size in pixels (default 256). */
1649
- tileSize?: number;
1650
- /** Attribution string shown in the map's attribution control. */
1651
- attribution?: string;
1652
- /** Visible extent as `[west, south, east, north]` in WGS84 degrees. */
1653
- bounds?: [number, number, number, number];
1654
- /** Minimum zoom at which tiles are requested. */
1655
- minzoom?: number;
1656
- /** Maximum zoom at which tiles are requested. */
1657
- maxzoom?: number;
1658
- /** Tile y-axis scheme; `"tms"` flips the y origin. Defaults to `"xyz"`. */
1659
- scheme?: "xyz" | "tms";
1660
- /** Initial visibility (default true). */
1661
- visible?: boolean;
1662
- /** Initial opacity in [0, 1] (default 1). */
1663
- opacity?: number;
1664
- /**
1665
- * Extra source fields merged onto the layer's `source` (e.g. the WMS
1666
- * `layers`/`styles`/`format` recorded for restore). The required `type`,
1667
- * `tiles`, and `tileSize` always win over keys supplied here.
1668
- */
1669
- source?: Record<string, unknown>;
1670
- /** Extra metadata merged onto the layer record. */
1671
- metadata?: Record<string, unknown>;
1672
- }
1673
- /**
1674
- * A named, collapsible folder in the layer panel that organizes a contiguous
1675
- * run of layers. Groups may be nested by referencing another group as their
1676
- * parent; the root groups omit `parentId`.
1677
- *
1678
- * The group's `visible` flag and `opacity` multiplier are folded into each
1679
- * child layer's effective render state by `applyGroupEffects` before the map
1680
- * syncs, so children keep their own stored `visible`/`opacity` values.
1681
- */
1682
- export interface LayerGroup {
1683
- id: string;
1684
- name: string;
1685
- /** Parent folder id, or undefined when this folder is at the panel root. */
1686
- parentId?: string;
1687
- /** When true, the group's children are hidden in the panel (not on the map). */
1688
- collapsed: boolean;
1689
- /** Group-level visibility; ANDed with each child layer's own visibility. */
1690
- visible: boolean;
1691
- /** Group-level opacity in [0, 1]; multiplied into each child's opacity. */
1692
- opacity: number;
1693
- }
1694
- /**
1695
- * Metadata `sourceKind` marking a live SQL query layer: a GeoJSON-backed layer
1696
- * created from a SQL Workspace result whose DuckDB statement is stored on the
1697
- * layer metadata and re-executed on refresh. Defined here so the desktop app
1698
- * (which owns the query/refresh logic) and `@geolibre/plugins` (which excludes
1699
- * these layers from in-place geometry editing) share one value.
1700
- */
1701
- export declare const SQL_QUERY_SOURCE_KIND = "sql-query";
1702
- /**
1703
- * Metadata `sourceKind` marking a NetCDF/HDF grid baked into an `image` overlay,
1704
- * as opposed to the KML ground overlays that otherwise use that layer type.
1705
- *
1706
- * Defined here so `@geolibre/map` (which must not run its feature-query identify
1707
- * on these) and the desktop app (which owns the symbology panel, the pixel
1708
- * readout, and the spectral profile) share one value.
1709
- */
1710
- export declare const NETCDF_IMAGE_SOURCE_KIND = "netcdf-image";
1711
- /**
1712
- * Detect a DuckDB query layer rendered through the plugin's external deck.gl
1713
- * overlay. Shared by `@geolibre/map`, `@geolibre/plugins`, and the desktop
1714
- * app so the detection criteria cannot drift.
1715
- */
1716
- export declare function isDuckDBQueryLayer(layer: Pick<GeoLibreLayer, "metadata" | "type"> | undefined): boolean;
1717
- export interface MapViewState {
1718
- center: [number, number];
1719
- zoom: number;
1720
- bearing: number;
1721
- pitch: number;
1722
- bbox?: [number, number, number, number];
1723
- }
1724
- /**
1725
- * Multi-map (split/grid) support. The workspace can show several map panes in a
1726
- * `rows x cols` grid. Pane 0 is always the *primary* map: it keeps the existing
1727
- * single-map wiring (the global `mapView` + `basemap*` fields, the layer/style
1728
- * panels, plugins, deck.gl). Panes 1..N are *secondary* maps described by
1729
- * `SecondaryMapView` records: every pane shares the same basemap and the same
1730
- * `layers`, but each secondary pane may override which layers are visible so
1731
- * different panes can show different layers. When `syncView` is on,
1732
- * panning/zooming any pane mirrors the camera to every other pane.
1733
- */
1734
- export interface MapGridLayout {
1735
- /** Grid rows (>= 1). */
1736
- rows: number;
1737
- /** Grid columns (>= 1). `rows * cols` is the total number of panes. */
1738
- cols: number;
1739
- /** When true, all panes share a synchronized camera. */
1740
- syncView: boolean;
1741
- }
1742
- /**
1743
- * Which engine draws a map pane.
1744
- *
1745
- * `"maplibre"` is the 2D MapLibre GL map that owns the app's plugin, styling,
1746
- * and deck.gl integrations. `"cesium"` is the 3D globe (see `CesiumCanvas`),
1747
- * which renders the same shared store state — camera, basemap, layers, group
1748
- * effects — through CesiumJS. `"mapbox"` is Mapbox GL JS and `"arcgis"` the
1749
- * ArcGIS Maps SDK for JavaScript, loaded from Esri's CDN at runtime (see
1750
- * `ArcgisCanvas`); both draw the same store state through their own engines.
1751
- *
1752
- * Used both for secondary panes ({@link SecondaryMapView.viewKind}) and for the
1753
- * primary workspace ({@link GeoLibreProject.primaryRenderer}), so the two never
1754
- * drift apart.
1755
- */
1756
- export type MapRendererKind = "maplibre" | "cesium" | "mapbox" | "arcgis";
1757
- /**
1758
- * The engine that draws the primary map area when a project says nothing. The
1759
- * 2D map: it is the renderer every tool, plugin, and panel is wired to, so an
1760
- * existing project (and a new one) opens exactly as it always did.
1761
- */
1762
- export declare const DEFAULT_PRIMARY_RENDERER: MapRendererKind;
1763
- /**
1764
- * A non-primary map pane: shares the primary map's basemap and layers, with its
1765
- * own camera and per-layer visibility overrides.
1766
- */
1767
- export interface SecondaryMapView {
1768
- /** Stable id, used as the React key and the sync-group registration id. */
1769
- id: string;
1770
- view: MapViewState;
1771
- /** Optional user-entered label shown on the pane (e.g. a date or scenario). */
1772
- label?: string;
1773
- /**
1774
- * Which rendering engine draws this pane. Defaults to `"maplibre"` (the 2D
1775
- * map) when absent, so existing projects and panes are unchanged. `"cesium"`
1776
- * renders a 3D globe (see {@link CesiumCanvas}) over the same shared layers.
1777
- */
1778
- viewKind?: MapRendererKind;
1779
- /**
1780
- * Per-layer visibility overrides keyed by layer id. A layer absent from this
1781
- * map inherits the primary map's visibility (`layer.visible`); an entry forces
1782
- * the layer visible (`true`) or hidden (`false`) in this pane only.
1783
- */
1784
- layerVisibility: Record<string, boolean>;
1785
- }
1786
- /** The default single-map grid (one pane, sync enabled so it turns on cleanly). */
1787
- export declare const DEFAULT_MAP_GRID_LAYOUT: MapGridLayout;
1788
- /** Maximum rows or columns in the map grid (so at most a 4x4 = 16-pane grid). */
1789
- export declare const MAX_MAP_GRID_DIM = 4;
1790
- /**
1791
- * Live multi-user collaboration (issue #307). These types describe the
1792
- * *ephemeral* session state the store holds while a live session is active. It
1793
- * is intentionally never written to the `.geolibre.json` project file (the
1794
- * `project.ts` serializers never read it) and never tracked in undo history (the
1795
- * store's `partialize` never lists it), so it resets cleanly on reload.
1796
- */
1797
- export type CollaborationRole = "host" | "guest";
1798
- /** Whether guests may edit (`co-edit`) or only watch (`view-only`). */
1799
- export type CollaborationMode = "view-only" | "co-edit";
1800
- export interface ParticipantIdentity {
1801
- provider: string;
1802
- userId: string;
1803
- username: string;
1804
- }
1805
- export interface CollabInvite {
1806
- token: string;
1807
- role: CollaborationMode;
1808
- createdAt: number;
1809
- maxUses?: number;
1810
- useCount: number;
1811
- revoked: boolean;
1812
- }
1813
- export interface CollaborationParticipant {
1814
- clientId: string;
1815
- displayName: string;
1816
- color: string;
1817
- role: CollaborationRole;
1818
- /**
1819
- * Host-set per-participant edit override (#754). `null` follows the session
1820
- * `mode`; `true`/`false` pins this participant to can-edit / view-only. Always
1821
- * `null` for the host (the host can always edit).
1822
- */
1823
- editOverride: boolean | null;
1824
- /** Optional account identity when signed-in identity binding is enabled. */
1825
- identity?: ParticipantIdentity | null;
1826
- }
1827
- /** A remote participant's live cursor + viewport, used to render presence. */
1828
- export interface CollaborationPresence {
1829
- displayName: string;
1830
- color: string;
1831
- cursor?: {
1832
- lng: number;
1833
- lat: number;
1834
- } | null;
1835
- view?: MapViewState | null;
1836
- }
1837
- /** One in-session chat message (#754). Ephemeral; never persisted to a project. */
1838
- export interface CollaborationChatMessage {
1839
- /** Server-assigned id (stable React key / dedupe). */
1840
- id: string;
1841
- /** clientId of the author. */
1842
- clientId: string;
1843
- displayName: string;
1844
- color: string;
1845
- text: string;
1846
- /** Optional map coordinate the author attached; clickable to recenter. */
1847
- coordinate?: {
1848
- lng: number;
1849
- lat: number;
1850
- } | null;
1851
- /** Server-assigned epoch-ms timestamp. */
1852
- ts: number;
1853
- }
1854
- export interface CollaborationState {
1855
- /** True once connected and joined to a session. */
1856
- isActive: boolean;
1857
- /** True while connecting/reconnecting (UI shows a spinner). */
1858
- connecting: boolean;
1859
- sessionId: string | null;
1860
- clientId: string | null;
1861
- role: CollaborationRole | null;
1862
- mode: CollaborationMode;
1863
- selfName: string;
1864
- selfColor: string;
1865
- participants: CollaborationParticipant[];
1866
- /** Remote presence keyed by participant clientId (never includes self). */
1867
- presence: Record<string, CollaborationPresence>;
1868
- /** When true, this participant's camera follows the host's viewport. */
1869
- followHost: boolean;
1870
- /** Recent session chat, oldest first, capped to a bounded window (#754). */
1871
- chat: CollaborationChatMessage[];
1872
- /** Session flag requiring participants to be signed in. */
1873
- requireIdentity: boolean;
1874
- /**
1875
- * Whether the connected relay has an identity issuer configured. False (the
1876
- * default) means it cannot verify a sign-in, so the host UI hides the
1877
- * "require a signed-in account" toggle instead of offering a gate that would
1878
- * lock every guest out.
1879
- */
1880
- identitySupported: boolean;
1881
- /** Layer IDs marked locked by the host. */
1882
- lockedLayerIds: string[];
1883
- /** Active session invites minted by host. */
1884
- invites: CollabInvite[];
1885
- /** Last human-readable error, surfaced in the Collaborate dialog. */
1886
- error: string | null;
1887
- }
1888
- /** Map projection the renderer uses. Mirrors the GlobeControl toggle. */
1889
- export type MapProjection = "globe" | "mercator";
1890
- /**
1891
- * Unit system the scale bar reports distances in. `"metric"` uses m/km,
1892
- * `"imperial"` uses ft/mi, and `"nautical"` uses nautical miles.
1893
- */
1894
- export type MapScaleUnit = "metric" | "imperial" | "nautical";
1895
- export interface MapPreferences {
1896
- restrictBounds: boolean;
1897
- bounds: [number, number, number, number];
1898
- minZoom: number;
1899
- maxZoom: number;
1900
- maxPitch: number;
1901
- renderWorldCopies: boolean;
1902
- projection: MapProjection;
1903
- /**
1904
- * Celestial body / ellipsoid the project's coordinates describe (keys into the
1905
- * ellipsoid registry in `@geolibre/core`). Drives measurement radii and pairs
1906
- * with planetary basemaps. Defaults to `"earth"` (WGS 84).
1907
- */
1908
- ellipsoidId: string;
1909
- /**
1910
- * Unit system the scale bar displays. Defaults to `"metric"`; switch to
1911
- * `"imperial"` for feet/miles or `"nautical"` for nautical miles.
1912
- */
1913
- scaleUnit: MapScaleUnit;
1914
- /**
1915
- * Whether the status bar resolves and shows the ground elevation under the
1916
- * pointer (issue #1813). **Defaults to `false`**: with 3D terrain off the
1917
- * lookup falls back to the public Open-Meteo service, so hovering would send
1918
- * coordinates off the device for a readout the user never asked for. Toggled
1919
- * from Controls -> Elevation.
1920
- */
1921
- showPointerElevation: boolean;
1922
- /** Whether the built-in 3D terrain control and terrain surface are enabled. */
1923
- terrainEnabled: boolean;
1924
- /** Mapbox-only style. New projects use Streets; absent follows the shared basemap. */
1925
- mapboxStyleUrl?: string;
1926
- /**
1927
- * ArcGIS-only basemap: an Esri basemap style id (`arcgis/streets`,
1928
- * `arcgis/imagery`, `osm/standard`, ...). New projects use Streets. Absent
1929
- * follows the shared basemap, translated to tiles the SDK can draw; the id
1930
- * is also set aside when no ArcGIS API key is configured, since Esri's
1931
- * basemap styles service requires one.
1932
- */
1933
- arcgisBasemap?: string;
1934
- /** Cesium imagery override; absent follows the shared project basemap. */
1935
- cesiumBasemap?: CesiumBasemapId;
1936
- /**
1937
- * Notation the status bar reports the pointer coordinate in: `"dd"` decimal
1938
- * degrees (default), `"dms"` degrees/minutes/seconds, `"ddm"` degrees and
1939
- * decimal minutes, or `"utm"` zone easting/northing. Stored as a string
1940
- * rather than a union so `@geolibre/core` does not have to depend on the
1941
- * formatter, which lives with the app's DMS helpers and the Gridlines
1942
- * plugin's UTM projection; the app normalises unknown values to `"dd"`.
1943
- */
1944
- coordinateFormat: string;
1945
- }
1946
- export interface RuntimeEnvironmentVariable {
1947
- key: string;
1948
- value: string;
1949
- enabled: boolean;
1950
- /**
1951
- * Absent or `true`: the value is a secret (desktop keeps it in the OS
1952
- * keychain; every egress removes it). `false`: an ordinary value saved in the
1953
- * project and kept on share/export.
1954
- */
1955
- secret?: boolean;
1956
- }
1957
- declare global {
1958
- interface Window {
1959
- __GEOLIBRE_RUNTIME_ENV__?: Record<string, string>;
1960
- }
1961
- }
1962
- /**
1963
- * Geocoding backend selection persisted in the project. The provider id keys
1964
- * into the geocoding registry in `@geolibre/core`; API keys are stored per
1965
- * provider so switching backends does not discard the others' keys. Empty
1966
- * endpoint overrides fall back to the provider's default endpoints.
1967
- */
1968
- export interface GeocodingPreferences {
1969
- providerId: string;
1970
- /** Per-provider API key / access token, keyed by provider id. */
1971
- apiKeys: Record<string, string>;
1972
- /** Optional custom forward endpoint (else the provider default). */
1973
- forwardEndpoint?: string;
1974
- /** Optional custom reverse endpoint (else the provider default). */
1975
- reverseEndpoint?: string;
1976
- /** Contact email sent to identify the client (used by Nominatim). */
1977
- email?: string;
1978
- }
1979
- export interface ProjectPreferences {
1980
- map: MapPreferences;
1981
- environmentVariables: RuntimeEnvironmentVariable[];
1982
- geocoding: GeocodingPreferences;
1983
- }
1984
- export type ProjectPluginControlPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
1985
- export interface ProjectPluginState {
1986
- manifestUrls: string[];
1987
- activePluginIds: string[];
1988
- mapControlPositions: Record<string, ProjectPluginControlPosition>;
1989
- settings: Record<string, unknown>;
1990
- }
1991
- export declare const DEFAULT_PROJECT_PREFERENCES: ProjectPreferences;
1992
- /**
1993
- * A single user override for one legend item, keyed in {@link LegendConfig.overrides}
1994
- * by a stable item key (a layer id for a whole entry, or `${layerId}::${index}`
1995
- * for an individual class within a graduated/categorized entry).
1996
- */
1997
- export interface LegendItemOverride {
1998
- /** User-supplied label that replaces the auto-generated one. */
1999
- label?: string;
2000
- /** When true, the item is omitted from the rendered legend. */
2001
- hidden?: boolean;
2002
- }
2003
- /** Swatch shape for a hand-authored legend item. */
2004
- export type LegendCustomShape = "square" | "circle" | "line";
2005
- /** One hand-authored legend item: a color swatch plus its label. */
2006
- export interface LegendCustomItem {
2007
- /** Display label (e.g. an NLCD class name). */
2008
- label: string;
2009
- /** Swatch color as a CSS color (typically `#rrggbb`). */
2010
- color: string;
2011
- /** Swatch shape; defaults to `"square"`. */
2012
- shape?: LegendCustomShape;
2013
- /**
2014
- * Symbol size in map pixels (circle radius / line width). Carried so that
2015
- * customizing a proportional-symbol entry keeps the graduated sizes it was
2016
- * seeded from instead of flattening every symbol to one size.
2017
- */
2018
- size?: number;
2019
- }
2020
- /**
2021
- * A hand-authored legend entry. Keyed by layer id it REPLACES that layer's
2022
- * auto-derived classes (the fallback when automatic derivation is wrong or
2023
- * impossible, e.g. a paletted land-cover raster like NLCD); keyed by a
2024
- * `custom:` id it renders as a standalone section not tied to any layer.
2025
- */
2026
- export interface LegendCustomEntry {
2027
- /** Optional heading; a layer-keyed entry falls back to the layer name. */
2028
- title?: string;
2029
- /** The items to render, top to bottom. */
2030
- items: LegendCustomItem[];
2031
- }
2032
- /** Map corner the on-map legend panel docks to. */
2033
- export type LegendPanelPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
2034
- /**
2035
- * User customizations for the legend (the on-map Legend panel and the Print
2036
- * Layout legend). The legend itself is always derived from the visible layers'
2037
- * symbology; this record only stores the edits layered on top (title, ordering,
2038
- * per-item rename/hide, hand-authored entries), so it survives layer additions
2039
- * and removals and is persisted in the `.geolibre.json` project.
2040
- */
2041
- export interface LegendConfig {
2042
- /** Heading drawn above the legend entries. */
2043
- title: string;
2044
- /** When true, classes are grouped under a per-layer heading. */
2045
- groupByLayer: boolean;
2046
- /**
2047
- * Custom top-level entry order by layer id, top-first. Layer ids not listed
2048
- * keep their default order after the listed ones.
2049
- */
2050
- order: string[];
2051
- /** Per-item overrides keyed by stable item key. */
2052
- overrides: Record<string, LegendItemOverride>;
2053
- /**
2054
- * Hand-authored entries keyed by layer id (replacing that layer's
2055
- * auto-derived classes) or by a standalone `custom:` id. See
2056
- * {@link LegendCustomEntry}.
2057
- */
2058
- customEntries?: Record<string, LegendCustomEntry>;
2059
- /** Whether the on-map Legend panel is open (persisted with the project). */
2060
- panelVisible?: boolean;
2061
- /** Whether the open panel is collapsed to just its header bar. */
2062
- panelCollapsed?: boolean;
2063
- /** Map corner the on-map Legend panel docks to; defaults to `"top-left"`. */
2064
- panelPosition?: LegendPanelPosition;
2065
- /**
2066
- * User-resized panel width in px (via the corner drag handles). Absent means
2067
- * the default width; height absent means auto-fit to content within the map.
2068
- */
2069
- panelWidth?: number;
2070
- /** User-resized panel height in px. See {@link LegendConfig.panelWidth}. */
2071
- panelHeight?: number;
2072
- }
2073
- export declare const DEFAULT_LEGEND_CONFIG: LegendConfig;
2074
- /** Camera target captured for a story chapter. */
2075
- export interface StoryChapterLocation {
2076
- center: [number, number];
2077
- zoom: number;
2078
- pitch: number;
2079
- bearing: number;
2080
- }
2081
- /** Where a chapter's text panel sits over the map. */
2082
- export type StoryChapterAlignment = "left" | "center" | "right" | "full";
2083
- /** How the map transitions to a chapter's location. */
2084
- export type StoryChapterAnimation = "flyTo" | "easeTo" | "jumpTo";
2085
- /** A layer opacity change triggered when a chapter is entered or exited. */
2086
- export interface StoryLayerOpacityChange {
2087
- /** Stable identity for React list keys; optional for older project files. */
2088
- id?: string;
2089
- /** GeoLibre store layer id whose opacity should change. */
2090
- layerId: string;
2091
- opacity: number;
2092
- /** Transition duration in milliseconds. */
2093
- duration?: number;
2094
- }
2095
- /** A single scene in a scroll-driven story map. */
2096
- export interface StoryChapter {
2097
- id: string;
2098
- title: string;
2099
- description: string;
2100
- /** Optional image shown in the chapter panel (URL or data URI). */
2101
- image?: string;
2102
- alignment: StoryChapterAlignment;
2103
- /** Hide the text panel while still transitioning the map. */
2104
- hidden: boolean;
2105
- location: StoryChapterLocation;
2106
- mapAnimation: StoryChapterAnimation;
2107
- /** Slowly rotate the camera once the transition settles. */
2108
- rotateAnimation: boolean;
2109
- onChapterEnter: StoryLayerOpacityChange[];
2110
- onChapterExit: StoryLayerOpacityChange[];
2111
- }
2112
- export type StoryInsetPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
2113
- /**
2114
- * A non-chapter intro/outro slide shown before the first or after the last
2115
- * chapter (#998). `"none"` disables it. The remaining modes are:
2116
- * - `"blank"` a solid screen in the panel theme color,
2117
- * - `"black"` a solid black screen,
2118
- * - `"global"` a zoomed-out global view of the map with no text,
2119
- * - `"adjacent"` the camera of the neighboring chapter (the first chapter for
2120
- * the start slide, the last chapter for the closing slide) with all text and
2121
- * media hidden, so the presenter can zoom into the full content next.
2122
- */
2123
- export type StorySlideMode = "none" | "blank" | "black" | "global" | "adjacent";
2124
- /** A start/closing slide that is actually shown (every mode except `"none"`). */
2125
- export type StoryActiveSlideMode = Exclude<StorySlideMode, "none">;
2126
- /** Scroll-driven story map authored on top of a GeoLibre project. */
2127
- export interface StoryMap {
2128
- title: string;
2129
- subtitle: string;
2130
- byline: string;
2131
- footer: string;
2132
- theme: "light" | "dark";
2133
- showMarkers: boolean;
2134
- markerColor: string;
2135
- inset: boolean;
2136
- insetPosition: StoryInsetPosition;
2137
- /**
2138
- * Start the presentation with the chapter itinerary/navigation panel hidden,
2139
- * revealing chapters one at a time instead of listing every upcoming location
2140
- * up front (#995). The presenter still offers a toggle to open the list.
2141
- */
2142
- hideChapterNav: boolean;
2143
- /** Optional intro slide shown before the first chapter (#998). */
2144
- startSlide: StorySlideMode;
2145
- /** Optional closing slide shown after the last chapter (#998). */
2146
- endSlide: StorySlideMode;
2147
- chapters: StoryChapter[];
2148
- }
2149
- export declare const DEFAULT_STORY_MAP: StoryMap;
2150
- /**
2151
- * One step in a {@link ProcessingModel}: a processing tool invoked with a fixed
2152
- * set of parameters. The runner chains steps by feeding each step's output layer
2153
- * into the next step's input layer parameter (`inputParam`, default `"layer"`),
2154
- * so a step's stored `parameters` for that input is ignored for every step after
2155
- * the first.
2156
- */
2157
- export interface ProcessingModelStep {
2158
- /** Stable id, unique within the model (used as the React key and run label). */
2159
- id: string;
2160
- /** The processing tool's registry id (e.g. `"buffer"`). */
2161
- toolId: string;
2162
- /** Parameter values keyed by the tool's parameter ids. */
2163
- parameters: Record<string, unknown>;
2164
- /**
2165
- * Which `type: "layer"` parameter receives the previous step's output. Defaults
2166
- * to `"layer"`; set it for tools whose primary input is named differently.
2167
- */
2168
- inputParam?: string;
2169
- }
2170
- /**
2171
- * What flows along a model edge. Vector nodes exchange FeatureCollections;
2172
- * raster nodes exchange GeoTIFF bytes. A port declaring `"any"` accepts either
2173
- * and is resolved to a concrete kind at run time by whatever is wired into it.
2174
- */
2175
- export type ModelPortKind = "vector" | "raster" | "any";
2176
- /** One connection point on a {@link ModelGraphNode}. */
2177
- export interface ModelGraphPort {
2178
- /**
2179
- * Port id, unique within its node and direction. For a tool node's inputs
2180
- * this is the underlying tool parameter id, so wiring an edge and setting the
2181
- * parameter by hand are the same operation.
2182
- */
2183
- id: string;
2184
- label: string;
2185
- kind: ModelPortKind;
2186
- /** Inputs only: the run fails when nothing is wired in and no value is set. */
2187
- required?: boolean;
2188
- }
2189
- /**
2190
- * What a node does. `input` sources an existing project layer, `tool` runs a
2191
- * processing algorithm, and `output` names a result to add back to the map.
2192
- */
2193
- export type ModelGraphNodeKind = "input" | "tool" | "output";
2194
- /** One node on the Model Builder canvas. */
2195
- export interface ModelGraphNode {
2196
- /** Stable id, unique within the graph; referenced by {@link ModelGraphEdge}. */
2197
- id: string;
2198
- kind: ModelGraphNodeKind;
2199
- /** Canvas position in graph coordinates (unscaled by zoom). */
2200
- x: number;
2201
- y: number;
2202
- /** `input` nodes: the project layer id this node sources. */
2203
- layerId?: string;
2204
- /**
2205
- * `tool` nodes: the tool's id within {@link provider}'s registry. Kept
2206
- * separate from the provider so the same short id can exist in both.
2207
- */
2208
- toolId?: string;
2209
- /** `tool` nodes: which registry resolves {@link toolId}. */
2210
- provider?: ModelToolProvider;
2211
- /** `tool` nodes: parameter values for everything not supplied by an edge. */
2212
- parameters?: Record<string, unknown>;
2213
- /** `output` nodes: the layer name given to the result added to the map. */
2214
- name?: string;
2215
- }
2216
- /**
2217
- * A directed connection from one node's output port to another node's input
2218
- * port. Ports are named, so a tool with several inputs (Clip's target and
2219
- * overlay, say) wires each one unambiguously.
2220
- */
2221
- export interface ModelGraphEdge {
2222
- id: string;
2223
- from: string;
2224
- fromPort: string;
2225
- to: string;
2226
- toPort: string;
2227
- }
2228
- /** The node-and-edge graph authored on the Model Builder canvas. */
2229
- export interface ProcessingModelGraph {
2230
- nodes: ModelGraphNode[];
2231
- edges: ModelGraphEdge[];
2232
- }
2233
- /** Which registry a {@link ModelGraphNode.toolId} is resolved against. */
2234
- export type ModelToolProvider = "vector" | "whitebox";
2235
- /**
2236
- * A reusable processing pipeline ("model" in QGIS Graphical Modeler / ArcGIS
2237
- * ModelBuilder terms), saved in the project file so it can be reloaded and
2238
- * re-run.
2239
- *
2240
- * Two shapes coexist. {@link steps} is the original strictly linear chain, and
2241
- * remains the only thing older builds understand. {@link graph} is the
2242
- * Model Builder's directed graph, which supports multi-input tools, branches
2243
- * and merges. When both are present `graph` wins; a model saved by the canvas
2244
- * also writes a `steps` projection whenever its graph happens to be a single
2245
- * chain, so older builds can still run it.
2246
- */
2247
- export interface ProcessingModel {
2248
- id: string;
2249
- name: string;
2250
- steps: ProcessingModelStep[];
2251
- graph?: ProcessingModelGraph;
2252
- }
2253
- /**
2254
- * Which dialog family executed a {@link ProcessingRun}. Drives the History
2255
- * panel's re-run routing: each kind maps to the dialog (and store open-flag)
2256
- * that can be reopened pre-filled with the run's parameters.
2257
- */
2258
- export type ProcessingRunKind = "vector" | "statistics" | "network" | "whitebox" | "raster" | "conversion" | "algorithm";
2259
- export type ProcessingRunStatus = "success" | "error";
2260
- /** Upper bound on persisted processing-history entries (oldest are dropped). */
2261
- export declare const MAX_PROCESSING_HISTORY = 100;
2262
- /**
2263
- * One recorded processing tool run (issue #1292). Appended by every processing
2264
- * dialog when a run finishes and persisted in the project file, so a saved
2265
- * project documents how its derived layers were produced. Parameter values are
2266
- * stored exactly as the dialog dispatched them (layer parameters hold layer
2267
- * ids), which is what re-run pre-fills and "Copy as Python" emit.
2268
- */
2269
- export interface ProcessingRun {
2270
- /** Stable id, unique within the project (React key and update key). */
2271
- id: string;
2272
- kind: ProcessingRunKind;
2273
- /** The tool's registry id (e.g. `"buffer"`, `"slope"`). */
2274
- toolId: string;
2275
- /** Human-readable tool name captured at run time. */
2276
- toolName: string;
2277
- /** Engine that executed the run: `client`, `wasm`, `sidecar`, `pyodide`, `browser`. */
2278
- engine: string;
2279
- /** Parameter values keyed by the tool's parameter ids. */
2280
- parameters: Record<string, unknown>;
2281
- /** Names of input layers referenced by layer parameters, keyed by layer id. */
2282
- inputLayerNames?: Record<string, string>;
2283
- /** Names of layers the run added to the map. */
2284
- outputLayerNames?: string[];
2285
- /** Input file path/name, for file-based tools (raster/conversion). */
2286
- inputPath?: string;
2287
- /** Output file path/name, for file-based tools (raster/conversion). */
2288
- outputPath?: string;
2289
- /** ISO timestamp of when the run started. */
2290
- startedAt: string;
2291
- /** Wall-clock duration of the run in milliseconds. */
2292
- durationMs?: number;
2293
- status: ProcessingRunStatus;
2294
- /** Error message when `status` is `"error"`. */
2295
- error?: string;
2296
- }
2297
- /**
2298
- * A pending "re-run from History" request. The History panel writes it to the
2299
- * store and opens the target dialog; the dialog consumes it (pre-filling its
2300
- * parameter form) and clears it. `autoRun` asks the dialog to start the run
2301
- * immediately after pre-filling (plain Re-run vs Edit & re-run).
2302
- */
2303
- export interface ProcessingRerunRequest {
2304
- kind: ProcessingRunKind;
2305
- toolId: string;
2306
- parameters: Record<string, unknown>;
2307
- /** Engine to preselect, when the dialog offers a choice. */
2308
- engine?: string;
2309
- autoRun?: boolean;
2310
- }
2311
- /** Column-count bounds for the Dashboard panel's widget grid. */
2312
- export declare const MIN_DASHBOARD_COLUMNS = 1;
2313
- export declare const MAX_DASHBOARD_COLUMNS = 6;
2314
- export declare const DEFAULT_DASHBOARD_COLUMNS = 2;
2315
- /** The chart a {@link DashboardWidget} draws. Mirrors the attribute Charts
2316
- * panel's types so a widget reuses the same rendering. The `"indicator"` type
2317
- * is a non-chart KPI tile (issue #1381). */
2318
- export type DashboardWidgetType = "histogram" | "scatter" | "bar" | "line" | "box" | "pie" | "indicator" | "selector" | "list";
2319
- /** How a bar widget reduces its category groups. */
2320
- export type DashboardWidgetAggregation = "count" | "sum" | "mean";
2321
- /**
2322
- * One chart in the Dashboard panel: a chart type bound to a layer and the
2323
- * field(s) it plots. Which `field*`/`category`/`aggregation` keys apply depends
2324
- * on `type` (histogram/line/box use `field`; scatter uses `xField`/`yField`;
2325
- * bar uses `category` + `aggregation` and, for sum/mean, `valueField`). Unused
2326
- * keys are simply ignored, so the record stays flat and easy to hand-edit.
2327
- * Saved in the project file so a dashboard reopens with its widgets intact.
2328
- */
2329
- export interface DashboardWidget {
2330
- /** Stable id, unique within the project (React key and store key). */
2331
- id: string;
2332
- /** The layer whose features feed this widget. */
2333
- layerId: string;
2334
- /** The chart to draw. */
2335
- type: DashboardWidgetType;
2336
- /** Optional custom title; the panel derives a label from the fields if absent. */
2337
- title?: string;
2338
- /** Optional hex color (`#rgb`/`#rrggbb`) for the chart's marks. Single-series
2339
- * charts use it as the series color; bar/pie use it as the base of a
2340
- * monochromatic ramp. Defaults to the theme primary / multi-color palette. */
2341
- color?: string;
2342
- /** Value field for histogram/line/box. */
2343
- field?: string;
2344
- /** X-axis field for scatter. */
2345
- xField?: string;
2346
- /** Y-axis field for scatter. */
2347
- yField?: string;
2348
- /** Number of bins for a histogram. */
2349
- bins?: number;
2350
- /** Category field for a bar chart. */
2351
- category?: string;
2352
- /** Aggregation for a bar chart (default `count`). */
2353
- aggregation?: DashboardWidgetAggregation;
2354
- /** Value field a bar chart's sum/mean reduces (ignored for `count`). */
2355
- valueField?: string;
2356
- /** Indicator widget: aggregation function for the KPI value (issue #1381).
2357
- * Extends bar aggregation with min, max, and median. */
2358
- indicatorAggregation?: IndicatorAggregation;
2359
- /** Indicator widget: optional prefix (e.g. "€", "$"). */
2360
- prefix?: string;
2361
- /** Indicator widget: optional suffix (e.g. " kg", " ha"). */
2362
- suffix?: string;
2363
- /** Selector widget: whether multiple values can be picked (default false). */
2364
- multiple?: boolean;
2365
- /** List widget: columns to display. */
2366
- listFields?: string[];
2367
- /** List widget: field to sort by. */
2368
- sortBy?: string;
2369
- /** List widget: sort direction (default "desc"). */
2370
- sortDir?: "asc" | "desc";
2371
- /** List widget: max rows to show (default 20). */
2372
- limit?: number;
2373
- }
2374
- /** Aggregation functions for indicator widgets (issue #1381). Extends the bar
2375
- * widget aggregation with min, max, and median. */
2376
- export type IndicatorAggregation = "count" | "sum" | "mean" | "min" | "max" | "median";
2377
- /**
2378
- * What slice of a layer's styling a Style Manager entry captures (issue #1294).
2379
- *
2380
- * - `"style"`: the layer's complete {@link LayerStyle} snapshot.
2381
- * - `"symbol"`: fill/stroke/marker/pattern symbology only, so it can restyle a
2382
- * layer without touching its labels or renderer configuration.
2383
- * - `"labels"`: the {@link LabelStyle} block only.
2384
- * - `"ramp"`: the color ramp + classification settings only (ramp name, class
2385
- * count, classification scheme), independent of the attribute the target
2386
- * layer classifies on.
2387
- */
2388
- export type StyleLibraryEntryKind = "style" | "symbol" | "labels" | "ramp";
2389
- /**
2390
- * One saved, reusable style in the Style Manager library (issue #1294). The
2391
- * payload is a {@link LayerStyle} subset chosen by {@link kind}; applying an
2392
- * entry merges that subset onto the target layer's style. Entries live either
2393
- * in the app-level library (persisted across projects) or embedded in a
2394
- * project file's `styleLibrary` array.
2395
- */
2396
- export interface StyleLibraryEntry {
2397
- /** Stable id, used as the IndexedDB/store key; upserts overwrite by id. */
2398
- id: string;
2399
- /** Display name shown in the Style Manager. */
2400
- name: string;
2401
- /** Which style subset {@link style} carries. */
2402
- kind: StyleLibraryEntryKind;
2403
- /** Free-form tags for filtering the library. */
2404
- tags: string[];
2405
- /** The saved {@link LayerStyle} subset (see {@link kind}). */
2406
- style: Partial<LayerStyle>;
2407
- /** ISO timestamp of the last save; empty for built-in presets. */
2408
- updatedAt: string;
2409
- }
2410
- /**
2411
- * One saved, re-addable layer in the Layer Library (issue #1520) — the "My
2412
- * Data" section of the Browser panel. Stores the layer's **source
2413
- * specification** plus its full presentation state (style, labels, filters,
2414
- * joins, virtual fields, attribute form), deliberately *not* the data, so the
2415
- * library stays small and an entry always reflects the current contents of its
2416
- * source.
2417
- *
2418
- * The exception is a layer whose features exist only in memory (drawn features,
2419
- * processing output) or in a local file: those have no re-fetchable source, so
2420
- * their features are embedded in {@link geojson} behind a size cap. See
2421
- * `layer-library.ts` for how an entry is captured and re-added.
2422
- */
2423
- export interface LayerLibraryEntry {
2424
- /** Stable id, used as the IndexedDB/store key; upserts overwrite by id. */
2425
- id: string;
2426
- /** Display name shown in the Browser panel's My Data section. */
2427
- name: string;
2428
- /** ISO timestamp of the last save. */
2429
- addedAt: string;
2430
- /** The layer type to recreate ({@link GeoLibreLayer.type}). */
2431
- layerType: LayerType;
2432
- /** The MapLibre/plugin source spec to recreate the layer from. */
2433
- source: Record<string, unknown>;
2434
- /** The saved layer's complete {@link LayerStyle} (labels included). */
2435
- style: LayerStyle;
2436
- /** Layer opacity in [0, 1]. */
2437
- opacity: number;
2438
- /** The layer metadata the renderers and plugin sync modules key off. */
2439
- metadata: Record<string, unknown>;
2440
- /** Absolute local path, for a layer read from a file on disk. */
2441
- sourcePath?: string;
2442
- /** Persistent attribute joins to reapply. */
2443
- joins?: LayerJoin[];
2444
- /** Expression-backed virtual fields to reapply. */
2445
- virtualFields?: LayerVirtualField[];
2446
- /** Per-field edit-widget/constraint configuration to reapply. */
2447
- attributeForm?: AttributeFormConfig;
2448
- /** Popup/tooltip design to reapply. */
2449
- popup?: LayerPopupConfig;
2450
- /**
2451
- * Embedded features, present only for a layer whose source cannot be
2452
- * re-read (in-memory features) or whose local file may be unavailable.
2453
- */
2454
- geojson?: FeatureCollection;
2455
- /**
2456
- * True when the entry can only be re-added by a host that can read
2457
- * {@link sourcePath} — i.e. its features were too large to embed, so the
2458
- * desktop app must re-read the file and the browser build cannot.
2459
- */
2460
- needsLocalFile?: boolean;
2461
- }
2462
- /** One saved template in the Template Library. */
2463
- export interface ProjectTemplateEntry {
2464
- id: string;
2465
- name: string;
2466
- description?: string;
2467
- project: GeoLibreProject;
2468
- createdAt: string;
2469
- updatedAt: string;
2470
- }
2471
- export interface GeoLibreProject {
2472
- id?: string;
2473
- version: string;
2474
- name: string;
2475
- mapView: MapViewState;
2476
- basemapStyleUrl: string;
2477
- basemapVisible: boolean;
2478
- basemapOpacity: number;
2479
- /** Custom colour for the Blank background. Null uses the current theme default. */
2480
- blankBackgroundColor?: string | null;
2481
- layers: GeoLibreLayer[];
2482
- /**
2483
- * Layer selected in the Layers panel when the project was saved. Omitted by
2484
- * legacy projects; `null` deliberately restores no active layer.
2485
- */
2486
- selectedLayerId?: string | null;
2487
- /** Named folders that organize the flat `layers` list in the layer panel. */
2488
- layerGroups?: LayerGroup[];
2489
- styles: Record<string, LayerStyle>;
2490
- preferences: ProjectPreferences;
2491
- plugins?: ProjectPluginState;
2492
- /** User customizations for the Print Layout legend. */
2493
- legend?: LegendConfig;
2494
- /**
2495
- * Print Layout composer settings (title, page size, orientation, blocks,
2496
- * atlas). Omitted while the composer is untouched, so projects that never
2497
- * opened it are unaffected (GeoLibre discussion #1992).
2498
- */
2499
- printLayout?: PrintLayoutConfig;
2500
- storymap?: StoryMap;
2501
- /** Saved processing pipelines (batch/model chaining; issue #344). */
2502
- models?: ProcessingModel[];
2503
- /** Recorded processing tool runs (Processing History; issue #1292). */
2504
- processingHistory?: ProcessingRun[];
2505
- /** Saved Dashboard panel chart widgets (issue #401). */
2506
- widgets?: DashboardWidget[];
2507
- /** Number of columns in the Dashboard widget grid; omitted when default. */
2508
- dashboardColumns?: number;
2509
- /**
2510
- * Multi-map grid layout; omitted (single 1x1 pane) for default projects so
2511
- * legacy readers and single-map files are unaffected.
2512
- */
2513
- mapLayout?: MapGridLayout;
2514
- /**
2515
- * Secondary map panes (everything past the primary pane). Omitted when the
2516
- * grid is a single pane. The primary pane uses the top-level `mapView` /
2517
- * `basemap*` fields.
2518
- */
2519
- secondaryMapViews?: SecondaryMapView[];
2520
- /** User-entered label for the primary pane; omitted when empty. */
2521
- primaryMapLabel?: string;
2522
- /**
2523
- * Which engine draws the primary map area (issue #2217). Omitted for the
2524
- * default 2D map, so every project written before this existed — and every
2525
- * project that never leaves MapLibre — is byte-identical to before. A project
2526
- * saved as `"cesium"` reopens directly on the 3D globe.
2527
- *
2528
- * This is independent of {@link mapLayout}: a 1x1 workspace can be either
2529
- * renderer, and a multi-pane grid can still mix the two through each pane's
2530
- * {@link SecondaryMapView.viewKind}.
2531
- */
2532
- primaryRenderer?: MapRendererKind;
2533
- /**
2534
- * Project-scoped Style Manager entries (issue #1294), so a project can carry
2535
- * its reusable styles to teammates. Omitted when empty; the app-level
2536
- * library is persisted outside the project file and never serialized here.
2537
- */
2538
- styleLibrary?: StyleLibraryEntry[];
2539
- /** Anchored review comments on map points or features (issue #1518). */
2540
- comments?: ProjectComment[];
2541
- /**
2542
- * Interaction state applied when the project opens: the Identify target and
2543
- * which map controls and toolbar panels start shown (issue #2688). Written by
2544
- * the Python `geolibre` package from `set_identify` / `show_control`, so a
2545
- * saved or HTML-exported notebook map opens the way it was set up. Omitted
2546
- * by default; the app keeps what it loaded and writes it back unchanged.
2547
- */
2548
- interaction?: ProjectInteraction;
2549
- metadata: Record<string, unknown>;
2550
- }
2551
- /**
2552
- * Startup interaction state carried by a project (see
2553
- * {@link GeoLibreProject.interaction}).
2554
- */
2555
- export interface ProjectInteraction {
2556
- /**
2557
- * Identify target on open: a layer id, `"all"` for every visible queryable
2558
- * layer, a list of layer ids to identify only those, or `null` for off.
2559
- */
2560
- identify?: string | string[] | null;
2561
- /**
2562
- * Map control or toolbar panel name (`"search"`, `"bookmark"`, `"globe"`,
2563
- * ...) to whether it starts shown. Unknown names are ignored on open.
2564
- */
2565
- controls?: Record<string, boolean>;
2566
- }
2567
- export type CommentAnchor = {
2568
- type: "point";
2569
- lngLat: [number, number];
2570
- } | {
2571
- type: "feature";
2572
- layerId: string;
2573
- featureId: string | number;
2574
- lngLat?: [number, number];
2575
- };
2576
- export interface CommentAuthor {
2577
- name: string;
2578
- color: string;
2579
- }
2580
- export interface CommentReply {
2581
- id: string;
2582
- author: CommentAuthor;
2583
- body: string;
2584
- createdAt: string;
2585
- }
2586
- export interface ProjectComment {
2587
- id: string;
2588
- anchor: CommentAnchor;
2589
- author: CommentAuthor;
2590
- body: string;
2591
- createdAt: string;
2592
- resolved: boolean;
2593
- replies: CommentReply[];
2594
- }
2595
- export interface RecentProjectEntry {
2596
- path: string;
2597
- name: string;
2598
- openedAt: string;
2599
- }
2600
- /**
2601
- * Size at or above which a local vector file is read through DuckDB instead of
2602
- * the in-memory JavaScript readers, and the feature count above which the user
2603
- * is asked before every feature is materialized as GeoJSON.
2604
- *
2605
- * These live in core so the desktop loaders (`duckdb-vector-guard.ts`) and the
2606
- * Add Vector Layer panel (`@geolibre/plugins`, which configures the
2607
- * `maplibre-gl-vector` control's `autoThreshold`) switch strategy at the *same*
2608
- * numbers. Before they were unified the two entry points disagreed — the panel
2609
- * tiled at 25 MB / 50k while drag-and-drop stayed in memory to 100 MB — so the
2610
- * same file behaved differently depending on how it was added, and no single
2611
- * number could be documented.
2612
- */
2613
- export declare const DUCKDB_VECTOR_ROUTE_BYTES: number;
2614
- export declare const DUCKDB_VECTOR_FEATURE_WARN_COUNT = 100000;
2615
- /** A collection whose coordinates cannot be WGS84 longitude/latitude. */
2616
- export interface NonGeographicCoordinates {
2617
- /** How many coordinates were inspected. */
2618
- sampled: number;
2619
- /** The largest |x| seen — a longitude may not exceed 180. */
2620
- maxAbsX: number;
2621
- /** The largest |y| seen — a latitude may not exceed 90. */
2622
- maxAbsY: number;
2623
- }
2624
- /**
2625
- * Detect a collection that declares (or is assumed to be) WGS84 but carries
2626
- * projected coordinates — the failure mode where a layer loads cleanly, appears
2627
- * in the Layers panel, and renders nowhere because its "longitude" is a easting
2628
- * in metres or feet.
2629
- *
2630
- * GeoLibre honours whatever CRS a file declares, so a file that declares
2631
- * `CRS84`/`GCS_WGS_1984` while holding State Plane or Albers coordinates is
2632
- * passed through untouched and lands off the map with no error. Callers use
2633
- * this to warn instead of failing silently; it does not guess the true CRS,
2634
- * which only the user knows.
2635
- *
2636
- * Sampling stops at `sampleLimit` coordinates: out-of-range values are a
2637
- * property of the whole file, so a prefix is enough and a 3-million-coordinate
2638
- * collection is not walked twice.
2639
- *
2640
- * @returns Details when a coordinate is out of geographic range, else null.
2641
- */
2642
- export declare function detectNonGeographicCoordinates(geojson: GeoJSON.FeatureCollection | undefined, sampleLimit?: number): NonGeographicCoordinates | null;
2643
- //#endregion
2644
4
  //#region src/diagram.d.ts
2645
5
  /**
2646
6
  * Hard cap on how many features get a diagram. Each diagram is rasterized into
@@ -2756,6 +116,28 @@ export declare function diagramPixelSize(datum: DiagramDatum, style: LayerStyle,
2756
116
  * stroke is not clipped at the edge.
2757
117
  */
2758
118
  export declare function drawMarkerPath(ctx: CanvasRenderingContext2D, shape: MarkerShape, size: number): void;
119
+ /**
120
+ * Whether a custom marker source is a raster image (PNG, JPEG, GIF, ...) rather
121
+ * than SVG: a non-SVG `data:image/...` URL, or an `http(s)` URL whose path ends
122
+ * in a raster extension. Raster markers cannot be recolored, so the marker
123
+ * color and per-class colors only apply to SVG sources. A remote URL without a
124
+ * telling extension is not classified here; the map sniffs its content type.
125
+ *
126
+ * @param markup - The `markerSvg` value.
127
+ * @returns `true` for a recognizably raster source.
128
+ */
129
+ export declare function isRasterMarkerSource(markup: string): boolean;
130
+ /**
131
+ * Whether a remote marker response holds SVG text, judged by its
132
+ * `content-type` header: `image/svg+xml`, or a text/XML type (a raw GitHub
133
+ * file is served as `text/plain`), reads as SVG and any other `image/*` does
134
+ * not. A missing or generic header falls back to a `.svg` path.
135
+ *
136
+ * @param url - The requested URL.
137
+ * @param contentType - The response's `content-type` header, if any.
138
+ * @returns `true` when the body should be read as SVG markup.
139
+ */
140
+ export declare function isSvgMarkerResponse(url: string, contentType: string | null): boolean;
2759
141
  /**
2760
142
  * Resolve user-supplied SVG input to an `Image.src`: inline markup (starting
2761
143
  * with `<`) is encoded as a data URL; otherwise only `data:` and `http(s):`
@@ -2809,280 +191,6 @@ export declare const PHOTO_PROPERTY = "photo";
2809
191
  */
2810
192
  export declare const PHOTO_FULL_PROPERTY = "photo_full";
2811
193
  //#endregion
2812
- //#region src/ellipsoids.d.ts
2813
- /**
2814
- * Celestial-body ellipsoids and the planetary basemaps that pair with them.
2815
- *
2816
- * GeoLibre is Earth-centric by construction: MapLibre only renders Web Mercator
2817
- * and all vector data is kept as WGS84 lon/lat GeoJSON. This module does *not*
2818
- * change that — MapLibre still treats the planet as a unit sphere and there is
2819
- * no true multi-CRS rendering (see maplibre-gl-js#168). What it adds is a
2820
- * per-project notion of *which body* the coordinates describe, so that:
2821
- *
2822
- * - distance / area / scale measurements use that body's radius instead of a
2823
- * hardcoded Earth radius, and
2824
- * - Moon / Mars basemaps (published in a Web-Mercator tiling scheme) can be
2825
- * selected like any other basemap.
2826
- *
2827
- * The active ellipsoid is a lightweight module-level singleton kept in sync with
2828
- * the project's map preferences (see the store's `setPreferences`). Measurement
2829
- * helpers read it lazily at call time, so callers in other packages don't need
2830
- * the value threaded through their signatures — a deliberate prototype-friendly
2831
- * shortcut over a full CRS/context refactor.
2832
- */
2833
- /** A biaxial (rotational) ellipsoid describing a celestial body. */
2834
- export interface Ellipsoid {
2835
- /** Stable id persisted in the project (`map.ellipsoidId`). */
2836
- id: string;
2837
- /** Human-readable name shown in the UI. */
2838
- name: string;
2839
- /** Equatorial (semi-major) radius in metres — the "web mercator" radius. */
2840
- semiMajorAxisMeters: number;
2841
- /**
2842
- * Inverse flattening `1/f`. `0` denotes a perfect sphere (Moon), in which case
2843
- * the polar radius equals {@link semiMajorAxisMeters}.
2844
- */
2845
- inverseFlattening: number;
2846
- }
2847
- /**
2848
- * Built-in ellipsoids. Earth is WGS 84; every other body uses IAU-adopted
2849
- * figures. Only Earth and Mars are appreciably oblate; the rest are modelled as
2850
- * spheres (`inverseFlattening: 0`), which is how the IAU/USGS simple-cylindrical
2851
- * products treat them and is well within the accuracy MapLibre's unit-sphere
2852
- * rendering can represent anyway.
2853
- */
2854
- export declare const ELLIPSOIDS: readonly [{
2855
- readonly id: "earth";
2856
- readonly name: "Earth (WGS 84)";
2857
- readonly semiMajorAxisMeters: 6378137;
2858
- readonly inverseFlattening: 298.257223563;
2859
- }, {
2860
- readonly id: "moon";
2861
- readonly name: "Moon";
2862
- readonly semiMajorAxisMeters: 1737400;
2863
- readonly inverseFlattening: 0;
2864
- }, {
2865
- readonly id: "mars";
2866
- readonly name: "Mars (IAU 2000)";
2867
- readonly semiMajorAxisMeters: 3396190;
2868
- readonly inverseFlattening: 169.894447;
2869
- }, {
2870
- readonly id: "mercury";
2871
- readonly name: "Mercury";
2872
- readonly semiMajorAxisMeters: 2439400;
2873
- readonly inverseFlattening: 0;
2874
- }, {
2875
- readonly id: "venus";
2876
- readonly name: "Venus";
2877
- readonly semiMajorAxisMeters: 6051800;
2878
- readonly inverseFlattening: 0;
2879
- }, {
2880
- readonly id: "io";
2881
- readonly name: "Io";
2882
- readonly semiMajorAxisMeters: 1821600;
2883
- readonly inverseFlattening: 0;
2884
- }, {
2885
- readonly id: "europa";
2886
- readonly name: "Europa";
2887
- readonly semiMajorAxisMeters: 1560800;
2888
- readonly inverseFlattening: 0;
2889
- }, {
2890
- readonly id: "ganymede";
2891
- readonly name: "Ganymede";
2892
- readonly semiMajorAxisMeters: 2631200;
2893
- readonly inverseFlattening: 0;
2894
- }, {
2895
- readonly id: "callisto";
2896
- readonly name: "Callisto";
2897
- readonly semiMajorAxisMeters: 2410300;
2898
- readonly inverseFlattening: 0;
2899
- }, {
2900
- readonly id: "titan";
2901
- readonly name: "Titan";
2902
- readonly semiMajorAxisMeters: 2574730;
2903
- readonly inverseFlattening: 0;
2904
- }, {
2905
- readonly id: "pluto";
2906
- readonly name: "Pluto";
2907
- readonly semiMajorAxisMeters: 1188300;
2908
- readonly inverseFlattening: 0;
2909
- }, {
2910
- readonly id: "charon";
2911
- readonly name: "Charon";
2912
- readonly semiMajorAxisMeters: 606000;
2913
- readonly inverseFlattening: 0;
2914
- }];
2915
- export type EllipsoidId = (typeof ELLIPSOIDS)[number]["id"];
2916
- export declare const DEFAULT_ELLIPSOID_ID: EllipsoidId;
2917
- /** Look an ellipsoid up by id, falling back to Earth for unknown ids. */
2918
- export declare function getEllipsoid(id: string | undefined): Ellipsoid;
2919
- /**
2920
- * Mean radius `R = (2a + b) / 3` in metres, where `b` is the polar radius
2921
- * derived from the inverse flattening. This is the radius used for spherical
2922
- * (haversine) distance and area math.
2923
- */
2924
- export declare function meanRadiusMeters(ellipsoid: Ellipsoid): number;
2925
- /** Earth's mean radius in metres — the radius Turf.js and MapLibre bake in. */
2926
- export declare const EARTH_MEAN_RADIUS_METERS: number;
2927
- /**
2928
- * Point the measurement helpers at a body. Unknown ids fall back to Earth so a
2929
- * malformed project can never break measurements. Safe to call on every
2930
- * preferences change; it is a cheap assignment.
2931
- */
2932
- export declare function setActiveEllipsoidId(id: string | undefined): void;
2933
- export declare function getActiveEllipsoid(): Ellipsoid;
2934
- /** Mean radius (metres) of the active body — for haversine distance/area. */
2935
- export declare function getActiveMeanRadiusMeters(): number;
2936
- /** Semi-major axis (metres) of the active body — for its Web-Mercator scale. */
2937
- export declare function getActiveSemiMajorAxisMeters(): number;
2938
- /**
2939
- * The active body's mean radius as a fraction of Earth's — `R_body / R_earth`,
2940
- * and exactly `1` on Earth.
2941
- *
2942
- * Everything GeoLibre measures ultimately comes from lon/lat *angles*, and the
2943
- * only thing that turns an angle into a ground distance is the radius it is
2944
- * multiplied by. Turf.js hardcodes Earth's, with no per-call override (that is
2945
- * the "Turf is Earth-locked" half of GeoLibre#1128), so rather than patch or
2946
- * replace Turf we post-scale what it returns and pre-scale what we hand it. The
2947
- * result is exact for a sphere, which is how every non-Earth body GeoLibre
2948
- * offers is modelled anyway, and within Mars' 0.6% flattening at worst.
2949
- *
2950
- * Suggested by @thareUSGS (USGS Astrogeology) on GeoLibre#1128 as the practical
2951
- * workaround planetary web maps have long used on Earth-locked engines.
2952
- */
2953
- export declare function getActiveBodyRadiusRatio(): number;
2954
- /**
2955
- * Convert a length Turf.js measured on Earth into the active body's true ground
2956
- * length. A no-op on Earth.
2957
- *
2958
- * Use on anything Turf *returns* — a distance, a length, a perimeter.
2959
- *
2960
- * The correction is a dimensionless ratio, so it is unit-agnostic: pass the
2961
- * length in whatever unit Turf gave it back (metres, kilometres, miles) and the
2962
- * result is in that same unit. There is no hidden unit conversion here.
2963
- */
2964
- export declare function earthLengthToBody(length: number): number;
2965
- /**
2966
- * Convert a true ground length on the active body into the Earth-equivalent
2967
- * length to hand Turf.js. A no-op on Earth.
2968
- *
2969
- * Use on anything passed *into* Turf as a distance — a buffer width, a circle
2970
- * or sector radius, a search threshold — so the resulting geometry spans that
2971
- * distance on this body rather than on Earth.
2972
- *
2973
- * Unit-agnostic like {@link earthLengthToBody}: pass the length in whatever
2974
- * unit you are about to hand Turf alongside it, and the result is in that unit.
2975
- */
2976
- export declare function bodyLengthToEarth(length: number): number;
2977
- /**
2978
- * Convert an area Turf.js measured on Earth into the active body's true ground
2979
- * area. A no-op on Earth.
2980
- *
2981
- * Areas scale with the *square* of the radius ratio, so this is not the same
2982
- * correction as {@link earthLengthToBody}. Unit-agnostic in the same way, for
2983
- * whatever squared unit the area is expressed in.
2984
- */
2985
- export declare function earthAreaToBody(area: number): number;
2986
- /**
2987
- * A raster basemap for a celestial body — the Moon and Mars mosaics, plus the
2988
- * Earth satellite imagery the planet switcher pairs with Earth. The tiles are
2989
- * XYZ (or TMS, see {@link scheme}) images in that body's Web-Mercator scheme, so
2990
- * MapLibre renders them directly. The `styleUrl` is a `geolibre://basemap/<id>`
2991
- * sentinel; the map controller expands it into a raster style at apply time (it
2992
- * is not a fetchable URL).
2993
- */
2994
- export interface PlanetaryBasemap {
2995
- id: string;
2996
- name: string;
2997
- /** Sentinel stored as the basemap style URL. */
2998
- styleUrl: string;
2999
- /** XYZ (or TMS, see {@link scheme}) tile template. */
3000
- tileUrl: string;
3001
- /**
3002
- * Tile row ordering. OpenPlanetaryMap's single-layer raster mosaics (the S3
3003
- * datasets) are published as **TMS** (tile origin bottom-left, Y flipped),
3004
- * whereas the CARTO `opmbuilder` named maps are standard **XYZ**. Omit for
3005
- * XYZ; MapLibre defaults to `"xyz"` when `scheme` is absent.
3006
- */
3007
- scheme?: "tms";
3008
- /** Max native zoom of the source (MapLibre overzooms beyond this). */
3009
- maxZoom: number;
3010
- /** Attribution shown on the map. */
3011
- attribution: string;
3012
- /** The body this basemap depicts, so selecting it can set the ellipsoid. */
3013
- ellipsoidId: EllipsoidId;
3014
- }
3015
- export declare const PLANETARY_BASEMAP_SENTINEL_PREFIX = "geolibre://basemap/";
3016
- export declare const PLANETARY_BASEMAPS: readonly PlanetaryBasemap[];
3017
- /**
3018
- * The section a planetary basemap is grouped under in the New Project and
3019
- * Change Basemap pickers. The Moon and Mars keep dedicated sections (they are
3020
- * the most-used bodies and each has several mosaics); every other body is
3021
- * collapsed into a single "other" section so the picker isn't a wall of
3022
- * one-item headings.
3023
- */
3024
- export type PlanetaryBasemapSectionId = "moon" | "mars" | "other";
3025
- /** A picker section paired with the planetary basemaps it lists. */
3026
- export interface PlanetaryBasemapGroup {
3027
- id: PlanetaryBasemapSectionId;
3028
- basemaps: readonly PlanetaryBasemap[];
3029
- }
3030
- /**
3031
- * {@link PLANETARY_BASEMAPS} grouped for the pickers: one section each for the
3032
- * Moon and Mars, then a single "Other celestial bodies" section for the rest,
3033
- * in {@link PLANETARY_BASEMAPS} order (grouped by body). Empty sections are
3034
- * dropped.
3035
- */
3036
- export declare const PLANETARY_BASEMAP_GROUPS: readonly PlanetaryBasemapGroup[];
3037
- /** Resolve a `geolibre://basemap/<id>` sentinel to its planetary basemap. */
3038
- export declare function getPlanetaryBasemapByStyleUrl(styleUrl: string | undefined): PlanetaryBasemap | undefined;
3039
- /** Look a planetary basemap up by its stable id. */
3040
- export declare function getPlanetaryBasemapById(id: string): PlanetaryBasemap | undefined;
3041
- /**
3042
- * The celestial bodies offered by the Layers-panel planet switcher, in menu
3043
- * order (like Google Earth's planet dropdown). Each body is paired with the
3044
- * basemap the switcher applies for it — USGS satellite imagery for Earth, the
3045
- * OpenPlanetaryMap Hillshaded Albedo mosaic for the Moon, and the OpenPlanetaryMap
3046
- * Viking mosaic for Mars.
3047
- */
3048
- export declare const PLANET_SWITCHER_OPTIONS: readonly [{
3049
- readonly ellipsoidId: "earth";
3050
- readonly basemapId: "earth-usgs-imagery";
3051
- }, {
3052
- readonly ellipsoidId: "moon";
3053
- readonly basemapId: "moon-hillshaded-albedo";
3054
- }, {
3055
- readonly ellipsoidId: "mars";
3056
- readonly basemapId: "mars-viking-mdim21";
3057
- }, {
3058
- readonly ellipsoidId: "callisto";
3059
- readonly basemapId: "callisto-galileo-voyager";
3060
- }, {
3061
- readonly ellipsoidId: "charon";
3062
- readonly basemapId: "charon-mosaic";
3063
- }, {
3064
- readonly ellipsoidId: "europa";
3065
- readonly basemapId: "europa-galileo-voyager";
3066
- }, {
3067
- readonly ellipsoidId: "ganymede";
3068
- readonly basemapId: "ganymede-galileo-voyager";
3069
- }, {
3070
- readonly ellipsoidId: "io";
3071
- readonly basemapId: "io-galileo-color";
3072
- }, {
3073
- readonly ellipsoidId: "mercury";
3074
- readonly basemapId: "mercury-messenger-color";
3075
- }, {
3076
- readonly ellipsoidId: "pluto";
3077
- readonly basemapId: "pluto-mosaic";
3078
- }, {
3079
- readonly ellipsoidId: "titan";
3080
- readonly basemapId: "titan-cassini";
3081
- }, {
3082
- readonly ellipsoidId: "venus";
3083
- readonly basemapId: "venus-magellan-color";
3084
- }];
3085
- //#endregion
3086
194
  //#region src/regional-basemaps.d.ts
3087
195
  /**
3088
196
  * Raster basemaps for regions the default catalog does not serve well.
@@ -3178,56 +286,38 @@ export declare function getRegionalBasemapById(id: string | undefined): Regional
3178
286
  /** Whether a style URL is a regional-basemap sentinel, resolvable or not. */
3179
287
  export declare function isRegionalBasemapSentinel(styleUrl: string | undefined): boolean;
3180
288
  //#endregion
3181
- //#region src/geojson-z.d.ts
3182
- /**
3183
- * Helpers for vector data whose coordinates carry a Z value (elevation), e.g.
3184
- * GPX tracks with `<ele>` readings or LineStringZ/PointZ geometries. MapLibre's
3185
- * 2D style layers ignore the third coordinate, so layers that want to render
3186
- * their Z values use these helpers to detect and rescale elevations before
3187
- * handing the data to a deck.gl overlay. The same data can carry its elevation
3188
- * in a `bbox` member too, which `horizontalBbox` trims back to two dimensions.
3189
- */
289
+ //#region src/arcgis-projection.d.ts
3190
290
  /**
3191
- * Reduces a bounding box to its horizontal extent, `[west, south, east, north]`.
3192
- *
3193
- * RFC 7946 §5 lets a `bbox` member carry elevation, in which case it holds six
3194
- * values — `[west, south, minAltitude, east, north, maxAltitude]` — and
3195
- * `@turf/bbox` returns a collection's own member verbatim rather than
3196
- * recomputing it. A consumer reading such a box as four values takes the
3197
- * altitude for a longitude and the east edge for a latitude; that is how a 3D
3198
- * feed reached MapLibre as an out-of-range latitude (#2358).
291
+ * Projections the ArcGIS renderer can draw its flat map in (issue #2708).
3199
292
  *
3200
- * Returns null when there is no usable horizontal extent: a box of any other
3201
- * length, or one carrying a non-finite value anywhere — an empty collection, or
3202
- * one whose features all have a null geometry, bboxes to ±Infinity, and a box
3203
- * whose altitudes are not finite is not one to trust the rest of.
3204
- *
3205
- * @param box - A GeoJSON or Turf bounding box, of four or six values.
293
+ * MapLibre and Mapbox only draw Web Mercator and a globe, but the ArcGIS Maps
294
+ * SDK reprojects vector layers on the client into any projected coordinate
295
+ * system it knows by WKID. `preferences.map.arcgisWkid` names that system;
296
+ * absent means the default Web Mercator map. The SDK cannot reproject tiled
297
+ * layers (XYZ, Esri basemaps), so in another projection those do not draw.
3206
298
  */
3207
- export declare function horizontalBbox(box: readonly number[] | null | undefined): [number, number, number, number] | null;
299
+ /** A projection offered in the settings picker. */
300
+ export interface ArcgisProjectionPreset {
301
+ /** The Esri or EPSG well-known ID the SDK resolves. */
302
+ wkid: number;
303
+ /** English name; the UI translates it by `id`. */
304
+ name: string;
305
+ /** Stable key for the translated name (`settings.map.arcgisProjections.<id>`). */
306
+ id: string;
307
+ }
308
+ /** Presets, verified to load and frame in the SDK pinned by `ARCGIS_SDK_VERSION`. */
309
+ export declare const ARCGIS_PROJECTION_PRESETS: readonly ArcgisProjectionPreset[];
3208
310
  /**
3209
- * Returns true when any coordinate in the GeoJSON carries a finite, non-zero
3210
- * Z value. All-zero Z arrays are treated as flat data because rendering them
3211
- * "in 3D" would be indistinguishable from the 2D result. The result is
3212
- * cached per GeoJSON object, so repeated calls on the same data are free.
311
+ * Normalize a stored ArcGIS projection WKID.
3213
312
  *
3214
- * @param geojson - Any GeoJSON object (geometry, feature, or collection).
3215
- * @param includeZero - Accept zero elevations when explicit absolute-height placement matters.
3216
- */
3217
- export declare function geojsonHasZCoordinates(geojson: GeoJSON$1 | null | undefined, includeZero?: boolean): boolean;
3218
- /**
3219
- * Returns a copy of the GeoJSON with every coordinate's Z value mapped to
3220
- * `z * verticalScale + offset` (missing or non-finite Z treated as 0). Used
3221
- * to apply vertical exaggeration and a constant altitude offset before 3D
3222
- * rendering. The identity transform (`verticalScale === 1 && offset === 0`)
3223
- * still produces a copy so the non-finite-Z sanitization applies on every
3224
- * path — WebGL does not handle NaN positions gracefully.
313
+ * Args:
314
+ * value: The raw `preferences.map.arcgisWkid` value.
3225
315
  *
3226
- * @param geojson - The feature collection to transform.
3227
- * @param verticalScale - Multiplier applied to each Z value.
3228
- * @param offset - Constant altitude in meters added after scaling.
316
+ * Returns:
317
+ * A positive integer WKID other than Web Mercator, or `undefined` for the
318
+ * default Web Mercator map (absent, malformed or a Web Mercator code).
3229
319
  */
3230
- export declare function transformGeojsonElevation(geojson: FeatureCollection, verticalScale: number, offset: number): FeatureCollection;
320
+ export declare function normalizeArcgisWkid(value: unknown): number | undefined;
3231
321
  //#endregion
3232
322
  //#region src/color-ramp.d.ts
3233
323
  /**
@@ -3347,7 +437,7 @@ export declare function createEqualIntervalBreaks(min: number, max: number, coun
3347
437
  */
3348
438
  export declare function createQuantileBreaks(values: number[], count: number): number[];
3349
439
  /** The classification schemes the graduated vector renderer offers. */
3350
- export type GraduatedClassificationScheme = "equal-interval" | "quantile" | "natural-breaks";
440
+ export type GraduatedClassificationScheme = "equal-interval" | "quantile" | "natural-breaks" | "standard-deviation" | "geometric-interval";
3351
441
  /**
3352
442
  * Builds the class *lower bounds* for a graduated vector renderer.
3353
443
  *
@@ -3366,6 +456,12 @@ export type GraduatedClassificationScheme = "equal-interval" | "quantile" | "nat
3366
456
  * MapLibre rejects a `step` expression whose inputs are not strictly ascending,
3367
457
  * so this de-duplication is load-bearing, not cosmetic.
3368
458
  *
459
+ * Standard deviation and geometric interval derive their breaks from the data,
460
+ * so `count` is a ceiling there: a standard-deviation break that falls outside
461
+ * the sample range is dropped rather than producing an empty class. See
462
+ * {@link standardDeviationClassBreaks} and {@link geometricIntervalClassBreaks}
463
+ * for how each treats its edge cases.
464
+ *
3369
465
  * @param values - The finite numeric values of the classified property.
3370
466
  * @param count - Number of classes requested.
3371
467
  * @param scheme - The classification scheme.
@@ -3625,97 +721,19 @@ export declare function requestMatrix(endpoint: string, body: MatrixRequestBody,
3625
721
  * @param signal - Optional abort signal.
3626
722
  * @returns The Valhalla `/route` response.
3627
723
  */
3628
- export declare function requestRoute(endpoint: string, body: RouteRequestBody, signal?: AbortSignal): Promise<unknown>;
3629
- //#endregion
3630
- //#region src/polyline.d.ts
3631
- /**
3632
- * Pure TypeScript Google Encoded Polyline algorithm codec.
3633
- *
3634
- * Supports arbitrary precision:
3635
- * - precision = 5: Google Maps standard, OSRM, HERE (factor 1e5, ~1.1m precision)
3636
- * - precision = 6: Valhalla, Mapbox, Open Source Routing Machine 6 (factor 1e6, ~0.11m precision)
3637
- *
3638
- * Coordinates are represented as `[lon, lat]` pairs in GeoJSON format.
3639
- */
3640
- /**
3641
- * Unescapes backslashes in a polyline string.
3642
- *
3643
- * When polyline strings are copied from JSON payloads, log files, or source code,
3644
- * backslashes are frequently double-escaped as `\\` or formatted with escape sequences.
3645
- *
3646
- * @param str - Input string with potentially escaped backslashes.
3647
- * @returns Cleaned polyline string.
3648
- */
3649
- export declare function unescapePolyline(str: string): string;
3650
- export interface PolylineDecodeResult {
3651
- coordinates: [number, number][];
3652
- complete: boolean;
3653
- }
3654
- /**
3655
- * Decodes an encoded polyline string into an array of `[lon, lat]` coordinates,
3656
- * along with a `complete` flag indicating whether the entire string was consumed
3657
- * as complete coordinate pairs without truncation or malformed characters.
3658
- *
3659
- * @param encoded - The ASCII-encoded polyline string.
3660
- * @param precision - Number of decimal digits (default: 5).
3661
- * @param unescape - Whether to unescape double-escaped backslashes before decoding (default: false).
3662
- * @returns Object with decoded `coordinates` and `complete` boolean status.
3663
- */
3664
- export declare function decodePolylineDetailed(encoded: string, precision?: number, unescape?: boolean): PolylineDecodeResult;
3665
- /**
3666
- * Decodes an encoded polyline string into an array of `[lon, lat]` coordinates.
3667
- *
3668
- * @param encoded - The ASCII-encoded polyline string.
3669
- * @param precision - Number of decimal digits (default: 5).
3670
- * @param unescape - Whether to unescape double-escaped backslashes before decoding (default: false).
3671
- * @returns Array of `[lon, lat]` coordinate pairs in GeoJSON order.
3672
- */
3673
- export declare function decodePolyline(encoded: string, precision?: number, unescape?: boolean): [number, number][];
3674
- /**
3675
- * Encodes an array of `[lon, lat]` coordinates into a Google Encoded Polyline string.
3676
- *
3677
- * @param coordinates - Array of `[lon, lat]` coordinate pairs.
3678
- * @param precision - Number of decimal digits (default: 5).
3679
- * @returns The encoded polyline string.
3680
- */
3681
- export declare function encodePolyline(coordinates: [number, number][], precision?: number): string;
3682
- /**
3683
- * Decodes an encoded polyline string into a GeoJSON `Feature<LineString>`.
3684
- *
3685
- * @param encoded - The polyline string.
3686
- * @param precision - Coordinate precision (default: 5).
3687
- * @param properties - Optional feature properties.
3688
- * @returns A GeoJSON LineString Feature.
3689
- */
3690
- export declare function polylineStrToGeoJSON(encoded: string, precision?: number, properties?: GeoJsonProperties): Feature<LineString>;
3691
- /**
3692
- * Encodes a GeoJSON LineString, MultiLineString, Feature, or FeatureCollection into encoded polyline string(s).
3693
- *
3694
- * @param geojson - The GeoJSON input geometry or feature.
3695
- * @param precision - Coordinate precision (default: 5).
3696
- * @returns An encoded polyline string for LineString, or an array of strings for MultiLineString / FeatureCollection.
3697
- */
3698
- export declare function geoJSONToPolylineStr(geojson: LineString | MultiLineString | Feature<LineString | MultiLineString> | FeatureCollection<LineString | MultiLineString>, precision?: number): string | string[];
3699
- export interface PolylineBatchOptions {
3700
- /** Coordinate precision (default: 5) */
3701
- precision?: number;
3702
- /** Whether to unescape `\\` backslashes (default: true) */
3703
- unescape?: boolean;
3704
- /** Custom delimiter string or RegExp separating individual polylines (default: newline) */
3705
- delimiter?: string | RegExp;
3706
- /** Whether to merge lines into a single MultiLineString feature (default: false) */
3707
- asMultiLine?: boolean;
3708
- /** Optional base properties to assign to output features */
3709
- baseProperties?: GeoJsonProperties;
3710
- }
724
+ export declare function requestRoute(endpoint: string, body: RouteRequestBody, signal?: AbortSignal): Promise<unknown>;
3711
725
  /**
3712
- * Parses and batch-decodes multiple polylines from a text block or file content.
726
+ * Requests a turn-by-turn route from the Valhalla server. Unlike
727
+ * {@link requestRoute}, the body is passed through as is, so the caller can ask
728
+ * for Valhalla's OSRM-compatible output with voice and banner instructions,
729
+ * alternates, a start heading, and costing options (the navigation tool).
3713
730
  *
3714
- * @param input - Multiline string or delimited text containing encoded polylines.
3715
- * @param options - Decoding and parsing configuration.
3716
- * @returns A FeatureCollection containing LineString (or MultiLineString) features.
731
+ * @param endpoint - The Valhalla base URL.
732
+ * @param body - The `/route` request body.
733
+ * @param signal - Optional abort signal.
734
+ * @returns The Valhalla `/route` response.
3717
735
  */
3718
- export declare function batchDecodePolylines(input: string, options?: PolylineBatchOptions): FeatureCollection<LineString | MultiLineString>;
736
+ export declare function requestNavigationRoute(endpoint: string, body: Record<string, unknown>, signal?: AbortSignal): Promise<unknown>;
3719
737
  //#endregion
3720
738
  //#region src/vector-color.d.ts
3721
739
  /**
@@ -4539,6 +1557,13 @@ export declare function isAdoptedVectorAwaitingFeatures(layer: {
4539
1557
  export interface AttributeFormEvalOptions {
4540
1558
  /** Map zoom for `["zoom"]` in expressions; defaults to 0. */
4541
1559
  zoom?: number;
1560
+ /**
1561
+ * Constraints a data service enforces regardless of the form's
1562
+ * presentation (ArcGIS domains). A field the form hides is still checked
1563
+ * against its entry here, so a visibility rule cannot let an invalid value
1564
+ * reach the service.
1565
+ */
1566
+ serviceForm?: AttributeFormConfig;
4542
1567
  /**
4543
1568
  * Real feature backing the properties, when the caller has one — its
4544
1569
  * geometry feeds `["geometry-type"]` and geometry-aware operators. Its
@@ -4549,7 +1574,7 @@ export interface AttributeFormEvalOptions {
4549
1574
  }
4550
1575
  /** Why a field's value was rejected; codes map to localized messages. */
4551
1576
  export interface AttributeFormFieldError {
4552
- code: "required" | "number" | "range" | "valueMap" | "constraint";
1577
+ code: "required" | "number" | "integer" | "text" | "range" | "valueMap" | "constraint";
4553
1578
  /**
4554
1579
  * For `constraint`: the author's `constraintDescription`, or the
4555
1580
  * expression's own error text when it failed to evaluate.
@@ -4601,10 +1626,180 @@ export declare function isAttributeFormFieldVisible(config: AttributeFormFieldCo
4601
1626
  export declare function validateAttributeFormField(config: AttributeFormFieldConfig, properties: Record<string, unknown>, options?: AttributeFormEvalOptions): AttributeFormFieldError | null;
4602
1627
  /**
4603
1628
  * Validate a whole candidate properties record against a form config. Hidden
4604
- * fields (visibility expression currently false) are skipped entirely — a
4605
- * field the form does not show cannot block a save.
1629
+ * fields (visibility expression currently false) skip the form's own rules —
1630
+ * a field the form does not show cannot block a save — but are still checked
1631
+ * against `options.serviceForm`, whose constraints the data service enforces.
4606
1632
  */
4607
1633
  export declare function validateAttributeFormValues(form: AttributeFormConfig | undefined, properties: Record<string, unknown>, options?: AttributeFormEvalOptions): AttributeFormValidation;
1634
+ /**
1635
+ * Combine a layer's designer-authored form with the constraints its data
1636
+ * service publishes (for example ArcGIS coded-value and range domains) into
1637
+ * the form the editing surfaces use. The author's presentation choices
1638
+ * (alias, visibility, constraint expression, a narrower value map or bounds)
1639
+ * survive, but never widen what the service accepts: a service value map
1640
+ * forces the value-map widget and keeps only author entries the service also
1641
+ * lists (all service entries when none overlap), bounds take the tighter of
1642
+ * each side, and the service's declared value type always applies.
1643
+ *
1644
+ * @param form - The layer's designer-authored config, if any.
1645
+ * @param service - Service-derived configs, if the layer has any.
1646
+ * @returns The effective config, or `form` itself when there is no service form.
1647
+ */
1648
+ export declare function mergeAttributeFormConfigs(form: AttributeFormConfig | undefined, service: AttributeFormConfig | undefined): AttributeFormConfig | undefined;
1649
+ //#endregion
1650
+ //#region src/layer-descriptive-metadata.d.ts
1651
+ /** STAC specification version the Item export targets. */
1652
+ export declare const STAC_VERSION = "1.0.0";
1653
+ /** Schema URL of the STAC processing extension, declared for `processing:lineage`. */
1654
+ export declare const STAC_PROCESSING_EXTENSION = "https://stac-extensions.github.io/processing/v1.1.0/schema.json";
1655
+ /**
1656
+ * Split comma-separated keyword text into a clean keyword list.
1657
+ *
1658
+ * @param text - Text such as `"roads, transport, osm"`.
1659
+ * @returns The trimmed, non-empty keywords with case-insensitive duplicates removed.
1660
+ */
1661
+ export declare function parseMetadataKeywords(text: string): string[];
1662
+ /**
1663
+ * Normalize a raw descriptive-metadata value (from a project file, a plugin or
1664
+ * the Metadata dialog): keep only string fields, trim them, and drop empty
1665
+ * fields, empty keywords and links without an address.
1666
+ *
1667
+ * Values are not validated here — a malformed email or date in a hand-edited
1668
+ * file is kept so the dialog can show and fix it rather than silently lose it.
1669
+ *
1670
+ * @param value - Any value.
1671
+ * @returns The cleaned record, or `undefined` when nothing is left, so an
1672
+ * empty record is never written to a project.
1673
+ */
1674
+ export declare function normalizeLayerDescriptiveMetadata(value: unknown): LayerDescriptiveMetadata | undefined;
1675
+ /**
1676
+ * Whether a string is a plausible email address (`local@domain.tld`).
1677
+ *
1678
+ * @param value - The candidate address.
1679
+ * @returns `true` when it has the shape of an email address.
1680
+ */
1681
+ export declare function isValidMetadataEmail(value: string): boolean;
1682
+ /**
1683
+ * Whether a string is an absolute URL with a scheme a metadata link may use
1684
+ * (http, https, ftp, s3, gs, mailto). Script and data URLs are rejected.
1685
+ *
1686
+ * @param value - The candidate URL.
1687
+ * @returns `true` when it parses as an allowed absolute URL.
1688
+ */
1689
+ export declare function isValidMetadataUrl(value: string): boolean;
1690
+ /**
1691
+ * Whether a string is an ISO 8601 date (`YYYY-MM-DD`) or date-time
1692
+ * (`YYYY-MM-DDTHH:MM[:SS[.fff]][Z|±HH:MM]`) naming a real instant.
1693
+ *
1694
+ * @param value - The candidate date.
1695
+ * @returns `true` when it is a valid ISO 8601 date or date-time.
1696
+ */
1697
+ export declare function isValidMetadataDate(value: string): boolean;
1698
+ /**
1699
+ * Convert a validated metadata date to an RFC 3339 UTC date-time, as STAC
1700
+ * requires. A date-only bound covers its whole day: a start becomes the first
1701
+ * second of the day, an end the last. A date-time without an offset is read
1702
+ * as UTC so the export does not depend on the exporting machine's time zone.
1703
+ *
1704
+ * @param value - A date accepted by {@link isValidMetadataDate}.
1705
+ * @param bound - Whether the value starts or ends an interval.
1706
+ * @returns The RFC 3339 date-time, or `null` for an invalid date.
1707
+ */
1708
+ export declare function metadataDateToRfc3339(value: string, bound: "start" | "end"): string | null;
1709
+ /** Why a metadata field failed {@link validateLayerDescriptiveMetadata}. */
1710
+ export type LayerMetadataIssueCode = "email" | "url" | "date" | "dateOrder";
1711
+ /** One validation failure, addressed by a dotted field path. */
1712
+ export interface LayerMetadataIssue {
1713
+ /**
1714
+ * The failing field: `contact.email`, `temporalExtent.start`,
1715
+ * `temporalExtent.end`, or `links.<index>.href`.
1716
+ */
1717
+ field: string;
1718
+ code: LayerMetadataIssueCode;
1719
+ }
1720
+ /**
1721
+ * Validate the fields of a descriptive-metadata record that have a format:
1722
+ * the contact email, the temporal-extent dates (and their order), and the
1723
+ * link URLs. Free-text fields are not checked.
1724
+ *
1725
+ * @param metadata - The record to check (normalized or a dialog draft).
1726
+ * @returns Every failure found; empty when the record is valid.
1727
+ */
1728
+ export declare function validateLayerDescriptiveMetadata(metadata: LayerDescriptiveMetadata | undefined): LayerMetadataIssue[];
1729
+ /** A STAC 1.0 link object. */
1730
+ export interface StacLink {
1731
+ href: string;
1732
+ rel: string;
1733
+ type?: string;
1734
+ title?: string;
1735
+ }
1736
+ /** A STAC 1.0 asset object. */
1737
+ export interface StacAsset {
1738
+ href: string;
1739
+ type?: string;
1740
+ title?: string;
1741
+ roles?: string[];
1742
+ }
1743
+ /** A STAC 1.0 provider object. */
1744
+ export interface StacProvider {
1745
+ name: string;
1746
+ description?: string;
1747
+ roles?: string[];
1748
+ url?: string;
1749
+ }
1750
+ /** The STAC 1.0 Item {@link buildLayerStacItem} produces. */
1751
+ export interface StacItem {
1752
+ type: "Feature";
1753
+ stac_version: string;
1754
+ stac_extensions: string[];
1755
+ id: string;
1756
+ geometry: Record<string, unknown> | null;
1757
+ bbox?: [number, number, number, number];
1758
+ properties: Record<string, unknown> & {
1759
+ datetime: string | null;
1760
+ };
1761
+ links: StacLink[];
1762
+ assets: Record<string, StacAsset>;
1763
+ }
1764
+ /** Options for {@link buildLayerStacItem}. */
1765
+ export interface LayerStacItemOptions {
1766
+ /** The layer's extent in EPSG:4326 as `[west, south, east, north]`. */
1767
+ bbox?: readonly number[] | null;
1768
+ /** Where the layer's data can be fetched from, when it has a source URL. */
1769
+ assetHref?: string | null;
1770
+ /** Clock used for `datetime` when no temporal extent is recorded. */
1771
+ now?: Date;
1772
+ }
1773
+ /**
1774
+ * Guess the media type of a layer's data asset from the URL's extension, or
1775
+ * the layer type when the URL has none (a COG is flagged cloud-optimized).
1776
+ *
1777
+ * @param href - The asset URL.
1778
+ * @param layerType - The layer's type.
1779
+ * @returns The media type, or `undefined` when it cannot be told.
1780
+ */
1781
+ export declare function stacAssetMediaType(href: string, layerType: GeoLibreLayer["type"]): string | undefined;
1782
+ /**
1783
+ * Build a STAC 1.0 Item describing a layer from its descriptive metadata.
1784
+ *
1785
+ * Mapping: `id` is the layer id; `geometry`/`bbox` come from the WGS84 extent
1786
+ * (a `null` geometry, as STAC allows, when the extent is unknown); `title`
1787
+ * falls back to the layer name; `abstract` becomes `description`; the contact
1788
+ * becomes a `producer` provider; `lineage` becomes `processing:lineage` (with
1789
+ * the processing extension declared); the temporal extent becomes `datetime`
1790
+ * or `start_datetime`/`end_datetime` (with `datetime` set to the export time
1791
+ * when none is recorded, since STAC requires one); links keep their `rel`
1792
+ * (default `related`); and a source URL becomes the `data` asset.
1793
+ *
1794
+ * A license that is not an SPDX-style identifier (STAC 1.0's pattern) is
1795
+ * exported as `proprietary`, with the original text kept in
1796
+ * `geolibre:license`; the attribution is kept in `geolibre:attribution`.
1797
+ *
1798
+ * @param layer - The layer to describe.
1799
+ * @param options - Extent, asset URL and clock; see {@link LayerStacItemOptions}.
1800
+ * @returns The STAC Item, ready to `JSON.stringify`.
1801
+ */
1802
+ export declare function buildLayerStacItem(layer: Pick<GeoLibreLayer, "id" | "name" | "type" | "descriptiveMetadata">, options?: LayerStacItemOptions): StacItem;
4608
1803
  //#endregion
4609
1804
  //#region src/popup.d.ts
4610
1805
  /** One resolved popup row, ready for the renderer. */
@@ -4771,87 +1966,6 @@ export declare function isInlineImageValue(value: unknown): value is string;
4771
1966
  */
4772
1967
  export declare function isSafePopupUrl(value: unknown, allowDataImage?: boolean): value is string;
4773
1968
  //#endregion
4774
- //#region src/joins.d.ts
4775
- /**
4776
- * Match key for a persistent join: empty values (null/undefined/NaN/empty
4777
- * string) never match a row, mirroring a SQL/pandas NaN join key. Non-empty
4778
- * values are keyed by their string form, so a numeric `5` and the string `"5"`
4779
- * join while a zero-padded code like `"01001"` only matches another `"01001"`.
4780
- * Kept in sync with the Processing attribute join's `attributeJoinKey`.
4781
- */
4782
- export declare function layerJoinKey(value: unknown): string | null;
4783
- /**
4784
- * Remove every column previously added by `joins` (per their `addedFields`
4785
- * bookkeeping) from a copy of `features`, restoring the pre-join properties.
4786
- * Features without any tracked column are returned unchanged (same reference).
4787
- */
4788
- export declare function stripJoinFields(features: Feature[], joins: LayerJoin[] | undefined): Feature[];
4789
- /** Result of {@link applyLayerJoins}: joined features plus refreshed join records. */
4790
- export interface ApplyLayerJoinsResult {
4791
- features: Feature[];
4792
- /** Input joins with `addedFields` and `stats` recomputed for this run. */
4793
- joins: LayerJoin[];
4794
- }
4795
- /**
4796
- * Apply `joins` in order to base (already-stripped) `features`, returning new
4797
- * feature objects with the joined columns merged into their properties.
4798
- *
4799
- * Semantics per join: left join, first matching join row wins, and joined
4800
- * columns are null-filled on unmatched features so the schema stays
4801
- * consistent. An output name (prefix + field) that collides with an existing
4802
- * column — from the base data or an earlier join — drops that one column;
4803
- * the join's other columns still apply. A disabled join, or one whose source
4804
- * cannot be resolved, contributes nothing and gets empty `addedFields` and no
4805
- * stats.
4806
- *
4807
- * @param features - The layer's base features (strip previous joins first).
4808
- * @param joins - Join definitions in application order.
4809
- * @param resolveSource - Maps a join's `joinLayerId` to that layer's current
4810
- * feature collection, or `undefined` when the layer is gone (or is the
4811
- * target itself; self-joins are refused by the caller).
4812
- */
4813
- export declare function applyLayerJoins(features: Feature[], joins: LayerJoin[] | undefined, resolveSource: (joinLayerId: string) => FeatureCollection | undefined): ApplyLayerJoinsResult;
4814
- /**
4815
- * Strip-and-reapply this layer's derived columns — persistent joins, then
4816
- * virtual fields (so an expression can read joined columns) — resolving join
4817
- * sources from `allLayers`. Pass `nextJoins`/`nextVirtualFields` to replace
4818
- * the definitions (the layer's current bookkeeping still drives the strip, so
4819
- * removed definitions clean up after themselves); omit them to refresh the
4820
- * existing definitions against current data. Layers without a feature
4821
- * collection are returned unchanged.
4822
- */
4823
- export declare function applyJoinsToLayer(layer: GeoLibreLayer, allLayers: GeoLibreLayer[], nextJoins?: LayerJoin[], nextVirtualFields?: LayerVirtualField[]): GeoLibreLayer;
4824
- /**
4825
- * Ids of every layer whose data (directly or transitively) feeds `layerId`'s
4826
- * joins, following `joinLayerId` edges through each source's own joins.
4827
- * Disabled joins count too: re-enabling one must not spring a cycle. The Joins
4828
- * UI uses this to keep a layer that already consumes the target — however
4829
- * indirectly — out of the join-source picker, so circular joins cannot be
4830
- * authored (the refresh cascade still breaks them defensively for hand-edited
4831
- * projects).
4832
- */
4833
- export declare function collectTransitiveJoinSourceIds(layers: GeoLibreLayer[], layerId: string): Set<string>;
4834
- /**
4835
- * Refresh every layer whose joins (directly or transitively) consume the
4836
- * layer identified by `seedId`, after that layer's data changed — or after it
4837
- * was removed (a gone source resolves to nothing, so its frozen columns strip
4838
- * away). The affected layers re-derive in topological dependency order, so a
4839
- * layer joining two other affected layers sees both of them fresh regardless
4840
- * of their positions in the layer panel. The seed itself is not touched.
4841
- */
4842
- export declare function cascadeLayerJoinRefresh(layers: GeoLibreLayer[], seedId: string): GeoLibreLayer[];
4843
- /**
4844
- * Re-resolve every layer's persistent joins against the freshly loaded layer
4845
- * set (project open). Layers re-derive in topological order of their join
4846
- * dependencies, so a chain (`C joins A, A joins B`) resolves A before C; a
4847
- * hand-edited cycle is broken by forcing one of its members through first
4848
- * (see {@link topologicalJoinOrder}), so consumers downstream of the cycle
4849
- * still re-derive after it. Layers with virtual fields but no joins re-derive
4850
- * too (their expressions run against the freshly loaded features). Layer sets
4851
- * without joins or virtual fields pass through by reference.
4852
- */
4853
- export declare function reapplyLayerJoins(layers: GeoLibreLayer[]): GeoLibreLayer[];
4854
- //#endregion
4855
1969
  //#region src/virtual-fields.d.ts
4856
1970
  /**
4857
1971
  * Virtual fields (QGIS Field Calculator → "Create virtual field", issue
@@ -5353,272 +2467,6 @@ export declare function scaleAltitudeToActiveBody(earthAltitudeMeters: number |
5353
2467
  */
5354
2468
  export declare function formatCameraAltitude(meters: number, unit: MapScaleUnit): string;
5355
2469
  //#endregion
5356
- //#region src/project.d.ts
5357
- /** Placeholder name a project carries before the user names it. */
5358
- export declare const DEFAULT_PROJECT_NAME = "Untitled Project";
5359
- export interface CreateProjectOptions {
5360
- basemapStyleUrl?: string;
5361
- mapView?: MapViewState;
5362
- /** Celestial body the project describes; defaults to Earth when omitted. */
5363
- ellipsoidId?: string;
5364
- }
5365
- export declare function normalizeBlankBackgroundColor(value: unknown): string | null;
5366
- export declare function createDefaultMapView(): MapViewState;
5367
- export declare function createEmptyProject(name?: string, options?: CreateProjectOptions): GeoLibreProject;
5368
- /**
5369
- * Serialize a project to `.geolibre.json` text: indented project structure with
5370
- * compact (unindented) embedded GeoJSON. See {@link serializeProjectValue} for
5371
- * why the two halves are formatted differently.
5372
- *
5373
- * @param project Project to serialize.
5374
- * @returns The file contents to write.
5375
- */
5376
- export declare function serializeProject(project: GeoLibreProject): string;
5377
- /**
5378
- * Per-layer serialized text kept across {@link serializeProjectWithLayerCache}
5379
- * calls, keyed by the layer record each entry was built from. A `WeakMap`, so a
5380
- * layer the store has replaced or removed drops its text with it.
5381
- */
5382
- export type ProjectLayerSerializationCache = WeakMap<object, {
5383
- index: number;
5384
- text: string;
5385
- }>;
5386
- /** Create an empty {@link ProjectLayerSerializationCache}. */
5387
- export declare function createProjectLayerSerializationCache(): ProjectLayerSerializationCache;
5388
- /**
5389
- * Serialize a project exactly as {@link serializeProject} does, reusing the
5390
- * text of every layer whose source record is unchanged since an earlier call.
5391
- *
5392
- * Feature data lives inside layer records, so re-stringifying every layer on
5393
- * each autosave costs megabytes of main-thread work for a project with large
5394
- * GeoJSON layers — even when only the camera moved (GeoLibre#2633). The store
5395
- * replaces a layer object whenever it changes, so object identity is a sound
5396
- * cache key: a camera move reuses every layer, and an edit to one layer
5397
- * re-serializes only that one.
5398
- *
5399
- * `layerSources[i]` must be the record `project.layers[i]` was derived from
5400
- * (e.g. the store's `layers`, before `projectFromStore` prepared them), and that
5401
- * derivation must depend on the record alone — as `buildProjectSnapshot`'s does
5402
- * — or a cached entry could outlive a change it should have reflected. When the
5403
- * two arrays differ in length the cache is bypassed rather than trusted.
5404
- *
5405
- * @param project Project to serialize, as built from `layerSources`.
5406
- * @param layerSources Immutable source record for each entry of
5407
- * `project.layers`, in the same order, used as the cache key.
5408
- * @param cache Cache shared between calls; see
5409
- * {@link createProjectLayerSerializationCache}.
5410
- * @returns The same text {@link serializeProject} returns for `project`.
5411
- */
5412
- export declare function serializeProjectWithLayerCache(project: GeoLibreProject, layerSources: readonly object[], cache: ProjectLayerSerializationCache): string;
5413
- export declare function parseProject(json: string): GeoLibreProject;
5414
- /**
5415
- * Validate and coerce a story map loaded from an untrusted project file.
5416
- *
5417
- * Returns null when the value carries no chapters so empty story maps stay out
5418
- * of the saved project, mirroring how plugins are only persisted when present.
5419
- *
5420
- * @param storymap Raw value read from the project JSON.
5421
- * @returns A normalized story map, or null when there is nothing to keep.
5422
- */
5423
- export declare function normalizeStoryMap(storymap: unknown): StoryMap | null;
5424
- /** Whether a story map carries chapters or any non-default setting. */
5425
- export declare function storyMapHasContent(story: StoryMap): boolean;
5426
- /**
5427
- * Coerce an untrusted (possibly hand-edited) `models` array into valid
5428
- * {@link ProcessingModel} records. Drops models and steps without a usable id or
5429
- * tool id, de-duplicates models by id, and keeps step `parameters` as a plain
5430
- * object (the runner validates parameter values per tool at run time). Returns
5431
- * `null` when there is nothing worth persisting, so a model-less project stays
5432
- * free of the key.
5433
- *
5434
- * @param value Raw `models` value from the project JSON.
5435
- * @returns Normalized models, or `null` when none survive.
5436
- */
5437
- export declare function normalizeModels(value: unknown): ProcessingModel[] | null;
5438
- /**
5439
- * Coerce an untrusted `graph` value into a {@link ProcessingModelGraph}. Drops
5440
- * nodes without a usable id or an unknown kind, de-duplicates node ids, and
5441
- * drops edges that do not connect two surviving nodes or that name an empty
5442
- * port. Self-edges are dropped too, since a node cannot feed itself.
5443
- *
5444
- * Structural validity beyond this (cycles, type mismatches, missing required
5445
- * inputs) is the runner's job — those depend on the tool registries, which the
5446
- * project layer deliberately does not import.
5447
- *
5448
- * @param value Raw `graph` value from the project JSON.
5449
- * @returns The normalized graph, or `null` when it has no usable nodes.
5450
- */
5451
- export declare function normalizeModelGraph(value: unknown): ProcessingModelGraph | null;
5452
- /**
5453
- * Coerce an untrusted (possibly hand-edited) `processingHistory` array into
5454
- * valid {@link ProcessingRun} records. Drops entries without a usable id, tool
5455
- * id, or known kind, de-duplicates by id, keeps `parameters` as a plain object,
5456
- * and caps the list at {@link MAX_PROCESSING_HISTORY} (keeping the newest,
5457
- * i.e. last, entries). Returns `null` when nothing survives, so a history-less
5458
- * project stays free of the key.
5459
- *
5460
- * @param value Raw `processingHistory` value from the project JSON.
5461
- * @returns Normalized runs, or `null` when none survive.
5462
- */
5463
- export declare function normalizeProcessingHistory(value: unknown): ProcessingRun[] | null;
5464
- /**
5465
- * Coerce an untrusted (possibly hand-edited) camera object into a valid
5466
- * {@link MapViewState}, falling back to the default view for missing parts.
5467
- */
5468
- export declare function normalizeMapViewState(value: unknown): MapViewState;
5469
- /**
5470
- * Coerce an untrusted `mapLayout` into a valid {@link MapGridLayout}. Returns
5471
- * null when absent or effectively single-pane so default projects stay
5472
- * byte-identical (the field is only written when the grid is larger than 1x1).
5473
- */
5474
- export declare function normalizeMapLayout(value: unknown): MapGridLayout | null;
5475
- /**
5476
- * Coerce an untrusted `primaryRenderer` into a known engine id (issue #2217).
5477
- *
5478
- * Returns null for the default 2D map — absent, unknown, or an explicit
5479
- * `"maplibre"` — because the field is only written when it is not the default,
5480
- * so a MapLibre project serializes byte-identically to before this existed.
5481
- * The return type is narrowed to `"cesium" | "mapbox" | "arcgis" | null` rather
5482
- * than the full {@link MapRendererKind} for that reason: `"maplibre"` is never a
5483
- * result.
5484
- */
5485
- export declare function normalizePrimaryRenderer(value: unknown): "cesium" | "mapbox" | "arcgis" | null;
5486
- /**
5487
- * Coerce an untrusted `secondaryMapViews` array into valid
5488
- * {@link SecondaryMapView} records, dropping entries without a usable id and
5489
- * de-duplicating by id. Returns null when none are valid.
5490
- */
5491
- export declare function normalizeSecondaryMapViews(value: unknown): SecondaryMapView[] | null;
5492
- /**
5493
- * Reconcile a parsed grid layout with its secondary panes so the store invariant
5494
- * holds: `secondaryMapViews.length === rows * cols - 1`. Surplus panes are
5495
- * dropped; missing panes are filled by cloning the primary map. A null/absent
5496
- * layout (or a 1x1 grid) collapses to the single-map default.
5497
- */
5498
- export declare function resolveMapGrid(layout: MapGridLayout | null, secondaryViews: SecondaryMapView[] | null, primary: {
5499
- mapView: MapViewState;
5500
- }): {
5501
- mapLayout: MapGridLayout;
5502
- secondaryMapViews: SecondaryMapView[];
5503
- };
5504
- /**
5505
- * Coerce an untrusted (possibly hand-edited) `widgets` array into valid
5506
- * {@link DashboardWidget} records. Drops widgets without a usable id, layer id,
5507
- * or recognized chart type, de-duplicates by id, and keeps only the optional
5508
- * keys that are present and well-typed (the Dashboard panel falls back to
5509
- * sensible defaults for anything missing). Returns `null` when there is nothing
5510
- * worth persisting, so a widget-less project stays free of the key.
5511
- *
5512
- * @param value Raw `widgets` value from the project JSON.
5513
- * @returns Normalized widgets, or `null` when none survive.
5514
- */
5515
- export declare function normalizeWidgets(value: unknown): DashboardWidget[] | null;
5516
- /**
5517
- * Clamp an untrusted dashboard column count into the supported range, falling
5518
- * back to the default for a missing or non-finite value.
5519
- *
5520
- * @param value Raw `dashboardColumns` value from the project JSON.
5521
- * @returns An integer column count within [MIN, MAX].
5522
- */
5523
- export declare function normalizeDashboardColumns(value: unknown): number;
5524
- /**
5525
- * Coerce an untrusted `interaction` block into a {@link ProjectInteraction}.
5526
- *
5527
- * Layer ids are kept even when no such layer exists: the block is replayed
5528
- * against whatever layers the project has when it opens, and the loader drops
5529
- * the ones it cannot find. Control names are kept as written for the same
5530
- * reason; the app ignores names it does not know.
5531
- *
5532
- * @param value - Raw `interaction` value from the project JSON or the store.
5533
- * @returns The normalized block, or null when it carries nothing to apply.
5534
- */
5535
- export declare function normalizeProjectInteraction(value: unknown): ProjectInteraction | null;
5536
- export declare function isAllowedPluginManifestUrl(url: string): boolean;
5537
- export declare function normalizeProjectComments(rawComments: unknown): ProjectComment[];
5538
- export declare function projectFromStore(state: {
5539
- projectName: string;
5540
- mapView: MapViewState;
5541
- basemapStyleUrl: string;
5542
- basemapVisible: boolean;
5543
- basemapOpacity: number;
5544
- blankBackgroundColor?: string | null;
5545
- layers: GeoLibreLayer[];
5546
- selectedLayerId?: string | null;
5547
- layerGroups?: LayerGroup[];
5548
- preferences: ProjectPreferences;
5549
- plugins?: ProjectPluginState | null;
5550
- legend?: LegendConfig | null;
5551
- printLayout?: PrintLayoutConfig | null;
5552
- storymap?: StoryMap | null;
5553
- models?: ProcessingModel[] | null;
5554
- processingHistory?: ProcessingRun[] | null;
5555
- widgets?: DashboardWidget[] | null;
5556
- dashboardColumns?: number;
5557
- mapLayout?: MapGridLayout;
5558
- secondaryMapViews?: SecondaryMapView[];
5559
- primaryMapLabel?: string;
5560
- primaryRenderer?: MapRendererKind;
5561
- /** Project-scoped Style Manager entries (the store's `projectStyleLibrary`). */
5562
- styleLibrary?: StyleLibraryEntry[] | null;
5563
- comments?: ProjectComment[] | null;
5564
- /** Startup interaction state loaded with the project, written back as-is. */
5565
- interaction?: ProjectInteraction | null;
5566
- metadata: Record<string, unknown>;
5567
- }): GeoLibreProject;
5568
- /**
5569
- * The plain HTTP(S) WMS template inside the desktop app's `geolibre-wms://`
5570
- * wrapper (its CORS-exempt native fetcher), or the tile unchanged when it is
5571
- * not wrapped or the wrapped URL is not HTTP(S). Shared by project export and
5572
- * the ArcGIS engine's story-export templates.
5573
- *
5574
- * @param tile - A tile template, wrapped or not.
5575
- * @returns The unwrapped template, or `tile` itself.
5576
- */
5577
- export declare function portableWmsTileUrl(tile: unknown): unknown;
5578
- export declare function applyProjectToStore(project: GeoLibreProject): {
5579
- projectName: string;
5580
- mapView: MapViewState;
5581
- basemapStyleUrl: string;
5582
- basemapVisible: boolean;
5583
- basemapOpacity: number;
5584
- blankBackgroundColor: string | null;
5585
- layers: GeoLibreLayer[];
5586
- layerGroups: LayerGroup[];
5587
- preferences: ProjectPreferences;
5588
- projectPlugins: ProjectPluginState | null;
5589
- legend: LegendConfig;
5590
- printLayout: PrintLayoutConfig;
5591
- storymap: StoryMap | null;
5592
- models: ProcessingModel[];
5593
- processingHistory: ProcessingRun[];
5594
- widgets: DashboardWidget[];
5595
- dashboardColumns: number;
5596
- mapLayout: MapGridLayout;
5597
- secondaryMapViews: SecondaryMapView[];
5598
- primaryMapLabel: string;
5599
- primaryRenderer: MapRendererKind;
5600
- projectStyleLibrary: StyleLibraryEntry[];
5601
- comments: ProjectComment[];
5602
- projectInteraction: ProjectInteraction | null;
5603
- metadata: Record<string, unknown>;
5604
- };
5605
- /**
5606
- * Create an unlinked copy of a project, suffixed with "(copy)" by default and
5607
- * stripped of share-specific metadata (shareId, shareUrl, etc.).
5608
- */
5609
- export declare function detachProjectCopy(project: GeoLibreProject, options?: {
5610
- nameSuffix?: string;
5611
- }): GeoLibreProject;
5612
- /**
5613
- * Create a template snapshot of a project. Optionally strips data layers while
5614
- * keeping basemap, layer groups, styles, legend config, preferences, widgets, and
5615
- * print layout.
5616
- */
5617
- export declare function createProjectTemplate(project: GeoLibreProject, options?: {
5618
- name?: string;
5619
- stripDataLayers?: boolean;
5620
- }): GeoLibreProject;
5621
- //#endregion
5622
2470
  //#region src/style-library.d.ts
5623
2471
  /**
5624
2472
  * Layer types whose symbology is driven by the vector {@link LayerStyle}
@@ -5750,6 +2598,26 @@ export declare const MAX_LAYER_LIBRARY_ENTRIES = 500;
5750
2598
  * @returns True when the source alone is enough to recreate the layer's data.
5751
2599
  */
5752
2600
  export declare function hasRestorableLayerSource(layer: Pick<GeoLibreLayer, "source" | "metadata">): boolean;
2601
+ /**
2602
+ * The absolute local path a layer's data can be **re-read** from, or undefined.
2603
+ *
2604
+ * A non-empty `sourcePath` is not enough on its own: a file picked in the
2605
+ * browser has no path, and both the vector and raster controls still record the
2606
+ * bare file *name* there for display. Each control marks a genuinely re-readable
2607
+ * absolute path differently, so both conventions are honored:
2608
+ *
2609
+ * - Vector / plain local GeoJSON: `metadata.localFileReloadable` alongside an
2610
+ * absolute `sourcePath` (`prepareLayerForSave`, `needsLocalFileReload`,
2611
+ * `restoreVectorLayers`).
2612
+ * - Raster / COG: `metadata.localFilePath` holds the absolute path outright,
2613
+ * and it is what `restoreRasterLayers` re-reads on restore. Without this
2614
+ * branch a locally-opened COG could not be saved at all, even though its
2615
+ * restore pass is fully able to replay it.
2616
+ *
2617
+ * Every candidate is re-validated, because a hand-edited project or an imported
2618
+ * bundle can set these fields to anything.
2619
+ */
2620
+ export declare function layerLocalPath(layer: Pick<GeoLibreLayer, "sourcePath" | "metadata">): string | undefined;
5753
2621
  /**
5754
2622
  * Whether "Save to library" applies to a layer at all — the cheap predicate the
5755
2623
  * layer actions menu gates on. Two things have to hold:
@@ -5860,6 +2728,7 @@ export interface LayerLibraryConfigPatch {
5860
2728
  virtualFields?: LayerVirtualField[];
5861
2729
  attributeForm?: AttributeFormConfig;
5862
2730
  popup?: LayerPopupConfig;
2731
+ descriptiveMetadata?: LayerDescriptiveMetadata;
5863
2732
  }
5864
2733
  /** How an entry should be re-added to the current project. */
5865
2734
  export type LayerLibraryAddPlan =
@@ -6237,6 +3106,88 @@ export interface LayerStyleMatch {
6237
3106
  */
6238
3107
  export declare function matchLayerStyleEntry(layer: GeoLibreLayer, entries: readonly LayerStyleFileEntry[]): LayerStyleMatch | null;
6239
3108
  //#endregion
3109
+ //#region src/layers-file.d.ts
3110
+ /** `type` tag identifying a layers file. */
3111
+ export declare const LAYERS_FILE_TYPE = "geolibre-layers";
3112
+ /** Format version written by {@link serializeLayersFile}. */
3113
+ export declare const LAYERS_FILE_VERSION = 1;
3114
+ /**
3115
+ * Size ceiling for a layers file, in UTF-8 bytes. A file of references is a few
3116
+ * kilobytes per layer, and the Startup setting keeps a parsed copy in the
3117
+ * desktop settings (localStorage), so a file past this is refused rather than
3118
+ * crowding out the rest of the settings.
3119
+ */
3120
+ export declare const MAX_LAYERS_FILE_BYTES: number;
3121
+ /** The layers and the folders they sit in. */
3122
+ export interface LayersFileContent {
3123
+ /** Layer records in store (bottom-to-top) order. */
3124
+ layers: GeoLibreLayer[];
3125
+ /** The folders the layers belong to, with their ancestors. */
3126
+ layerGroups: LayerGroup[];
3127
+ }
3128
+ /** The on-disk layers document. */
3129
+ export interface LayersFile extends LayersFileContent {
3130
+ type: typeof LAYERS_FILE_TYPE;
3131
+ version: typeof LAYERS_FILE_VERSION;
3132
+ }
3133
+ /**
3134
+ * Whether a layer (in its saved form) points at its data rather than carrying
3135
+ * it: it has a re-fetchable source, an http(s) source path, or an absolute
3136
+ * local path the desktop app re-reads, and holds no inline features.
3137
+ *
3138
+ * @param layer - A layer as `projectFromStore` writes it.
3139
+ * @returns True when the layer can go in a layers file.
3140
+ */
3141
+ export declare function isReferencedLayer(layer: GeoLibreLayer): boolean;
3142
+ /**
3143
+ * Pick the layers of a saved project that can go in a layers file.
3144
+ *
3145
+ * @param project - A project as `projectFromStore` writes it. A host that can
3146
+ * re-fetch a layer's features (a GeoJSON layer loaded from a URL) strips its
3147
+ * `geojson` first, so the layer counts as a reference here.
3148
+ * @returns The file content, and the names of the layers left out because they
3149
+ * carry their data inline.
3150
+ */
3151
+ export declare function extractLayersFileContent(project: Pick<GeoLibreProject, "layers" | "layerGroups">): {
3152
+ content: LayersFileContent;
3153
+ skipped: string[];
3154
+ };
3155
+ /**
3156
+ * Serialize layers into the JSON written by Export Layers.
3157
+ *
3158
+ * @param content - The layers and their folders.
3159
+ * @returns Pretty-printed file content.
3160
+ */
3161
+ export declare function serializeLayersFile(content: LayersFileContent): string;
3162
+ /**
3163
+ * Coerce untrusted layers (a hand-edited file, or the copy kept in settings)
3164
+ * into clean ones. Each layer goes through the same normalization a project
3165
+ * file's layers do; one without an id, a name, a known type, or a reference to
3166
+ * its data is dropped, as is a repeated id.
3167
+ *
3168
+ * @param value - An object with `layers` and optional `layerGroups` arrays.
3169
+ * @returns The usable layers and the folders they sit in.
3170
+ */
3171
+ export declare function normalizeLayersFileContent(value: unknown): LayersFileContent;
3172
+ /**
3173
+ * Parse a file written by {@link serializeLayersFile}.
3174
+ *
3175
+ * @param json - The file content.
3176
+ * @returns The normalized layers and folders.
3177
+ * @throws Error when the content is too large, is not a layers file, comes
3178
+ * from a newer format version, or holds no usable layers.
3179
+ */
3180
+ export declare function parseLayersFile(json: string): LayersFileContent;
3181
+ /**
3182
+ * Add a layers file's layers on top of a project's own, keeping the project's
3183
+ * layers where an id repeats.
3184
+ *
3185
+ * @param project - The project to add to (usually a new, empty one).
3186
+ * @param content - The layers and folders to add.
3187
+ * @returns A new project with the layers added.
3188
+ */
3189
+ export declare function addLayersToProject(project: GeoLibreProject, content: LayersFileContent): GeoLibreProject;
3190
+ //#endregion
6240
3191
  //#region src/layer-groups.d.ts
6241
3192
  /** Opacity a freshly created {@link LayerGroup} starts at (fully opaque). */
6242
3193
  export declare const DEFAULT_LAYER_GROUP_OPACITY = 1;
@@ -6673,6 +3624,15 @@ export interface S3UrlSigner {
6673
3624
  status: number;
6674
3625
  body: string;
6675
3626
  }>;
3627
+ /**
3628
+ * Drops the cached credentials and signed URLs of the connection that
3629
+ * serves `target`, so the next `presign` resolves them afresh. Called when S3
3630
+ * refuses a request as expired.
3631
+ */
3632
+ invalidateCredentials?(target: {
3633
+ bucket?: string;
3634
+ connectionId?: string;
3635
+ }): void;
6676
3636
  /** The persisted location (`s3://bucket/prefix/`) the S3 browser opens at, or "". */
6677
3637
  defaultLocation?(): string;
6678
3638
  /** Persists the S3 browser's default location; "" clears it. */
@@ -6814,6 +3774,20 @@ export declare function isStoryHiddenLayer(opacities: Record<string, number> | u
6814
3774
  * @param opacities The store's `ui.storymapLayerOpacity` record.
6815
3775
  */
6816
3776
  export declare function storyVisibleLayers(layers: GeoLibreLayer[], presenting: boolean, opacities: Record<string, number> | undefined): GeoLibreLayer[];
3777
+ /**
3778
+ * Resolve a story chapter location to a full camera view.
3779
+ *
3780
+ * A location's `pitch` and `bearing` are optional in memory (a project file
3781
+ * fills them with 0 on load). An absent value keeps the camera's current one,
3782
+ * the same as MapLibre's camera methods do for an omitted option, so engines
3783
+ * whose camera API needs every field (Cesium, `MapEngine.applyView`) behave
3784
+ * like the MapLibre map.
3785
+ *
3786
+ * @param location The chapter's camera target.
3787
+ * @param current The camera's current view, used for an absent pitch/bearing.
3788
+ * @returns The location with `pitch` and `bearing` filled in.
3789
+ */
3790
+ export declare function storyLocationView(location: StoryChapterLocation, current: Pick<MapViewState, "pitch" | "bearing">): MapViewState;
6817
3791
  //#endregion
6818
3792
  //#region src/layer-ref-scrub.d.ts
6819
3793
  /**
@@ -7035,6 +4009,13 @@ interface LayersSlice {
7035
4009
  * `undefined` to restore the default full-property dump.
7036
4010
  */
7037
4011
  setLayerPopup: (id: string, popup: LayerPopupConfig | undefined) => void;
4012
+ /**
4013
+ * Replace the layer's user-authored catalog metadata (title, abstract,
4014
+ * keywords, license, contact, lineage, temporal extent, links). The record
4015
+ * is normalized first; one that cleans to nothing (or `undefined`) removes
4016
+ * the metadata entirely. One call is one undo step.
4017
+ */
4018
+ setLayerDescriptiveMetadata: (id: string, metadata: LayerDescriptiveMetadata | undefined) => void;
7038
4019
  /**
7039
4020
  * Replace the layer's editor tracking configuration (whether creation/edit
7040
4021
  * author and timestamp columns are maintained, and under which names). Pass
@@ -7257,6 +4238,11 @@ interface ProcessingSlice {
7257
4238
  models: ProcessingModel[];
7258
4239
  /** Recorded processing tool runs, oldest first (Processing History; #1292). */
7259
4240
  processingHistory: ProcessingRun[];
4241
+ /**
4242
+ * Object-Based Analysis workbench state saved with the project (#3053), an
4243
+ * app-owned JSON object; null until the workbench is used.
4244
+ */
4245
+ obiaWorkbench: Record<string, unknown> | null;
7260
4246
  /** Insert a new model or replace an existing one matching by `id`. */
7261
4247
  saveModel: (model: ProcessingModel) => void;
7262
4248
  /** Remove a saved model by id. */
@@ -7267,6 +4253,11 @@ interface ProcessingSlice {
7267
4253
  updateProcessingRun: (id: string, patch: Partial<Omit<ProcessingRun, "id">>) => void;
7268
4254
  /** Drop all recorded processing runs. */
7269
4255
  clearProcessingHistory: () => void;
4256
+ /**
4257
+ * Replace the saved workbench state. `markDirty` is false when the app is
4258
+ * only mirroring state it just restored, so opening a project stays clean.
4259
+ */
4260
+ setObiaWorkbench: (value: Record<string, unknown> | null, markDirty?: boolean) => void;
7270
4261
  }
7271
4262
  //#endregion
7272
4263
  //#region src/store/project-content-slice.d.ts
@@ -7276,6 +4267,10 @@ interface ProjectContentSlice {
7276
4267
  widgets: DashboardWidget[];
7277
4268
  /** Number of columns in the Dashboard widget grid. */
7278
4269
  dashboardColumns: number;
4270
+ /** Saved map views from the Bookmarks panel, in panel order (#2869). */
4271
+ bookmarks: ProjectBookmark[];
4272
+ /** Folders the bookmarks are organized into. */
4273
+ bookmarkGroups: ProjectBookmarkGroup[];
7279
4274
  /** Anchored review comments on map points or features (issue #1518). */
7280
4275
  comments: ProjectComment[];
7281
4276
  /**
@@ -7311,6 +4306,11 @@ interface ProjectContentSlice {
7311
4306
  toggleResolveComment: (commentId: string, resolved?: boolean) => void;
7312
4307
  deleteComment: (commentId: string) => void;
7313
4308
  setComments: (comments: ProjectComment[]) => void;
4309
+ /**
4310
+ * Replace every bookmark and folder (the Bookmarks panel writes its whole
4311
+ * state back after each edit). Marks the project dirty.
4312
+ */
4313
+ setBookmarks: (bookmarks: ProjectBookmark[], bookmarkGroups: ProjectBookmarkGroup[]) => void;
7314
4314
  }
7315
4315
  //#endregion
7316
4316
  //#region src/store/project-slice.d.ts
@@ -7335,8 +4335,14 @@ interface ProjectSlice {
7335
4335
  */
7336
4336
  setPrintLayout: (printLayout: PrintLayoutConfig) => void;
7337
4337
  setProjectPlugins: (projectPlugins: ProjectPluginState | null, shouldMarkDirty?: boolean) => void;
4338
+ /**
4339
+ * Start a new, untitled project. `layers` and `layerGroups` seed it with
4340
+ * layers (the Startup setting's default layers).
4341
+ */
7338
4342
  newProject: (options?: CreateProjectOptions & {
7339
4343
  name?: string;
4344
+ layers?: GeoLibreLayer[];
4345
+ layerGroups?: LayerGroup[];
7340
4346
  }) => void;
7341
4347
  loadProject: (project: GeoLibreProject, path?: string | null, options?: {
7342
4348
  rememberRecent?: boolean;
@@ -7435,6 +4441,9 @@ interface SessionSlice {
7435
4441
  * plain meaning.
7436
4442
  */
7437
4443
  identifyLayerIds: string[] | null;
4444
+ /** Transient map-selection gesture activity, published by the primary renderer. */
4445
+ featureSelectionActive: boolean;
4446
+ setFeatureSelectionActive: (active: boolean) => void;
7438
4447
  pointerCoords: [number, number] | null;
7439
4448
  /**
7440
4449
  * Ground elevation in true metres under the pointer, for the status bar
@@ -7516,6 +4525,12 @@ interface UiSlice {
7516
4525
  notebookOpen: boolean;
7517
4526
  assistantOpen: boolean;
7518
4527
  attributeTableOpen: boolean;
4528
+ /**
4529
+ * Pending "open the attribute table in edit mode" request for this layer,
4530
+ * written by Identify's Edit attributes action (#2932). The table consumes
4531
+ * and clears it. Null when idle.
4532
+ */
4533
+ attributeTableEditLayerId: string | null;
7519
4534
  /** Whether the Raster Attribute Table bottom panel is open (issue #1307). */
7520
4535
  rasterAttributeTableOpen: boolean;
7521
4536
  dashboardOpen: boolean;
@@ -7575,6 +4590,11 @@ interface UiSlice {
7575
4590
  setNotebookOpen: (open: boolean) => void;
7576
4591
  setAssistantOpen: (open: boolean) => void;
7577
4592
  setAttributeTableOpen: (open: boolean) => void;
4593
+ /**
4594
+ * Ask the attribute table to open in edit mode on `layerId` (opening the
4595
+ * table too), or clear a pending request with `null`.
4596
+ */
4597
+ requestAttributeTableEdit: (layerId: string | null) => void;
7578
4598
  setRasterAttributeTableOpen: (open: boolean) => void;
7579
4599
  setDashboardOpen: (open: boolean) => void;
7580
4600
  setStorymapPanelOpen: (open: boolean) => void;
@@ -7608,7 +4628,7 @@ interface AppState extends ProjectSlice, MapViewSlice, LayersSlice, LayerGroupsS
7608
4628
  //#endregion
7609
4629
  //#region src/store/undo-history.d.ts
7610
4630
  /** The fields undo/redo snapshots, restores and compares. */
7611
- type HistoryState = Pick<AppState, "layers" | "layerGroups" | "basemapStyleUrl" | "basemapVisible" | "basemapOpacity" | "blankBackgroundColor" | "storymap" | "comments">;
4631
+ type HistoryState = Pick<AppState, "layers" | "layerGroups" | "basemapStyleUrl" | "basemapVisible" | "basemapOpacity" | "blankBackgroundColor" | "storymap" | "comments" | "widgets" | "legend">;
7612
4632
  export declare function subscribeProjectRestoreHistory(listener: () => void): () => void;
7613
4633
  export declare function canUndoProjectRestore(): boolean;
7614
4634
  export declare function canRedoProjectRestore(): boolean;
@@ -7628,6 +4648,14 @@ export declare function registerProjectRestoreHistory(before: GeoLibreProject, b
7628
4648
  export declare function undo(): void;
7629
4649
  /** Step the history forward one entry and mark the project dirty. */
7630
4650
  export declare function redo(): void;
4651
+ /**
4652
+ * Apply a store change that is not the user's (data loading in behind a
4653
+ * project) without recording an undo step for it. The history stays as it
4654
+ * was, so undo neither takes the change back out nor loses earlier steps.
4655
+ *
4656
+ * @param change - The store updates to apply.
4657
+ */
4658
+ export declare function withoutHistory(change: () => void): void;
7631
4659
  /** Empty both the undo and redo stacks (e.g. on new/loaded project). */
7632
4660
  export declare function clearHistory(): void;
7633
4661
  //#endregion
@@ -7635,6 +4663,14 @@ export declare function clearHistory(): void;
7635
4663
  export declare const useAppStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<AppState>, "temporal"> & {
7636
4664
  temporal: import("zustand").StoreApi<import("zundo").TemporalState<HistoryState>>;
7637
4665
  }>;
4666
+ /**
4667
+ * Whether the map should fit to data the user just added, per the project's
4668
+ * Map Preferences. Add-data paths consult this before an automatic fit; an
4669
+ * explicit "Zoom to layer" request ignores it.
4670
+ *
4671
+ * @returns `true` unless the user turned off zooming to new layers.
4672
+ */
4673
+ export declare function shouldZoomToNewLayers(): boolean;
7638
4674
  /**
7639
4675
  * React hook for consuming application capability state for a specific privilege.
7640
4676
  *
@@ -8595,11 +5631,29 @@ interface CredentialRedactionResult {
8595
5631
  export declare const MAX_REDACT_DEPTH = 12;
8596
5632
  /** Whether an object key in layer/plugin configuration holds a credential. */
8597
5633
  export declare function isCredentialFieldName(name: string): boolean;
5634
+ /**
5635
+ * Whether a URL query-parameter name carries a credential. This is the wider of
5636
+ * the two registries (see `URL_CREDENTIAL_PARAMS`). Exported so a caller that
5637
+ * must leave the parameter in place — the native diagnostics log rewrites its
5638
+ * value to `[redacted]` rather than dropping the pair — shares this registry
5639
+ * instead of keeping a second, narrower list that can drift from it.
5640
+ */
5641
+ export declare function isCredentialUrlParam(name: string): boolean;
8598
5642
  /**
8599
5643
  * Remove credentials from URL-shaped values without encoding tile-template
8600
5644
  * placeholders such as `{z}/{x}/{y}`.
8601
5645
  */
8602
5646
  export declare function redactUrlCredentials(value: string): string;
5647
+ /**
5648
+ * Replace the registry-declared publishable plugin settings.
5649
+ *
5650
+ * Built-in ids in {@link PUBLISHABLE_PLUGIN_SETTINGS} always win, so a registry
5651
+ * entry cannot widen a first-party plugin's allowlist.
5652
+ *
5653
+ * @param entries Plugin ids mapped to the settings keys to keep, or `null` to
5654
+ * keep the whole blob. Ids that declare nothing should be omitted.
5655
+ */
5656
+ export declare function setRegistryPublishableSettings(entries: Iterable<readonly [string, readonly string[] | null]>): void;
8603
5657
  /**
8604
5658
  * Return a detached project safe for any external egress.
8605
5659
  *
@@ -8612,9 +5666,22 @@ export declare function redactUrlCredentials(value: string): string;
8612
5666
  * and carries no credentials, and dropping it stripped the legend, colorbar,
8613
5667
  * and swipe from the exported map. Manifest URLs, activation, and control
8614
5668
  * positions stay intact so recipients can still load and configure the plugin
8615
- * themselves.
5669
+ * themselves. A registry-listed external plugin can opt in through the
5670
+ * `publishableSettings` field of its registry entry (see
5671
+ * {@link setRegistryPublishableSettings}); what it keeps is still swept below.
8616
5672
  */
8617
5673
  export declare function redactProjectCredentials(project: GeoLibreProject): CredentialRedactionResult;
5674
+ /**
5675
+ * Remove credentials from a single configuration value (a layer `source`,
5676
+ * `metadata`, or `sourcePath`) with the same rules the project redaction pass
5677
+ * applies to layer configuration: credential-named fields and non-reference
5678
+ * header values are dropped, and credential URL parameters are stripped from
5679
+ * every URL-shaped string.
5680
+ *
5681
+ * @param value - The configuration value to scrub. Not mutated.
5682
+ * @returns A detached, redacted copy.
5683
+ */
5684
+ export declare function redactConfigurationCredentials<T>(value: T): T;
8618
5685
  /** Convenience wrapper for callers that only need the safe project. */
8619
5686
  export declare function redactCredentials(project: GeoLibreProject): GeoLibreProject;
8620
5687
  //#endregion
@@ -8777,5 +5844,94 @@ export declare function localFileName(path: string): string;
8777
5844
  /** Keep imported layers distinguishable, including within a multi-file import. */
8778
5845
  export declare function uniqueImportedLayerName(name: string, names: Iterable<string>): string;
8779
5846
  //#endregion
8780
- export type { AppState, CesiumIonAssetKind, CesiumIonLayerOptions, CesiumIonQuickPick, CesiumIonQuickPickGroup, CesiumKmlLayerOptions, ConversionToolKind, CredentialRedactionResult, CzmlDocument, CzmlLayerOptions, CzmlPacket, CzmlSource, GeocodeMatch, GeocodeRequest, GeocodeStatus, GeocoderConfig, GeocodingPreferenceInput, GeocodingProvider, GeocodingProviderId, GpsStatusFix, IdentifyState, LayerSummary, NetworkToolKind, NominatimForwardResult, NominatimReverseResult, ProjectCredentialLookup, RasterToolKind, ReverseGeocodeDisplay, StatisticsToolKind, VectorToolKind };
5847
+ //#region src/datum-shift.d.ts
5848
+ /**
5849
+ * Datum shifts (proj4 `+towgs84` Helmert parameters) for coordinate systems
5850
+ * whose datum is not WGS84-compatible, by EPSG code.
5851
+ *
5852
+ * The offline EPSG tables GeoLibre resolves codes with
5853
+ * (`geotiff-geokeys-to-proj4`) leave the shift out for many national grids, and
5854
+ * epsg.io's PROJJSON for a projected CRS carries no transformation either, so
5855
+ * proj4 would treat those datums as WGS84 and place data tens to hundreds of
5856
+ * metres off (about 100 m for the British National Grid). The parameters are
5857
+ * EPSG's (the transformation epsg.io's proj4 strings use), within a few
5858
+ * metres of PROJ's best transformation for each (15 m for the NAD27 mean);
5859
+ * grid-based transformations (OSTN15, NTv2, NADCON) are finer but need grid
5860
+ * files proj4 does not ship. Datums the tables already shift (ED50, AGD66,
5861
+ * AGD84, Tokyo, NZGD49, TM75 and others) are not listed.
5862
+ */
5863
+ /**
5864
+ * The `+towgs84` parameters for an EPSG CRS or datum code, or null when the
5865
+ * code is not one whose shift GeoLibre adds.
5866
+ *
5867
+ * @param crs An EPSG geographic or projected CRS code.
5868
+ * @param datum An EPSG datum code, used when the CRS code is unknown.
5869
+ */
5870
+ export declare function datumShiftFor(crs: number | null | undefined, datum?: number | null): string | null;
5871
+ /**
5872
+ * Add the datum shift to a proj4 definition built for an EPSG CRS (or from a
5873
+ * GeoTIFF's geokeys), when the definition has none and the CRS is one whose
5874
+ * shift is known. A definition that already names a datum transformation
5875
+ * (`+towgs84`, `+datum=`, `+nadgrids=`) is returned unchanged.
5876
+ *
5877
+ * @param definition A proj4 definition string.
5878
+ * @param crs The EPSG CRS code it was built for.
5879
+ * @param datum The EPSG datum code, for a user-defined CRS.
5880
+ */
5881
+ export declare function withDatumShift(definition: string, crs: number | null | undefined, datum?: number | null): string;
5882
+ /**
5883
+ * Add the datum shift to a proj4 definition built from GeoTIFF geokeys, from
5884
+ * the projected or geographic CRS code, else the datum code.
5885
+ *
5886
+ * @param definition The proj4 definition built from `geoKeys`.
5887
+ * @param geoKeys The GeoTIFF's geokeys (geotiff.js names).
5888
+ */
5889
+ export declare function withGeoKeysDatumShift(definition: string, geoKeys: Record<string, unknown> | null | undefined): string;
5890
+ /** The part of `cog-tiler-wasm` the datum-shift hook needs (0.5 and later). */
5891
+ interface CogTilerCrsHook {
5892
+ setSourceCrsResolver?: (fn: ((def: string, geoKeys: Record<string, unknown>) => string | null | undefined) | null) => void;
5893
+ }
5894
+ /**
5895
+ * Have `cog-tiler-wasm` add the datum shift to each COG's source CRS, so a
5896
+ * raster it tiles lands where the rest of GeoLibre puts it. Idempotent; a
5897
+ * tiler without the hook is left as it is. WKT definitions are left alone.
5898
+ *
5899
+ * @param module The imported `cog-tiler-wasm` module.
5900
+ */
5901
+ export declare function installCogTilerDatumShift(module: CogTilerCrsHook): void;
5902
+ //#endregion
5903
+ //#region src/cog-jpeg-tables.d.ts
5904
+ type NumericArray = ArrayLike<number> | undefined;
5905
+ /** Convert separate TIFF Y/Cb/Cr planes to RGB using tags 529 and 532. */
5906
+ export declare function convertTiffYCbCrToRgb(yPlane: ArrayLike<number>, cbPlane: ArrayLike<number>, crPlane: ArrayLike<number>, coefficients?: NumericArray, referenceBlackWhite?: NumericArray): [Float64Array, Float64Array, Float64Array];
5907
+ /**
5908
+ * Whether a cog-tiler-wasm level's `compression` is baseline JPEG, the only
5909
+ * codec whose tiles may omit their tables (TIFF tag 347) and so need the
5910
+ * geotiff.js window read in {@link patchJpegCogSource}. The string is whitebox-wasm's
5911
+ * enum name, so match `Jpeg`/`OldJpeg` exactly: a looser `/jpeg/i` would also
5912
+ * catch `JpegXl`, which the wasm decoder handles and geotiff.js cannot decode
5913
+ * at all (#2339).
5914
+ */
5915
+ export declare function isAbbreviatedJpegCompression(compression: string | undefined): boolean;
5916
+ /**
5917
+ * Route an abbreviated-JPEG COG's tile windows through geotiff.js, which reads
5918
+ * the shared tables, converting Y/Cb/Cr to the RGB bands the renderers expect.
5919
+ * Any other source is returned unchanged.
5920
+ *
5921
+ * @param source - A cog-tiler-wasm source.
5922
+ * @returns The same source, patched in place when it needs it.
5923
+ */
5924
+ export declare function patchJpegCogSource(source: unknown): unknown;
5925
+ /**
5926
+ * A cog-tiler module whose `openCog` returns {@link patchJpegCogSource}-patched
5927
+ * sources; the rest of the module is passed through.
5928
+ *
5929
+ * @param module - The cog-tiler-wasm module (or a test double).
5930
+ * @returns The wrapped module.
5931
+ */
5932
+ export declare function withJpegTablesPatch<M extends {
5933
+ openCog: (input: never) => Promise<unknown>;
5934
+ }>(module: M): M;
5935
+ //#endregion
5936
+ export { AddTileLayerOptions, AppCapabilities, AppPrivilege, AppRole, type AppState, ApplyLayerJoinsResult, AttributeFormConfig, AttributeFormFieldConfig, AttributeFormValueMapEntry, AttributeFormWidget, BLANK_BASEMAP, BLEND_MODES, BlendMode, CESIUM_BASEMAPS, CesiumBasemapId, CesiumBasemapImagery, type CesiumIonAssetKind, type CesiumIonLayerOptions, type CesiumIonQuickPick, type CesiumIonQuickPickGroup, type CesiumKmlLayerOptions, CollabInvite, CollaborationChatMessage, CollaborationMode, CollaborationParticipant, CollaborationPresence, CollaborationRole, CollaborationState, CommentAnchor, CommentAuthor, CommentReply, type ConversionToolKind, CreateProjectOptions, type CredentialRedactionResult, type CzmlDocument, type CzmlLayerOptions, type CzmlPacket, type CzmlSource, DEFAULT_BASEMAP, DEFAULT_BLEND_MODE, DEFAULT_DASHBOARD_COLUMNS, DEFAULT_ELLIPSOID_ID, DEFAULT_LAYER_STYLE, DEFAULT_LEGEND_CONFIG, DEFAULT_MAP_GRID_LAYOUT, DEFAULT_PRIMARY_RENDERER, DEFAULT_PRINT_LAYOUT, DEFAULT_PROJECT_NAME, DEFAULT_PROJECT_PREFERENCES, DEFAULT_STORY_MAP, DUCKDB_VECTOR_FEATURE_WARN_COUNT, DUCKDB_VECTOR_ROUTE_BYTES, DashboardWidget, DashboardWidgetAggregation, DashboardWidgetType, DiagramField, DiagramSizeMode, DiagramType, EARTH_MEAN_RADIUS_METERS, ELLIPSOIDS, EditorTrackingConfig, Ellipsoid, EllipsoidId, FeatureChangeSummary, FieldVisibility, FillPattern, GeoLibreLayer, GeoLibreProject, type GeocodeMatch, type GeocodeRequest, type GeocodeStatus, type GeocoderConfig, type GeocodingPreferenceInput, GeocodingPreferences, type GeocodingProvider, type GeocodingProviderId, GeometryGeneratorType, type GpsStatusFix, type IdentifyState, IndicatorAggregation, LARGE_VECTOR_FEATURE_THRESHOLD, LAYER_TYPES, LabelAnchor, LabelDedupe, LabelStyle, LabelTransform, LayerCapabilities, LayerConnection, LayerDescriptiveMetadata, LayerDiff, LayerGroup, LayerJoin, LayerJoinStats, LayerLibraryEntry, LayerMetadataContact, LayerMetadataLink, LayerMetadataTemporalExtent, LayerPopupConfig, LayerQuickFilter, LayerStyle, type LayerSummary, LayerType, LayerVirtualField, LegendConfig, LegendCustomEntry, LegendCustomItem, LegendCustomShape, LegendItemOverride, LegendPanelPosition, LineDecoration, MAX_DASHBOARD_COLUMNS, MAX_MAP_GRID_DIM, MAX_PROCESSING_HISTORY, MAX_PROJECT_BOOKMARKS, MIN_DASHBOARD_COLUMNS, MapGridLayout, MapPreferences, MapProjection, MapRendererKind, MapScaleUnit, MapViewState, MarkerShape, ModelGraphEdge, ModelGraphNode, ModelGraphNodeKind, ModelGraphPort, ModelPortKind, ModelToolProvider, NETCDF_IMAGE_SOURCE_KIND, type NetworkToolKind, type NominatimForwardResult, type NominatimReverseResult, NonGeographicCoordinates, OPENFREEMAP_BASEMAPS, PLANETARY_BASEMAPS, PLANETARY_BASEMAP_GROUPS, PLANETARY_BASEMAP_SENTINEL_PREFIX, PLANET_SWITCHER_OPTIONS, PROJECT_VERSION, PROTOMAPS_BASEMAPS, ParticipantIdentity, PlanetaryBasemap, PlanetaryBasemapGroup, PlanetaryBasemapSectionId, PluginDiff, PointRenderer, PolylineBatchOptions, PolylineDecodeResult, PopupDateFormat, PopupFieldConfig, PopupFieldFormat, PopupFieldKind, PrintLayoutConfig, PrintLayoutCorner, PrintLayoutLegendEntry, PrintLayoutPageFilter, ProcessingModel, ProcessingModelGraph, ProcessingModelStep, ProcessingRerunRequest, ProcessingRun, ProcessingRunKind, ProcessingRunStatus, ProjectBookmark, ProjectBookmarkGroup, ProjectComment, type ProjectCredentialLookup, ProjectDiff, ProjectDiffOptions, ProjectInteraction, ProjectLayerSerializationCache, ProjectPluginControlPosition, ProjectPluginState, ProjectPreferences, ProjectTemplateEntry, ProjectValueChange, QuickFilterDateKind, QuickFilterKind, QuickFilterTextOperator, type RasterToolKind, RecentProjectEntry, type ReverseGeocodeDisplay, RuntimeEnvironmentVariable, SQL_QUERY_SOURCE_KIND, SecondaryMapView, type StatisticsToolKind, StoryActiveSlideMode, StoryChapter, StoryChapterAlignment, StoryChapterAnimation, StoryChapterLocation, StoryInsetPosition, StoryLayerOpacityChange, StoryMap, StorySlideMode, StrokeWidthUnit, StyleLibraryEntry, StyleLibraryEntryKind, VectorRule, VectorStyleMode, VectorStyleStop, type VectorToolKind, applyJoinsToLayer, applyLayerJoins, applyProjectToStore, availableCesiumBasemap, basemapToCesiumImagery, batchDecodePolylines, bodyLengthToEarth, cascadeLayerJoinRefresh, collectTransitiveJoinSourceIds, createDefaultMapView, createDefaultPrintLayout, createEmptyProject, createProjectLayerSerializationCache, createProjectTemplate, decodePolyline, decodePolylineDetailed, detachProjectCopy, detectNonGeographicCoordinates, diffFeatureCollections, diffProjects, earthAreaToBody, earthLengthToBody, encodePolyline, geoJSONToPolylineStr, geojsonHasZCoordinates, getActiveBodyRadiusRatio, getActiveEllipsoid, getActiveMeanRadiusMeters, getActiveSemiMajorAxisMeters, getEllipsoid, getPlanetaryBasemapById, getPlanetaryBasemapByStyleUrl, horizontalBbox, hydrateProjectLayer, isAllowedPluginManifestUrl, isDefaultPrintLayout, isDuckDBQueryLayer, isSessionOnlyLayer, jsonValuesEqual, layerJoinKey, meanRadiusMeters, normalizeBlankBackgroundColor, normalizeBookmarkGroups, normalizeBookmarks, normalizeCesiumBasemap, normalizeDashboardColumns, normalizeLegendConfig, normalizeMapLayout, normalizeMapViewState, normalizeModelGraph, normalizeModels, normalizeObiaWorkbench, normalizePrimaryRenderer, normalizePrintLayoutConfig, normalizeProcessingHistory, normalizeProjectComments, normalizeProjectInteraction, normalizeSecondaryMapViews, normalizeStoryMap, normalizeWidgets, parseProject, polylineStrToGeoJSON, portableWmsTileUrl, previewValue, printLayoutConfigsEqual, projectFromStore, reapplyLayerJoins, resolveMapGrid, sameCesiumImagery, scrubPrintLayoutForLayers, scrubPrintLayoutForRemovedLayers, serializeProject, serializeProjectWithLayerCache, serializeProjectWithLayerCacheAsync, setActiveEllipsoidId, shouldUseTiledRendering, storyMapHasContent, stripJoinFields, styleValue, transformGeojsonElevation, unescapePolyline };
8781
5937
  //# sourceMappingURL=index.d.mts.map