@faclon-labs/app-sdk 0.1.0 → 0.3.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.
Files changed (183) hide show
  1. package/README.md +39 -1
  2. package/dist/IOSenseApp.js +26 -6
  3. package/dist/SignIn.js +2 -2
  4. package/dist/auth.d.ts +7 -0
  5. package/dist/auth.js +35 -1
  6. package/dist/config.d.ts +5 -0
  7. package/dist/config.js +1 -0
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/map/globe.d.ts +5 -0
  11. package/dist/map/globe.js +5 -0
  12. package/dist/map/index.d.ts +21 -0
  13. package/dist/map/index.js +21 -0
  14. package/dist/map/source.d.ts +48 -0
  15. package/dist/map/source.js +73 -0
  16. package/dist/map/testing.d.ts +5 -0
  17. package/dist/map/testing.js +5 -0
  18. package/dist/session.d.ts +1 -1
  19. package/dist/session.js +1 -1
  20. package/package.json +55 -5
  21. package/vendor/SOURCE.txt +1 -0
  22. package/vendor/map-engine/cesium/camera.d.ts +10 -0
  23. package/vendor/map-engine/cesium/camera.js +25 -0
  24. package/vendor/map-engine/cesium/index.d.ts +2 -0
  25. package/vendor/map-engine/cesium/index.js +2 -0
  26. package/vendor/map-engine/cesium/renderer.d.ts +149 -0
  27. package/vendor/map-engine/cesium/renderer.js +837 -0
  28. package/vendor/map-engine/commands/index.d.ts +2 -0
  29. package/vendor/map-engine/commands/index.js +2 -0
  30. package/vendor/map-engine/commands/post-message.d.ts +32 -0
  31. package/vendor/map-engine/commands/post-message.js +77 -0
  32. package/vendor/map-engine/commands/webmcp.d.ts +17 -0
  33. package/vendor/map-engine/commands/webmcp.js +59 -0
  34. package/vendor/map-engine/core/commands.d.ts +82 -0
  35. package/vendor/map-engine/core/commands.js +46 -0
  36. package/vendor/map-engine/core/emitter.d.ts +9 -0
  37. package/vendor/map-engine/core/emitter.js +38 -0
  38. package/vendor/map-engine/core/equal.d.ts +2 -0
  39. package/vendor/map-engine/core/equal.js +28 -0
  40. package/vendor/map-engine/core/errors.d.ts +20 -0
  41. package/vendor/map-engine/core/errors.js +34 -0
  42. package/vendor/map-engine/core/geometry-family.d.ts +3 -0
  43. package/vendor/map-engine/core/geometry-family.js +13 -0
  44. package/vendor/map-engine/core/index.d.ts +4 -0
  45. package/vendor/map-engine/core/index.js +3 -0
  46. package/vendor/map-engine/core/types.d.ts +709 -0
  47. package/vendor/map-engine/core/types.js +7 -0
  48. package/vendor/map-engine/data/annotations.d.ts +3 -0
  49. package/vendor/map-engine/data/annotations.js +63 -0
  50. package/vendor/map-engine/data/contracts.d.ts +172 -0
  51. package/vendor/map-engine/data/contracts.js +12 -0
  52. package/vendor/map-engine/data/index.d.ts +4 -0
  53. package/vendor/map-engine/data/index.js +3 -0
  54. package/vendor/map-engine/data/schema.d.ts +7 -0
  55. package/vendor/map-engine/data/schema.js +40 -0
  56. package/vendor/map-engine/geofence/evaluator.d.ts +35 -0
  57. package/vendor/map-engine/geofence/evaluator.js +172 -0
  58. package/vendor/map-engine/geofence/history.d.ts +9 -0
  59. package/vendor/map-engine/geofence/history.js +19 -0
  60. package/vendor/map-engine/geofence/index.d.ts +2 -0
  61. package/vendor/map-engine/geofence/index.js +2 -0
  62. package/vendor/map-engine/index.d.ts +27 -0
  63. package/vendor/map-engine/index.js +14 -0
  64. package/vendor/map-engine/layers/index.d.ts +1 -0
  65. package/vendor/map-engine/layers/index.js +1 -0
  66. package/vendor/map-engine/layers/layers.d.ts +49 -0
  67. package/vendor/map-engine/layers/layers.js +316 -0
  68. package/vendor/map-engine/maplibre/deck-host.d.ts +105 -0
  69. package/vendor/map-engine/maplibre/deck-host.js +401 -0
  70. package/vendor/map-engine/maplibre/icons.d.ts +17 -0
  71. package/vendor/map-engine/maplibre/icons.js +65 -0
  72. package/vendor/map-engine/maplibre/index.d.ts +3 -0
  73. package/vendor/map-engine/maplibre/index.js +2 -0
  74. package/vendor/map-engine/maplibre/map-like.d.ts +56 -0
  75. package/vendor/map-engine/maplibre/map-like.js +1 -0
  76. package/vendor/map-engine/maplibre/renderer.d.ts +173 -0
  77. package/vendor/map-engine/maplibre/renderer.js +889 -0
  78. package/vendor/map-engine/maplibre/style.d.ts +84 -0
  79. package/vendor/map-engine/maplibre/style.js +493 -0
  80. package/vendor/map-engine/present/decorations.d.ts +25 -0
  81. package/vendor/map-engine/present/decorations.js +115 -0
  82. package/vendor/map-engine/present/index.d.ts +2 -0
  83. package/vendor/map-engine/present/index.js +2 -0
  84. package/vendor/map-engine/present/present.d.ts +47 -0
  85. package/vendor/map-engine/present/present.js +149 -0
  86. package/vendor/map-engine/query/index.d.ts +1 -0
  87. package/vendor/map-engine/query/index.js +1 -0
  88. package/vendor/map-engine/query/planner.d.ts +26 -0
  89. package/vendor/map-engine/query/planner.js +47 -0
  90. package/vendor/map-engine/react/MapView.d.ts +87 -0
  91. package/vendor/map-engine/react/MapView.js +270 -0
  92. package/vendor/map-engine/react/context.d.ts +39 -0
  93. package/vendor/map-engine/react/context.js +94 -0
  94. package/vendor/map-engine/react/index.d.ts +2 -0
  95. package/vendor/map-engine/react/index.js +2 -0
  96. package/vendor/map-engine/react/store.d.ts +19 -0
  97. package/vendor/map-engine/react/store.js +18 -0
  98. package/vendor/map-engine/realtime/apply.d.ts +74 -0
  99. package/vendor/map-engine/realtime/apply.js +155 -0
  100. package/vendor/map-engine/realtime/index.d.ts +1 -0
  101. package/vendor/map-engine/realtime/index.js +1 -0
  102. package/vendor/map-engine/render/index.d.ts +1 -0
  103. package/vendor/map-engine/render/index.js +1 -0
  104. package/vendor/map-engine/render/offline.d.ts +8 -0
  105. package/vendor/map-engine/render/offline.js +47 -0
  106. package/vendor/map-engine/render/renderer.d.ts +74 -0
  107. package/vendor/map-engine/render/renderer.js +1 -0
  108. package/vendor/map-engine/render/terrarium.d.ts +48 -0
  109. package/vendor/map-engine/render/terrarium.js +110 -0
  110. package/vendor/map-engine/runtime/drawing.d.ts +28 -0
  111. package/vendor/map-engine/runtime/drawing.js +58 -0
  112. package/vendor/map-engine/runtime/index.d.ts +5 -0
  113. package/vendor/map-engine/runtime/index.js +2 -0
  114. package/vendor/map-engine/runtime/offline.d.ts +24 -0
  115. package/vendor/map-engine/runtime/offline.js +37 -0
  116. package/vendor/map-engine/runtime/overlays.d.ts +25 -0
  117. package/vendor/map-engine/runtime/overlays.js +65 -0
  118. package/vendor/map-engine/runtime/runtime.d.ts +4 -0
  119. package/vendor/map-engine/runtime/runtime.js +2105 -0
  120. package/vendor/map-engine/runtime/types.d.ts +407 -0
  121. package/vendor/map-engine/runtime/types.js +1 -0
  122. package/vendor/map-engine/scene/index.d.ts +1 -0
  123. package/vendor/map-engine/scene/index.js +1 -0
  124. package/vendor/map-engine/scene/scene.d.ts +31 -0
  125. package/vendor/map-engine/scene/scene.js +216 -0
  126. package/vendor/map-engine/selection/index.d.ts +1 -0
  127. package/vendor/map-engine/selection/index.js +1 -0
  128. package/vendor/map-engine/selection/selection.d.ts +12 -0
  129. package/vendor/map-engine/selection/selection.js +28 -0
  130. package/vendor/map-engine/spatial/geojson.d.ts +15 -0
  131. package/vendor/map-engine/spatial/geojson.js +83 -0
  132. package/vendor/map-engine/spatial/geometry.d.ts +13 -0
  133. package/vendor/map-engine/spatial/geometry.js +206 -0
  134. package/vendor/map-engine/spatial/import.d.ts +27 -0
  135. package/vendor/map-engine/spatial/import.js +96 -0
  136. package/vendor/map-engine/spatial/index.d.ts +38 -0
  137. package/vendor/map-engine/spatial/index.js +37 -0
  138. package/vendor/map-engine/spatial/line-of-sight.d.ts +35 -0
  139. package/vendor/map-engine/spatial/line-of-sight.js +43 -0
  140. package/vendor/map-engine/spatial/measure.d.ts +28 -0
  141. package/vendor/map-engine/spatial/measure.js +90 -0
  142. package/vendor/map-engine/spatial/operations.d.ts +21 -0
  143. package/vendor/map-engine/spatial/operations.js +171 -0
  144. package/vendor/map-engine/spatial/query.d.ts +17 -0
  145. package/vendor/map-engine/spatial/query.js +88 -0
  146. package/vendor/map-engine/spatial/spatial-index.d.ts +24 -0
  147. package/vendor/map-engine/spatial/spatial-index.js +36 -0
  148. package/vendor/map-engine/spatial/volume-mesh.d.ts +19 -0
  149. package/vendor/map-engine/spatial/volume-mesh.js +56 -0
  150. package/vendor/map-engine/temporal/index.d.ts +3 -0
  151. package/vendor/map-engine/temporal/index.js +3 -0
  152. package/vendor/map-engine/temporal/journal.d.ts +20 -0
  153. package/vendor/map-engine/temporal/journal.js +34 -0
  154. package/vendor/map-engine/temporal/playback.d.ts +41 -0
  155. package/vendor/map-engine/temporal/playback.js +80 -0
  156. package/vendor/map-engine/temporal/tracks.d.ts +33 -0
  157. package/vendor/map-engine/temporal/tracks.js +119 -0
  158. package/vendor/map-engine/testing/annotation-store.d.ts +24 -0
  159. package/vendor/map-engine/testing/annotation-store.js +43 -0
  160. package/vendor/map-engine/testing/contracts.d.ts +41 -0
  161. package/vendor/map-engine/testing/contracts.js +328 -0
  162. package/vendor/map-engine/testing/fixtures-monitoring.d.ts +22 -0
  163. package/vendor/map-engine/testing/fixtures-monitoring.js +103 -0
  164. package/vendor/map-engine/testing/fixtures.d.ts +18 -0
  165. package/vendor/map-engine/testing/fixtures.js +28 -0
  166. package/vendor/map-engine/testing/index.d.ts +7 -0
  167. package/vendor/map-engine/testing/index.js +7 -0
  168. package/vendor/map-engine/testing/mock-ontology.d.ts +13 -0
  169. package/vendor/map-engine/testing/mock-ontology.js +24 -0
  170. package/vendor/map-engine/testing/mock-provider.d.ts +97 -0
  171. package/vendor/map-engine/testing/mock-provider.js +369 -0
  172. package/vendor/map-engine/testing/test-renderer.d.ts +72 -0
  173. package/vendor/map-engine/testing/test-renderer.js +153 -0
  174. package/vendor/map-engine/viewport/index.d.ts +1 -0
  175. package/vendor/map-engine/viewport/index.js +1 -0
  176. package/vendor/map-engine/viewport/viewport.d.ts +19 -0
  177. package/vendor/map-engine/viewport/viewport.js +102 -0
  178. package/vendor/map-provider-uns/client.d.ts +75 -0
  179. package/vendor/map-provider-uns/client.js +111 -0
  180. package/vendor/map-provider-uns/index.d.ts +2 -0
  181. package/vendor/map-provider-uns/index.js +2 -0
  182. package/vendor/map-provider-uns/provider.d.ts +131 -0
  183. package/vendor/map-provider-uns/provider.js +561 -0
