@geolibre/core 3.3.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 +339 -462
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +978 -6355
- package/dist/index.mjs.map +1 -1
- package/dist/{joins-CRZZcLqX.d.mts → project-diff-BD23T4xv.d.mts} +588 -3
- package/dist/project-diff-BD23T4xv.d.mts.map +1 -0
- package/dist/project-diff-Bua7fBME.mjs +8140 -0
- package/dist/project-diff-Bua7fBME.mjs.map +1 -0
- package/dist/worker-safe.d.mts +2 -2
- package/dist/worker-safe.mjs +2 -2
- package/package.json +1 -1
- package/dist/joins-CGcRoTpc.mjs +0 -1822
- package/dist/joins-CGcRoTpc.mjs.map +0 -1
- package/dist/joins-CRZZcLqX.d.mts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
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";
|
|
2
2
|
import "zustand";
|
|
3
3
|
import "zundo";
|
|
4
4
|
//#region src/diagram.d.ts
|
|
@@ -116,6 +116,28 @@ export declare function diagramPixelSize(datum: DiagramDatum, style: LayerStyle,
|
|
|
116
116
|
* stroke is not clipped at the edge.
|
|
117
117
|
*/
|
|
118
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;
|
|
119
141
|
/**
|
|
120
142
|
* Resolve user-supplied SVG input to an `Image.src`: inline markup (starting
|
|
121
143
|
* with `<`) is encoded as a data URL; otherwise only `data:` and `http(s):`
|
|
@@ -264,6 +286,39 @@ export declare function getRegionalBasemapById(id: string | undefined): Regional
|
|
|
264
286
|
/** Whether a style URL is a regional-basemap sentinel, resolvable or not. */
|
|
265
287
|
export declare function isRegionalBasemapSentinel(styleUrl: string | undefined): boolean;
|
|
266
288
|
//#endregion
|
|
289
|
+
//#region src/arcgis-projection.d.ts
|
|
290
|
+
/**
|
|
291
|
+
* Projections the ArcGIS renderer can draw its flat map in (issue #2708).
|
|
292
|
+
*
|
|
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.
|
|
298
|
+
*/
|
|
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[];
|
|
310
|
+
/**
|
|
311
|
+
* Normalize a stored ArcGIS projection WKID.
|
|
312
|
+
*
|
|
313
|
+
* Args:
|
|
314
|
+
* value: The raw `preferences.map.arcgisWkid` value.
|
|
315
|
+
*
|
|
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).
|
|
319
|
+
*/
|
|
320
|
+
export declare function normalizeArcgisWkid(value: unknown): number | undefined;
|
|
321
|
+
//#endregion
|
|
267
322
|
//#region src/color-ramp.d.ts
|
|
268
323
|
/**
|
|
269
324
|
* Color-ramp definitions and classification-break helpers shared by the
|
|
@@ -382,7 +437,7 @@ export declare function createEqualIntervalBreaks(min: number, max: number, coun
|
|
|
382
437
|
*/
|
|
383
438
|
export declare function createQuantileBreaks(values: number[], count: number): number[];
|
|
384
439
|
/** The classification schemes the graduated vector renderer offers. */
|
|
385
|
-
export type GraduatedClassificationScheme = "equal-interval" | "quantile" | "natural-breaks";
|
|
440
|
+
export type GraduatedClassificationScheme = "equal-interval" | "quantile" | "natural-breaks" | "standard-deviation" | "geometric-interval";
|
|
386
441
|
/**
|
|
387
442
|
* Builds the class *lower bounds* for a graduated vector renderer.
|
|
388
443
|
*
|
|
@@ -401,6 +456,12 @@ export type GraduatedClassificationScheme = "equal-interval" | "quantile" | "nat
|
|
|
401
456
|
* MapLibre rejects a `step` expression whose inputs are not strictly ascending,
|
|
402
457
|
* so this de-duplication is load-bearing, not cosmetic.
|
|
403
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
|
+
*
|
|
404
465
|
* @param values - The finite numeric values of the classified property.
|
|
405
466
|
* @param count - Number of classes requested.
|
|
406
467
|
* @param scheme - The classification scheme.
|
|
@@ -661,6 +722,18 @@ export declare function requestMatrix(endpoint: string, body: MatrixRequestBody,
|
|
|
661
722
|
* @returns The Valhalla `/route` response.
|
|
662
723
|
*/
|
|
663
724
|
export declare function requestRoute(endpoint: string, body: RouteRequestBody, signal?: AbortSignal): Promise<unknown>;
|
|
725
|
+
/**
|
|
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).
|
|
730
|
+
*
|
|
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.
|
|
735
|
+
*/
|
|
736
|
+
export declare function requestNavigationRoute(endpoint: string, body: Record<string, unknown>, signal?: AbortSignal): Promise<unknown>;
|
|
664
737
|
//#endregion
|
|
665
738
|
//#region src/vector-color.d.ts
|
|
666
739
|
/**
|
|
@@ -1484,6 +1557,13 @@ export declare function isAdoptedVectorAwaitingFeatures(layer: {
|
|
|
1484
1557
|
export interface AttributeFormEvalOptions {
|
|
1485
1558
|
/** Map zoom for `["zoom"]` in expressions; defaults to 0. */
|
|
1486
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;
|
|
1487
1567
|
/**
|
|
1488
1568
|
* Real feature backing the properties, when the caller has one — its
|
|
1489
1569
|
* geometry feeds `["geometry-type"]` and geometry-aware operators. Its
|
|
@@ -1494,7 +1574,7 @@ export interface AttributeFormEvalOptions {
|
|
|
1494
1574
|
}
|
|
1495
1575
|
/** Why a field's value was rejected; codes map to localized messages. */
|
|
1496
1576
|
export interface AttributeFormFieldError {
|
|
1497
|
-
code: "required" | "number" | "range" | "valueMap" | "constraint";
|
|
1577
|
+
code: "required" | "number" | "integer" | "text" | "range" | "valueMap" | "constraint";
|
|
1498
1578
|
/**
|
|
1499
1579
|
* For `constraint`: the author's `constraintDescription`, or the
|
|
1500
1580
|
* expression's own error text when it failed to evaluate.
|
|
@@ -1546,10 +1626,26 @@ export declare function isAttributeFormFieldVisible(config: AttributeFormFieldCo
|
|
|
1546
1626
|
export declare function validateAttributeFormField(config: AttributeFormFieldConfig, properties: Record<string, unknown>, options?: AttributeFormEvalOptions): AttributeFormFieldError | null;
|
|
1547
1627
|
/**
|
|
1548
1628
|
* Validate a whole candidate properties record against a form config. Hidden
|
|
1549
|
-
* fields (visibility expression currently false)
|
|
1550
|
-
* 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.
|
|
1551
1632
|
*/
|
|
1552
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;
|
|
1553
1649
|
//#endregion
|
|
1554
1650
|
//#region src/layer-descriptive-metadata.d.ts
|
|
1555
1651
|
/** STAC specification version the Item export targets. */
|
|
@@ -2371,461 +2467,6 @@ export declare function scaleAltitudeToActiveBody(earthAltitudeMeters: number |
|
|
|
2371
2467
|
*/
|
|
2372
2468
|
export declare function formatCameraAltitude(meters: number, unit: MapScaleUnit): string;
|
|
2373
2469
|
//#endregion
|
|
2374
|
-
//#region src/project.d.ts
|
|
2375
|
-
/** Placeholder name a project carries before the user names it. */
|
|
2376
|
-
export declare const DEFAULT_PROJECT_NAME = "Untitled Project";
|
|
2377
|
-
export interface CreateProjectOptions {
|
|
2378
|
-
basemapStyleUrl?: string;
|
|
2379
|
-
mapView?: MapViewState;
|
|
2380
|
-
/** Celestial body the project describes; defaults to Earth when omitted. */
|
|
2381
|
-
ellipsoidId?: string;
|
|
2382
|
-
}
|
|
2383
|
-
export declare function normalizeBlankBackgroundColor(value: unknown): string | null;
|
|
2384
|
-
export declare function createDefaultMapView(): MapViewState;
|
|
2385
|
-
export declare function createEmptyProject(name?: string, options?: CreateProjectOptions): GeoLibreProject;
|
|
2386
|
-
/**
|
|
2387
|
-
* Serialize a project to `.geolibre.json` text: indented project structure with
|
|
2388
|
-
* compact (unindented) embedded GeoJSON. See {@link serializeProjectValue} for
|
|
2389
|
-
* why the two halves are formatted differently.
|
|
2390
|
-
*
|
|
2391
|
-
* @param project Project to serialize.
|
|
2392
|
-
* @returns The file contents to write.
|
|
2393
|
-
*/
|
|
2394
|
-
export declare function serializeProject(project: GeoLibreProject): string;
|
|
2395
|
-
/**
|
|
2396
|
-
* Per-layer serialized text kept across {@link serializeProjectWithLayerCache}
|
|
2397
|
-
* calls, keyed by the layer record each entry was built from. A `WeakMap`, so a
|
|
2398
|
-
* layer the store has replaced or removed drops its text with it.
|
|
2399
|
-
*/
|
|
2400
|
-
export type ProjectLayerSerializationCache = WeakMap<object, {
|
|
2401
|
-
index: number;
|
|
2402
|
-
text: string;
|
|
2403
|
-
}>;
|
|
2404
|
-
/** Create an empty {@link ProjectLayerSerializationCache}. */
|
|
2405
|
-
export declare function createProjectLayerSerializationCache(): ProjectLayerSerializationCache;
|
|
2406
|
-
/**
|
|
2407
|
-
* Serialize a project exactly as {@link serializeProject} does, reusing the
|
|
2408
|
-
* text of every layer whose source record is unchanged since an earlier call.
|
|
2409
|
-
*
|
|
2410
|
-
* Feature data lives inside layer records, so re-stringifying every layer on
|
|
2411
|
-
* each autosave costs megabytes of main-thread work for a project with large
|
|
2412
|
-
* GeoJSON layers — even when only the camera moved (GeoLibre#2633). The store
|
|
2413
|
-
* replaces a layer object whenever it changes, so object identity is a sound
|
|
2414
|
-
* cache key: a camera move reuses every layer, and an edit to one layer
|
|
2415
|
-
* re-serializes only that one.
|
|
2416
|
-
*
|
|
2417
|
-
* `layerSources[i]` must be the record `project.layers[i]` was derived from
|
|
2418
|
-
* (e.g. the store's `layers`, before `projectFromStore` prepared them), and that
|
|
2419
|
-
* derivation must depend on the record alone — as `buildProjectSnapshot`'s does
|
|
2420
|
-
* — or a cached entry could outlive a change it should have reflected. When the
|
|
2421
|
-
* two arrays differ in length the cache is bypassed rather than trusted.
|
|
2422
|
-
*
|
|
2423
|
-
* @param project Project to serialize, as built from `layerSources`.
|
|
2424
|
-
* @param layerSources Immutable source record for each entry of
|
|
2425
|
-
* `project.layers`, in the same order, used as the cache key.
|
|
2426
|
-
* @param cache Cache shared between calls; see
|
|
2427
|
-
* {@link createProjectLayerSerializationCache}.
|
|
2428
|
-
* @returns The same text {@link serializeProject} returns for `project`.
|
|
2429
|
-
*/
|
|
2430
|
-
export declare function serializeProjectWithLayerCache(project: GeoLibreProject, layerSources: readonly object[], cache: ProjectLayerSerializationCache): string;
|
|
2431
|
-
/**
|
|
2432
|
-
* {@link serializeProjectWithLayerCache} that hands the main thread back
|
|
2433
|
-
* between layers, so autosave on a project with several large layers is many
|
|
2434
|
-
* short tasks instead of one 300-400 ms freeze (GeoLibre#2869).
|
|
2435
|
-
*
|
|
2436
|
-
* The cache makes a camera move free, so the cost lands on the first autosave
|
|
2437
|
-
* and on edits to a big layer: each layer that misses the cache is serialized
|
|
2438
|
-
* in its own slice, and the thread is released once a slice has run longer than
|
|
2439
|
-
* a few milliseconds. A single huge layer is still one slice. The result is
|
|
2440
|
-
* identical to the synchronous call. `project` and `layerSources` must not be
|
|
2441
|
-
* mutated while this runs; the store replaces records rather than editing them,
|
|
2442
|
-
* so a snapshot taken from it stays valid.
|
|
2443
|
-
*
|
|
2444
|
-
* @param project Project to serialize, as built from `layerSources`.
|
|
2445
|
-
* @param layerSources Immutable source record for each entry of
|
|
2446
|
-
* `project.layers`, in the same order, used as the cache key.
|
|
2447
|
-
* @param cache Cache shared between calls.
|
|
2448
|
-
* @param yieldFn Hands the thread back; replaced in tests.
|
|
2449
|
-
* @returns The same text {@link serializeProject} returns for `project`.
|
|
2450
|
-
*/
|
|
2451
|
-
export declare function serializeProjectWithLayerCacheAsync(project: GeoLibreProject, layerSources: readonly object[], cache: ProjectLayerSerializationCache, yieldFn?: () => Promise<void>): Promise<string>;
|
|
2452
|
-
export declare function parseProject(json: string): GeoLibreProject;
|
|
2453
|
-
/**
|
|
2454
|
-
* Validate and coerce a story map loaded from an untrusted project file.
|
|
2455
|
-
*
|
|
2456
|
-
* Returns null when the value carries no chapters so empty story maps stay out
|
|
2457
|
-
* of the saved project, mirroring how plugins are only persisted when present.
|
|
2458
|
-
*
|
|
2459
|
-
* @param storymap Raw value read from the project JSON.
|
|
2460
|
-
* @returns A normalized story map, or null when there is nothing to keep.
|
|
2461
|
-
*/
|
|
2462
|
-
export declare function normalizeStoryMap(storymap: unknown): StoryMap | null;
|
|
2463
|
-
/** Whether a story map carries chapters or any non-default setting. */
|
|
2464
|
-
export declare function storyMapHasContent(story: StoryMap): boolean;
|
|
2465
|
-
/**
|
|
2466
|
-
* Coerce an untrusted (possibly hand-edited) `models` array into valid
|
|
2467
|
-
* {@link ProcessingModel} records. Drops models and steps without a usable id or
|
|
2468
|
-
* tool id, de-duplicates models by id, and keeps step `parameters` as a plain
|
|
2469
|
-
* object (the runner validates parameter values per tool at run time). Returns
|
|
2470
|
-
* `null` when there is nothing worth persisting, so a model-less project stays
|
|
2471
|
-
* free of the key.
|
|
2472
|
-
*
|
|
2473
|
-
* @param value Raw `models` value from the project JSON.
|
|
2474
|
-
* @returns Normalized models, or `null` when none survive.
|
|
2475
|
-
*/
|
|
2476
|
-
export declare function normalizeModels(value: unknown): ProcessingModel[] | null;
|
|
2477
|
-
/**
|
|
2478
|
-
* Coerce an untrusted `graph` value into a {@link ProcessingModelGraph}. Drops
|
|
2479
|
-
* nodes without a usable id or an unknown kind, de-duplicates node ids, and
|
|
2480
|
-
* drops edges that do not connect two surviving nodes or that name an empty
|
|
2481
|
-
* port. Self-edges are dropped too, since a node cannot feed itself.
|
|
2482
|
-
*
|
|
2483
|
-
* Structural validity beyond this (cycles, type mismatches, missing required
|
|
2484
|
-
* inputs) is the runner's job — those depend on the tool registries, which the
|
|
2485
|
-
* project layer deliberately does not import.
|
|
2486
|
-
*
|
|
2487
|
-
* @param value Raw `graph` value from the project JSON.
|
|
2488
|
-
* @returns The normalized graph, or `null` when it has no usable nodes.
|
|
2489
|
-
*/
|
|
2490
|
-
export declare function normalizeModelGraph(value: unknown): ProcessingModelGraph | null;
|
|
2491
|
-
/**
|
|
2492
|
-
* Coerce an untrusted (possibly hand-edited) `processingHistory` array into
|
|
2493
|
-
* valid {@link ProcessingRun} records. Drops entries without a usable id, tool
|
|
2494
|
-
* id, or known kind, de-duplicates by id, keeps `parameters` as a plain object,
|
|
2495
|
-
* and caps the list at {@link MAX_PROCESSING_HISTORY} (keeping the newest,
|
|
2496
|
-
* i.e. last, entries). Returns `null` when nothing survives, so a history-less
|
|
2497
|
-
* project stays free of the key.
|
|
2498
|
-
*
|
|
2499
|
-
* @param value Raw `processingHistory` value from the project JSON.
|
|
2500
|
-
* @returns Normalized runs, or `null` when none survive.
|
|
2501
|
-
*/
|
|
2502
|
-
export declare function normalizeProcessingHistory(value: unknown): ProcessingRun[] | null;
|
|
2503
|
-
/**
|
|
2504
|
-
* Coerce an untrusted (possibly hand-edited) camera object into a valid
|
|
2505
|
-
* {@link MapViewState}, falling back to the default view for missing parts.
|
|
2506
|
-
*/
|
|
2507
|
-
export declare function normalizeMapViewState(value: unknown): MapViewState;
|
|
2508
|
-
/**
|
|
2509
|
-
* Coerce an untrusted `mapLayout` into a valid {@link MapGridLayout}. Returns
|
|
2510
|
-
* null when absent or effectively single-pane so default projects stay
|
|
2511
|
-
* byte-identical (the field is only written when the grid is larger than 1x1).
|
|
2512
|
-
*/
|
|
2513
|
-
export declare function normalizeMapLayout(value: unknown): MapGridLayout | null;
|
|
2514
|
-
/**
|
|
2515
|
-
* Coerce an untrusted `primaryRenderer` into a known engine id (issue #2217).
|
|
2516
|
-
*
|
|
2517
|
-
* Returns null for the default 2D map — absent, unknown, or an explicit
|
|
2518
|
-
* `"maplibre"` — because the field is only written when it is not the default,
|
|
2519
|
-
* so a MapLibre project serializes byte-identically to before this existed.
|
|
2520
|
-
* The return type is narrowed to `"cesium" | "mapbox" | "arcgis" | null` rather
|
|
2521
|
-
* than the full {@link MapRendererKind} for that reason: `"maplibre"` is never a
|
|
2522
|
-
* result.
|
|
2523
|
-
*/
|
|
2524
|
-
export declare function normalizePrimaryRenderer(value: unknown): "cesium" | "mapbox" | "arcgis" | null;
|
|
2525
|
-
/**
|
|
2526
|
-
* Coerce an untrusted `secondaryMapViews` array into valid
|
|
2527
|
-
* {@link SecondaryMapView} records, dropping entries without a usable id and
|
|
2528
|
-
* de-duplicating by id. Returns null when none are valid.
|
|
2529
|
-
*/
|
|
2530
|
-
export declare function normalizeSecondaryMapViews(value: unknown): SecondaryMapView[] | null;
|
|
2531
|
-
/**
|
|
2532
|
-
* Reconcile a parsed grid layout with its secondary panes so the store invariant
|
|
2533
|
-
* holds: `secondaryMapViews.length === rows * cols - 1`. Surplus panes are
|
|
2534
|
-
* dropped; missing panes are filled by cloning the primary map. A null/absent
|
|
2535
|
-
* layout (or a 1x1 grid) collapses to the single-map default.
|
|
2536
|
-
*/
|
|
2537
|
-
export declare function resolveMapGrid(layout: MapGridLayout | null, secondaryViews: SecondaryMapView[] | null, primary: {
|
|
2538
|
-
mapView: MapViewState;
|
|
2539
|
-
}): {
|
|
2540
|
-
mapLayout: MapGridLayout;
|
|
2541
|
-
secondaryMapViews: SecondaryMapView[];
|
|
2542
|
-
};
|
|
2543
|
-
/**
|
|
2544
|
-
* Coerce an untrusted (possibly hand-edited) `widgets` array into valid
|
|
2545
|
-
* {@link DashboardWidget} records. Drops widgets without a usable id, layer id,
|
|
2546
|
-
* or recognized chart type, de-duplicates by id, and keeps only the optional
|
|
2547
|
-
* keys that are present and well-typed (the Dashboard panel falls back to
|
|
2548
|
-
* sensible defaults for anything missing). Returns `null` when there is nothing
|
|
2549
|
-
* worth persisting, so a widget-less project stays free of the key.
|
|
2550
|
-
*
|
|
2551
|
-
* @param value Raw `widgets` value from the project JSON.
|
|
2552
|
-
* @returns Normalized widgets, or `null` when none survive.
|
|
2553
|
-
*/
|
|
2554
|
-
export declare function normalizeWidgets(value: unknown): DashboardWidget[] | null;
|
|
2555
|
-
/**
|
|
2556
|
-
* Clamp an untrusted dashboard column count into the supported range, falling
|
|
2557
|
-
* back to the default for a missing or non-finite value.
|
|
2558
|
-
*
|
|
2559
|
-
* @param value Raw `dashboardColumns` value from the project JSON.
|
|
2560
|
-
* @returns An integer column count within [MIN, MAX].
|
|
2561
|
-
*/
|
|
2562
|
-
export declare function normalizeDashboardColumns(value: unknown): number;
|
|
2563
|
-
/**
|
|
2564
|
-
* Coerce an untrusted `interaction` block into a {@link ProjectInteraction}.
|
|
2565
|
-
*
|
|
2566
|
-
* Layer ids are kept even when no such layer exists: the block is replayed
|
|
2567
|
-
* against whatever layers the project has when it opens, and the loader drops
|
|
2568
|
-
* the ones it cannot find. Control names are kept as written for the same
|
|
2569
|
-
* reason; the app ignores names it does not know.
|
|
2570
|
-
*
|
|
2571
|
-
* @param value - Raw `interaction` value from the project JSON or the store.
|
|
2572
|
-
* @returns The normalized block, or null when it carries nothing to apply.
|
|
2573
|
-
*/
|
|
2574
|
-
export declare function normalizeProjectInteraction(value: unknown): ProjectInteraction | null;
|
|
2575
|
-
export declare function isAllowedPluginManifestUrl(url: string): boolean;
|
|
2576
|
-
export declare function normalizeProjectComments(rawComments: unknown): ProjectComment[];
|
|
2577
|
-
export declare function projectFromStore(state: {
|
|
2578
|
-
projectName: string;
|
|
2579
|
-
mapView: MapViewState;
|
|
2580
|
-
basemapStyleUrl: string;
|
|
2581
|
-
basemapVisible: boolean;
|
|
2582
|
-
basemapOpacity: number;
|
|
2583
|
-
blankBackgroundColor?: string | null;
|
|
2584
|
-
layers: GeoLibreLayer[];
|
|
2585
|
-
selectedLayerId?: string | null;
|
|
2586
|
-
layerGroups?: LayerGroup[];
|
|
2587
|
-
preferences: ProjectPreferences;
|
|
2588
|
-
plugins?: ProjectPluginState | null;
|
|
2589
|
-
legend?: LegendConfig | null;
|
|
2590
|
-
printLayout?: PrintLayoutConfig | null;
|
|
2591
|
-
storymap?: StoryMap | null;
|
|
2592
|
-
models?: ProcessingModel[] | null;
|
|
2593
|
-
processingHistory?: ProcessingRun[] | null;
|
|
2594
|
-
widgets?: DashboardWidget[] | null;
|
|
2595
|
-
dashboardColumns?: number;
|
|
2596
|
-
mapLayout?: MapGridLayout;
|
|
2597
|
-
secondaryMapViews?: SecondaryMapView[];
|
|
2598
|
-
primaryMapLabel?: string;
|
|
2599
|
-
primaryRenderer?: MapRendererKind;
|
|
2600
|
-
/** Project-scoped Style Manager entries (the store's `projectStyleLibrary`). */
|
|
2601
|
-
styleLibrary?: StyleLibraryEntry[] | null;
|
|
2602
|
-
comments?: ProjectComment[] | null;
|
|
2603
|
-
/** Startup interaction state loaded with the project, written back as-is. */
|
|
2604
|
-
interaction?: ProjectInteraction | null;
|
|
2605
|
-
metadata: Record<string, unknown>;
|
|
2606
|
-
}): GeoLibreProject;
|
|
2607
|
-
/**
|
|
2608
|
-
* The plain HTTP(S) WMS template inside the desktop app's `geolibre-wms://`
|
|
2609
|
-
* wrapper (its CORS-exempt native fetcher), or the tile unchanged when it is
|
|
2610
|
-
* not wrapped or the wrapped URL is not HTTP(S). Shared by project export and
|
|
2611
|
-
* the ArcGIS engine's story-export templates.
|
|
2612
|
-
*
|
|
2613
|
-
* @param tile - A tile template, wrapped or not.
|
|
2614
|
-
* @returns The unwrapped template, or `tile` itself.
|
|
2615
|
-
*/
|
|
2616
|
-
export declare function portableWmsTileUrl(tile: unknown): unknown;
|
|
2617
|
-
/**
|
|
2618
|
-
* The store form of one project layer: its style completed from
|
|
2619
|
-
* {@link DEFAULT_LAYER_STYLE} and the project's top-level `styles` entry.
|
|
2620
|
-
*
|
|
2621
|
-
* Legacy and externally-authored projects can carry a partial top-level style
|
|
2622
|
-
* alongside newer fields on the layer itself. Those layer fields are kept,
|
|
2623
|
-
* while the top-level copy stays authoritative where it explicitly supplies a
|
|
2624
|
-
* value.
|
|
2625
|
-
*
|
|
2626
|
-
* @param project - The project the layer belongs to (for its `styles` map).
|
|
2627
|
-
* @param layer - One of `project.layers`.
|
|
2628
|
-
* @returns A new layer record ready for the store.
|
|
2629
|
-
*/
|
|
2630
|
-
export declare function hydrateProjectLayer(project: Pick<GeoLibreProject, "styles">, layer: GeoLibreLayer): GeoLibreLayer;
|
|
2631
|
-
export declare function applyProjectToStore(project: GeoLibreProject): {
|
|
2632
|
-
projectName: string;
|
|
2633
|
-
mapView: MapViewState;
|
|
2634
|
-
basemapStyleUrl: string;
|
|
2635
|
-
basemapVisible: boolean;
|
|
2636
|
-
basemapOpacity: number;
|
|
2637
|
-
blankBackgroundColor: string | null;
|
|
2638
|
-
layers: GeoLibreLayer[];
|
|
2639
|
-
layerGroups: LayerGroup[];
|
|
2640
|
-
preferences: ProjectPreferences;
|
|
2641
|
-
projectPlugins: ProjectPluginState | null;
|
|
2642
|
-
legend: LegendConfig;
|
|
2643
|
-
printLayout: PrintLayoutConfig;
|
|
2644
|
-
storymap: StoryMap | null;
|
|
2645
|
-
models: ProcessingModel[];
|
|
2646
|
-
processingHistory: ProcessingRun[];
|
|
2647
|
-
widgets: DashboardWidget[];
|
|
2648
|
-
dashboardColumns: number;
|
|
2649
|
-
mapLayout: MapGridLayout;
|
|
2650
|
-
secondaryMapViews: SecondaryMapView[];
|
|
2651
|
-
primaryMapLabel: string;
|
|
2652
|
-
primaryRenderer: MapRendererKind;
|
|
2653
|
-
projectStyleLibrary: StyleLibraryEntry[];
|
|
2654
|
-
comments: ProjectComment[];
|
|
2655
|
-
projectInteraction: ProjectInteraction | null;
|
|
2656
|
-
metadata: Record<string, unknown>;
|
|
2657
|
-
};
|
|
2658
|
-
/**
|
|
2659
|
-
* Create an unlinked copy of a project, suffixed with "(copy)" by default and
|
|
2660
|
-
* stripped of share-specific metadata (shareId, shareUrl, etc.).
|
|
2661
|
-
*/
|
|
2662
|
-
export declare function detachProjectCopy(project: GeoLibreProject, options?: {
|
|
2663
|
-
nameSuffix?: string;
|
|
2664
|
-
}): GeoLibreProject;
|
|
2665
|
-
/**
|
|
2666
|
-
* Create a template snapshot of a project. Optionally strips data layers while
|
|
2667
|
-
* keeping basemap, layer groups, styles, legend config, preferences, widgets, and
|
|
2668
|
-
* print layout.
|
|
2669
|
-
*/
|
|
2670
|
-
export declare function createProjectTemplate(project: GeoLibreProject, options?: {
|
|
2671
|
-
name?: string;
|
|
2672
|
-
stripDataLayers?: boolean;
|
|
2673
|
-
}): GeoLibreProject;
|
|
2674
|
-
//#endregion
|
|
2675
|
-
//#region src/project-diff.d.ts
|
|
2676
|
-
/** One changed value, with bounded human-readable previews of each side. */
|
|
2677
|
-
export interface ProjectValueChange {
|
|
2678
|
-
/** Dotted key path relative to the section, e.g. `fillColor` or `labels.field`. */
|
|
2679
|
-
path: string;
|
|
2680
|
-
/** Preview of the earlier value; `undefined` when the key was absent. */
|
|
2681
|
-
before?: string;
|
|
2682
|
-
/** Preview of the later value; `undefined` when the key is now absent. */
|
|
2683
|
-
after?: string;
|
|
2684
|
-
}
|
|
2685
|
-
/** Counts of embedded GeoJSON feature changes in one layer. */
|
|
2686
|
-
export interface FeatureChangeSummary {
|
|
2687
|
-
added: number;
|
|
2688
|
-
removed: number;
|
|
2689
|
-
modified: number;
|
|
2690
|
-
unchanged: number;
|
|
2691
|
-
/**
|
|
2692
|
-
* How features were matched: `"id"` when every feature carries a unique
|
|
2693
|
-
* `id`, `"geometry"` when none does (matched by geometry hash), `"mixed"`
|
|
2694
|
-
* otherwise.
|
|
2695
|
-
*/
|
|
2696
|
-
matchedBy: "id" | "geometry" | "mixed";
|
|
2697
|
-
}
|
|
2698
|
-
/** Changes to one layer between the two projects. */
|
|
2699
|
-
export interface LayerDiff {
|
|
2700
|
-
id: string;
|
|
2701
|
-
/** Layer name in the later project (or the earlier one when removed). */
|
|
2702
|
-
name: string;
|
|
2703
|
-
/** Layer type in the later project (or the earlier one when removed). */
|
|
2704
|
-
type: string;
|
|
2705
|
-
status: "added" | "removed" | "changed";
|
|
2706
|
-
/** Set when the layer was renamed. */
|
|
2707
|
-
renamed?: {
|
|
2708
|
-
before: string;
|
|
2709
|
-
after: string;
|
|
2710
|
-
};
|
|
2711
|
-
/**
|
|
2712
|
-
* Set when the layer changed position relative to the layers present in
|
|
2713
|
-
* both projects (bottom-to-top indexes in each project's `layers`).
|
|
2714
|
-
*/
|
|
2715
|
-
moved?: {
|
|
2716
|
-
before: number;
|
|
2717
|
-
after: number;
|
|
2718
|
-
};
|
|
2719
|
-
visibility?: {
|
|
2720
|
-
before: boolean;
|
|
2721
|
-
after: boolean;
|
|
2722
|
-
};
|
|
2723
|
-
opacity?: {
|
|
2724
|
-
before: number;
|
|
2725
|
-
after: number;
|
|
2726
|
-
};
|
|
2727
|
-
/** Style keys other than labels. */
|
|
2728
|
-
style: ProjectValueChange[];
|
|
2729
|
-
/** Label style keys (`style.labels.*`), without the `labels.` prefix. */
|
|
2730
|
-
labels: ProjectValueChange[];
|
|
2731
|
-
/** `filterExpression` and `quickFilters`. */
|
|
2732
|
-
filter: ProjectValueChange[];
|
|
2733
|
-
/** `type`, `source.*` and `sourcePath`. */
|
|
2734
|
-
source: ProjectValueChange[];
|
|
2735
|
-
/** Any other persisted layer field (popup, joins, metadata.*, ...). */
|
|
2736
|
-
other: ProjectValueChange[];
|
|
2737
|
-
/** Embedded GeoJSON feature changes; absent when the data is unchanged. */
|
|
2738
|
-
features?: FeatureChangeSummary;
|
|
2739
|
-
/** Feature count for an added or removed layer with embedded GeoJSON. */
|
|
2740
|
-
featureCount?: number;
|
|
2741
|
-
}
|
|
2742
|
-
/** Changes to one plugin's project state. */
|
|
2743
|
-
export interface PluginDiff {
|
|
2744
|
-
id: string;
|
|
2745
|
-
/** `added`/`removed` mean the plugin was activated/deactivated. */
|
|
2746
|
-
status: "added" | "removed" | "changed";
|
|
2747
|
-
changes: ProjectValueChange[];
|
|
2748
|
-
}
|
|
2749
|
-
/** The full structured difference between two projects. */
|
|
2750
|
-
export interface ProjectDiff {
|
|
2751
|
-
layers: {
|
|
2752
|
-
added: LayerDiff[];
|
|
2753
|
-
removed: LayerDiff[];
|
|
2754
|
-
changed: LayerDiff[];
|
|
2755
|
-
/** True when any layer present in both projects changed position. */
|
|
2756
|
-
reordered: boolean;
|
|
2757
|
-
};
|
|
2758
|
-
camera: ProjectValueChange[];
|
|
2759
|
-
basemap: ProjectValueChange[];
|
|
2760
|
-
/** Map projection (`preferences.map.projection`). */
|
|
2761
|
-
projection: ProjectValueChange[];
|
|
2762
|
-
/** Other project preferences (`preferences.*` minus the projection). */
|
|
2763
|
-
preferences: ProjectValueChange[];
|
|
2764
|
-
plugins: PluginDiff[];
|
|
2765
|
-
/** Plugin manifest URLs added to or removed from the project. */
|
|
2766
|
-
pluginManifests: {
|
|
2767
|
-
added: string[];
|
|
2768
|
-
removed: string[];
|
|
2769
|
-
};
|
|
2770
|
-
/** Project name (`name`), `metadata.description` and other metadata keys. */
|
|
2771
|
-
metadata: ProjectValueChange[];
|
|
2772
|
-
/** Other top-level sections that changed (`legend`, `storymap`, ...). */
|
|
2773
|
-
sections: string[];
|
|
2774
|
-
/** Total number of reported changes; 0 means the projects are equivalent. */
|
|
2775
|
-
changeCount: number;
|
|
2776
|
-
}
|
|
2777
|
-
/** Options for {@link diffProjects}. */
|
|
2778
|
-
export interface ProjectDiffOptions {
|
|
2779
|
-
/** Maximum characters of a before/after preview (default 80). */
|
|
2780
|
-
maxPreviewLength?: number;
|
|
2781
|
-
}
|
|
2782
|
-
/**
|
|
2783
|
-
* Deep structural equality for JSON-like values. A key whose value is
|
|
2784
|
-
* `undefined` is treated as absent, so an in-memory record compares equal to
|
|
2785
|
-
* its JSON round trip.
|
|
2786
|
-
*
|
|
2787
|
-
* @param a - First value.
|
|
2788
|
-
* @param b - Second value.
|
|
2789
|
-
* @returns True when the two values are structurally equal.
|
|
2790
|
-
*/
|
|
2791
|
-
export declare function jsonValuesEqual(a: unknown, b: unknown): boolean;
|
|
2792
|
-
/**
|
|
2793
|
-
* Render a bounded JSON-ish preview of a value without serializing more of it
|
|
2794
|
-
* than the preview can show, so a large array or object costs no more than
|
|
2795
|
-
* `maxLength` characters of work.
|
|
2796
|
-
*
|
|
2797
|
-
* @param value - The value to preview.
|
|
2798
|
-
* @param maxLength - Maximum preview length; longer output ends with `…`.
|
|
2799
|
-
* @returns The preview, or `undefined` for `undefined`.
|
|
2800
|
-
*/
|
|
2801
|
-
export declare function previewValue(value: unknown, maxLength?: number): string | undefined;
|
|
2802
|
-
/**
|
|
2803
|
-
* Count the features added, removed and modified between two feature
|
|
2804
|
-
* collections. Features are matched by `id` when they carry one; id-less
|
|
2805
|
-
* features are matched by geometry hash, so a feature whose properties
|
|
2806
|
-
* changed but whose geometry did not counts as modified, while a moved
|
|
2807
|
-
* id-less feature counts as one removal plus one addition.
|
|
2808
|
-
*
|
|
2809
|
-
* @param before - Earlier collection (absent counts as empty).
|
|
2810
|
-
* @param after - Later collection (absent counts as empty).
|
|
2811
|
-
* @returns The change counts.
|
|
2812
|
-
*/
|
|
2813
|
-
export declare function diffFeatureCollections(before: FeatureCollection | null | undefined, after: FeatureCollection | null | undefined): FeatureChangeSummary;
|
|
2814
|
-
/**
|
|
2815
|
-
* Compute a structured summary of what changed from `before` to `after`.
|
|
2816
|
-
*
|
|
2817
|
-
* Layers are matched by id. Embedded GeoJSON is compared per feature (by id,
|
|
2818
|
-
* falling back to geometry hash) and each feature is hashed once per object,
|
|
2819
|
-
* so diffing the same parsed project against several others reuses its
|
|
2820
|
-
* hashes; callers keep and pass the same parsed project objects to benefit.
|
|
2821
|
-
*
|
|
2822
|
-
* @param before - The earlier project (e.g. an autosave snapshot).
|
|
2823
|
-
* @param after - The later project (e.g. the current project).
|
|
2824
|
-
* @param options - Preview length and other tuning.
|
|
2825
|
-
* @returns The grouped change summary.
|
|
2826
|
-
*/
|
|
2827
|
-
export declare function diffProjects(before: GeoLibreProject, after: GeoLibreProject, options?: ProjectDiffOptions): ProjectDiff;
|
|
2828
|
-
//#endregion
|
|
2829
2470
|
//#region src/style-library.d.ts
|
|
2830
2471
|
/**
|
|
2831
2472
|
* Layer types whose symbology is driven by the vector {@link LayerStyle}
|
|
@@ -2957,6 +2598,26 @@ export declare const MAX_LAYER_LIBRARY_ENTRIES = 500;
|
|
|
2957
2598
|
* @returns True when the source alone is enough to recreate the layer's data.
|
|
2958
2599
|
*/
|
|
2959
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;
|
|
2960
2621
|
/**
|
|
2961
2622
|
* Whether "Save to library" applies to a layer at all — the cheap predicate the
|
|
2962
2623
|
* layer actions menu gates on. Two things have to hold:
|
|
@@ -3445,6 +3106,88 @@ export interface LayerStyleMatch {
|
|
|
3445
3106
|
*/
|
|
3446
3107
|
export declare function matchLayerStyleEntry(layer: GeoLibreLayer, entries: readonly LayerStyleFileEntry[]): LayerStyleMatch | null;
|
|
3447
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
|
|
3448
3191
|
//#region src/layer-groups.d.ts
|
|
3449
3192
|
/** Opacity a freshly created {@link LayerGroup} starts at (fully opaque). */
|
|
3450
3193
|
export declare const DEFAULT_LAYER_GROUP_OPACITY = 1;
|
|
@@ -3881,6 +3624,15 @@ export interface S3UrlSigner {
|
|
|
3881
3624
|
status: number;
|
|
3882
3625
|
body: string;
|
|
3883
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;
|
|
3884
3636
|
/** The persisted location (`s3://bucket/prefix/`) the S3 browser opens at, or "". */
|
|
3885
3637
|
defaultLocation?(): string;
|
|
3886
3638
|
/** Persists the S3 browser's default location; "" clears it. */
|
|
@@ -4486,6 +4238,11 @@ interface ProcessingSlice {
|
|
|
4486
4238
|
models: ProcessingModel[];
|
|
4487
4239
|
/** Recorded processing tool runs, oldest first (Processing History; #1292). */
|
|
4488
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;
|
|
4489
4246
|
/** Insert a new model or replace an existing one matching by `id`. */
|
|
4490
4247
|
saveModel: (model: ProcessingModel) => void;
|
|
4491
4248
|
/** Remove a saved model by id. */
|
|
@@ -4496,6 +4253,11 @@ interface ProcessingSlice {
|
|
|
4496
4253
|
updateProcessingRun: (id: string, patch: Partial<Omit<ProcessingRun, "id">>) => void;
|
|
4497
4254
|
/** Drop all recorded processing runs. */
|
|
4498
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;
|
|
4499
4261
|
}
|
|
4500
4262
|
//#endregion
|
|
4501
4263
|
//#region src/store/project-content-slice.d.ts
|
|
@@ -4505,6 +4267,10 @@ interface ProjectContentSlice {
|
|
|
4505
4267
|
widgets: DashboardWidget[];
|
|
4506
4268
|
/** Number of columns in the Dashboard widget grid. */
|
|
4507
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[];
|
|
4508
4274
|
/** Anchored review comments on map points or features (issue #1518). */
|
|
4509
4275
|
comments: ProjectComment[];
|
|
4510
4276
|
/**
|
|
@@ -4540,6 +4306,11 @@ interface ProjectContentSlice {
|
|
|
4540
4306
|
toggleResolveComment: (commentId: string, resolved?: boolean) => void;
|
|
4541
4307
|
deleteComment: (commentId: string) => void;
|
|
4542
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;
|
|
4543
4314
|
}
|
|
4544
4315
|
//#endregion
|
|
4545
4316
|
//#region src/store/project-slice.d.ts
|
|
@@ -4564,8 +4335,14 @@ interface ProjectSlice {
|
|
|
4564
4335
|
*/
|
|
4565
4336
|
setPrintLayout: (printLayout: PrintLayoutConfig) => void;
|
|
4566
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
|
+
*/
|
|
4567
4342
|
newProject: (options?: CreateProjectOptions & {
|
|
4568
4343
|
name?: string;
|
|
4344
|
+
layers?: GeoLibreLayer[];
|
|
4345
|
+
layerGroups?: LayerGroup[];
|
|
4569
4346
|
}) => void;
|
|
4570
4347
|
loadProject: (project: GeoLibreProject, path?: string | null, options?: {
|
|
4571
4348
|
rememberRecent?: boolean;
|
|
@@ -4664,6 +4441,9 @@ interface SessionSlice {
|
|
|
4664
4441
|
* plain meaning.
|
|
4665
4442
|
*/
|
|
4666
4443
|
identifyLayerIds: string[] | null;
|
|
4444
|
+
/** Transient map-selection gesture activity, published by the primary renderer. */
|
|
4445
|
+
featureSelectionActive: boolean;
|
|
4446
|
+
setFeatureSelectionActive: (active: boolean) => void;
|
|
4667
4447
|
pointerCoords: [number, number] | null;
|
|
4668
4448
|
/**
|
|
4669
4449
|
* Ground elevation in true metres under the pointer, for the status bar
|
|
@@ -4848,7 +4628,7 @@ interface AppState extends ProjectSlice, MapViewSlice, LayersSlice, LayerGroupsS
|
|
|
4848
4628
|
//#endregion
|
|
4849
4629
|
//#region src/store/undo-history.d.ts
|
|
4850
4630
|
/** The fields undo/redo snapshots, restores and compares. */
|
|
4851
|
-
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">;
|
|
4852
4632
|
export declare function subscribeProjectRestoreHistory(listener: () => void): () => void;
|
|
4853
4633
|
export declare function canUndoProjectRestore(): boolean;
|
|
4854
4634
|
export declare function canRedoProjectRestore(): boolean;
|
|
@@ -4868,6 +4648,14 @@ export declare function registerProjectRestoreHistory(before: GeoLibreProject, b
|
|
|
4868
4648
|
export declare function undo(): void;
|
|
4869
4649
|
/** Step the history forward one entry and mark the project dirty. */
|
|
4870
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;
|
|
4871
4659
|
/** Empty both the undo and redo stacks (e.g. on new/loaded project). */
|
|
4872
4660
|
export declare function clearHistory(): void;
|
|
4873
4661
|
//#endregion
|
|
@@ -6056,5 +5844,94 @@ export declare function localFileName(path: string): string;
|
|
|
6056
5844
|
/** Keep imported layers distinguishable, including within a multi-file import. */
|
|
6057
5845
|
export declare function uniqueImportedLayerName(name: string, names: Iterable<string>): string;
|
|
6058
5846
|
//#endregion
|
|
6059
|
-
|
|
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 };
|
|
6060
5937
|
//# sourceMappingURL=index.d.mts.map
|