@orbat-mapper/tactical-draw 0.34.0 → 0.36.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.
@@ -0,0 +1,1542 @@
1
+ import { ControlMeasureStyle, HighlightAppearance, PatternId, TextAmplifiers } from "@orbat-mapper/control-measures";
2
+ import { Feature, Position } from "geojson";
3
+
4
+ //#region src/pin-presentation.d.ts
5
+ /** View preferences, never part of an authored PointSymbol snapshot. */
6
+ interface PinPresentation {
7
+ enabled: boolean;
8
+ mode: "screen" | "world";
9
+ liftPixels: number;
10
+ heightMeters: number;
11
+ sizePixels: number;
12
+ occlusion: "none" | "terrain";
13
+ prioritizePins: boolean;
14
+ /** Paint whole pins far to near by camera depth; ties retain layer order. Default on. */
15
+ depthSort: boolean;
16
+ stem: {
17
+ color: string;
18
+ width: number;
19
+ opacity: number;
20
+ };
21
+ dot: {
22
+ color: string;
23
+ radius: number;
24
+ opacity: number;
25
+ };
26
+ halo: {
27
+ color: string;
28
+ width: number;
29
+ opacity: number;
30
+ };
31
+ symbolHalo: {
32
+ color: string;
33
+ width: number;
34
+ opacity: number;
35
+ };
36
+ plate: {
37
+ enabled: boolean;
38
+ color: string;
39
+ borderColor: string;
40
+ borderWidth: number;
41
+ padding: number;
42
+ radius: number;
43
+ opacity: number;
44
+ };
45
+ /**
46
+ * View-wide zoom-out shrinking of the screen-space pin (symbol, plate, halos,
47
+ * dot and screen lift; stem width stays constant). Below `fullSizeZoom` the
48
+ * pin is multiplied by `falloff` per zoom level; `sizeLimits` sets the floor.
49
+ */
50
+ zoomScale: {
51
+ enabled: boolean;
52
+ fullSizeZoom: number;
53
+ falloff: number;
54
+ };
55
+ /**
56
+ * View-wide perspective sizing: pins nearer the camera than the view center
57
+ * grow and farther ones shrink, by `(centerDepth / pinDepth) ^ strength`
58
+ * (1 = true perspective). Multiplies with `zoomScale`; scales the same parts.
59
+ */
60
+ distanceScale: {
61
+ enabled: boolean;
62
+ strength: number;
63
+ };
64
+ /**
65
+ * View-wide bounds on the pin scale (zoom × distance), applied only while either
66
+ * scaling mode is enabled: the one place that decides how small or large pins get.
67
+ * If `minScale` exceeds `maxScale`, `maxScale` wins.
68
+ */
69
+ sizeLimits: {
70
+ minScale: number;
71
+ maxScale: number;
72
+ };
73
+ }
74
+ /** Nested settings, merged key by key rather than replaced by a patch. */
75
+ declare const sections: readonly ["stem", "dot", "halo", "symbolHalo", "plate", "zoomScale", "distanceScale", "sizeLimits"];
76
+ type PinSection = (typeof sections)[number];
77
+ declare const viewWideKeys: readonly ["mode", "occlusion", "prioritizePins", "depthSort", "zoomScale", "distanceScale", "sizeLimits"];
78
+ type PinPresentationPatch = Partial<Omit<PinPresentation, PinSection>> & { [K in PinSection]?: Partial<PinPresentation[K]> };
79
+ /** Per-unit appearance and dimensions; spatial rules belong to the view. */
80
+ type PinOverridePatch = Omit<PinPresentationPatch, (typeof viewWideKeys)[number]>;
81
+ interface PinPresentationState {
82
+ defaults: PinPresentationPatch;
83
+ overrides: Record<string, PinOverridePatch>;
84
+ }
85
+ type PinPresentationStatus = "supported" | "unsupported" | "loading" | "waiting-for-elevation" | "unavailable";
86
+ interface PinPresentationCapability {
87
+ status: PinPresentationStatus;
88
+ reason?: string;
89
+ }
90
+ interface PinPresentationStatusEvent extends PinPresentationCapability {
91
+ graphicIds: readonly string[];
92
+ }
93
+ /** Render payload for one atomic graphic; shared icon resources retain HQ staff. */
94
+ interface PinRender {
95
+ id: string;
96
+ position: Position;
97
+ resource: IconResource;
98
+ octagonSize: number;
99
+ presentation: PinPresentation;
100
+ opacity: number;
101
+ /** Absolute clockwise bearing in radians, independent of billboard orientation. */
102
+ direction?: number;
103
+ /** Selection chrome only, on the host highlight/handles surface. */
104
+ highlightOnly?: boolean;
105
+ }
106
+ interface PinFootprint {
107
+ ground: PixelCoordinate;
108
+ attachment: PixelCoordinate;
109
+ min: PixelCoordinate;
110
+ max: PixelCoordinate;
111
+ }
112
+ declare const DEFAULT_PIN_PRESENTATION: Readonly<PinPresentation>;
113
+ /**
114
+ * Multiplier for screen-space pin dimensions at `zoom`, never above 1; 1 when zoom
115
+ * scaling is off. Unbounded below: combinePinScale applies `sizeLimits`.
116
+ */
117
+ declare function pinZoomScale(presentation: PinPresentation, zoom: number): number;
118
+ /**
119
+ * Perspective multiplier for a pin at camera depth `depth` (clip-space w), relative
120
+ * to the view center at `referenceDepth`; 1 when distance scaling is off. Unbounded:
121
+ * combinePinScale applies `sizeLimits`. Engines that scale on the GPU must mirror
122
+ * this formula in their shader.
123
+ */
124
+ declare function pinDistanceScale(presentation: PinPresentation, depth: number, referenceDepth: number): number;
125
+ /**
126
+ * Combined screen-space pin scale from the two mode factors (as returned by
127
+ * pinZoomScale and pinDistanceScale), bounded by `sizeLimits` while either mode is
128
+ * enabled; if its `minScale` exceeds `maxScale`, `maxScale` wins. Engines that
129
+ * scale on the GPU must mirror this in their shader.
130
+ */
131
+ declare function combinePinScale(presentation: PinPresentation, zoomScale: number, distanceScale: number): number;
132
+ /**
133
+ * Whether `value` is an acceptable number for the pin setting named `key`.
134
+ * Exported so a host's input handling can reject a value with the same rules
135
+ * the store enforces, rather than re-encoding the bounds and drifting from it.
136
+ */
137
+ declare function isValidPinNumber(key: string, value: unknown): value is number;
138
+ declare function resolvePinPresentation(...patches: readonly PinPresentationPatch[]): PinPresentation;
139
+ /** Replacing patches makes omitted override properties inherit again. */
140
+ declare class PinPresentationStore {
141
+ private state;
142
+ /** Monotonic stamp source for {@link revision}. */
143
+ private revisions;
144
+ private defaultsRevision;
145
+ private readonly overrideRevisions;
146
+ private readonly emitter;
147
+ getState(): PinPresentationState;
148
+ resolve(id: string): PinPresentation;
149
+ /**
150
+ * @internal A stamp that changes whenever {@link resolve} may return a
151
+ * different presentation for `id`, so a renderer can keep reusing the pins
152
+ * whose presentation a change left alone.
153
+ */
154
+ revision(id: string): number;
155
+ replace(state: PinPresentationState): void;
156
+ setDefaults(patch: PinPresentationPatch): void;
157
+ setOverride(id: string, patch: PinOverridePatch): void;
158
+ resetOverride(id: string): void;
159
+ /**
160
+ * Set several overrides, and with `null` reset them, as one validated change
161
+ * and one `onChange` emit. Each patch replaces that id's previous patch, as
162
+ * {@link setOverride} does; ids not named keep theirs. An invalid patch
163
+ * throws and leaves every override unchanged.
164
+ */
165
+ setOverrides(patches: Readonly<Record<string, PinOverridePatch | null>>): void;
166
+ onChange(listener: (state: PinPresentationState) => void): () => void;
167
+ }
168
+ //#endregion
169
+ //#region src/gestures/types.d.ts
170
+ interface PointerEventInfo {
171
+ /** Per-event hit-tolerance override (e.g. larger for touch). */
172
+ hitTolerance?: number;
173
+ /**
174
+ * Whether Alt/Option was held. Modifiers are populated on mouse
175
+ * pointer-down; touch leaves them undefined. Which gesture reads which key
176
+ * is set by `TacticalDrawOptions.editModifiers` and `offsetDragModifier`.
177
+ */
178
+ altKey?: boolean;
179
+ /**
180
+ * Whether Shift was held for this pointer event. Constrain gestures read
181
+ * their key (Shift by default) live, on every move.
182
+ */
183
+ shiftKey?: boolean;
184
+ /** Whether Control was held for this pointer event. */
185
+ ctrlKey?: boolean;
186
+ /** Whether Meta/Command was held for this pointer event. */
187
+ metaKey?: boolean;
188
+ /** Engine-native event, for drivers that need to call preventDefault etc. */
189
+ native?: unknown;
190
+ }
191
+ interface PointerCallback {
192
+ (pixel: PixelCoordinate, info?: PointerEventInfo): void;
193
+ }
194
+ /**
195
+ * Engine-agnostic pointer driver consumed by `TacticalDraw`'s edit controller.
196
+ * The controller owns handle rendering and hit-tests handles in lonLat space;
197
+ * the driver only carries raw pointer events, drag-pan toggle, and pixel
198
+ * projection.
199
+ */
200
+ interface EditPointerDriver {
201
+ onPointerDown(cb: PointerCallback): () => void;
202
+ onPointerMove(cb: PointerCallback): () => void;
203
+ onPointerUp(cb: PointerCallback): () => void;
204
+ /**
205
+ * `false` holds the engine's own drag gestures for the duration of an edit
206
+ * drag — its drag-pan, and any other drag the engine binds to the same
207
+ * pointer (MapLibre's drag-rotate) — so the drag moves only the handle;
208
+ * `true` restores the ones the host had enabled. Despite the name it is not
209
+ * limited to panning.
210
+ */
211
+ setDragPanEnabled(enabled: boolean): void;
212
+ toPixel(lonLat: Position): PixelCoordinate | null;
213
+ fromPixel(pixel: PixelCoordinate): Position;
214
+ /** Idempotent. */
215
+ dispose(): void;
216
+ }
217
+ //#endregion
218
+ //#region src/tactical-draw/edit-modifiers.d.ts
219
+ /** A keyboard modifier a pointer gesture can read. */
220
+ type ModifierKey = "alt" | "shift" | "ctrl" | "meta";
221
+ /**
222
+ * Which modifier keys the editor's gestures listen for (#652). Each role takes
223
+ * a key or `false` to turn the gesture off; omitted roles keep their current
224
+ * key. See {@link TacticalDrawOptions.editModifiers}.
225
+ */
226
+ interface EditModifiers {
227
+ /**
228
+ * Drag a vertex with this key held to hand the gesture to the definition's
229
+ * `modifierDrag` hook (e.g. a Flow Arrow split or merge). Any key in a list
230
+ * starts it. Held while pressing an option handle, it lets the definition
231
+ * widen that drag or reset (e.g. sizing every Split Arrow head at once).
232
+ * @default ["ctrl", "meta"]
233
+ */
234
+ modifierDrag?: ModifierKey | readonly ModifierKey[] | false;
235
+ /**
236
+ * Click a vertex with this key held to delete it, or an option handle to
237
+ * reset its option. Must not share a key with `modifierDrag`.
238
+ * @default "alt"
239
+ */
240
+ deleteOrReset?: ModifierKey | false;
241
+ /**
242
+ * Hold to constrain angles while drawing or dragging a vertex, and to step
243
+ * rotations in 15° increments.
244
+ * @default "shift"
245
+ */
246
+ constrain?: ModifierKey | false;
247
+ /**
248
+ * Click a point, a midpoint or the body of a graphic with parts (e.g. a Flow
249
+ * Arrow's flows) with this key held to toggle that part in or out of the
250
+ * edit session's part selection instead of selecting it alone (see
251
+ * `EditSession.selectedParts`). A drag with the key held is a plain
252
+ * drag, so it may share the `constrain` key (Shift-drag constrains,
253
+ * Shift-click extends). Must not share a key with `modifierDrag` or
254
+ * `deleteOrReset`, which act on the same press. Point and midpoint presses
255
+ * read the key from the edit pointer events; a body click reads it from the
256
+ * engine's click event.
257
+ *
258
+ * Off by default: a host that synthesises the constrain key on every event
259
+ * (to make constraining persistent) would otherwise extend on every click.
260
+ * @default false
261
+ */
262
+ extendPartSelection?: ModifierKey | false;
263
+ }
264
+ /** {@link EditModifiers} with every role filled in, as `getEditModifiers()` returns it. */
265
+ interface ResolvedEditModifiers {
266
+ modifierDrag: readonly ModifierKey[] | false;
267
+ deleteOrReset: ModifierKey | false;
268
+ constrain: ModifierKey | false;
269
+ extendPartSelection: ModifierKey | false;
270
+ }
271
+ declare const DEFAULT_EDIT_MODIFIERS: ResolvedEditModifiers;
272
+ /**
273
+ * Modifier keys held during a pick, normalised across engines (#754).
274
+ * `primary` is the platform's command key: Meta (⌘) on Apple platforms,
275
+ * Ctrl elsewhere.
276
+ */
277
+ interface PickModifiers {
278
+ alt: boolean;
279
+ shift: boolean;
280
+ ctrl: boolean;
281
+ meta: boolean;
282
+ primary: boolean;
283
+ }
284
+ /**
285
+ * Read the modifier keys from an engine pick or pointer event without
286
+ * assuming its type: a DOM event, an engine wrapper with an `originalEvent`,
287
+ * or nothing at all (every key `false`).
288
+ */
289
+ declare function readPickModifiers(originalEvent: unknown): PickModifiers;
290
+ //#endregion
291
+ //#region src/marker.d.ts
292
+ /** Displayed icon height; same pixel/meter contract as point-symbol sizes. */
293
+ type MarkerSize = PointSymbolSize;
294
+ interface MarkerStyle {
295
+ /** Host-interpreted tint, handed to {@link MarkerCapability.render}. */
296
+ color?: string;
297
+ /** 0–1 display multiplier applied by TacticalDraw. */
298
+ opacity?: number;
299
+ }
300
+ /**
301
+ * Persisted generic marker (e.g. a pin) whose icon is supplied by the
302
+ * host application. TacticalDraw treats `symbolId` as opaque (ADR-0059).
303
+ */
304
+ interface Marker {
305
+ id: string;
306
+ kind: "marker";
307
+ /** Host-defined icon identifier resolved by the {@link MarkerCapability}. */
308
+ symbolId: string;
309
+ position: Position;
310
+ /** Normalized radians clockwise from geographic north, around the icon anchor. */
311
+ rotation: number;
312
+ size: MarkerSize;
313
+ /** Optional text; the capability decides whether and how to draw it. */
314
+ label?: string;
315
+ style?: MarkerStyle;
316
+ properties?: Record<string, unknown>;
317
+ schemaVersion: 1;
318
+ }
319
+ interface MarkerAnchor {
320
+ x: number;
321
+ y: number;
322
+ }
323
+ /** Host-prepared marker icon in canonical SVG units. */
324
+ interface MarkerIcon {
325
+ /**
326
+ * Content-derived identity for adapter-wide icon reuse: equal ids must mean
327
+ * identical SVG. Include anything that changes the drawing (symbol, color, label).
328
+ */
329
+ resourceId: string;
330
+ /** Self-contained SVG markup. Producing safe content is the host's responsibility. */
331
+ svg: string;
332
+ width: number;
333
+ height: number;
334
+ /** Point placed at `Marker.position` (e.g. a pin's tip); rotation and scale pivot here. */
335
+ anchor: MarkerAnchor;
336
+ }
337
+ interface MarkerRender extends MarkerIcon {
338
+ /** False when the capability did not recognize `symbolId` and a placeholder is shown. */
339
+ available: boolean;
340
+ }
341
+ interface MarkerCapability {
342
+ /** Return `undefined` for an unknown `symbolId`; TacticalDraw renders a placeholder. */
343
+ render(marker: Marker): MarkerIcon | undefined;
344
+ /** Monotonic host-owned revision; bump it when icon resolution changes. */
345
+ readonly generation?: number;
346
+ /**
347
+ * Optional collocation member support (ADR-0063). Without it a Marker
348
+ * stands in the Bracket, drawn from its ordinary icon.
349
+ */
350
+ readonly collocation?: CollocationMemberSupport<CollocationMarker>;
351
+ }
352
+ /**
353
+ * One `MarkerCapability` from several, such as a badge catalog and the host's
354
+ * own icons: each marker gets the icon of the first capability that recognises
355
+ * its symbol id. `generation` is the sum of the parts' generations, so it still
356
+ * increases when any part bumps its own.
357
+ */
358
+ declare function composeMarkerCapabilities(...capabilities: readonly MarkerCapability[]): MarkerCapability;
359
+ declare function isMarker(graphic: unknown): graphic is Marker;
360
+ declare function cloneMarker(marker: Marker): Marker;
361
+ declare function markerOpacity(marker: Marker): number;
362
+ declare function validateMarker(marker: Marker): void;
363
+ declare function normalizeMarker(marker: Marker): Marker;
364
+ //#endregion
365
+ //#region src/collocation.d.ts
366
+ /** The two parts a collocation arranges its members in (ADR-0063). */
367
+ type CollocationPart = "staff" | "bracket";
368
+ /**
369
+ * A graphic embedded in a collocation: a point symbol or Marker whose own
370
+ * position is optional. Without one it stands at the collocation's location.
371
+ * Its `size`, `offset` and `rotation` are kept in data but ignored while it is
372
+ * a member: the collocation's own `size` sizes every member.
373
+ */
374
+ type CollocationMemberGraphic = CollocationPointSymbol | CollocationMarker;
375
+ /** A point symbol as a collocation member: its position and size are optional. */
376
+ type CollocationPointSymbol = Omit<PointSymbol, "position" | "size"> & {
377
+ position?: Position; /** Kept but ignored while a member: the collocation's `size` applies. */
378
+ size?: PointSymbolSize;
379
+ };
380
+ /** A Marker as a collocation member: its position and size are optional. */
381
+ type CollocationMarker = Omit<Marker, "position" | "size"> & {
382
+ position?: Position; /** Kept but ignored while a member: the collocation's `size` applies. */
383
+ size?: PointSymbolSize;
384
+ };
385
+ interface CollocationMember {
386
+ /** The embedded graphic; its `id` is the member id, unique within this collocation only. */
387
+ graphic: CollocationMemberGraphic;
388
+ /** Always wins over the capability's role and `options.parts`. */
389
+ part?: CollocationPart;
390
+ /** Draw this member in the app-wide Highlight appearance. */
391
+ highlight?: boolean;
392
+ }
393
+ type CollocationLocate = "bounds-center" | "centroid" | "first";
394
+ /**
395
+ * How a collocation edit stores a dragged part (`EditOptions.partDrag`):
396
+ * `"keep"` keeps a ground part on the ground and makes anything else
397
+ * screen-relative; `"ground"` and `"screen-relative"` always store that mode.
398
+ */
399
+ type CollocationPartDrag = "keep" | "ground" | "screen-relative";
400
+ /**
401
+ * Default `EditOptions.screenRelativeReach`: the farthest, in CSS px at
402
+ * collocation scale 1 from the location to a part's registration, that
403
+ * `partDrag: "keep"` stores a dragged part screen-relative. A part dragged
404
+ * further is stored on the ground, so its leader is a ground line rather than
405
+ * a long screen-space line drawn into the part image.
406
+ */
407
+ declare const COLLOCATION_SCREEN_RELATIVE_REACH = 200;
408
+ /**
409
+ * Style of the spread area. Defaults: `line.strokeColor` at 1 px, dashed
410
+ * `[6, 4]`; filled in the stroke color, or `fillColor`, at `fillOpacity` 0.1.
411
+ */
412
+ type CollocationAreaStyle = Pick<ControlMeasureStyle, "strokeColor" | "strokeWidth" | "strokeDash" | "fillColor" | "fillPattern"> & {
413
+ /** 0–1; default 0.1, whatever `fillColor` is, as a plate's is 0.85. */fillOpacity?: number;
414
+ };
415
+ /**
416
+ * A line a collocation draws that can be shown or hidden: `show: false`
417
+ * draws none but keeps the style for when it shows again. Widths and dashes
418
+ * are CSS px at collocation scale 1.
419
+ */
420
+ interface CollocationStroke {
421
+ show?: boolean;
422
+ strokeColor?: string;
423
+ strokeWidth?: number;
424
+ strokeDash?: number[];
425
+ }
426
+ /** What a collocation draws on the ground beneath its parts. Every field is optional. */
427
+ interface CollocationGround {
428
+ /**
429
+ * Default `{ mark: "auto" }`: no mark where a Staff's foot or a leader
430
+ * already ends at the location, as on a paper map, else a ring.
431
+ */
432
+ location?: {
433
+ mark?: "auto" | "ring" | "dot" | "cross" | "none";
434
+ color?: string;
435
+ size?: number;
436
+ };
437
+ /** Default `{ mark: "none" }`. */
438
+ memberPositions?: {
439
+ mark?: "dot" | "cross" | "none";
440
+ color?: string;
441
+ size?: number;
442
+ };
443
+ /**
444
+ * Default `true`: the location and member position marks shrink with the
445
+ * members when a ground size shrinks the collocation below its `maxPixels`.
446
+ * `false` keeps them at their full size.
447
+ */
448
+ scaleMarks?: boolean;
449
+ /**
450
+ * Lines from each positioned member to the location. Hidden by default;
451
+ * `{ show: true }` is 1 px solid in `memberPositions.color`.
452
+ */
453
+ ties?: CollocationStroke;
454
+ /**
455
+ * Default `{ shape: "none" }`; `padding` in true ground metres, default 100.
456
+ * `"hull"` is the convex hull; `"concave"` hugs the members instead, the
457
+ * way a hand-drawn outline would: a padded circle round each member,
458
+ * groups apart joined by a band one padding wide, inner corners rounded.
459
+ */
460
+ spread?: {
461
+ shape?: "none" | "hull" | "concave" | "circle" | "box";
462
+ padding?: number;
463
+ style?: CollocationAreaStyle;
464
+ };
465
+ }
466
+ /** The outline of a collocation's Bracket (see {@link CollocationOptions.bracket}). */
467
+ type CollocationBracketShape = "square" | "brace" | "bar" | "box" | "none";
468
+ /**
469
+ * A Bracket's part placement. With `bracket.side: "auto"`, `side` records the
470
+ * side the Bracket stands on, which the layout keeps wherever the placement
471
+ * points (only a part drag turns it, past a dead zone around the diagonal),
472
+ * and marks a screen-relative placement as holding the members'
473
+ * middle rather than the tick root, so a side switch never moves them; that
474
+ * holds whatever `bracket.side` is now, so setting a fixed side afterwards
475
+ * doesn't move them either. Editors write it from the layout's part `side`
476
+ * and `placedAt`. A placement without `side` holds the tick root, so
477
+ * switching a placed Bracket to auto leaves it where it is.
478
+ *
479
+ * **Hosts must carry `side` along** whenever they copy, move or rewrite a
480
+ * placement: spread the old placement (`{ ...placement, offset }`) rather
481
+ * than building a new one from `mode`, `offset` and `position`. Dropping
482
+ * `side` changes what `offset` anchors to (the tick root instead of the
483
+ * members' middle), so the Bracket jumps.
484
+ *
485
+ * `via` bends the leader: it runs location → `via` → tick root, in the
486
+ * placement's own frame, a lon/lat position for a ground placement and CSS px
487
+ * at collocation scale 1 from the location (as `offset`) for a
488
+ * screen-relative one. The `"bend"` grip writes it on the line of the tick,
489
+ * so the leader reaches the Bracket along it, but any point draws. A ground
490
+ * bend is a ground point, so a ground-placed Bracket stays pinned at every
491
+ * zoom however long the bend; `bracket.tick` stays the short stub drawn with
492
+ * the Bracket. A part drag drops it. Malformed, it is ignored.
493
+ */
494
+ type CollocationBracketPlacement = PointSymbolPlacement & {
495
+ side?: "left" | "top" | "bottom";
496
+ via?: Position;
497
+ };
498
+ /** Where a collocation's Bracket stands against its members. */
499
+ type CollocationBracketSide = "left" | "top" | "bottom" | "auto";
500
+ /**
501
+ * A plate behind a part's members (`staff.plate`, `bracket.plate`), hidden by
502
+ * default: `{ show: true }` is white at 0.85 opacity. `border` strokes its
503
+ * edge, hidden by default: `{ show: true }` is `line.strokeColor` at 1 px (px
504
+ * at scale 1). Plate and border are display only: clicks on them don't pick
505
+ * the part.
506
+ */
507
+ interface CollocationPlate {
508
+ show?: boolean;
509
+ fillColor?: string;
510
+ /** 0–1; default 0.85. */
511
+ fillOpacity?: number;
512
+ border?: {
513
+ show?: boolean;
514
+ strokeColor?: string;
515
+ strokeWidth?: number;
516
+ };
517
+ }
518
+ /**
519
+ * The `options.memberOptions` bag types by member kind, for a capability
520
+ * package to declare its own through declaration merging, so hosts get its
521
+ * options typed:
522
+ *
523
+ * ```ts
524
+ * declare module "@orbat-mapper/tactical-draw" {
525
+ * interface CollocationMemberOptionTypes {
526
+ * pointSymbol: MyCollocationOptions;
527
+ * }
528
+ * }
529
+ * ```
530
+ *
531
+ * A kind nobody declares takes any `Record<string, unknown>`.
532
+ */
533
+ interface CollocationMemberOptionTypes {}
534
+ type MemberOptionsOf<K extends string> = K extends keyof CollocationMemberOptionTypes ? CollocationMemberOptionTypes[K] : Record<string, unknown>;
535
+ /** Kind-keyed bags handed, unread, to each member kind's capability. */
536
+ interface CollocationMemberOptions {
537
+ pointSymbol?: MemberOptionsOf<"pointSymbol">;
538
+ marker?: MemberOptionsOf<"marker">;
539
+ }
540
+ /**
541
+ * The halo behind a collocation's line work and leaders (`line.halo`), hidden
542
+ * by default: `{ show: true }` is white, 3 px wider than each line it backs.
543
+ * `show: false` keeps the style for when it shows again. The halo is always
544
+ * solid, even behind a dashed leader.
545
+ */
546
+ interface CollocationHalo {
547
+ show?: boolean;
548
+ /** Default `#ffffff`. */
549
+ strokeColor?: string;
550
+ /**
551
+ * How much wider the halo is than each line it backs (the line's own
552
+ * width plus this), CSS px at collocation scale 1, so half of it shows on
553
+ * either side; default 3. Ground leaders keep it unscaled, as their width.
554
+ */
555
+ strokeWidth?: number;
556
+ }
557
+ /** Collocation-wide options. Every field is optional (ADR-0063, #634). */
558
+ interface CollocationOptions {
559
+ /** Default part for members without `part`; default `"role"` (each capability's role). */
560
+ parts?: "role" | CollocationPart;
561
+ /** How the location is derived when `position` is absent; default `"bounds-center"`. */
562
+ locate?: CollocationLocate;
563
+ /** CSS px at collocation scale 1; a number sets both axes. Default `{ x: 12, y: 10 }`. */
564
+ gap?: number | {
565
+ x?: number;
566
+ y?: number;
567
+ };
568
+ staff?: {
569
+ /**
570
+ * How far the Staff runs below the lowest flag's frame, in size
571
+ * references (as milsymbol's `hqStaffLength`, measured from the frame's
572
+ * bottom wherever the staff leaves it); default 1.
573
+ */
574
+ tail?: number;
575
+ /**
576
+ * Staff line px at scale 1, or `"frame"` (default): the lowest flag's own
577
+ * frame stroke at the collocation's size, so the Staff looks like the
578
+ * staff it replaces. A lowest flag that reports no frame stroke (a
579
+ * Marker, say) falls back to `line.strokeWidth`.
580
+ */
581
+ strokeWidth?: number | "frame";
582
+ /**
583
+ * Staff line color, or `"frame"` (default): the lowest flag's own frame
584
+ * color, so the Staff looks like the staff it replaces. A lowest flag that
585
+ * reports no frame color falls back to `line.strokeColor`.
586
+ */
587
+ strokeColor?: "frame" | (string & {});
588
+ /**
589
+ * A plate behind the Staff's flags, 4 px past everything they draw,
590
+ * labels and echelons included (see {@link CollocationPlate}).
591
+ */
592
+ plate?: CollocationPlate;
593
+ };
594
+ bracket?: {
595
+ /**
596
+ * The Bracket's default spot, where it stands without a placement: CSS
597
+ * px at collocation scale 1 from the location to its tick root, joined
598
+ * to the location by a leader. Default `[80, -40]` (right and up) for an
599
+ * `"auto"` Bracket, so it starts as a left one; `[40, -80]` (up and
600
+ * right) for a `"left"` or `"bottom"` Bracket; `[40, 80]` (down and
601
+ * right) for a `"top"` Bracket, so the leader comes from above. `[0, 0]`
602
+ * puts the tick root on the location with no leader.
603
+ */
604
+ defaultOffset?: [number, number];
605
+ /**
606
+ * Where the Bracket stands against its members. `"left"`: a
607
+ * vertical spine left of them, mirrored to their right when the location
608
+ * lies right of it. `"top"` / `"bottom"`: a horizontal spine above or
609
+ * below a row of members, the leader meeting it from that side. Every
610
+ * shape, `align`, `attach` (`"top"` meets the first column) and `plate`
611
+ * work the same way turned on its side, while the members keep the left
612
+ * Bracket's grid (rows of `columns`, left to right, top to bottom);
613
+ * `gap` and `padding` keep their screen axes. `"auto"` picks the side from
614
+ * where the Bracket stands, switching as it is dragged: mostly above the
615
+ * location `"bottom"`, mostly below `"top"`, otherwise `"left"`. Default
616
+ * `"auto"`.
617
+ */
618
+ side?: CollocationBracketSide;
619
+ columns?: number;
620
+ align?: "left" | "center"; /** Length of the square shape's caps, and the brace's curl. Default 7. */
621
+ cap?: number; /** Length of the tick, from where the leader meets it to the spine. Default 14. */
622
+ tick?: number;
623
+ /**
624
+ * The Bracket's outline; default `"square"` (a spine with caps). `"brace"`
625
+ * curls its ends by `cap` and points back into the tick, `"bar"` is the
626
+ * spine alone, `"box"` frames the members, and `"none"` draws no outline,
627
+ * the tick running to the members, or to the plate's edge with a plate.
628
+ */
629
+ shape?: CollocationBracketShape;
630
+ /**
631
+ * Where the leader meets the Bracket: its `"middle"` (default) or its
632
+ * `"top"` row (with a `"top"` or `"bottom"` side, its first column).
633
+ */
634
+ attach?: "middle" | "top";
635
+ /**
636
+ * A plate behind the Bracket's members, from the spine to `padding` past
637
+ * their far edge (see {@link CollocationPlate}).
638
+ */
639
+ plate?: CollocationPlate;
640
+ /**
641
+ * Space between the Bracket and its members, CSS px at collocation scale
642
+ * 1, as CSS padding: `x` left and right of them, `y` above and below; a
643
+ * number sets both. For a left Bracket, `x` is the space from the spine
644
+ * to the members (labels sit inside it) and, for the box and plate, past
645
+ * their far edge; `y` is how far the outline reaches past the first and
646
+ * last row (frames for the square, brace and bar; everything drawn for
647
+ * the box and plate). A top or bottom Bracket keeps the screen axes, so
648
+ * there `y` is the spine side. Unset, the spine side follows `cap`, so
649
+ * the caps just reach the members, and every other side is 4.
650
+ */
651
+ padding?: number | {
652
+ x?: number;
653
+ y?: number;
654
+ };
655
+ };
656
+ /**
657
+ * Shared by Staff, Bracket and leaders; default `#000000`, 2 px, no halo
658
+ * (see {@link CollocationHalo}).
659
+ */
660
+ line?: {
661
+ strokeColor?: string;
662
+ strokeWidth?: number;
663
+ halo?: CollocationHalo;
664
+ };
665
+ /**
666
+ * The leaders joining parts to the location, on screen and on the ground.
667
+ * `show: false` draws none, nor the Bracket's tick they would meet (the
668
+ * style is kept for when they show again; the members don't move);
669
+ * a part off its location then stands unconnected, and only its line work
670
+ * and members pick it. `strokeColor` and `strokeWidth` default to
671
+ * `line`'s, `strokeDash` to solid. The halo follows `line.halo`.
672
+ */
673
+ leader?: CollocationStroke;
674
+ ground?: CollocationGround;
675
+ /** Kind-keyed bags handed, unread, to each member kind's capability. */
676
+ memberOptions?: CollocationMemberOptions;
677
+ }
678
+ /** Display style of a whole collocation. */
679
+ interface CollocationStyle {
680
+ /**
681
+ * 0–1 multiplier on everything the collocation draws: ground marks, part
682
+ * line work, members and Highlight, on top of each member's own opacity
683
+ * (e.g. a host's layer opacity). Display only; picking is unchanged.
684
+ * Default 1; values out of range are clamped and a non-finite value counts
685
+ * as 1.
686
+ */
687
+ opacity?: number;
688
+ }
689
+ /**
690
+ * A fifth Graphic kind: several point symbols and Markers presented as standing
691
+ * together at one location, in a Staff and a Bracket (ADR-0063).
692
+ */
693
+ interface Collocation {
694
+ id: string;
695
+ kind: "collocation";
696
+ /** The location, if the host owns one; otherwise derived from member positions. */
697
+ position?: Position;
698
+ /** Host order. */
699
+ members: CollocationMember[];
700
+ placements?: {
701
+ staff?: PointSymbolPlacement;
702
+ bracket?: CollocationBracketPlacement;
703
+ };
704
+ /**
705
+ * The size every member is drawn at, in the shape of a point symbol's:
706
+ * screen-sized in `pixels`, or ground-sized in `meters` with optional
707
+ * `minPixels` / `maxPixels`. Members' own sizes are ignored. Absent or
708
+ * invalid, the point-symbol capability's `defaultSize` applies.
709
+ */
710
+ size?: PointSymbolSize;
711
+ options?: CollocationOptions;
712
+ style?: CollocationStyle;
713
+ properties?: Record<string, unknown>;
714
+ schemaVersion: 1;
715
+ }
716
+ /**
717
+ * What one committed step of a collocation edit changed (#761). Only the keys
718
+ * the step changed are present; a key present as `undefined` was cleared.
719
+ * Covers what gestures and part commands edit: an `updateGraphic` step that
720
+ * changes anything else (style, properties, other options, member graphics
721
+ * beyond their positions) reports only the covered keys.
722
+ */
723
+ interface CollocationCommitChanges {
724
+ placements?: Collocation["placements"];
725
+ size?: PointSymbolSize;
726
+ /**
727
+ * The options the step changed, as a patch for
728
+ * {@link patchCollocationOptions}: `bracket.columns`, `undefined` when
729
+ * cleared.
730
+ */
731
+ options?: CollocationOptions;
732
+ /**
733
+ * Member order and each member's `part` (`undefined`: its role decides),
734
+ * when either changed. Lists only the members the engine was given.
735
+ */
736
+ members?: {
737
+ order: string[];
738
+ parts: Record<string, CollocationPart | undefined>;
739
+ };
740
+ /** The new position of each member whose position changed; `undefined` when cleared. */
741
+ memberPositions?: Record<string, Position | undefined>;
742
+ position?: Position;
743
+ }
744
+ /** A collocation member's image, in canonical SVG units. */
745
+ interface CollocationMemberIcon {
746
+ /** Content-derived identity reconciled as an ADR-0030 icon resource. */
747
+ resourceId: string;
748
+ svg: string;
749
+ width: number;
750
+ height: number;
751
+ }
752
+ /** What a capability is told when it draws one collocation member. */
753
+ interface CollocationMemberRenderContext {
754
+ /** The part the member stands in. */
755
+ part: CollocationPart;
756
+ /** This member kind's own `options.memberOptions` bag, unread by the engine. */
757
+ options?: Record<string, unknown>;
758
+ /**
759
+ * The app-wide Highlight appearance, every field resolved, when the member
760
+ * is highlighted; the capability draws it in the member's own shape. Widths
761
+ * are CSS pixels at the member's display size.
762
+ */
763
+ highlight?: Required<HighlightAppearance>;
764
+ }
765
+ /**
766
+ * A capability's drawing of one collocation member. Every coordinate is in
767
+ * canonical SVG units relative to the icon's top-left.
768
+ */
769
+ interface CollocationMemberRender {
770
+ icon: CollocationMemberIcon;
771
+ /** What the layout aligns and stacks on (the frame). */
772
+ box: PointSymbolRect;
773
+ /** Everything drawn, labels included. */
774
+ extent: PointSymbolRect;
775
+ /** Where the Staff meets a flag; defaults to the box's left edge halfway down. */
776
+ attachment?: PointSymbolAnchor;
777
+ /**
778
+ * The width of the member's frame line in canonical units, which a Staff
779
+ * with `staff.strokeWidth: "frame"` matches. Absent for a member without a frame.
780
+ */
781
+ strokeWidth?: number;
782
+ /** The color of the member's frame line, which a `staff.strokeColor: "frame"` Staff matches. */
783
+ strokeColor?: string;
784
+ /**
785
+ * The point Bracket rows line up on; defaults to the ordinary render's
786
+ * `octagonAnchor` for point symbols and the box centre for Markers.
787
+ */
788
+ registration?: PointSymbolAnchor;
789
+ }
790
+ /**
791
+ * Optional collocation support on a member kind's capability (ADR-0063). The
792
+ * engine reads only role, box, extent, attachment, registration and size
793
+ * reference; it never reads a SIDC.
794
+ */
795
+ interface CollocationMemberSupport<G> {
796
+ /** The part a member stands in unless its entry or `options.parts` says otherwise. */
797
+ role(graphic: G): CollocationPart;
798
+ render(graphic: G, context: CollocationMemberRenderContext): CollocationMemberRender;
799
+ /**
800
+ * Canonical SVG units the member's `size` maps to: the octagon height for
801
+ * point symbols, the icon height for Markers.
802
+ */
803
+ sizeReference(graphic: G): number;
804
+ }
805
+ /** A member render with every engine fallback filled in. */
806
+ interface ResolvedCollocationMemberRender extends CollocationMemberRender {
807
+ attachment: PointSymbolAnchor;
808
+ registration: PointSymbolAnchor;
809
+ sizeReference: number;
810
+ /**
811
+ * The member is highlighted but its capability has no collocation support,
812
+ * so the engine cases its box in the Highlight appearance inside the part image.
813
+ */
814
+ highlightCasing: boolean;
815
+ }
816
+ /**
817
+ * The closed member kind → capability table (ADR-0063). Keys are the
818
+ * camelCase graphic kinds, as in `options.memberOptions`; a new member kind
819
+ * joins only by an engine change.
820
+ */
821
+ interface CollocationMemberCapabilities {
822
+ pointSymbol?: PointSymbolCapability;
823
+ marker?: MarkerCapability;
824
+ }
825
+ /** Per-member inputs of a {@link CollocationRender}. */
826
+ interface CollocationRenderMember {
827
+ memberId: string;
828
+ part: CollocationPart;
829
+ /** Absent when the member's kind has no capability. */
830
+ render?: ResolvedCollocationMemberRender;
831
+ }
832
+ /**
833
+ * ADR-0031 snapshot render for a collocation. It holds inputs only: the
834
+ * source graphic, the resolved location and each member's assigned part and
835
+ * render. Layout is recomputed from these per view.
836
+ */
837
+ interface CollocationRender {
838
+ graphic: Collocation;
839
+ /** `undefined` when the collocation has no location and draws nothing. */
840
+ location?: Position;
841
+ /** The size every member is drawn at: {@link resolveCollocationSize}. */
842
+ size: PointSymbolSize;
843
+ members: CollocationRenderMember[];
844
+ }
845
+ declare function isCollocation(graphic: unknown): graphic is Collocation;
846
+ declare function cloneCollocation(collocation: Collocation): Collocation;
847
+ /**
848
+ * Throws a `TypeError` naming the first malformed field: an empty `id`, a
849
+ * `schemaVersion` other than 1, `members` not an array or a member without a
850
+ * graphic id, a non-finite `position`, or `options` not an object. Malformed
851
+ * option values don't throw: they resolve to their defaults, and
852
+ * {@link sanitizeCollocationOptions} drops them.
853
+ */
854
+ declare function validateCollocation(collocation: Collocation): void;
855
+ /**
856
+ * A validated copy of `collocation` ({@link validateCollocation}) with
857
+ * `style.opacity` clamped to 0–1 (a non-finite one is 1) and malformed option
858
+ * values dropped by {@link sanitizeCollocationOptions}.
859
+ */
860
+ declare function normalizeCollocation(collocation: Collocation): Collocation;
861
+ /** `style.opacity` clamped to 0–1; 1 when absent or not finite. */
862
+ declare function collocationOpacity(collocation: Pick<Collocation, "style">): number;
863
+ /**
864
+ * `previous` when it is structurally equal to `next`, else `next`. A host that
865
+ * rebuilds its collocations on every render (members referenced from its own
866
+ * symbols, not stored in the collocation) passes each one through this so an
867
+ * unchanged collocation keeps its object identity, and TacticalDraw's
868
+ * per-graphic render cache, which is keyed by identity, still hits:
869
+ *
870
+ * ```ts
871
+ * const next = buildCollocation(entry, symbols);
872
+ * const graphic = stableCollocation(previousById.get(next.id), next);
873
+ * previousById.set(graphic.id, graphic);
874
+ * ```
875
+ *
876
+ * Reused member graphics short-circuit the comparison, so it stays cheap. The
877
+ * comparison is key-set sensitive: `{ position: undefined }` differs from a
878
+ * missing `position`, so build the collocation the same way every time.
879
+ */
880
+ declare function stableCollocation(previous: Collocation | undefined, next: Collocation): Collocation;
881
+ /**
882
+ * Deep-merge `patch` into `options` and return the result; neither argument
883
+ * is changed. Plain objects merge key by key, so one nested field changes in
884
+ * one call:
885
+ *
886
+ * ```ts
887
+ * options = patchCollocationOptions(options, { ground: { location: { mark: "dot" } } });
888
+ * ```
889
+ *
890
+ * Arrays and scalars replace, as does an object over a scalar (`gap: { x: 8 }`
891
+ * over `gap: 6`). A field set to
892
+ * `undefined` is removed, so it falls back to its default: every
893
+ * `CollocationOptions` field resolves an absent or invalid value to its
894
+ * default. Branches the patch doesn't touch keep their identity.
895
+ */
896
+ declare function patchCollocationOptions(options: CollocationOptions | undefined, patch: CollocationOptions): CollocationOptions;
897
+ /**
898
+ * The collocation's location: `position` if given, else derived from its
899
+ * positioned members by `options.locate` in Web Mercator, with longitudes
900
+ * unwrapped against the first position so an antimeridian collocation doesn't
901
+ * centre on the far side. The result stays in the first position's world
902
+ * copy. `undefined` means no location: the collocation draws nothing.
903
+ */
904
+ declare function resolveCollocationLocation(collocation: Collocation): Position | undefined;
905
+ /**
906
+ * The size every member of `collocation` is drawn at: its own `size`, else
907
+ * the point-symbol capability's `defaultSize`, else the Marker draw default.
908
+ * An invalid `size` (not finite or not positive) counts as absent.
909
+ */
910
+ declare function resolveCollocationSize(collocation: Pick<Collocation, "size">, capabilities?: CollocationMemberCapabilities): PointSymbolSize;
911
+ /**
912
+ * The part `member` stands in, as {@link buildCollocationRender} assigns it:
913
+ * {@link assignCollocationPart} with the capability's role asked at the
914
+ * collocation's size. Pass `{ graphic }` alone for the part it would get
915
+ * without a `part` of its own.
916
+ */
917
+ declare function collocationMemberPart(collocation: Collocation, member: CollocationMember, capabilities?: CollocationMemberCapabilities): CollocationPart;
918
+ /** Options for {@link buildCollocationRender}. */
919
+ interface BuildCollocationRenderOptions {
920
+ /** The app-wide Highlight appearance handed to highlighted members. */
921
+ highlight?: HighlightAppearance;
922
+ }
923
+ /**
924
+ * Build the input-only {@link CollocationRender} snapshot: the resolved
925
+ * location and size and, per member, its part and its member render from the
926
+ * member kind's capability, with the engine fallback for a capability without
927
+ * `collocation` support. Capabilities see each member with the collocation's
928
+ * size in place of its own. A member whose kind has no capability is left
929
+ * unrendered. Each capability sees only its own `options.memberOptions` bag.
930
+ */
931
+ declare function buildCollocationRender(collocation: Collocation, capabilities?: CollocationMemberCapabilities, options?: BuildCollocationRenderOptions): CollocationRender;
932
+ //#endregion
933
+ //#region src/point-symbol.d.ts
934
+ type PointSymbolSize = {
935
+ value: number;
936
+ unit: "pixels";
937
+ } | {
938
+ value: number;
939
+ unit: "meters"; /** Floor for the on-screen projection of the ground-based size; none when omitted. */
940
+ minPixels?: number; /** Cap on the on-screen projection of the ground-based size — typically the pixel size the symbol had when anchored to ground; unclamped when omitted. */
941
+ maxPixels?: number;
942
+ };
943
+ interface PointSymbolGraphicModifiers {
944
+ /** Radians clockwise, relative to the point symbol's own orientation. */
945
+ direction?: number;
946
+ }
947
+ interface PointSymbolColors {
948
+ fill?: string;
949
+ frame?: string;
950
+ icon?: string;
951
+ info?: string;
952
+ outline?: string;
953
+ }
954
+ interface PointSymbolStyle {
955
+ colors?: PointSymbolColors;
956
+ monoColor?: string;
957
+ opacity?: number;
958
+ /** 0–1 multiplier applied to both body and connector opacity; defaults to 1. */
959
+ overallOpacity?: number;
960
+ outlineWidth?: number;
961
+ fill?: boolean;
962
+ frame?: boolean;
963
+ icon?: boolean;
964
+ }
965
+ type PointSymbolPlacement = {
966
+ mode: "screen-relative";
967
+ offset: [number, number];
968
+ } | {
969
+ mode: "ground";
970
+ position: Position;
971
+ };
972
+ /**
973
+ * Modifier that temporarily activates offset placement for a body drag.
974
+ * @deprecated Use {@link ModifierKey}; kept as an alias.
975
+ */
976
+ type OffsetDragModifier = ModifierKey;
977
+ type PointSymbolConnector = "auto" | "direct";
978
+ /** Optional connector overrides; omitted properties inherit symbol styling. */
979
+ interface PointSymbolOffsetStyle {
980
+ strokeColor?: string;
981
+ /** 0–1, independent of the body opacity. */
982
+ opacity?: number;
983
+ /** Fixed CSS-pixel width, independent of symbol size. */
984
+ strokeWidth?: number;
985
+ /** Alternating dash/gap lengths in CSS pixels; [] means solid. */
986
+ strokeDash?: number[];
987
+ }
988
+ interface PointSymbolOffset {
989
+ /** Gap at the symbol attachment end, measured along the line in CSS pixels; defaults to 0. */
990
+ anchorPadding?: number;
991
+ style?: PointSymbolOffsetStyle;
992
+ placement: PointSymbolPlacement;
993
+ connector: PointSymbolConnector;
994
+ /** Authored indicator length as a multiple of the displayed octagon size. */
995
+ indicatorLength?: number;
996
+ }
997
+ interface PointSymbol {
998
+ id: string;
999
+ kind: "point-symbol";
1000
+ sidc: string;
1001
+ position: Position;
1002
+ /** Normalized radians clockwise from geographic north. */
1003
+ rotation: number;
1004
+ /** Milsymbol's octagon-based L dimension. */
1005
+ size: PointSymbolSize;
1006
+ offset?: PointSymbolOffset;
1007
+ textAmplifiers?: TextAmplifiers;
1008
+ graphicModifiers?: PointSymbolGraphicModifiers;
1009
+ style?: PointSymbolStyle;
1010
+ rendererOptions?: {
1011
+ milsymbol?: Record<string, unknown>;
1012
+ };
1013
+ properties?: Record<string, unknown>;
1014
+ schemaVersion?: 1;
1015
+ }
1016
+ interface PointSymbolAnchor {
1017
+ x: number;
1018
+ y: number;
1019
+ }
1020
+ interface PointSymbolRect {
1021
+ x: number;
1022
+ y: number;
1023
+ width: number;
1024
+ height: number;
1025
+ }
1026
+ /** Canonical-size, renderer-neutral point-symbol output. */
1027
+ interface PointSymbolRender {
1028
+ /** Content-derived identity for adapter-wide native-resource reuse. */
1029
+ resourceId: string;
1030
+ svg: string;
1031
+ /** Renderer-space octagon size used to interpret persisted symbol size. */
1032
+ octagonSize: number;
1033
+ width: number;
1034
+ height: number;
1035
+ /**
1036
+ * Visible content box in canonical SVG units, relative to the image's
1037
+ * top-left. Footprints, hit tests and edit boxes use it, so transparent
1038
+ * padding (e.g. room for a soft halo) is not clickable; the image itself is
1039
+ * still drawn at `width × height`. Defaults to the full image.
1040
+ */
1041
+ contentBounds?: PointSymbolRect;
1042
+ anchor: PointSymbolAnchor;
1043
+ octagonAnchor: PointSymbolAnchor;
1044
+ valid: boolean;
1045
+ validation?: unknown;
1046
+ /** Optional body/attachment capability. All coordinates are canonical SVG units. */
1047
+ offset?: {
1048
+ body: PointSymbolRender; /** Body registration in the ordinary image, preserving natural HQ placement. */
1049
+ ordinaryRegistration: PointSymbolAnchor;
1050
+ attachment: PointSymbolAnchor;
1051
+ indicator?: {
1052
+ direction: PointSymbolAnchor;
1053
+ length: number;
1054
+ minLength?: number;
1055
+ };
1056
+ strokeColor: string;
1057
+ strokeWidth: number;
1058
+ };
1059
+ }
1060
+ interface PointSymbolCapability {
1061
+ readonly defaultSize: PointSymbolSize;
1062
+ readonly defaultRotation: number;
1063
+ render(symbol: PointSymbol): PointSymbolRender;
1064
+ invalidate(): void;
1065
+ /**
1066
+ * Monotonic counter that increments on each `invalidate()` call. Consumers
1067
+ * (e.g. a render cache keyed on graphic snapshot identity) may read this to
1068
+ * detect that previously rendered point-symbol output is stale even though
1069
+ * the graphic snapshot itself is unchanged. Optional — when absent,
1070
+ * invalidation cannot be detected by cache layers, so they must not attempt
1071
+ * to key on it.
1072
+ */
1073
+ readonly generation?: number;
1074
+ /**
1075
+ * Optional collocation member support (ADR-0063). Without it a point symbol
1076
+ * stands in the Bracket, drawn from its ordinary render. Collocation member
1077
+ * images come from `collocation.render`, not `render`: a wrapper around a
1078
+ * capability must forward this member, and wrap its `render` too if the
1079
+ * wrapper changes how symbols look.
1080
+ */
1081
+ readonly collocation?: CollocationMemberSupport<CollocationPointSymbol>;
1082
+ }
1083
+ declare function isPointSymbol(graphic: unknown): graphic is PointSymbol;
1084
+ declare function clonePointSymbol(symbol: PointSymbol): PointSymbol;
1085
+ /**
1086
+ * Replace a point-symbol size value as a user-driven resize. Ground-size display
1087
+ * bounds scale with the value so they continue to constrain zoom changes rather
1088
+ * than preventing the resize itself.
1089
+ */
1090
+ declare function resizePointSymbolSize(size: PointSymbolSize, value: number): PointSymbolSize;
1091
+ //#endregion
1092
+ //#region src/fill-pattern.d.ts
1093
+ /**
1094
+ * Shared hatch fill-pattern tiles for area control-measure fills (ADR-0035
1095
+ * `FillPattern`, excluding `"solid"` which every adapter already renders as a
1096
+ * flat color). Both the MapLibre adapter (raster `addImage` pattern) and the
1097
+ * OpenLayers adapter (canvas `Pattern` fill) need the *same* diagonal-hatch
1098
+ * texture, so it is rasterized once here in pure math — no `HTMLCanvasElement`
1099
+ * — so it works in adapter code and in jsdom/node tests alike.
1100
+ */
1101
+ type HatchPattern = PatternId;
1102
+ /**
1103
+ * Every non-solid `FillPattern` as a runtime list — the value-level companion
1104
+ * to {@link HatchPattern}, so adapters can test membership and build filter
1105
+ * expressions without re-spelling the pattern vocabulary.
1106
+ */
1107
+ declare const HATCH_PATTERNS: readonly HatchPattern[];
1108
+ /** Tile edge, CSS px, of the mine-pictogram family (they use the full 32-unit tile). */
1109
+ declare const MINE_PATTERN_TILE_SIZE: number;
1110
+ /** True for the mine-pictogram family — a screen-space glyph texture rather than a repeating hatch. */
1111
+ declare function isMinePattern(pattern: HatchPattern): pattern is MinePattern;
1112
+ interface Rgba {
1113
+ r: number;
1114
+ g: number;
1115
+ b: number;
1116
+ a: number;
1117
+ }
1118
+ /**
1119
+ * Stable id for a rasterized tile, keyed by pattern and color. Adapters use
1120
+ * this as the image-registry key (MapLibre `addImage` id, OpenLayers pattern
1121
+ * cache key) so the same color+pattern never gets rasterized twice. Color is
1122
+ * lowercased so `"#FF0000"` and `"#ff0000"` share one texture.
1123
+ */
1124
+ declare function fillPatternImageId(color: string, pattern: HatchPattern): string;
1125
+ /**
1126
+ * Tile edge length in device pixels for a given `pixelRatio`. Must be a power
1127
+ * of two — MapLibre requires POT dimensions for seamless WebGL texture wrap —
1128
+ * and scales linearly with `pixelRatio` for the ratios that matter in
1129
+ * practice (1x/2x displays: 32 -> 64, both already POT). Non-POT products
1130
+ * (e.g. a 3x ratio, 32*3=96) round up to the next POT rather than losing the
1131
+ * power-of-two guarantee.
1132
+ */
1133
+ declare function fillPatternImageDimension(pixelRatio: number): number;
1134
+ /**
1135
+ * Parse a hex (`#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`) or `rgb()`/`rgba()`
1136
+ * color string into normalized channels, alpha in `[0, 1]`. Unparseable input
1137
+ * falls back to opaque black rather than throwing, since a mis-themed fill
1138
+ * should still render *something*. Shared by every renderer that needs CSS
1139
+ * colors as numbers — hatch fills here, billboard pins in the MapLibre
1140
+ * adapter — so the accepted syntax stays identical across them.
1141
+ */
1142
+ declare function parseColor(color: string): Rgba;
1143
+ /** The mine-pictogram members of {@link HatchPattern}, derived so the family stays in one place. */
1144
+ type MinePattern = Extract<HatchPattern, `mine-${string}`>;
1145
+ /** Coverage from the canonical command interpreter, exposed only for focused conformance tests. */
1146
+ /**
1147
+ * Rasterize one seamless hatch tile as a straight RGBA pixel buffer — no
1148
+ * canvas involved, so this runs identically in a browser adapter and in
1149
+ * jsdom/node tests. Every command, tile dimension, stroke, fill, and dash is
1150
+ * read from the public renderer-neutral pattern definition.
1151
+ */
1152
+ declare function makeFillPatternImage(color: string, pattern: HatchPattern, pixelRatio?: number): {
1153
+ width: number;
1154
+ height: number;
1155
+ data: Uint8ClampedArray;
1156
+ };
1157
+ //#endregion
1158
+ //#region src/map-adapter.d.ts
1159
+ type PixelCoordinate = [number, number];
1160
+ type MapCursor = "" | "default" | "crosshair" | "grab" | "grabbing" | "pointer" | "move";
1161
+ interface MapEvent {
1162
+ type: string;
1163
+ coordinate: Position;
1164
+ pixel: PixelCoordinate;
1165
+ originalEvent: unknown;
1166
+ }
1167
+ type MapEventHandler = (event: MapEvent) => void;
1168
+ interface StyleOptions {
1169
+ strokeColor?: string;
1170
+ strokeWidth?: number;
1171
+ strokeDash?: number[];
1172
+ fillColor?: string;
1173
+ pointFillColor?: string;
1174
+ pointRadius?: number;
1175
+ text?: TextStyleOptions;
1176
+ }
1177
+ /**
1178
+ * Text (label) style for a layer. When `labelProperty` is set, adapters also
1179
+ * read per-feature label properties: `rotation` (radians, rendered as
1180
+ * `π − rotation`), the size anchor's `textSizeMeters` (ground) or
1181
+ * `textSizePixels` (screen) (ADR-0028), `textAnchor` (`"start"` = text
1182
+ * begins at the label point, `"end"` = text ends there; absent = centered),
1183
+ * and the screen-space offset `textAnchorGap`/`textBaselineShift` (ems of the
1184
+ * rendered size, applied after rotation in the text's own frame; read it as
1185
+ * `[right, down]` with `labelTextOffsetEms`, ADR-0068).
1186
+ * A ground-anchored label renders at `textSizeMeters / resolution`, pinned at
1187
+ * `textSizeMaxPixels` and faded out then hidden below `textSizeMinPixels`
1188
+ * (`resolveTextAppearance`, ADR-0060); a screen-anchored one at a constant
1189
+ * `textSizePixels`, unclamped.
1190
+ */
1191
+ interface TextStyleOptions {
1192
+ text?: string;
1193
+ labelProperty?: string;
1194
+ font?: string;
1195
+ fillColor?: string;
1196
+ strokeColor?: string;
1197
+ strokeWidth?: number;
1198
+ rotation?: number;
1199
+ /**
1200
+ * Lower edge of the ground-anchored label band (ADR-0060): zoomed out past
1201
+ * it, a label keeps shrinking with its graphic while it fades out, then
1202
+ * hides, so it never outgrows the area it names.
1203
+ * @default 4
1204
+ */
1205
+ textSizeMinPixels?: number;
1206
+ /**
1207
+ * Upper edge of the ground-anchored label band (ADR-0028): text never
1208
+ * renders above this pixel size, however far the view zooms in.
1209
+ * @default 24
1210
+ */
1211
+ textSizeMaxPixels?: number;
1212
+ }
1213
+ /**
1214
+ * Per-feature style for edit handles (vertex / midpoint / translate / rotate).
1215
+ * The producer (`TacticalDraw`) rides this on `properties.style`; the adapter
1216
+ * reads it back when rendering the handle, so it is part of the adapter
1217
+ * contract rather than the tactical-draw authoring surface. `pointRadius` is a
1218
+ * UI affordance not present on `ControlMeasureStyle`. See ADR-0006.
1219
+ */
1220
+ interface HandleStyle {
1221
+ strokeColor?: string;
1222
+ strokeWidth?: number;
1223
+ strokeDash?: readonly number[];
1224
+ fillColor?: string;
1225
+ /**
1226
+ * How `fillColor` paints a filled part's interior. Absent or `"solid"` is
1227
+ * today's flat fill; `"hatch"`/`"reverse-hatch"`/`"cross-hatch"`/`"horizontal"`/`"vertical"`/`"dots"` request the shared pattern texture
1228
+ * ({@link makeFillPatternImage}). Alpha rides in `fillColor` — there is no
1229
+ * separate opacity field. Adapters that cannot rasterize a pattern degrade
1230
+ * to solid. Per-feature only: layer-level `StyleOptions` has no equivalent.
1231
+ */
1232
+ fillPattern?: "solid" | HatchPattern;
1233
+ pointRadius?: number;
1234
+ /**
1235
+ * Highlight casing color for a line or area part (the renderer's resolved
1236
+ * `style.highlight`, opacity already folded in). Adapters paint a solid
1237
+ * casing `highlightCasingWidth(strokeWidth)` wide along the geometry —
1238
+ * outline only for an area — beneath every fill and stroke of the
1239
+ * feature's group, even when the stroke itself is transparent. The casing
1240
+ * is display-only: it never widens the feature's hit area. Per-feature
1241
+ * only: layer-level `StyleOptions` has no equivalent. Not to be confused
1242
+ * with the transient passive outline of `setPassiveOutlines`.
1243
+ */
1244
+ highlightColor?: string;
1245
+ /**
1246
+ * Casing reach past each side of the stroke in CSS pixels (the renderer's
1247
+ * resolved `HighlightAppearance.width`); absent means
1248
+ * `HIGHLIGHT_CASING_OUTSET_CSS_PIXELS`, and `0` paints no casing.
1249
+ */
1250
+ highlightWidth?: number;
1251
+ /**
1252
+ * Glow reach past the casing in CSS pixels (the renderer's resolved
1253
+ * `HighlightAppearance.glow`); absent means no glow. Adapters paint the
1254
+ * `HIGHLIGHT_GLOW_BANDS` beneath every casing of the group, as plain
1255
+ * translucent strokes. Display-only like the casing.
1256
+ */
1257
+ highlightGlow?: number;
1258
+ }
1259
+ type LayerId = string;
1260
+ /** Canonical SVG resource shared by point features through `iconId`. */
1261
+ interface IconResource {
1262
+ id: string;
1263
+ svg: string;
1264
+ width: number;
1265
+ height: number;
1266
+ anchor: [number, number];
1267
+ /**
1268
+ * Visible content box in unscaled canvas coordinates. Icon picks and their
1269
+ * footprints use it instead of the full canvas, so transparent padding is not
1270
+ * hit area; the icon is still drawn at `width × height`. Defaults to the full
1271
+ * canvas.
1272
+ */
1273
+ contentRect?: PointSymbolRect;
1274
+ /**
1275
+ * Direct visible mark used to rank icon picks, in unscaled canvas coordinates.
1276
+ * Hits elsewhere in the full canvas measure their distance from this rectangle;
1277
+ * omit it to preserve whole-canvas distance-zero behavior.
1278
+ */
1279
+ coreRect?: PointSymbolRect;
1280
+ /**
1281
+ * Line work that is the icon's only hit area, in unscaled canvas
1282
+ * coordinates: a pick hits within the tolerance plus half of `width` (both
1283
+ * scaled with the icon) of one of these polylines, and nowhere else in the
1284
+ * image. Used for drawings that are mostly empty canvas, such as a
1285
+ * collocation's Staff or Bracket (ADR-0063). Overrides `contentRect` and
1286
+ * `coreRect` for picking.
1287
+ */
1288
+ hitLines?: readonly IconHitLine[];
1289
+ }
1290
+ /** One polyline of {@link IconResource.hitLines}. */
1291
+ interface IconHitLine {
1292
+ points: readonly (readonly [number, number])[];
1293
+ /** Stroke width in canvas units. */
1294
+ width: number;
1295
+ }
1296
+ /** A self-contained image fixed to four geographic corners, ordered TL/TR/BR/BL. */
1297
+ interface ImageOverlayResource {
1298
+ id: string;
1299
+ url: string;
1300
+ width: number;
1301
+ height: number;
1302
+ coordinates: readonly [Position, Position, Position, Position];
1303
+ opacity: number;
1304
+ }
1305
+ /**
1306
+ * One stable, atomic unit in a logical layer's bottom-to-top paint stack.
1307
+ *
1308
+ * Features paint in array order inside the group. A filled feature paints its
1309
+ * interior before its outline, and text or icon content paints at that
1310
+ * feature's array position. An empty group is valid and keeps its identity and
1311
+ * stack position.
1312
+ *
1313
+ * Any feature may carry these generic seam fields (ADR-0063), read through the
1314
+ * helpers in `feature-seam-fields.ts`:
1315
+ * - `iconOffset: [x, y]` — on an icon feature, the offset from its point to the
1316
+ * resource anchor, in resource units; it scales with the icon's display size
1317
+ * and turns with its rotation (MapLibre `icon-offset`, OpenLayers and
1318
+ * Leaflet a shifted anchor). See `resolveIconAnchor`. Pair it with
1319
+ * `iconScreenRotation`, not a non-zero `iconRotation`, when the map may
1320
+ * turn: MapLibre draws icons with `icon-rotation-alignment: viewport`, so
1321
+ * an `iconRotation` there holds its angle on screen while OpenLayers and
1322
+ * the shared picker turn it (and the offset with it) with the bearing.
1323
+ * - `iconScreenRotation` — on an icon feature, a rotation in radians clockwise
1324
+ * on screen that replaces `iconRotation` and ignores the map bearing, so the
1325
+ * icon keeps that angle however the map turns (OpenLayers
1326
+ * `rotateWithView: false`). See `resolveIconScreenRotation`.
1327
+ * - `hitArea: false` — the feature is drawn but never picked; the shared
1328
+ * screen-space picker drops it, so picks fall through to what lies beneath.
1329
+ */
1330
+ interface FeatureGroup {
1331
+ /** Optional view-only point-symbol presentation; ordinary features are the fallback. */
1332
+ pin?: PinRender;
1333
+ id: string;
1334
+ features: readonly Feature[];
1335
+ iconResources: readonly IconResource[];
1336
+ /**
1337
+ * Ground-anchored rasters painted atomically with this Graphic.
1338
+ *
1339
+ * Each overlay also needs a feature in `features` whose `properties.imageOverlayId`
1340
+ * is the overlay's `id`, with a polygon whose ring starts TL, TR, BR, BL. OpenLayers
1341
+ * paints an overlay only through the feature that names it, positioned from that
1342
+ * feature's geometry rather than `coordinates`, and silently drops an overlay no
1343
+ * feature names. MapLibre and Leaflet don't read the property, so such a bug shows
1344
+ * only on OpenLayers.
1345
+ */
1346
+ imageOverlays?: readonly ImageOverlayResource[];
1347
+ /**
1348
+ * Monotonic stamp identifying this group's rendered content, when the
1349
+ * producer supplies one. Two groups with the same `id` and the same
1350
+ * `revision` carry byte-identical `features` and `iconResources`, so an
1351
+ * adapter may skip any diff or upload work for them. A missing `revision`
1352
+ * means "unknown" — adapters must fall back to their own comparison and
1353
+ * must never treat two absent stamps as equal.
1354
+ */
1355
+ revision?: number;
1356
+ }
1357
+ /**
1358
+ * Click-style hit event delivered by {@link MapAdapter.onPick}.
1359
+ *
1360
+ * `id` is the control measure id, already split off the feature id by the
1361
+ * adapter (see `controlMeasureIdFromFeature`).
1362
+ *
1363
+ * `originalEvent` is whatever the engine surfaces — OpenLayers normalises to
1364
+ * `PointerEvent`, MapLibre delivers `MouseEvent`, Leaflet delivers
1365
+ * `MouseEvent | TouchEvent`. Do not narrow to `PointerEvent` at the consumer.
1366
+ */
1367
+ interface PickEvent {
1368
+ id: string;
1369
+ feature: Feature;
1370
+ pixel: PixelCoordinate;
1371
+ coordinate: Position;
1372
+ originalEvent: MouseEvent | PointerEvent | TouchEvent;
1373
+ /**
1374
+ * Set by `TacticalDraw` when the hit is part of a collocation (ADR-0063):
1375
+ * the part, plus `memberId` for a member image. Part line work and its
1376
+ * in-image leader report `part` only; ground marks are never hit. `id`
1377
+ * stays the collocation's id. Adapters never set it.
1378
+ */
1379
+ collocation?: {
1380
+ part: "staff" | "bracket";
1381
+ memberId?: string;
1382
+ };
1383
+ }
1384
+ type PickHandler = (event: PickEvent) => void;
1385
+ interface PickOptions {
1386
+ signal?: AbortSignal;
1387
+ }
1388
+ interface MapAdapter {
1389
+ onPinPresentationStatusChange?(handler: (event: PinPresentationStatusEvent) => void): () => void;
1390
+ getPinPresentationCapability?(graphicId?: string): PinPresentationCapability;
1391
+ getPinFootprint?(graphicId: string): PinFootprint | null;
1392
+ pickPin?(graphicId: string, pixel: PixelCoordinate, tolerance: number): boolean;
1393
+ /** Invert a pinned attachment for a location drag, preserving pointer grab. */
1394
+ movePinFromPixel?(graphicId: string, attachment: PixelCoordinate): Position | null;
1395
+ /**
1396
+ * Add a vector layer to the map.
1397
+ * @returns unique layer ID
1398
+ */
1399
+ addVectorLayer(options?: {
1400
+ style?: StyleOptions;
1401
+ }): LayerId;
1402
+ /**
1403
+ * Remove a layer from the map.
1404
+ */
1405
+ removeLayer(layerId: LayerId): void;
1406
+ /**
1407
+ * Set the style for a specific layer.
1408
+ */
1409
+ setLayerStyle(layerId: LayerId, style: StyleOptions): void;
1410
+ /**
1411
+ * Reconcile one complete bottom-to-top desired state for a logical layer.
1412
+ *
1413
+ * Group IDs must be non-empty and unique within the layer. Every feature
1414
+ * must have an ID that is unique across all groups in the layer. Invalid
1415
+ * desired state throws synchronously before cache, resource, or engine
1416
+ * mutation.
1417
+ */
1418
+ setLayerFeatureGroups(layerId: LayerId, groups: readonly FeatureGroup[]): void;
1419
+ /**
1420
+ * Subscribe to click-style "pick" events for a specific layer. Basemap and
1421
+ * other-layer clicks never fire the handler.
1422
+ *
1423
+ * For control-measure features, adapters must set `PickEvent.id` to the
1424
+ * originating control-measure id (not the rendered part's feature id).
1425
+ * Features that do not satisfy the control-measure feature-id contract must
1426
+ * be ignored rather than dispatched.
1427
+ *
1428
+ * Bound to the engine's tap-suppressing click event (OL `singleclick`,
1429
+ * MapLibre `click`, Leaflet `click`) so the handler does not fire at the
1430
+ * end of a pan or pinch-zoom gesture.
1431
+ *
1432
+ * Hit tolerance is pointer-type aware: 4 px for mouse/pen, 12 px for touch.
1433
+ * Outline-only polygon interiors additionally have bounded inward selection
1434
+ * reach from visible viewport-clipped boundaries: 24 px for mouse/pen and
1435
+ * 36 px for touch. A visible solid or patterned fill owns its full interior.
1436
+ * For grouped desired state, comparable hits follow authoritative group
1437
+ * order even when the engine reports another native order. A fully opaque
1438
+ * solid fill in a higher group suppresses lower candidates beneath its
1439
+ * interior; translucent and patterned fills leave visible lower marks
1440
+ * eligible.
1441
+ *
1442
+ * Returns an unsubscribe function. The returned function and the optional
1443
+ * `signal` are both honoured; either teardown path stops further events,
1444
+ * and both are idempotent.
1445
+ */
1446
+ onPick(layerId: LayerId, handler: PickHandler, opts?: PickOptions): () => void;
1447
+ /**
1448
+ * Map Event Listeners
1449
+ *
1450
+ * Ordering contract: a `"click"` handler and the `onPick` handlers for the
1451
+ * same user click MUST observe the pick first — adapters deliver picks and
1452
+ * `"click"` from the same underlying engine event, in registration order.
1453
+ * The draw/edit controllers register their pick subscriptions before their
1454
+ * click handler and read the stashed pick inside it (click-away close /
1455
+ * close-then-pick re-dispatch); an adapter that fires `"click"` from an
1456
+ * earlier engine event than its picks breaks that contract (e.g. OL
1457
+ * `click` vs `singleclick`).
1458
+ */
1459
+ on(eventType: "click" | "pointermove" | "dblclick", handler: MapEventHandler): void;
1460
+ off(eventType: "click" | "pointermove" | "dblclick", handler: MapEventHandler): void;
1461
+ /**
1462
+ * Projection / Coordinate Utilities
1463
+ */
1464
+ toLonLat(coordinate: number[]): Position;
1465
+ fromLonLat(position: Position): number[];
1466
+ getPixelFromCoordinate(position: Position): PixelCoordinate | null;
1467
+ /**
1468
+ * Convert a viewport pixel to longitude/latitude. Optional so third-party
1469
+ * adapters compiled against an older ABI remain valid.
1470
+ */
1471
+ getCoordinateFromPixel?(pixel: PixelCoordinate): Position | null;
1472
+ /**
1473
+ * Get current viewport size in CSS pixels.
1474
+ */
1475
+ getViewportSize(): {
1476
+ width: number;
1477
+ height: number;
1478
+ };
1479
+ /**
1480
+ * Pan the map by pixel delta.
1481
+ * Positive delta means desired on-screen feature shift (right/down).
1482
+ */
1483
+ panByPixels(delta: PixelCoordinate, options?: {
1484
+ durationMs?: number;
1485
+ }): void;
1486
+ /**
1487
+ * Set the map viewport cursor. Pass an empty string to restore engine default styling.
1488
+ */
1489
+ setCursor(cursor: MapCursor): void;
1490
+ /**
1491
+ * Toggle the engine's native double-click-to-zoom gesture. `TacticalDraw`
1492
+ * disables this for the lifetime of a variable-length draw so the commit
1493
+ * `dblclick` doesn't also zoom the map.
1494
+ */
1495
+ setDoubleClickZoomEnabled(enabled: boolean): void;
1496
+ /**
1497
+ * Get current view resolution (meters per pixel at center or generally).
1498
+ * returns undefined if not supported or not ready.
1499
+ */
1500
+ getResolution(): number | undefined;
1501
+ /**
1502
+ * Get current map zoom level
1503
+ */
1504
+ getZoom(): number | undefined;
1505
+ /**
1506
+ * Get current view bearing, radians — the clockwise-from-north compass
1507
+ * direction that screen-up points to (MapLibre-bearing semantics). `0` for
1508
+ * engines/views that don't rotate.
1509
+ */
1510
+ getBearing(): number;
1511
+ /**
1512
+ * Listen for view changes (zoom/resolution)
1513
+ */
1514
+ onViewChange(handler: () => void): void;
1515
+ offViewChange(handler: () => void): void;
1516
+ /**
1517
+ * The engine evaluates the meters→pixels clamp for ground-sized point
1518
+ * symbols inside its own style layer, so meters-sized point symbols don't
1519
+ * need view-change re-renders for size.
1520
+ */
1521
+ readonly scalesGroundPointSymbolsNatively?: boolean;
1522
+ /**
1523
+ * Construct an {@link EditPointerDriver} for `TacticalDraw`'s edit
1524
+ * controller. The controller subscribes to pointer events on the returned
1525
+ * driver to wire handle drags (vertex / midpoint / translate / rotate).
1526
+ */
1527
+ createEditPointerDriver(): EditPointerDriver;
1528
+ /**
1529
+ * Release all adapter-owned map resources. Adapters must not be used after
1530
+ * destruction.
1531
+ */
1532
+ destroy(): void;
1533
+ /**
1534
+ * Returns the features currently set on the layer — the adapter-side cache
1535
+ * of the last grouped mutation, flattened in bottom-to-top group
1536
+ * order. Empty array for an unknown layer. The private ordered group cache is
1537
+ * not exposed. Callers must not mutate the returned array or features.
1538
+ */
1539
+ getLayerFeatures(layerId: LayerId): readonly Feature[];
1540
+ }
1541
+ //#endregion
1542
+ export { CollocationLocate as $, DEFAULT_PIN_PRESENTATION as $t, PointSymbolColors as A, validateCollocation as At, clonePointSymbol as B, isMarker as Bt, isMinePattern as C, collocationOpacity as Ct, PointSymbol as D, resolveCollocationLocation as Dt, OffsetDragModifier as E, patchCollocationOptions as Et, PointSymbolPlacement as F, MarkerRender as Ft, Collocation as G, EditModifiers as Gt, resizePointSymbolSize as H, normalizeMarker as Ht, PointSymbolRect as I, MarkerSize as It, CollocationBracketShape as J, ResolvedEditModifiers as Jt, CollocationAreaStyle as K, ModifierKey as Kt, PointSymbolRender as L, MarkerStyle as Lt, PointSymbolGraphicModifiers as M, MarkerAnchor as Mt, PointSymbolOffset as N, MarkerCapability as Nt, PointSymbolAnchor as O, resolveCollocationSize as Ot, PointSymbolOffsetStyle as P, MarkerIcon as Pt, CollocationHalo as Q, PointerEventInfo as Qt, PointSymbolSize as R, cloneMarker as Rt, fillPatternImageId as S, collocationMemberPart as St, parseColor as T, normalizeCollocation as Tt, BuildCollocationRenderOptions as U, validateMarker as Ut, isPointSymbol as V, markerOpacity as Vt, COLLOCATION_SCREEN_RELATIVE_REACH as W, DEFAULT_EDIT_MODIFIERS as Wt, CollocationCommitChanges as X, EditPointerDriver as Xt, CollocationBracketSide as Y, readPickModifiers as Yt, CollocationGround as Z, PointerCallback as Zt, HATCH_PATTERNS as _, CollocationStroke as _t, ImageOverlayResource as a, PinPresentationState as an, CollocationMemberOptionTypes as at, Rgba as b, buildCollocationRender as bt, MapCursor as c, PinPresentationStore as cn, CollocationMemberRenderContext as ct, PickEvent as d, isValidPinNumber as dn, CollocationPart as dt, PinFootprint as en, CollocationMarker as et, PickHandler as f, pinDistanceScale as fn, CollocationPartDrag as ft, TextStyleOptions as g, CollocationRenderMember as gt, StyleOptions as h, CollocationRender as ht, IconResource as i, PinPresentationPatch as in, CollocationMemberIcon as it, PointSymbolConnector as j, Marker as jt, PointSymbolCapability as k, stableCollocation as kt, MapEvent as l, PinRender as ln, CollocationMemberSupport as lt, PixelCoordinate as m, resolvePinPresentation as mn, CollocationPointSymbol as mt, HandleStyle as n, PinPresentation as nn, CollocationMemberCapabilities as nt, LayerId as o, PinPresentationStatus as on, CollocationMemberOptions as ot, PickOptions as p, pinZoomScale as pn, CollocationPlate as pt, CollocationBracketPlacement as q, PickModifiers as qt, IconHitLine as r, PinPresentationCapability as rn, CollocationMemberGraphic as rt, MapAdapter as s, PinPresentationStatusEvent as sn, CollocationMemberRender as st, FeatureGroup as t, PinOverridePatch as tn, CollocationMember as tt, MapEventHandler as u, combinePinScale as un, CollocationOptions as ut, HatchPattern as v, CollocationStyle as vt, makeFillPatternImage as w, isCollocation as wt, fillPatternImageDimension as x, cloneCollocation as xt, MINE_PATTERN_TILE_SIZE as y, ResolvedCollocationMemberRender as yt, PointSymbolStyle as z, composeMarkerCapabilities as zt };