@@ -0,0 +1,709 @@
1
+ /**
2
+ * Public contracts of the Map Engine.
3
+ *
4
+ * Coordinates are semantic: `{ latitude, longitude }` in WGS84 (EPSG:4326).
5
+ * GeoJSON's `[longitude, latitude]` order exists only in `spatial/geojson.ts`.
6
+ */
7
+ export type Unsubscribe = () => void;
8
+ /** A WGS84 position. Latitude in [-90, 90], longitude in [-180, 180]. */
9
+ export interface Position {
10
+ latitude: number;
11
+ longitude: number;
12
+ /**
13
+ * Metres (ADR-028). What it is measured from is not guessed: a layer that draws heights declares the reference
14
+ * (`visualization.elevation.reference`). Without altitude, a position is on the ground (or on terrain).
15
+ */
16
+ altitude?: number;
17
+ }
18
+ export interface PointGeometry {
19
+ type: 'Point';
20
+ coordinates: Position;
21
+ }
22
+ export interface LineStringGeometry {
23
+ type: 'LineString';
24
+ coordinates: Position[];
25
+ }
26
+ /** Rings are closed (first position equals last). The first ring is the outer boundary; the rest are holes. */
27
+ export interface PolygonGeometry {
28
+ type: 'Polygon';
29
+ coordinates: Position[][];
30
+ }
31
+ export interface MultiPointGeometry {
32
+ type: 'MultiPoint';
33
+ coordinates: Position[];
34
+ }
35
+ export interface MultiLineStringGeometry {
36
+ type: 'MultiLineString';
37
+ coordinates: Position[][];
38
+ }
39
+ export interface MultiPolygonGeometry {
40
+ type: 'MultiPolygon';
41
+ coordinates: Position[][][];
42
+ }
43
+ /**
44
+ * A circle on the ground: a centre and a radius in metres. GeoJSON has no circle, so it becomes a polygon only where
45
+ * it must (GeoJSON export, rendering); containment tests use the true distance.
46
+ */
47
+ export interface CircleGeometry {
48
+ type: 'Circle';
49
+ center: Position;
50
+ radiusMeters: number;
51
+ }
52
+ export type Geometry = PointGeometry | LineStringGeometry | PolygonGeometry | MultiPointGeometry | MultiLineStringGeometry | MultiPolygonGeometry | CircleGeometry;
53
+ export type GeometryType = Geometry['type'];
54
+ /** Geometries an area visualization can draw and a geofence can use. */
55
+ export type AreaGeometry = PolygonGeometry | MultiPolygonGeometry | CircleGeometry;
56
+ /** What a geometry looks like on a map: a point, a line, or an area. Layers draw one family. */
57
+ export type GeometryFamily = 'point' | 'line' | 'area';
58
+ /** Pixels kept clear at each side of the map (for panels over it). A number pads all sides alike. */
59
+ export type Padding = number | {
60
+ top: number;
61
+ right: number;
62
+ bottom: number;
63
+ left: number;
64
+ };
65
+ /** Axis-aligned bounds in degrees. MVP does not wrap the antimeridian: west <= east. */
66
+ export interface BoundingBox {
67
+ west: number;
68
+ south: number;
69
+ east: number;
70
+ north: number;
71
+ }
72
+ /** A spatial projection of an Ontology object. `objectId` is the stable identity shared with tables, charts and inspectors. */
73
+ export interface SpatialObject {
74
+ objectId: string;
75
+ geometry: Geometry;
76
+ properties?: Record<string, unknown>;
77
+ /** When the source observed this state (ISO 8601). Used to reject stale realtime updates and to age objects. */
78
+ observedAt?: string;
79
+ /** When the source system received it (ISO 8601), for display; ordering uses `observedAt`. */
80
+ receivedAt?: string;
81
+ /** The state holds from / until (ISO 8601). Outside this window the object is not drawn (it stays queryable). */
82
+ validFrom?: string;
83
+ validUntil?: string;
84
+ /** How sure the source is, 0…1. What it means is the source's business; the map only shows it. */
85
+ confidence?: number;
86
+ /** Where the position may really be. */
87
+ uncertainty?: PositionUncertainty;
88
+ /** Unresolved: candidate geometries besides this one, until the source says which holds (doc 29 §4). */
89
+ alternatives?: ObjectAlternative[];
90
+ /** Where this came from, passed through untouched (UNS owns provenance; doc 29 §10). */
91
+ provenance?: Provenance;
92
+ /** Properties the user may not see: the provider removed their values (doc 28 G13). */
93
+ redacted?: string[];
94
+ }
95
+ /** An error around a position: a radius, or an ellipse (semi-axes in metres, major axis clockwise from north). */
96
+ export interface PositionUncertainty {
97
+ radiusMeters?: number;
98
+ ellipse?: {
99
+ semiMajorMeters: number;
100
+ semiMinorMeters: number;
101
+ orientationDegrees?: number;
102
+ };
103
+ }
104
+ /** One candidate geometry of an unresolved object. */
105
+ export interface ObjectAlternative {
106
+ id?: string;
107
+ geometry: Geometry;
108
+ /** 0…1, as the source states it. */
109
+ probability?: number;
110
+ label?: string;
111
+ }
112
+ /** Source, time, version and marking of an object or of one property. The engine never interprets it. */
113
+ export interface Provenance {
114
+ source?: string;
115
+ observedAt?: string;
116
+ version?: string | number;
117
+ classification?: string;
118
+ signature?: 'valid' | 'invalid' | 'unsigned' | 'unknown';
119
+ /** Upstream ids or names this was derived from, nearest first. */
120
+ lineage?: string[];
121
+ /** Per-property provenance, when properties come from different places. */
122
+ properties?: Record<string, Omit<Provenance, 'properties'>>;
123
+ extra?: Record<string, unknown>;
124
+ }
125
+ export type SpatialRelation = {
126
+ relation: 'bbox';
127
+ bounds: BoundingBox;
128
+ } | {
129
+ relation: 'within';
130
+ geometry: Geometry;
131
+ } | {
132
+ relation: 'contains';
133
+ geometry: Geometry;
134
+ } | {
135
+ relation: 'intersects';
136
+ geometry: Geometry;
137
+ } | {
138
+ relation: 'near';
139
+ position: Position;
140
+ distanceMeters: number;
141
+ }
142
+ /** A ranking, not a filter: the `count` closest objects to `position`, optionally within `maxDistanceMeters`. */
143
+ | {
144
+ relation: 'nearest';
145
+ position: Position;
146
+ count: number;
147
+ maxDistanceMeters?: number;
148
+ };
149
+ /**
150
+ * One property condition (doc §10 filters): `property` compared with `value` using the same operators as style
151
+ * rules, plus `exists` (the property has a non-null value; no `value`). `between` takes [min, max] (inclusive),
152
+ * `in` an array, `gt`/`gte`/`lt`/`lte` a number.
153
+ */
154
+ export interface PropertyCondition {
155
+ property: string;
156
+ op: RuleOperator | 'exists';
157
+ value?: unknown;
158
+ }
159
+ /**
160
+ * What a layer (or an application) wants. Every filtering field narrows the result.
161
+ * `bounds` is the viewport data boundary the runtime adds (ADR-013).
162
+ * `zoom` and `time` are hints (doc §13): they never narrow the result on the client, but a provider may use them
163
+ * to send less detail when zoomed out, or only what existed during the time range.
164
+ */
165
+ export interface SpatialQuery {
166
+ ontologyType?: string;
167
+ /** Only objects with this geometry type. Layers set it (a layer draws one type), so rankings like
168
+ * `nearest` count only objects the layer can show, and providers send nothing it cannot draw. */
169
+ geometryType?: GeometryType;
170
+ objectIds?: string[];
171
+ spatial?: SpatialRelation;
172
+ bounds?: BoundingBox;
173
+ /** Exact property values (shorthand for `eq` conditions). */
174
+ filter?: Record<string, unknown>;
175
+ /** Property conditions, all of which must hold. */
176
+ where?: PropertyCondition[];
177
+ /** Hint: the zoom the result will be shown at. */
178
+ zoom?: number;
179
+ /** Hint: the time range being shown (replay). Absent when live. */
180
+ time?: TimeRange;
181
+ }
182
+ export interface MapViewport {
183
+ center: Position;
184
+ zoom: number;
185
+ /** Degrees clockwise from north, in [0, 360). */
186
+ bearing?: number;
187
+ /** Degrees from vertical, in [0, 85]. */
188
+ pitch?: number;
189
+ /** Visible bounds, reported by the renderer or computed by the runtime. */
190
+ bounds?: BoundingBox;
191
+ }
192
+ export type VisualizationType = 'marker' | 'line' | 'polygon' | 'heatmap' | 'track' | 'extrusion' | 'model' | 'volume' | 'link' | 'image';
193
+ export type IconShape = 'circle' | 'square' | 'triangle' | 'diamond' | 'arrow';
194
+ export type RuleOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'in';
195
+ /**
196
+ * Generic style rule. First match wins; a rule without `property` matches everything (the fallback).
197
+ * Compare `property` with `value` using `op` (default 'eq'). `between` takes [min, max] (inclusive), `in` an array.
198
+ * `equals` is the original shorthand for `op: 'eq', value`.
199
+ */
200
+ export interface StyleRule {
201
+ property?: string;
202
+ op?: RuleOperator;
203
+ value?: unknown;
204
+ equals?: unknown;
205
+ style: StyleTokens;
206
+ }
207
+ export interface StyleTokens {
208
+ color?: string;
209
+ /** Marker layers with an icon: an image for objects matching this rule (e.g. a different marker per status). */
210
+ imageUrl?: string;
211
+ size?: number;
212
+ opacity?: number;
213
+ strokeColor?: string;
214
+ strokeWidth?: number;
215
+ /** Lines and area outlines: dashed, as dash and gap lengths in line widths (e.g. [2, 2]). Omit for solid. */
216
+ dash?: number[];
217
+ /** Model layers: a glTF/GLB model for objects matching this rule. */
218
+ modelUrl?: string;
219
+ label?: string;
220
+ }
221
+ export interface LabelConfig {
222
+ /** Object property whose value is drawn as text. */
223
+ property: string;
224
+ size?: number;
225
+ color?: string;
226
+ haloColor?: string;
227
+ /** Hide labels below this zoom (decluttering). */
228
+ minZoom?: number;
229
+ /**
230
+ * Areas only: where the one label goes. 'center' (default) inside the middle; 'top' just inside the top edge —
231
+ * for large or nested areas (operating areas, zones) whose middles hold other things.
232
+ */
233
+ placement?: 'center' | 'top';
234
+ }
235
+ /** Marker icon: a built-in shape (recoloured by style rules) or an image URL (drawn as is). */
236
+ export interface IconConfig {
237
+ shape?: IconShape;
238
+ imageUrl?: string;
239
+ /** Object property holding a rotation in degrees clockwise from north (e.g. heading). */
240
+ rotateBy?: string;
241
+ /** Icon size in pixels. Default 18. */
242
+ size?: number;
243
+ }
244
+ /** Group nearby markers into counted bubbles until `maxZoom`. Rendering-side clustering of loaded objects. */
245
+ export interface ClusterConfig {
246
+ /** Pixel radius within which markers merge. Default 50. */
247
+ radius?: number;
248
+ /** Last zoom with clusters. Default 14. */
249
+ maxZoom?: number;
250
+ }
251
+ /** Density surface over points. Weight comes from a numeric property (default 1 per object). */
252
+ export interface HeatmapConfig {
253
+ weightProperty?: string;
254
+ /** Multiplies the weight. Default 1. */
255
+ weightScale?: number;
256
+ /** Pixel radius of influence. Default 24. */
257
+ radius?: number;
258
+ intensity?: number;
259
+ }
260
+ /** What an altitude is measured from (ADR-028). Never guessed: a layer that draws heights says which. */
261
+ export type AltitudeReference = 'msl' | 'agl' | 'ellipsoid';
262
+ /**
263
+ * Draw points and lines at a height (ADR-028): from the geometry's `altitude`, or from a numeric property.
264
+ * `msl` = above mean sea level, `agl` = above the ground/terrain, `ellipsoid` = GNSS height.
265
+ */
266
+ export interface ElevationConfig {
267
+ from: 'geometry' | 'property';
268
+ /** With `from: 'property'`: the property holding metres. */
269
+ property?: string;
270
+ reference: AltitudeReference;
271
+ /** Multiplies heights (to make low flight visible). Default 1. */
272
+ exaggeration?: number;
273
+ /** A thin line from each object down to the ground. */
274
+ stems?: boolean;
275
+ /** The object's footprint drawn on the ground under it. */
276
+ shadow?: boolean;
277
+ }
278
+ /** Areas raised into blocks (buildings, zones with a ceiling). Heights in metres, fixed or from properties. */
279
+ export interface ExtrusionConfig {
280
+ height?: number;
281
+ heightProperty?: string;
282
+ /** Where the block starts (a floating volume). Default 0. */
283
+ base?: number;
284
+ baseProperty?: string;
285
+ }
286
+ /** A 3D model (glTF/GLB) at each point, oriented by properties. Per-rule models use `style.modelUrl`. */
287
+ export interface ModelConfig {
288
+ url?: string;
289
+ /** Model size in metres along its longest side; omit to use the model's own units (metres). */
290
+ sizeMeters?: number;
291
+ /** Degrees clockwise from north. */
292
+ headingProperty?: string;
293
+ pitchProperty?: string;
294
+ rollProperty?: string;
295
+ /**
296
+ * A fixed correction for a model file that does not follow glTF's axes, in degrees. A glTF file has +Y up and
297
+ * its front facing +Z; such a file faces its heading with no correction. Added to the orientation from properties.
298
+ */
299
+ axis?: {
300
+ pitch?: number;
301
+ yaw?: number;
302
+ roll?: number;
303
+ };
304
+ }
305
+ /**
306
+ * A coverage volume at each point (sensor range): a `dome` (sphere cap of a range), or a `wedge` (a sector of a
307
+ * range between an azimuth ± beamWidth/2 and between two elevation angles). Values fixed or from properties.
308
+ */
309
+ export interface VolumeConfig {
310
+ shape: 'dome' | 'wedge';
311
+ range?: number;
312
+ rangeProperty?: string;
313
+ /** Wedge centre, degrees clockwise from north. */
314
+ azimuth?: number;
315
+ azimuthProperty?: string;
316
+ /** Wedge opening, degrees. */
317
+ beamWidth?: number;
318
+ beamWidthProperty?: string;
319
+ /** Degrees above the horizon. Defaults 0 and 90. */
320
+ minElevation?: number;
321
+ maxElevation?: number;
322
+ }
323
+ /** Trail of recent positions (doc 07). Drawn as a line ending at the current time (live) or at the replay time. */
324
+ export interface TrackVisualizationConfig {
325
+ /** Trail length in minutes. Default 30. */
326
+ windowMinutes?: number;
327
+ }
328
+ export interface VisualizationConfig {
329
+ type: VisualizationType;
330
+ /** Track layers only. */
331
+ track?: TrackVisualizationConfig;
332
+ style?: StyleRule[];
333
+ /** Text from an object property. Needs a label font in the basemap config. */
334
+ label?: LabelConfig;
335
+ /** Markers only. */
336
+ icon?: IconConfig;
337
+ /** Markers only. */
338
+ cluster?: ClusterConfig;
339
+ /** Heatmap layers only. */
340
+ heatmap?: HeatmapConfig;
341
+ /** Marker, line, track, model and volume layers: draw at a height (ADR-028). */
342
+ elevation?: ElevationConfig;
343
+ /** Extrusion layers only. */
344
+ extrusion?: ExtrusionConfig;
345
+ /** Model layers only. */
346
+ model?: ModelConfig;
347
+ /** Volume layers only. */
348
+ volume?: VolumeConfig;
349
+ /** How old an object may be before it ages (doc 28 G1): sets `$age` for rules, and fades. */
350
+ age?: AgeConfig;
351
+ /** Continuous styling: a number property mapped onto a style token (e.g. confidence → opacity). */
352
+ scales?: StyleScale[];
353
+ /** Point layers: draw each object's position error, and its unresolved alternatives. */
354
+ uncertainty?: UncertaintyDisplay;
355
+ /** Point layers: range rings around each object, following it. */
356
+ rings?: RingsConfig;
357
+ /** Point layers: the ground area a camera at each object sees. */
358
+ footprint?: FootprintConfig;
359
+ /** Link layers only: lines between linked objects. */
360
+ link?: LinkConfig;
361
+ /** Image layers only: a picture pinned to the ground by each object's four corners. */
362
+ image?: ImageOverlayConfig;
363
+ }
364
+ /**
365
+ * Age states from the time since `observedAt` (live: the clock; replay: the replay time). Objects without
366
+ * `observedAt` never age. Rules can use `$age` ('fresh' | 'ageing' | 'stale' | 'lost').
367
+ */
368
+ export interface AgeConfig {
369
+ /** Default: half of staleAfterSeconds. */
370
+ ageingAfterSeconds?: number;
371
+ staleAfterSeconds: number;
372
+ /** Default: never lost. */
373
+ lostAfterSeconds?: number;
374
+ /** Fade ageing and stale objects (opacity 0.7 / 0.4, lost 0.2). Default true. */
375
+ fade?: boolean;
376
+ /** Leave lost objects off the map. Default false. */
377
+ hideLost?: boolean;
378
+ }
379
+ /** Linear mapping of a number onto a token, clamped to the range. `property` may be `$confidence`. */
380
+ export interface StyleScale {
381
+ property: string;
382
+ token: 'opacity' | 'size' | 'strokeWidth' | 'color' | 'strokeColor';
383
+ domain: [number, number];
384
+ /** Numbers, or two colours (#RRGGBB) to blend between. */
385
+ range: [number, number] | [string, string];
386
+ }
387
+ export interface UncertaintyDisplay {
388
+ color?: string;
389
+ /** Fill opacity of the error areas. Default 0.15. */
390
+ opacity?: number;
391
+ /** Also draw unresolved alternatives (dashed, joined to the object). Default true. */
392
+ alternatives?: boolean;
393
+ }
394
+ export interface RingsConfig {
395
+ distancesMeters: number[];
396
+ color?: string;
397
+ /** Label each ring with its distance. Default true. */
398
+ labels?: boolean;
399
+ }
400
+ /**
401
+ * A camera's ground footprint from where it is and where it looks. With a height above ground the footprint runs
402
+ * from the near to the far edge of the view; without one (or looking at the horizon) it reaches `maxRangeMeters`.
403
+ */
404
+ export interface FootprintConfig {
405
+ /** Degrees clockwise from north. */
406
+ headingProperty: string;
407
+ /** Degrees below the horizon. */
408
+ pitchProperty?: string;
409
+ pitch?: number;
410
+ /** Horizontal field of view, degrees. */
411
+ fovProperty?: string;
412
+ fov?: number;
413
+ /** Vertical field of view, degrees. Default 3/4 of the horizontal. */
414
+ fovVertical?: number;
415
+ /** Height above the ground, metres. */
416
+ heightProperty?: string;
417
+ height?: number;
418
+ /** Default 5000. */
419
+ maxRangeMeters?: number;
420
+ color?: string;
421
+ }
422
+ /** Which links a link layer draws: between objects on the map, by link type (all when omitted). */
423
+ export interface LinkConfig {
424
+ types?: string[];
425
+ }
426
+ export interface ImageOverlayConfig {
427
+ /** Property holding the image URL; or one `url` for all. */
428
+ urlProperty?: string;
429
+ url?: string;
430
+ /** Default 0.85. */
431
+ opacity?: number;
432
+ }
433
+ export interface InteractionConfig {
434
+ selectable?: boolean;
435
+ hoverable?: boolean;
436
+ }
437
+ /** What to load. A layer never names a database (ADR-005). */
438
+ export interface LayerSource {
439
+ ontologyType?: string;
440
+ objectIds?: string[];
441
+ spatialQuery?: SpatialRelation;
442
+ /** Exact property values (shorthand for `eq` conditions). */
443
+ filter?: Record<string, unknown>;
444
+ /** Property conditions, all of which must hold (e.g. status in [FAULT, ALARM], speed > 50). */
445
+ where?: PropertyCondition[];
446
+ }
447
+ export interface MapLayer {
448
+ id: string;
449
+ source: LayerSource;
450
+ visible: boolean;
451
+ zIndex: number;
452
+ visualization: VisualizationConfig;
453
+ interaction?: InteractionConfig;
454
+ }
455
+ export interface SelectionContext {
456
+ objectIds: string[];
457
+ primaryObjectId?: string;
458
+ /** Who changed the selection: 'map', 'api', or an application component name. */
459
+ source: string;
460
+ timestamp: number;
461
+ }
462
+ /** A SpatialObject participating in the current scene through one layer. */
463
+ export interface SceneObject {
464
+ /** `${layerId}:${objectId}` — one object can appear in several layers. */
465
+ key: string;
466
+ layerId: string;
467
+ object: SpatialObject;
468
+ selected: boolean;
469
+ hovered: boolean;
470
+ }
471
+ export interface SceneState {
472
+ viewport: MapViewport;
473
+ layers: MapLayer[];
474
+ objects: SceneObject[];
475
+ selection?: SelectionContext;
476
+ }
477
+ export interface ScenePatch {
478
+ added?: SceneObject[];
479
+ updated?: SceneObject[];
480
+ /** Scene object keys. */
481
+ removed?: string[];
482
+ /** Present when layer definitions (order, visibility, style) changed. */
483
+ layers?: MapLayer[];
484
+ }
485
+ export interface BasemapConfig {
486
+ kind: 'none' | 'style' | 'tiles';
487
+ styleUrl?: string;
488
+ tileUrl?: string;
489
+ attribution?: string;
490
+ /**
491
+ * The deepest zoom the raster tiles (`tileUrl`, or `rasterFallback`) exist at. Closer in, the renderer stretches
492
+ * that level instead of asking for tiles a server answers with a "no data" picture. Default: none (ask freely).
493
+ */
494
+ maxZoom?: number;
495
+ /** Background colour when kind is 'none'. */
496
+ background?: string;
497
+ /**
498
+ * Font file for labels (any format the browser can load, e.g. woff2), supplied by the application so the
499
+ * engine bundles no font and needs no glyph server. Without it, layer labels are not drawn.
500
+ */
501
+ font?: {
502
+ name: string;
503
+ url: string;
504
+ };
505
+ /**
506
+ * A raster `{z}/{x}/{y}` tile URL showing the same map, for renderers that cannot draw a vector style (the 3D
507
+ * globe). Only used with `kind: 'style'`.
508
+ */
509
+ rasterFallback?: string;
510
+ /** Credit for the `rasterFallback` tiles (a style carries its own; fallback tiles often come from elsewhere). */
511
+ rasterFallbackAttribution?: string;
512
+ }
513
+ /**
514
+ * Elevation tiles for terrain (raster DEM), configured like the basemap: the engine runs no terrain service, and
515
+ * licensing is the deployment's concern (§25). Development may use public dev-only sources.
516
+ */
517
+ export interface TerrainConfig {
518
+ /** `{z}/{x}/{y}` URL of DEM tiles. */
519
+ tileUrl: string;
520
+ /** How heights are packed into the tile colours. Default 'terrarium'. */
521
+ encoding?: 'terrarium' | 'mapbox';
522
+ tileSize?: number;
523
+ maxZoom?: number;
524
+ attribution?: string;
525
+ /** Multiplies terrain heights. Default 1. */
526
+ exaggeration?: number;
527
+ /** Contour lines from the same DEM tiles (doc 28 G11). */
528
+ contours?: ContourConfig;
529
+ }
530
+ export interface ContourConfig {
531
+ /** Metres between lines. */
532
+ interval: number;
533
+ /** Every Nth line is an index line (bolder, labelled). Default 5. */
534
+ majorEvery?: number;
535
+ color?: string;
536
+ }
537
+ /**
538
+ * What a renderer can draw beyond flat 2D (ADR-026..028). The runtime compares a map's needs with these and
539
+ * reports MISSING_CAPABILITY instead of leaving a layer silently empty. Absent means no.
540
+ */
541
+ export interface RendererCapabilities {
542
+ /** `projection: 'globe'`. */
543
+ globe?: boolean;
544
+ /** `terrain` relief. */
545
+ terrain?: boolean;
546
+ /** Points and lines drawn at their height (`visualization.elevation`). */
547
+ altitude?: boolean;
548
+ extrusion?: boolean;
549
+ models?: boolean;
550
+ volumes?: boolean;
551
+ tiles3d?: boolean;
552
+ /** Can answer sampleElevation() from its terrain. */
553
+ elevation?: boolean;
554
+ }
555
+ /**
556
+ * A 3D Tiles tileset (phase 3E): city meshes, photogrammetry, detailed terrain — scenery, not data objects. Configured
557
+ * by URL like the basemap (self-hostable; no Cesium Ion). Needs the renderer's `tiles3d` capability.
558
+ */
559
+ export interface TilesetConfig {
560
+ id: string;
561
+ /** URL of the tileset.json. */
562
+ url: string;
563
+ label?: string;
564
+ /** Detail: lower is sharper and heavier. Default 16. */
565
+ maximumScreenSpaceError?: number;
566
+ /** Default true. */
567
+ show?: boolean;
568
+ }
569
+ export interface MapConfig {
570
+ viewport: MapViewport;
571
+ basemap: BasemapConfig;
572
+ layers: MapLayer[];
573
+ /** Flat map (default) or a globe (ADR-026). */
574
+ projection?: 'mercator' | 'globe';
575
+ /** Ground relief from elevation tiles; without it the ground is flat at 0 m. */
576
+ terrain?: TerrainConfig;
577
+ /** 3D Tiles scenery (phase 3E). */
578
+ tilesets?: TilesetConfig[];
579
+ /**
580
+ * A disconnected site (doc 28 G14): every URL the map uses (basemap, fonts, terrain, scenery, icons, models) must
581
+ * be relative or on an allowed origin; anything else is refused when the config is set. `true` = relative only.
582
+ */
583
+ offline?: boolean | {
584
+ allowedOrigins: string[];
585
+ };
586
+ }
587
+ /** What a user made on the map (doc 29 §5): first-class, separate from application data. */
588
+ export type AnnotationKind = 'point' | 'line' | 'polygon' | 'rectangle' | 'circle' | 'measurement' | 'label' | 'note';
589
+ export interface Annotation {
590
+ id: string;
591
+ kind: AnnotationKind;
592
+ geometry: Geometry;
593
+ label?: string;
594
+ note?: string;
595
+ /** Overrides the default look (colour, width, opacity, dash). */
596
+ style?: StyleTokens;
597
+ author?: string;
598
+ /** ISO 8601. */
599
+ createdAt?: string;
600
+ updatedAt?: string;
601
+ metadata?: Record<string, unknown>;
602
+ }
603
+ /** A geometry an agent (or anyone) suggests; a person accepts it (it becomes an annotation) or rejects it. */
604
+ export interface Proposal {
605
+ id: string;
606
+ geometry: Geometry;
607
+ label?: string;
608
+ note?: string;
609
+ /** Who suggested it, e.g. `agent:route-planner`. */
610
+ origin: string;
611
+ createdAt: string;
612
+ }
613
+ /** A temporary emphasis on objects that does not change the selection. */
614
+ export interface Highlight {
615
+ objectIds: string[];
616
+ color?: string;
617
+ /** ISO 8601; absent = until cleared. */
618
+ until?: string;
619
+ origin?: string;
620
+ }
621
+ /** What a layer shows right now, for the application to tell its users (doc 28 G13). */
622
+ export type LayerStatus = 'ok' | 'loading' | 'denied' | 'error' | 'missing-capability';
623
+ export interface Size {
624
+ width: number;
625
+ height: number;
626
+ }
627
+ export type ValidationResult = {
628
+ valid: true;
629
+ } | {
630
+ valid: false;
631
+ reason: string;
632
+ };
633
+ /** ISO 8601 timestamps. */
634
+ export interface TimeRange {
635
+ start: string;
636
+ end: string;
637
+ }
638
+ /** One observed position. Flat latitude/longitude as in doc 07 (still semantic, never `[lon, lat]`). */
639
+ export interface TrackPoint {
640
+ timestamp: string;
641
+ latitude: number;
642
+ longitude: number;
643
+ altitude?: number;
644
+ speed?: number;
645
+ /** Degrees clockwise from north. When missing, it is derived from neighbouring points. */
646
+ heading?: number;
647
+ }
648
+ /** Ordered positions of one object over time. */
649
+ export interface Track {
650
+ objectId: string;
651
+ points: TrackPoint[];
652
+ /** The object's properties, so replay can show objects that are no longer in today's data. */
653
+ properties?: Record<string, unknown>;
654
+ }
655
+ /** What the application asks the map to show. The application owns time (ADR-010); the map follows. */
656
+ export type TimeSetting = {
657
+ mode: 'live';
658
+ } | {
659
+ mode: 'replay';
660
+ at: string;
661
+ range?: TimeRange;
662
+ };
663
+ /** What the map is showing. */
664
+ export type TimeState = {
665
+ mode: 'live';
666
+ } | {
667
+ mode: 'replay';
668
+ at: string;
669
+ range: TimeRange;
670
+ };
671
+ /**
672
+ * A zone that watches objects. Client-side evaluation is for display and analysis; authoritative alerting and the
673
+ * right to create or edit geofences belong to the server runtime (doc 16, ADR-016).
674
+ */
675
+ export interface Geofence {
676
+ id: string;
677
+ name?: string;
678
+ /** A polygon, a multipolygon or a circle. */
679
+ geometry: AreaGeometry;
680
+ enabled: boolean;
681
+ /** Which objects it watches. Empty means every point object on the map. */
682
+ watch?: {
683
+ layerIds?: string[];
684
+ objectIds?: string[];
685
+ filter?: Record<string, unknown>;
686
+ where?: PropertyCondition[];
687
+ };
688
+ /** Exit only when this far outside the edge (jitter, doc 15). Default 0. */
689
+ hysteresisMeters?: number;
690
+ /** Consecutive agreeing readings needed to change state (debounce). Default 1. */
691
+ debounceSamples?: number;
692
+ /** Emit one dwell event per visit after this long inside. */
693
+ dwellSeconds?: number;
694
+ /**
695
+ * An altitude band (phase 3E): the geofence is a volume — inside means inside the outline AND between these heights
696
+ * (metres, in the watched objects' own altitude reference). An object without altitude is never inside a band.
697
+ */
698
+ minAltitude?: number;
699
+ maxAltitude?: number;
700
+ }
701
+ export type GeofenceEventType = 'enter' | 'exit' | 'dwell';
702
+ export interface GeofenceEvent {
703
+ geofenceId: string;
704
+ objectId: string;
705
+ type: GeofenceEventType;
706
+ /** Observation time of the reading that caused it (ISO 8601). */
707
+ timestamp: string;
708
+ position: Position;
709
+ }