@orbat-mapper/control-measures 0.2.0-alpha.1 → 0.2.0-alpha.2

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,1653 @@
1
+ import { Feature, FeatureCollection, Geometry, LineString, MultiLineString, MultiPolygon, Point, Polygon, Position } from "geojson";
2
+
3
+ //#region src/internal/api-utils.d.ts
4
+ type ValidationMode = "silent" | "warn" | "throw";
5
+ //#endregion
6
+ //#region src/draw-rules/types.d.ts
7
+ interface AnchorTransformEvent {
8
+ previous: readonly Position[];
9
+ next: readonly Position[];
10
+ activePointIndex?: number;
11
+ }
12
+ interface ControlMeasureDrawRule {
13
+ readonly id: string;
14
+ readonly minimumUserPoints: number;
15
+ readonly canonicalPointCount?: number;
16
+ /**
17
+ * Number of raw (clicked + rubber-band) points at which `derive` can already
18
+ * produce a renderable canonical shape, so the draw controller renders a live
19
+ * symbol preview instead of the bare vertex-marker outline. Lets a measure
20
+ * show feedback before the full `minimumUserPoints` commit threshold is
21
+ * reached — e.g. Area21 pads two points (first click + cursor) up to its
22
+ * three-point search-area shape. Must be <= `minimumUserPoints`. Defaults to
23
+ * `minimumUserPoints` (no early preview).
24
+ */
25
+ readonly minimumPreviewPoints?: number;
26
+ /**
27
+ * Number of trailing slots in the canonical control-point array that are
28
+ * NOT user-clicked spine vertices. For Axis1, this is 1 (the width handle
29
+ * at index N-1). Drives four behaviors in TacticalDraw:
30
+ * 1. New clicks insert at `length - trailingFixedSlots` (not appended).
31
+ * 2. Midpoint handles render only between segments inside
32
+ * [0 .. length - 1 - trailingFixedSlots].
33
+ * 3. The "click the last added point to commit" hit test uses
34
+ * `committed[length - 1 - trailingFixedSlots]`.
35
+ * 4. `canCommit` evaluates `length - trailingFixedSlots >= minimumUserPoints`.
36
+ * Defaults to 0 (the entire array is user-clicked spine). See ADR-0008.
37
+ */
38
+ readonly trailingFixedSlots?: number;
39
+ derive(points: readonly Position[]): Position[];
40
+ transform(event: AnchorTransformEvent): Position[];
41
+ }
42
+ //#endregion
43
+ //#region src/metadata.d.ts
44
+ type ControlMeasureGeometryType = Geometry["type"];
45
+ type ControlMeasureGeometry = "point" | "line" | "area";
46
+ declare const DRAW_RULE_IDS: readonly ["Area1", "Area7", "Area8", "Area11", "Area12", "Area15", "Area21", "Axis1", "Line1", "Line3", "Line9", "Line10", "Line23", "Line24", "Line29", "Point12"];
47
+ type DrawRuleId = (typeof DRAW_RULE_IDS)[number];
48
+ interface BaseParamDescriptor {
49
+ key: string;
50
+ label: string;
51
+ description?: string;
52
+ visibleWhen?: (opts: Record<string, unknown>) => boolean;
53
+ }
54
+ interface NumberParamDescriptor extends BaseParamDescriptor {
55
+ type: "number";
56
+ min?: number;
57
+ max?: number;
58
+ step?: number;
59
+ unit?: string;
60
+ }
61
+ interface BooleanParamDescriptor extends BaseParamDescriptor {
62
+ type: "boolean";
63
+ }
64
+ interface ColorParamDescriptor extends BaseParamDescriptor {
65
+ type: "color";
66
+ }
67
+ interface EnumParamDescriptor extends BaseParamDescriptor {
68
+ type: "enum";
69
+ options: readonly {
70
+ label: string;
71
+ value: string | number | boolean;
72
+ }[];
73
+ }
74
+ interface TextParamDescriptor extends BaseParamDescriptor {
75
+ type: "text";
76
+ placeholder?: string;
77
+ maxLength?: number;
78
+ }
79
+ type ParamDescriptor = NumberParamDescriptor | BooleanParamDescriptor | ColorParamDescriptor | TextParamDescriptor | EnumParamDescriptor;
80
+ interface ControlMeasureMetadata {
81
+ id: string;
82
+ name: string;
83
+ description: string;
84
+ entity: string;
85
+ entityType: string;
86
+ entitySubtype?: string;
87
+ value: string;
88
+ geometry: ControlMeasureGeometry;
89
+ minCoordinates?: number;
90
+ maxCoordinates?: number;
91
+ geometryTypes?: readonly ControlMeasureGeometryType[];
92
+ drawRule?: DrawRuleId;
93
+ /**
94
+ * Resolved draw rule object (anchor contract) attached by the registry when
95
+ * the kind's `drawRule` id has an implementation. Consumed by the
96
+ * `TacticalDraw` façade to drive click accumulation during draw and
97
+ * vertex-snap during edit — see ADR-0005.
98
+ */
99
+ rule?: ControlMeasureDrawRule;
100
+ params?: readonly ParamDescriptor[];
101
+ /**
102
+ * Marks a measure that emits a text label whose pixel size should be captured
103
+ * once at draw-commit time (rather than re-resolved on every zoom). Hosts use
104
+ * this to stamp default label sizing onto the committed measure — see
105
+ * `withCommittedAdapterMeasureOptions` in `tactical-draw`. Keeping it on the
106
+ * definition means adding such a measure stays a one-file change (ADR-0013).
107
+ */
108
+ capturesLabelSize?: boolean;
109
+ }
110
+ //#endregion
111
+ //#region src/define.d.ts
112
+ /**
113
+ * The loosest `FeatureCollection` a control-measure generator may emit: any
114
+ * geometry, with per-feature properties that the renderer normalizes.
115
+ */
116
+ type AnyFeatureCollection = FeatureCollection<Geometry, Record<string, unknown> | null>;
117
+ /**
118
+ * A generator's call signature, constrained only by its inputs and output. The
119
+ * options parameter is typed `never` so that a generator with *any* concrete
120
+ * options type satisfies the bound — function parameters are contravariant, so
121
+ * `(o: BlockOptions) => …` is assignable to `(o: never) => …`. The actual
122
+ * options type is recovered covariantly via {@link OptsOf}, never through this
123
+ * bound. See ADR-0013.
124
+ */
125
+ type ControlMeasureGenerator = (controlPoints: Position[], options: never) => AnyFeatureCollection;
126
+ /**
127
+ * Everything that defines one control measure, co-located with its generator.
128
+ * `registry.ts` collects these into the single `DEFINITIONS` map, from which
129
+ * the `ControlMeasureId` union, `OptionsByKind`, the generator dispatch, the
130
+ * default options, and rule resolution are all derived rather than maintained
131
+ * as parallel tables. See ADR-0013.
132
+ */
133
+ interface ControlMeasureDefinition<Id extends string, G extends ControlMeasureGenerator> {
134
+ /** Catalog metadata; `id` is pinned to the record's literal key. */
135
+ metadata: ControlMeasureMetadata & {
136
+ id: Id;
137
+ };
138
+ /** Pure generator: control points (+ options) → GeoJSON features. */
139
+ generator: G;
140
+ /** Default options, tied to the generator's own options parameter. */
141
+ defaultOptions: NonNullable<Parameters<G>[1]>;
142
+ /**
143
+ * Resolved draw-rule object, merged back onto metadata by the registry. The
144
+ * doctrinal `drawRule` spec id stays on `metadata` (ADR-0005); the registry
145
+ * guards that `rule` agrees with it. See ADR-0013.
146
+ */
147
+ rule?: ControlMeasureDrawRule;
148
+ /**
149
+ * Representative sample used only by the static catalog/thumbnail previews
150
+ * (the `/preview` subpath). Most measures omit it and fall back to a generic
151
+ * layout keyed off `geometry`/`minCoordinates`/`entityType`; a measure whose
152
+ * symbol needs special framing co-locates the override here rather than in a
153
+ * central per-id switch. Points are **unitless** (~`[-1, 1]`); the resolver
154
+ * scales them to the small degree offsets the projected-meter generators
155
+ * expect. `options` is type-checked against this measure's own options. See
156
+ * ADR-0025.
157
+ */
158
+ previewSample?: PreviewSample<NonNullable<Parameters<G>[1]>>;
159
+ }
160
+ /**
161
+ * A measure's representative preview input. Shared between the typed
162
+ * {@link ControlMeasureDefinition} field and the erased
163
+ * {@link AnyControlMeasureDefinition}; `Options` is the measure's own options
164
+ * type (or `unknown` once erased). See ADR-0025.
165
+ */
166
+ interface PreviewSample<Options> {
167
+ controlPoints: readonly (readonly [number, number])[];
168
+ options?: Partial<Options>;
169
+ }
170
+ /**
171
+ * Extracts a definition's options type covariantly from its generator's
172
+ * (optional) second parameter — robust where inferring through the
173
+ * contravariant parameter position is not. See ADR-0013.
174
+ */
175
+ type OptsOf<D> = D extends {
176
+ generator: (points: Position[], options?: infer O) => unknown;
177
+ } ? O : never;
178
+ //#endregion
179
+ //#region src/generators/cm11-command-control-lines/boundary.d.ts
180
+ /** Configuration options for the Boundary control measure. */
181
+ interface BoundaryOptions {
182
+ /**
183
+ * Field B echelon. One of the keys in {@link ECHELONS} (e.g. `"battalion"`,
184
+ * `"division"`) or an equivalent symbol form (`"II"`, `"XX"`). `"none"`,
185
+ * empty, or unknown renders no glyph and leaves the line continuous.
186
+ * @default "battalion"
187
+ */
188
+ echelon?: string;
189
+ /**
190
+ * Echelon glyph height in meters (ground-anchored). Ignored when
191
+ * `echelonSizePixels` is supplied together with `metersPerPixel`.
192
+ * @default 750
193
+ */
194
+ echelonSize?: number;
195
+ /**
196
+ * Echelon glyph height in screen pixels (screen-anchored). Resolved to meters
197
+ * against `metersPerPixel`; bakes to a meter size on draw/edit commit
198
+ * (ADR-0020).
199
+ * @default 16
200
+ */
201
+ echelonSizePixels?: number;
202
+ /**
203
+ * Gap left on each side of the echelon glyph, as a ratio of the glyph height.
204
+ * `0` butts the line against the glyph; larger values widen the break.
205
+ * @default 0.3
206
+ */
207
+ echelonPadding?: number;
208
+ /**
209
+ * Meters-per-pixel at the current zoom/latitude. Stamped by the host when the
210
+ * measure is screen-anchored; required to resolve `echelonSizePixels` and to
211
+ * lock the T/AS text size to the glyph height.
212
+ */
213
+ metersPerPixel?: number;
214
+ /**
215
+ * Map zoom captured at draw-commit (`capturesLabelSize`). Forwarded onto the
216
+ * T/AS labels as `textSizeZoom` so a ground-anchored boundary's text scales
217
+ * with zoom like its meter-baked echelon glyph (maplibre).
218
+ */
219
+ labelSizeZoom?: number;
220
+ /**
221
+ * Map resolution (meters-per-pixel) captured at draw-commit
222
+ * (`capturesLabelSize`). Forwarded onto the T/AS labels as `textSizeResolution`
223
+ * so a ground-anchored boundary's text scales with zoom (OpenLayers), and used
224
+ * as the reference resolution that sizes the text to the glyph height.
225
+ */
226
+ labelSizeResolution?: number;
227
+ /**
228
+ * Number of label groups (echelon + designators), spaced evenly by cumulative
229
+ * arc length along the whole boundary. `1` places a single group at the
230
+ * midpoint of the total length (which may fall on any segment).
231
+ * @default 1
232
+ */
233
+ labelRepetitions?: number;
234
+ /**
235
+ * Spacing between label groups when `labelRepetitions > 1`, relative to an even
236
+ * spread across the whole boundary. `1` spreads them evenly end-to-end; `<1`
237
+ * clusters them toward the midpoint; `>1` pushes them toward the ends
238
+ * (clamped to the boundary). No effect for a single group.
239
+ * @default 1
240
+ */
241
+ labelSpacing?: number;
242
+ /** Field T (unique designator) for unit 1 — the left-of-travel side. */
243
+ unit1Designator?: string;
244
+ /** Field AS (country code) for unit 1 — the left-of-travel side. */
245
+ unit1Country?: string;
246
+ /** Field T (unique designator) for unit 2 — the right-of-travel side. */
247
+ unit2Designator?: string;
248
+ /** Field AS (country code) for unit 2 — the right-of-travel side. */
249
+ unit2Country?: string;
250
+ /**
251
+ * Round the boundary's corners by curving it through the control points
252
+ * (centripetal Catmull-Rom spline). The spline preserves the endpoints, so
253
+ * the line still meets its drawn anchors.
254
+ * @default false
255
+ */
256
+ smooth?: boolean;
257
+ /**
258
+ * Number of samples per segment when `smooth` is enabled. Higher values yield
259
+ * a denser, smoother curve.
260
+ * @default 12
261
+ */
262
+ smoothResolution?: number;
263
+ }
264
+ /**
265
+ * Creates a Boundary control measure: a polyline through `positions` carrying
266
+ * repeated echelon + unit-designator labels.
267
+ *
268
+ * @param positions - Boundary anchor points (≥2); the input contract is
269
+ * enforced at the render seam (ADR-0014).
270
+ * @param options - {@link BoundaryOptions}.
271
+ */
272
+ declare function createBoundary(positions: Position[], options?: BoundaryOptions): FeatureCollection<MultiLineString | MultiPolygon | Point>;
273
+ //#endregion
274
+ //#region src/generators/cm15-maneuver-areas/battlePosition.d.ts
275
+ /** Configuration options for the Battle Position control measure. */
276
+ interface BattlePositionOptions {
277
+ /**
278
+ * Field B echelon. One of the keys in the echelon vocabulary (e.g.
279
+ * `"battalion"`, `"division"`) or an equivalent symbol form (`"II"`, `"XX"`).
280
+ * `"none"`, empty, or unknown renders no glyph and leaves the boundary
281
+ * continuous.
282
+ * @default "battalion"
283
+ */
284
+ echelon?: string;
285
+ /**
286
+ * Echelon glyph height in meters (ground-anchored). Ignored when
287
+ * `echelonSizePixels` is supplied together with `metersPerPixel`.
288
+ * @default 750
289
+ */
290
+ echelonSize?: number;
291
+ /**
292
+ * Echelon glyph height in screen pixels (screen-anchored). Resolved to meters
293
+ * against `metersPerPixel`; bakes to a meter size on draw/edit commit
294
+ * (ADR-0020).
295
+ * @default 16
296
+ */
297
+ echelonSizePixels?: number;
298
+ /**
299
+ * Gap left on each side of the echelon glyph, as a ratio of the glyph height.
300
+ * `0` butts the boundary against the glyph; larger values widen the break.
301
+ * @default 0.3
302
+ */
303
+ echelonPadding?: number;
304
+ /**
305
+ * Slides the echelon along the boundary, as a signed fraction of the total
306
+ * perimeter measured from its default anchor on the bottom edge. `0` keeps it
307
+ * centered on the bottom; positive/negative values move it around the ring in
308
+ * either direction (wrapping at the seam).
309
+ * @default 0
310
+ */
311
+ echelonPosition?: number;
312
+ /**
313
+ * Meters-per-pixel at the current zoom/latitude. Stamped by the host when the
314
+ * measure is screen-anchored; required to resolve `echelonSizePixels`.
315
+ */
316
+ metersPerPixel?: number;
317
+ /**
318
+ * Round the area's corners by curving the boundary through the control points
319
+ * (closed centripetal Catmull-Rom spline), matching the rounded shape in the
320
+ * APP-6 template.
321
+ * @default false
322
+ */
323
+ smooth?: boolean;
324
+ /**
325
+ * Number of samples per segment when `smooth` is enabled. Higher values yield
326
+ * a denser, smoother curve.
327
+ * @default 16
328
+ */
329
+ smoothResolution?: number;
330
+ }
331
+ /**
332
+ * Creates a Battle Position control measure: a closed area through `positions`
333
+ * carrying a single echelon (Field B) glyph straddling its boundary — anchored
334
+ * to the bottom edge by default, slidable via `echelonPosition`.
335
+ *
336
+ * @param positions - Area anchor points (≥3); the input contract is enforced at
337
+ * the render seam (ADR-0014).
338
+ * @param options - {@link BattlePositionOptions}.
339
+ */
340
+ declare function createBattlePosition(positions: Position[], options?: BattlePositionOptions): FeatureCollection<MultiLineString | MultiPolygon>;
341
+ //#endregion
342
+ //#region src/generators/cm14-maneuver-lines/principalDirectionOfFire.d.ts
343
+ /**
344
+ * Configuration options for the Principal Direction of Fire tactical symbol.
345
+ */
346
+ interface PrincipalDirectionOfFireOptions {
347
+ /** Arrowhead length relative to each arm's own length (default: 0.07) */
348
+ arrowheadLengthRatio?: number;
349
+ /** Arrowhead wing spread relative to the arrowhead length (default: 0.67) */
350
+ arrowheadWidthRatio?: number;
351
+ }
352
+ declare const DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS: Required<PrincipalDirectionOfFireOptions>;
353
+ /**
354
+ * Generates a GeoJSON FeatureCollection for a PRINCIPAL DIRECTION OF FIRE
355
+ * tactical symbol: a "V" of arms from the vertex out to the (independent) tips,
356
+ * each ending in an open arrowhead.
357
+ *
358
+ * Renders one arm per tip, so two points (vertex + one tip) draws the single
359
+ * arm being placed — the live feedback after PT 1 — and three points draws the
360
+ * full V. Points beyond the third are ignored (input contract, ADR-0014).
361
+ *
362
+ * @param coordinates - [PT 1 (vertex), PT 2 (tip), PT 3 (tip)]
363
+ * @param options - Arrowhead sizing parameters
364
+ */
365
+ declare function createPrincipalDirectionOfFire(coordinates: Position[], options?: PrincipalDirectionOfFireOptions): FeatureCollection<MultiLineString, Record<string, never>>;
366
+ //#endregion
367
+ //#region src/generators/cm14-maneuver-lines/finalProtectiveFire.d.ts
368
+ /**
369
+ * Configuration options for the Final Protective Fire tactical symbols.
370
+ *
371
+ * Identical to Principal Direction of Fire (arrowhead sizing), plus a filled
372
+ * "blade" running along the inside of one arm.
373
+ */
374
+ interface FinalProtectiveFireOptions {
375
+ /** Arrowhead length relative to each arm's own length (default: 0.07) */
376
+ arrowheadLengthRatio?: number;
377
+ /** Arrowhead wing spread relative to the arrowhead length (default: 0.67) */
378
+ arrowheadWidthRatio?: number;
379
+ /**
380
+ * Blade height (its perpendicular reach into the inside of the V) relative
381
+ * to the bladed arm's own length (default: 0.03).
382
+ */
383
+ bladeHeight?: number;
384
+ }
385
+ declare const DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS: Required<FinalProtectiveFireOptions>;
386
+ type FpfProps = {
387
+ part?: string;
388
+ fill?: true;
389
+ };
390
+ declare function createFinalProtectiveFireLeft(coordinates: Position[], options?: FinalProtectiveFireOptions): FeatureCollection<MultiLineString | Polygon, FpfProps>;
391
+ declare function createFinalProtectiveFireRight(coordinates: Position[], options?: FinalProtectiveFireOptions): FeatureCollection<MultiLineString | Polygon, FpfProps>;
392
+ //#endregion
393
+ //#region src/projection.d.ts
394
+ type Point2D = [number, number];
395
+ /**
396
+ * Project WGS84 (Lon/Lat) to Web Mercator (Meters).
397
+ */
398
+ declare const project: (lon: number, lat: number) => Point2D;
399
+ /**
400
+ * Unproject Web Mercator (Meters) back to WGS84 (Lon/Lat).
401
+ */
402
+ declare const unproject: (x: number, y: number) => Position;
403
+ //#endregion
404
+ //#region src/attack-utils.d.ts
405
+ interface AttackOptions {
406
+ shaftWidthRatio?: number;
407
+ roundedBends?: boolean;
408
+ bendSegments?: number;
409
+ }
410
+ /**
411
+ * Calculates the relative metrics (longitudinal and lateral) of the width point
412
+ * relative to the Tip-Neck axis.
413
+ *
414
+ * @param pts - Array of positions [Tip, Neck, ..., WidthPoint]
415
+ * @returns { longitudinal: number, lateral: number } | null
416
+ */
417
+ declare function calculateMetrics(pts: Position[]): {
418
+ longitudinal: number;
419
+ lateral: number;
420
+ } | null;
421
+ /**
422
+ * Computes an initial Width Point based on the Tip and Neck positions.
423
+ * It places the point perpendicular to the neck at a default distance relative to the length.
424
+ *
425
+ * @param tip - Tip position (Lon/Lat)
426
+ * @param neck - Neck position (Lon/Lat)
427
+ * @returns Width Point position (Lon/Lat)
428
+ */
429
+ declare function computeInitialWidthPoint(tip: Position, neck: Position): Position;
430
+ //#endregion
431
+ //#region src/generators/cm15-maneuver-areas/mainAttack.d.ts
432
+ declare const DEFAULT_MAIN_ATTACK_OPTIONS: Required<AttackOptions>;
433
+ type MainAttackOptions = AttackOptions;
434
+ /**
435
+ * Generates a GeoJSON FeatureCollection for a Main Attack tactical symbol.
436
+ *
437
+ * The symbol consists of a single MultiLineString feature containing:
438
+ * 1. **Arrowhead**: A line forming a "chevron" or "roof" shape.
439
+ * 2. **Shaft**: Two parallel lines behind the arrow.
440
+ *
441
+ * The shaft is calculated to terminate exactly where it touches the inner walls
442
+ * of the arrowhead, creating a seamless connection.
443
+ *
444
+ * @param coordinates - An array of GeoJSON Positions (Lon/Lat).
445
+ * Minimum 3 points required.
446
+ * **Order matters:** * - Index 0: **Tip** (The sharp point of the arrow)
447
+ * - Index 1 to N-2: **Spine** (The path the shaft follows)
448
+ * - Index N-1: **Width Control** (Determines the width of the arrowhead)
449
+ * @param options - Configuration for ratios and properties.
450
+ * @returns A GeoJSON FeatureCollection containing a single MultiLineString.
451
+ */
452
+ declare function createMainAttack(coordinates: Position[], options?: MainAttackOptions): FeatureCollection<MultiLineString>;
453
+ //#endregion
454
+ //#region src/generators/cm15-maneuver-areas/supportingAttack.d.ts
455
+ type SupportingAttackOptions = AttackOptions;
456
+ declare const DEFAULT_SUPPORTING_ATTACK_OPTIONS: Required<SupportingAttackOptions>;
457
+ /**
458
+ * Generates a GeoJSON FeatureCollection for a Supporting Attack tactical symbol.
459
+ *
460
+ * The symbol differs from Main Attack in that it is a single LineString
461
+ * outlining the arrow shape, rather than a filled Polygon header + Shaft lines.
462
+ *
463
+ * @param coordinates - An array of GeoJSON Positions.
464
+ * @param options - Configuration options.
465
+ * @returns A GeoJSON FeatureCollection<LineString>.
466
+ */
467
+ declare function createSupportingAttack(coordinates: Position[], options?: SupportingAttackOptions): FeatureCollection<LineString>;
468
+ //#endregion
469
+ //#region src/generators/cm99-generic-arrows/classicArrow.d.ts
470
+ /**
471
+ * A plain, clean arrow for illustrations — not a doctrinal symbol. The shaft is
472
+ * a straight polyline through the drawn control points (Line1 contract) and the
473
+ * tip carries a solid triangular arrowhead. No wobble, no curve: the canonical
474
+ * "draw an arrow" graphic.
475
+ */
476
+ /**
477
+ * Arrowhead silhouette:
478
+ * - `triangle` — solid triangle with a flat back (the default).
479
+ * - `barbed` — swept-back barbs with a forward notch (classic arrowhead).
480
+ * - `concave` — a sharper barbed head with a deep forward notch.
481
+ * - `diamond` — a rhombus, widest at its middle.
482
+ * - `harpoon` — an asymmetric single-sided barb.
483
+ * - `swallowtail` — barbs that sweep back into two trailing tails.
484
+ * - `chevron` — a thick hollow "V".
485
+ * - `circle` — a round dot terminator.
486
+ * - `tee` — a flat crossbar terminator (no point).
487
+ * - `open` — an unfilled "V", drawn as two strokes meeting at the tip.
488
+ */
489
+ type ClassicArrowHeadStyle = "triangle" | "barbed" | "concave" | "diamond" | "harpoon" | "swallowtail" | "chevron" | "circle" | "tee" | "open";
490
+ interface ClassicArrowOptions {
491
+ /** Arrowhead silhouette. */
492
+ arrowheadStyle?: ClassicArrowHeadStyle;
493
+ /** Round the shaft's corners by curving it through the control points. */
494
+ smooth?: boolean;
495
+ /** Number of samples per segment when smooth mode is enabled. */
496
+ smoothResolution?: number;
497
+ /** Arrowhead length as a fraction of the total path length. */
498
+ arrowheadLengthRatio?: number;
499
+ /** Arrowhead base width as a fraction of the total path length. */
500
+ arrowheadWidthRatio?: number;
501
+ }
502
+ /**
503
+ * Generates a GeoJSON FeatureCollection for the Classic Arrow: a shaft
504
+ * LineString (trimmed so it doesn't poke through the head) plus a head feature
505
+ * whose silhouette follows `arrowheadStyle` — a filled Polygon for the solid heads,
506
+ * or an open "V" LineString for `open`.
507
+ */
508
+ declare function createClassicArrow(coordinates: Position[], options?: ClassicArrowOptions): FeatureCollection<LineString | Polygon, {
509
+ part: "shaft" | "head";
510
+ fill?: boolean;
511
+ }>;
512
+ //#endregion
513
+ //#region src/generators/cm99-generic-arrows/blockArrow.d.ts
514
+ /**
515
+ * A solid "block" arrow for illustrations — not a doctrinal symbol. The whole
516
+ * arrow is one filled polygon: a shaft band of controllable width that runs
517
+ * through the drawn Axis1 spine and flares into a wider triangular head at the
518
+ * tip. Axis1 control points are ordered `[tip, neck, ...spine, width]`.
519
+ */
520
+ /**
521
+ * Arrowhead silhouette (all carved from the one filled body):
522
+ * - `triangle` — a flat-backed triangular head (the default).
523
+ * - `barbed` — swept-back barbs with the shaft entering at a forward notch.
524
+ * - `concave` — a sharper barbed head with a deeper notch.
525
+ * - `diamond` — a kite that flares to its widest mid-head.
526
+ * - `harpoon` — an asymmetric single-sided barb.
527
+ * - `swallowtail` — barbs that sweep back into two trailing tails.
528
+ * - `tee` — a flat crossbar terminator (no point).
529
+ */
530
+ type BlockArrowHeadStyle = "triangle" | "barbed" | "concave" | "diamond" | "harpoon" | "swallowtail" | "tee";
531
+ interface BlockArrowOptions {
532
+ /** Shaft band width as a fraction of the total path length. */
533
+ shaftWidth?: number;
534
+ /** Arrowhead silhouette. */
535
+ arrowheadStyle?: BlockArrowHeadStyle;
536
+ /** Arrowhead base width as a fraction of the total path length. */
537
+ arrowheadWidthRatio?: number;
538
+ /** Arrowhead length as a fraction of the total path length. */
539
+ arrowheadLengthRatio?: number;
540
+ /** Round the shaft's corners by curving it through the control points. */
541
+ smooth?: boolean;
542
+ /** Number of samples per segment when smooth mode is enabled. */
543
+ smoothResolution?: number;
544
+ /** Fill the body solid; when false the arrow is drawn as an outline only. */
545
+ filled?: boolean;
546
+ }
547
+ /**
548
+ * Generates a GeoJSON FeatureCollection for the Block Arrow: a single filled
549
+ * Polygon whose outline runs up the left side of the shaft, around the head
550
+ * (whose silhouette follows `arrowheadStyle`) to the tip and back, then down the
551
+ * right side of the shaft.
552
+ */
553
+ declare function createBlockArrow(coordinates: Position[], options?: BlockArrowOptions): FeatureCollection<Polygon, {
554
+ part: "body";
555
+ fill: boolean;
556
+ }>;
557
+ //#endregion
558
+ //#region src/generators/cm15-maneuver-areas/airborneAttack.d.ts
559
+ type AirborneAttackOptions = AttackOptions;
560
+ declare const DEFAULT_AIRBORNE_ATTACK_OPTIONS: Required<AirborneAttackOptions>;
561
+ /**
562
+ * Generates a GeoJSON FeatureCollection for an Airborne Attack tactical symbol.
563
+ *
564
+ * The symbol is similar to Supporting Attack but features a crossover point
565
+ * between the shaft and the head (Points 1 and 2/Neck).
566
+ *
567
+ * @param coordinates - An array of GeoJSON Positions.
568
+ * @param options - Configuration options.
569
+ * @returns A GeoJSON FeatureCollection<LineString>.
570
+ */
571
+ declare function createAirborneAttack(coordinates: Position[], options?: AirborneAttackOptions): FeatureCollection<LineString>;
572
+ //#endregion
573
+ //#region src/generators/cm15-maneuver-areas/attackHelicopter.d.ts
574
+ interface AttackHelicopterOptions extends AttackOptions {
575
+ symbolHeightRatio?: number;
576
+ triangleSizeRatio?: number;
577
+ bottomBarWidthRatio?: number;
578
+ bowtieWidthRatio?: number;
579
+ }
580
+ declare const DEFAULT_ATTACK_HELICOPTER_OPTIONS: Required<AttackHelicopterOptions>;
581
+ /**
582
+ * Generates a GeoJSON FeatureCollection for an Attack Helicopter tactical symbol.
583
+ *
584
+ * The symbol is based on the Airborne Attack (bow tie) geometry but features
585
+ * an additional symbol (vertical line + triangle) at the crossover point.
586
+ *
587
+ * @param coordinates - An array of GeoJSON Positions.
588
+ * @param options - Configuration options.
589
+ * @returns A GeoJSON FeatureCollection containing the main graphic and the symbol.
590
+ */
591
+ declare function createAttackHelicopter(coordinates: Position[], options?: AttackHelicopterOptions): FeatureCollection<LineString | Polygon>;
592
+ //#endregion
593
+ //#region src/generators/cm15-maneuver-areas/supportByFire.d.ts
594
+ interface SupportByFireOptions {
595
+ arrowheadWidthRatio?: number;
596
+ backLineLengthRatio?: number;
597
+ backLineAngle?: number;
598
+ }
599
+ declare const DEFAULT_SUPPORT_BY_FIRE_OPTIONS: Required<SupportByFireOptions>;
600
+ /**
601
+ * Generates a GeoJSON FeatureCollection for a Support By Fire tactical graphic.
602
+ *
603
+ * Input:
604
+ * - PT1: Left Base
605
+ * - PT2: Right Base
606
+ * - PT3: Left Tip
607
+ * - PT4: Right Tip
608
+ */
609
+ declare function createSupportByFire(coordinates: Position[], options?: SupportByFireOptions): FeatureCollection<LineString>;
610
+ //#endregion
611
+ //#region src/generators/cm15-maneuver-areas/attackByFire.d.ts
612
+ interface AttackByFireOptions {
613
+ arrowheadWidthRatio?: number;
614
+ backLineLengthRatio?: number;
615
+ backLineAngle?: number;
616
+ }
617
+ declare const DEFAULT_ATTACK_BY_FIRE_OPTIONS: Required<AttackByFireOptions>;
618
+ /**
619
+ * Generates a GeoJSON FeatureCollection for an Attack By Fire tactical graphic.
620
+ *
621
+ * Input:
622
+ * - PT1: Arrow Tip (Target)
623
+ * - PT2: Left Base
624
+ * - PT3: Right Base
625
+ *
626
+ * Logic:
627
+ * - Shaft: Midpoint(PT2, PT3) -> PT1
628
+ * - Base Line: PT2 -> PT3
629
+ * - Wings: Splayed out from PT2 and PT3
630
+ */
631
+ declare function createAttackByFire(coordinates: Position[], options?: AttackByFireOptions): FeatureCollection<LineString>;
632
+ //#endregion
633
+ //#region src/generators/cm14-maneuver-lines/flot.d.ts
634
+ /**
635
+ * Configuration options for the FLOT (Forward Line of Own Troops) geometry.
636
+ */
637
+ interface FLOTOptions {
638
+ /**
639
+ * The radius of the semicircular arcs in meters.
640
+ * Semicircles are placed tangent to each other (diameter = 2 * radius).
641
+ * This is ignored if radiusPixels is provided along with metersPerPixel.
642
+ * @default 50
643
+ */
644
+ radius?: number;
645
+ /**
646
+ * The radius of the semi-circular arcs in pixels.
647
+ * When provided along with metersPerPixel, the actual meter radius is calculated
648
+ * dynamically to maintain consistent visual size on screen.
649
+ * Takes precedence over radius when metersPerPixel is also provided.
650
+ * @default 10
651
+ */
652
+ radiusPixels?: number;
653
+ /**
654
+ * The meters-per-pixel ratio at the current zoom level and latitude.
655
+ * Required when using radiusPixels for zoom-aware sizing.
656
+ * Can be obtained from the map view's resolution or calculated using getMetersPerPixel().
657
+ */
658
+ metersPerPixel?: number;
659
+ /**
660
+ * The number of points used to render each individual semi-circle.
661
+ * Higher values create smoother arcs.
662
+ * @default 16
663
+ */
664
+ resolution?: number;
665
+ }
666
+ /**
667
+ * Default options for the FLOT graphic.
668
+ */
669
+ declare const DEFAULT_FLOT_OPTIONS: Required<Omit<FLOTOptions, "metersPerPixel">>;
670
+ /**
671
+ * Creates a FLOT (Forward Line of Own Troops) tactical graphic.
672
+ *
673
+ * Generates a scalloped/arc line representing the forward edge of friendly forces.
674
+ * The line consists of semi-circular arcs that bulge perpendicular to the base path,
675
+ * creating a distinctive visual pattern used in military tactical graphics.
676
+ *
677
+ * @param positions - Array of GeoJSON positions defining the base path
678
+ * @param options - Configuration options for the graphic
679
+ * @returns A GeoJSON FeatureCollection containing the scalloped LineString
680
+ *
681
+ * @example
682
+ * ```typescript
683
+ * const flot = createFLOT(
684
+ * [[-122.4194, 37.7749], [-122.4100, 37.7800], [-122.4000, 37.7750]],
685
+ * { radius: 100, resolution: 20 }
686
+ * );
687
+ * ```
688
+ */
689
+ declare function createFLOT(positions: Position[], options?: FLOTOptions): FeatureCollection<LineString>;
690
+ //#endregion
691
+ //#region src/generators/cm34-mission-tasks/block.d.ts
692
+ interface BlockMissionTaskOptions {
693
+ /** Gap for the 'B' label as a ratio of the front length (default: 0.2) */
694
+ labelGapRatio?: number;
695
+ /** Label height in CSS pixels at the draw/reference zoom. */
696
+ labelSizePixels?: number;
697
+ /** Map zoom at which labelSizePixels was captured. */
698
+ labelSizeZoom?: number;
699
+ /** Map resolution at which labelSizePixels was captured. */
700
+ labelSizeResolution?: number;
701
+ }
702
+ declare const DEFAULT_BLOCK_MISSION_TASK_OPTIONS: Required<Omit<BlockMissionTaskOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
703
+ /**
704
+ * Generates a GeoJSON FeatureCollection for a BLOCK mission task symbol (340100).
705
+ *
706
+ * Uses the same T-shape geometry as the protection-area Block symbol, with a
707
+ * "B" label centered on the shaft.
708
+ *
709
+ * @param coordinates - [PT. 1, PT. 2, optional PT. 3] as Position arrays
710
+ * @param options - Configuration options
711
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
712
+ */
713
+ declare function createBlockMissionTaskSymbol(coordinates: Position[], options?: BlockMissionTaskOptions): FeatureCollection<MultiLineString | Point>;
714
+ //#endregion
715
+ //#region src/generators/cm34-mission-tasks/breach.d.ts
716
+ /**
717
+ * Configuration options for the BREACH tactical symbol.
718
+ */
719
+ interface BreachOptions {
720
+ /** Tick mark length ratio relative to front opening (default: 0.15) */
721
+ tickLengthRatio?: number;
722
+ /** Tick mark angle in degrees from perpendicular (default: 45) */
723
+ tickAngle?: number;
724
+ /** Gap for the 'B' label as a ratio of the front length (default: 0.2) */
725
+ labelGapRatio?: number;
726
+ /** Label height in CSS pixels at the draw/reference zoom. */
727
+ labelSizePixels?: number;
728
+ /** Map zoom at which labelSizePixels was captured. */
729
+ labelSizeZoom?: number;
730
+ /** Map resolution at which labelSizePixels was captured. */
731
+ labelSizeResolution?: number;
732
+ }
733
+ /**
734
+ * Default options for the BREACH symbol.
735
+ */
736
+ declare const DEFAULT_BREACH_OPTIONS: Required<Omit<BreachOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
737
+ /**
738
+ * Generates a GeoJSON FeatureCollection for a BREACH mission task symbol (340200).
739
+ *
740
+ * A three-sided bracket (see {@link createBracketSymbol}) whose front opening
741
+ * endpoints terminate in tick marks pointing **outward** (away from the rear
742
+ * "B" line).
743
+ *
744
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
745
+ * @param options - Configuration options
746
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
747
+ */
748
+ declare function createBreachSymbol(coordinates: Position[], options?: BreachOptions): FeatureCollection<MultiLineString | Point>;
749
+ //#endregion
750
+ //#region src/generators/cm34-mission-tasks/bypass.d.ts
751
+ /**
752
+ * Configuration options for the BYPASS tactical symbol.
753
+ */
754
+ interface BypassOptions {
755
+ /** Arrowhead length ratio relative to front opening (default: 0.2) */
756
+ arrowheadLengthRatio?: number;
757
+ /** Gap for the 'B' label as a ratio of the front length (default: 0.2) */
758
+ labelGapRatio?: number;
759
+ /** Label height in CSS pixels at the draw/reference zoom. */
760
+ labelSizePixels?: number;
761
+ /** Map zoom at which labelSizePixels was captured. */
762
+ labelSizeZoom?: number;
763
+ /** Map resolution at which labelSizePixels was captured. */
764
+ labelSizeResolution?: number;
765
+ }
766
+ /**
767
+ * Default options for the BYPASS symbol.
768
+ */
769
+ declare const DEFAULT_BYPASS_OPTIONS: Required<Omit<BypassOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
770
+ /**
771
+ * Generates a GeoJSON FeatureCollection for a BYPASS mission task symbol (340300).
772
+ *
773
+ * A three-sided bracket (see {@link createBracketSymbol}) with a "B" label on
774
+ * the rear line, whose front opening endpoints terminate in outward-flaring
775
+ * chevron arrowheads instead of tick marks.
776
+ *
777
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
778
+ * @param options - Configuration options
779
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
780
+ */
781
+ declare function createBypassSymbol(coordinates: Position[], options?: BypassOptions): FeatureCollection<MultiLineString | Point>;
782
+ //#endregion
783
+ //#region src/generators/cm34-mission-tasks/canalize.d.ts
784
+ /**
785
+ * Configuration options for the CANALIZE tactical symbol.
786
+ */
787
+ interface CanalizeOptions {
788
+ /** Tick mark length ratio relative to front opening (default: 0.15) */
789
+ tickLengthRatio?: number;
790
+ /** Tick mark angle in degrees from perpendicular (default: 45) */
791
+ tickAngle?: number;
792
+ /** Gap for the 'C' label as a ratio of the front length (default: 0.2) */
793
+ labelGapRatio?: number;
794
+ /** Label height in CSS pixels at the draw/reference zoom. */
795
+ labelSizePixels?: number;
796
+ /** Map zoom at which labelSizePixels was captured. */
797
+ labelSizeZoom?: number;
798
+ /** Map resolution at which labelSizePixels was captured. */
799
+ labelSizeResolution?: number;
800
+ }
801
+ /**
802
+ * Default options for the CANALIZE symbol.
803
+ */
804
+ declare const DEFAULT_CANALIZE_OPTIONS: Required<Omit<CanalizeOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
805
+ /**
806
+ * Generates a GeoJSON FeatureCollection for a CANALIZE mission task symbol (340400).
807
+ *
808
+ * A three-sided bracket (see {@link createBracketSymbol}) whose front opening
809
+ * endpoints terminate in tick marks pointing **inward** (toward the rear "C"
810
+ * line), opposite BREACH's outward-facing ticks.
811
+ *
812
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
813
+ * @param options - Configuration options
814
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
815
+ */
816
+ declare function createCanalizeSymbol(coordinates: Position[], options?: CanalizeOptions): FeatureCollection<MultiLineString | Point>;
817
+ //#endregion
818
+ //#region src/generators/cm34-mission-tasks/clear.d.ts
819
+ /**
820
+ * Configuration options for the CLEAR tactical mission task symbol.
821
+ */
822
+ interface ClearOptions {
823
+ /**
824
+ * Padding between the vertical line's endpoints and the outer arrows, as a
825
+ * ratio of the symbol height. Insets the top and bottom arrows so they sit
826
+ * clear of PT. 1 / PT. 2 (default: 0.15).
827
+ */
828
+ arrowInsetRatio?: number;
829
+ /** Arrowhead depth (toward the rear) as a ratio of the symbol height (default: 0.15). */
830
+ arrowheadLengthRatio?: number;
831
+ /** Arrowhead width (along the vertical line) as a ratio of the symbol height (default: 0.2). */
832
+ arrowheadWidthRatio?: number;
833
+ /** Gap for the 'C' label as a ratio of the shaft length (default: 0.2). */
834
+ labelGapRatio?: number;
835
+ /** Label height in CSS pixels at the draw/reference zoom. */
836
+ labelSizePixels?: number;
837
+ /** Map zoom at which labelSizePixels was captured. */
838
+ labelSizeZoom?: number;
839
+ /** Map resolution at which labelSizePixels was captured. */
840
+ labelSizeResolution?: number;
841
+ }
842
+ /**
843
+ * Default options for the CLEAR symbol.
844
+ */
845
+ declare const DEFAULT_CLEAR_OPTIONS: Required<Omit<ClearOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
846
+ /**
847
+ * Generates a GeoJSON FeatureCollection for a CLEAR mission task symbol (340500).
848
+ *
849
+ * A vertical line (PT. 1 → PT. 2) with three arrows pointing at it,
850
+ * perpendicular to the line. The arrows come from the rear — the side PT. 3
851
+ * sits on — and their tips touch the vertical line; each carries a shaft
852
+ * reaching back to the rear. The arrows are evenly spaced along the line, so
853
+ * the middle arrow's tip sits at the midpoint of the vertical line and its
854
+ * shaft carries the 'C' glyph. The arrows stay perpendicular to the vertical
855
+ * line at any rotation.
856
+ *
857
+ * Input Points:
858
+ * - PT. 1: Top endpoint of the vertical line
859
+ * - PT. 2: Bottom endpoint of the vertical line — defines height with PT. 1
860
+ * - PT. 3: Rear point — defines the shaft length (and which side the arrows
861
+ * come from)
862
+ *
863
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
864
+ * @param options - Configuration options
865
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
866
+ */
867
+ declare function createClearSymbol(coordinates: Position[], options?: ClearOptions): FeatureCollection<MultiLineString | Point>;
868
+ //#endregion
869
+ //#region src/generators/cm34-mission-tasks/delay.d.ts
870
+ interface DelayOptions {
871
+ /** Arrowhead depth as a ratio of the straight-line length (default: 0.12). */
872
+ arrowheadLengthRatio?: number;
873
+ /** Arrowhead width as a ratio of the straight-line length (default: 0.12). */
874
+ arrowheadWidthRatio?: number;
875
+ /** Gap for the 'D' label as a ratio of the straight-line length (default: 0.18). */
876
+ labelGapRatio?: number;
877
+ /** Number of segments used to approximate the 180-degree arc (default: 32). */
878
+ arcSegments?: number;
879
+ /** Label height in CSS pixels at the draw/reference zoom. */
880
+ labelSizePixels?: number;
881
+ /** Map zoom at which labelSizePixels was captured. */
882
+ labelSizeZoom?: number;
883
+ /** Map resolution at which labelSizePixels was captured. */
884
+ labelSizeResolution?: number;
885
+ }
886
+ declare const DEFAULT_DELAY_OPTIONS: Required<Omit<DelayOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
887
+ declare function createDelaySymbol(coordinates: Position[], options?: DelayOptions): FeatureCollection<MultiLineString | Point>;
888
+ //#endregion
889
+ //#region src/generators/cm34-mission-tasks/isolate.d.ts
890
+ /**
891
+ * Configuration options for the ISOLATE tactical mission task symbol.
892
+ */
893
+ interface IsolateOptions {
894
+ /** Angular size of the opening on the friendly side, in degrees (default: 30). */
895
+ openingAngle?: number;
896
+ /** Number of inward-pointing arrowhead barbs spaced around the closed arc (default: 9). */
897
+ barbCount?: number;
898
+ /** Barb length as a ratio of the symbol radius (default: 0.18). */
899
+ barbLengthRatio?: number;
900
+ }
901
+ /**
902
+ * Generates a GeoJSON FeatureCollection for an ISOLATE mission task symbol (341500).
903
+ *
904
+ * A near-complete circle centered on PT. 1 whose radius reaches PT. 2. The arc
905
+ * starts (bare) at PT. 2's bearing and sweeps clockwise around the closed
906
+ * portion to a single arrow tip at the far end; the wedge-shaped gap (default
907
+ * 30°) between that arrow tip and PT. 2 is the opening — the "friendly side".
908
+ * Inward-pointing arrowhead barbs are spaced along the closed arc, set in from
909
+ * both ends so they never touch PT. 2 or the arrow tip, conveying the
910
+ * sealing-off of the enclosed force. Unlike the bracket mission tasks, isolate
911
+ * carries no glyph label.
912
+ *
913
+ * Input Points:
914
+ * - PT. 1: Center point
915
+ * - PT. 2: Start point — fixes the radius and the bearing of the opening
916
+ *
917
+ * @param coordinates - [PT. 1, PT. 2] as Position arrays
918
+ * @param options - Configuration options
919
+ * @returns GeoJSON FeatureCollection containing a single MultiLineString feature
920
+ */
921
+ declare function createIsolateSymbol(coordinates: Position[], options?: IsolateOptions): FeatureCollection<MultiLineString>;
922
+ //#endregion
923
+ //#region src/generators/cm29-protection-lines/antitankDitch.d.ts
924
+ interface AntitankDitchOptions {
925
+ /**
926
+ * The tooth depth in meters. Target tooth spacing is roughly 1.15x this depth.
927
+ * Ignored when toothHeightPixels is provided with metersPerPixel.
928
+ * @default 50
929
+ */
930
+ toothHeight?: number;
931
+ /**
932
+ * The tooth depth in pixels. When provided with metersPerPixel, the meter
933
+ * size is calculated dynamically to maintain a consistent visual size.
934
+ * @default 10
935
+ */
936
+ toothHeightPixels?: number;
937
+ /**
938
+ * The target base span of each triangular tooth as a multiple of tooth depth.
939
+ * Lower values make sharper, denser teeth; higher values make flatter teeth.
940
+ * @default 1.15
941
+ */
942
+ toothWidthRatio?: number;
943
+ /**
944
+ * The meters-per-pixel ratio at the current zoom level and latitude. Required
945
+ * when using toothHeightPixels for zoom-aware sizing.
946
+ */
947
+ metersPerPixel?: number;
948
+ }
949
+ declare const DEFAULT_ANTITANK_DITCH_OPTIONS: Required<Omit<AntitankDitchOptions, "metersPerPixel">>;
950
+ declare function createAntitankDitchUnderConstruction(positions: Position[], options?: AntitankDitchOptions): FeatureCollection<MultiLineString, {
951
+ part: "ditch";
952
+ }>;
953
+ declare function createAntitankDitchCompleted(positions: Position[], options?: AntitankDitchOptions): FeatureCollection<MultiPolygon, {
954
+ part: "teeth";
955
+ fill: boolean;
956
+ }>;
957
+ //#endregion
958
+ //#region src/generators/cm29-protection-lines/antitankWall.d.ts
959
+ interface AntitankWallOptions extends AntitankDitchOptions {
960
+ /**
961
+ * The total gap between consecutive tooth bases as a multiple of tooth base
962
+ * width. Use 0 for touching teeth; higher values create wider gaps.
963
+ * @default 1.35
964
+ */
965
+ toothSpacingRatio?: number;
966
+ }
967
+ declare const DEFAULT_ANTITANK_WALL_OPTIONS: Required<Omit<AntitankWallOptions, "metersPerPixel">>;
968
+ declare function createAntitankWall(positions: Position[], options?: AntitankWallOptions): FeatureCollection<MultiLineString, {
969
+ part: "wall";
970
+ }>;
971
+ //#endregion
972
+ //#region src/generators/cm29-protection-lines/fortifiedLine.d.ts
973
+ /**
974
+ * Configuration options for the Fortified Line geometry.
975
+ */
976
+ interface FortifiedLineOptions {
977
+ /**
978
+ * The size of the square teeth in meters.
979
+ * This controls both the width and height of the castellated pattern.
980
+ * This is ignored if sizePixels is provided along with metersPerPixel.
981
+ * @default 50
982
+ */
983
+ size?: number;
984
+ /**
985
+ * The size of the square teeth in pixels.
986
+ * When provided along with metersPerPixel, the actual meter size is calculated
987
+ * dynamically to maintain consistent visual size on screen.
988
+ * Takes precedence over size when metersPerPixel is also provided.
989
+ * @default 10
990
+ */
991
+ sizePixels?: number;
992
+ /**
993
+ * The meters-per-pixel ratio at the current zoom level and latitude.
994
+ * Required when using sizePixels for zoom-aware sizing.
995
+ */
996
+ metersPerPixel?: number;
997
+ /**
998
+ * Round the line's corners by curving the base path through the control
999
+ * points (centripetal Catmull-Rom spline) before generating the castellated
1000
+ * teeth, matching the rounded shape option on the Fortified Area and Battle
1001
+ * Position measures. With fewer than three control points the path is left
1002
+ * unchanged (a single segment cannot be smoothed).
1003
+ * @default false
1004
+ */
1005
+ smooth?: boolean;
1006
+ /**
1007
+ * Number of samples per segment when `smooth` is enabled. Higher values yield
1008
+ * a denser, smoother curve.
1009
+ * @default 16
1010
+ */
1011
+ smoothResolution?: number;
1012
+ }
1013
+ /**
1014
+ * Default options for the Fortified Line graphic.
1015
+ */
1016
+ declare const DEFAULT_FORTIFIED_LINE_OPTIONS: Required<Omit<FortifiedLineOptions, "metersPerPixel">>;
1017
+ /**
1018
+ * Creates a Fortified Line tactical graphic.
1019
+ *
1020
+ * Generates a castellated/square-wave line representing a fortified line.
1021
+ * The line consists of square "teeth" that project perpendicular to the base path.
1022
+ *
1023
+ * @param positions - Array of GeoJSON positions defining the base path
1024
+ * @param options - Configuration options for the graphic
1025
+ * @returns A GeoJSON FeatureCollection containing the castellated LineString
1026
+ */
1027
+ declare function createFortifiedLine(positions: Position[], options?: FortifiedLineOptions): FeatureCollection<LineString>;
1028
+ //#endregion
1029
+ //#region src/generators/cm15-maneuver-areas/fortifiedArea.d.ts
1030
+ /**
1031
+ * Configuration options for the Fortified Area. Inherits the Fortified Line
1032
+ * options (including `smooth`/`smoothResolution`) unchanged; the area applies
1033
+ * the smoothing as a closed Catmull-Rom ring rather than an open spline.
1034
+ */
1035
+ type FortifiedAreaOptions = FortifiedLineOptions;
1036
+ declare const DEFAULT_FORTIFIED_AREA_OPTIONS: Required<Omit<FortifiedLineOptions, "metersPerPixel">>;
1037
+ /**
1038
+ * Creates a Fortified Area tactical graphic.
1039
+ *
1040
+ * Generates a polygon with a castellated/square-wave boundary representing a fortified area.
1041
+ * The boundary consists of square "teeth" that project perpendicular to the path.
1042
+ *
1043
+ * @param positions - Array of GeoJSON positions defining the area boundary.
1044
+ * The first and last positions should match to close the polygon,
1045
+ * or it will be closed automatically.
1046
+ * @param options - Configuration options for the graphic
1047
+ * @returns A GeoJSON FeatureCollection containing the castellated Polygon
1048
+ */
1049
+ declare function createFortifiedArea(positions: Position[], options?: FortifiedAreaOptions): FeatureCollection<Polygon>;
1050
+ //#endregion
1051
+ //#region src/generators/cm27-protection-areas/block.d.ts
1052
+ type BlockOptions = Record<never, never>;
1053
+ declare const DEFAULT_BLOCK_OPTIONS: BlockOptions;
1054
+ /**
1055
+ * Generates a GeoJSON FeatureCollection for a "Block" tactical symbol (T-shape).
1056
+ *
1057
+ * @param coordinates - An array of GeoJSON Positions (Lon/Lat).
1058
+ * Expects exactly 3 points:
1059
+ * - PT1 & PT2: Endpoints of the vertical line.
1060
+ * - PT3: Defines the endpoint of the horizontal line (stem).
1061
+ * @param options - Configuration options.
1062
+ * @returns A GeoJSON FeatureCollection containing a LineString.
1063
+ */
1064
+ declare function createBlock(coordinates: Position[], _options?: BlockOptions): FeatureCollection<LineString>;
1065
+ //#endregion
1066
+ //#region src/generators/cm27-protection-areas/disrupt.d.ts
1067
+ interface DisruptOptions {
1068
+ middleArrowLengthRatio?: number;
1069
+ bottomArrowLengthRatio?: number;
1070
+ shaftLengthRatio?: number;
1071
+ arrowheadLengthRatio?: number;
1072
+ arrowheadWidthRatio?: number;
1073
+ }
1074
+ declare const DEFAULT_DISRUPT_OPTIONS: Required<DisruptOptions>;
1075
+ /**
1076
+ * Generates a GeoJSON FeatureCollection for a DISRUPT tactical symbol.
1077
+ *
1078
+ * Input:
1079
+ * - PT1: Top endpoint of the vertical spine
1080
+ * - PT2: Bottom endpoint of the vertical spine
1081
+ * - PT3: Reference point used to determine the longest-arrow offset
1082
+ *
1083
+ * Geometry:
1084
+ * - Spine: PT1 -> PT2
1085
+ * - PT2 -> PT1 defines the baseline orientation; arrow direction is constrained to its perpendicular axis
1086
+ * - PT3 is decomposed and projected onto the perpendicular axis through PT1 to derive a valid longest-arrow tip
1087
+ * - Three arrows placed at PT1, midpoint(PT1, PT2), and PT2
1088
+ * - Center shaft extends opposite arrow direction from midpoint with the same length as the middle arrow
1089
+ * - Top arrow is longest
1090
+ * - Middle and bottom arrows are proportional to the longest arrow
1091
+ * - Arrow heads are returned as filled triangle polygons
1092
+ */
1093
+ declare function createDisrupt(coordinates: Position[], options?: DisruptOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1094
+ //#endregion
1095
+ //#region src/generators/cm27-protection-areas/fix.d.ts
1096
+ interface FixOptions {
1097
+ arrowheadAngle?: number;
1098
+ arrowheadLengthRatio?: number;
1099
+ endSegmentRatio?: number;
1100
+ }
1101
+ declare const DEFAULT_FIX_OPTIONS: Required<FixOptions>;
1102
+ /**
1103
+ * Generates a GeoJSON FeatureCollection for a FIX tactical symbol.
1104
+ *
1105
+ * Input:
1106
+ * - PT1: Arrow tip end
1107
+ * - PT2: Opposite end
1108
+ *
1109
+ * Notes:
1110
+ * - Requires exactly two points.
1111
+ * - Produces one MultiLineString feature containing the zigzag body and open arrowhead wings.
1112
+ */
1113
+ declare function createFix(coordinates: Position[], options?: FixOptions): FeatureCollection<MultiLineString>;
1114
+ //#endregion
1115
+ //#region src/generators/cm27-protection-areas/turn.d.ts
1116
+ interface TurnOptions {
1117
+ arrowheadLengthRatio?: number;
1118
+ arrowheadWidthRatio?: number;
1119
+ arcSegments?: number;
1120
+ }
1121
+ declare const DEFAULT_TURN_OPTIONS: Required<TurnOptions>;
1122
+ /**
1123
+ * Generates a quarter-circle shaft from PT2 (rear) to the arrowhead base.
1124
+ * The arrowhead continues tangent to the arc and places its tip at PT1.
1125
+ * PT3 selects which side of the PT2 -> PT1 chord contains the arc.
1126
+ */
1127
+ declare function createTurn(coordinates: Position[], options?: TurnOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1128
+ //#endregion
1129
+ //#region src/generators/cm27-protection-areas/obstacleBypassEasy.d.ts
1130
+ interface ObstacleBypassEasyOptions {
1131
+ arrowheadLengthRatio?: number;
1132
+ arrowheadWidthRatio?: number;
1133
+ defaultLengthRatio?: number;
1134
+ }
1135
+ declare const DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS: Required<ObstacleBypassEasyOptions>;
1136
+ /**
1137
+ * Generates a GeoJSON FeatureCollection for an "Obstacle Bypass Easy" symbol.
1138
+ *
1139
+ * Input:
1140
+ * - PT1 and PT2 define the tips of the two arrowheads (opening and symbol height)
1141
+ * - PT3 defines signed symbol length along the perpendicular axis through midpoint(PT1, PT2)
1142
+ *
1143
+ * Geometry:
1144
+ * - Rear line is parallel to opening(PT1-PT2) and has equal length
1145
+ * - Two side rails run from rear endpoints to the arrowheads and are parallel to each other
1146
+ * - Rear line is perpendicular to both side rails
1147
+ * - Arrow heads are filled triangle polygons at PT1 and PT2
1148
+ */
1149
+ declare function createObstacleBypassEasy(coordinates: Position[], options?: ObstacleBypassEasyOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1150
+ //#endregion
1151
+ //#region src/generators/cm27-protection-areas/obstacleBypassDifficult.d.ts
1152
+ interface ObstacleBypassDifficultOptions {
1153
+ arrowheadLengthRatio?: number;
1154
+ arrowheadWidthRatio?: number;
1155
+ defaultLengthRatio?: number;
1156
+ zigzagAmplitudeRatio?: number;
1157
+ zigzagSpacingRatio?: number;
1158
+ }
1159
+ declare const DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS: Required<ObstacleBypassDifficultOptions>;
1160
+ declare function createObstacleBypassDifficult(coordinates: Position[], options?: ObstacleBypassDifficultOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1161
+ //#endregion
1162
+ //#region src/generators/cm27-protection-areas/obstacleBypassImpossible.d.ts
1163
+ interface ObstacleBypassImpossibleOptions {
1164
+ arrowheadLengthRatio?: number;
1165
+ arrowheadWidthRatio?: number;
1166
+ defaultLengthRatio?: number;
1167
+ rearBarLengthRatio?: number;
1168
+ rearGapRatio?: number;
1169
+ }
1170
+ declare const DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS: Required<ObstacleBypassImpossibleOptions>;
1171
+ /**
1172
+ * Generates a GeoJSON FeatureCollection for an "Obstacle Bypass Impossible" symbol.
1173
+ *
1174
+ * Input:
1175
+ * - PT1 and PT2 define the tips of the two arrowheads (opening and symbol height)
1176
+ * - PT3 defines signed symbol length along the perpendicular axis through midpoint(PT1, PT2)
1177
+ *
1178
+ * Geometry:
1179
+ * - Same base as obstacle bypass easy
1180
+ * - Rear line has two short perpendicular bars on the rear side
1181
+ */
1182
+ declare function createObstacleBypassImpossible(coordinates: Position[], options?: ObstacleBypassImpossibleOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1183
+ //#endregion
1184
+ //#region src/registry.d.ts
1185
+ /**
1186
+ * The single source of truth for the catalog: one **control measure
1187
+ * definition** record per measure, co-located with its generator and collected
1188
+ * here. The `ControlMeasureId` union, `OptionsByKind`, the generator dispatch,
1189
+ * the default options, and rule resolution are all *derived* from this map
1190
+ * rather than maintained as parallel tables. Adding a measure is a one-file
1191
+ * change plus one line here. See ADR-0013.
1192
+ */
1193
+ declare const DEFINITIONS: {
1194
+ boundary: ControlMeasureDefinition<"boundary", typeof createBoundary>;
1195
+ "battle-position": ControlMeasureDefinition<"battle-position", typeof createBattlePosition>;
1196
+ ambush: ControlMeasureDefinition<"ambush", (controlPoints: import("geojson").Position[], options?: AmbushOptions) => import("geojson").FeatureCollection<import("geojson").MultiLineString, Record<string, never>>>;
1197
+ "principal-direction-of-fire": ControlMeasureDefinition<"principal-direction-of-fire", typeof createPrincipalDirectionOfFire>;
1198
+ "final-protective-fire-left": ControlMeasureDefinition<"final-protective-fire-left", typeof createFinalProtectiveFireLeft>;
1199
+ "final-protective-fire-right": ControlMeasureDefinition<"final-protective-fire-right", typeof createFinalProtectiveFireRight>;
1200
+ "search-area": ControlMeasureDefinition<"search-area", (controlPoints: import("geojson").Position[], options?: TacticalArrowOptions) => import("geojson").FeatureCollection<import("geojson").MultiLineString | import("geojson").MultiPolygon, {
1201
+ part: "shaft" | "head";
1202
+ fill?: boolean;
1203
+ }>>;
1204
+ "main-attack": ControlMeasureDefinition<"main-attack", typeof createMainAttack>;
1205
+ "supporting-attack": ControlMeasureDefinition<"supporting-attack", typeof createSupportingAttack>;
1206
+ "classic-arrow": ControlMeasureDefinition<"classic-arrow", typeof createClassicArrow>;
1207
+ "block-arrow": ControlMeasureDefinition<"block-arrow", typeof createBlockArrow>;
1208
+ "airborne-attack": ControlMeasureDefinition<"airborne-attack", typeof createAirborneAttack>;
1209
+ "attack-helicopter": ControlMeasureDefinition<"attack-helicopter", typeof createAttackHelicopter>;
1210
+ "support-by-fire": ControlMeasureDefinition<"support-by-fire", typeof createSupportByFire>;
1211
+ "attack-by-fire": ControlMeasureDefinition<"attack-by-fire", typeof createAttackByFire>;
1212
+ flot: ControlMeasureDefinition<"flot", typeof createFLOT>;
1213
+ "block-mission-task": ControlMeasureDefinition<"block-mission-task", typeof createBlockMissionTaskSymbol>;
1214
+ breach: ControlMeasureDefinition<"breach", typeof createBreachSymbol>;
1215
+ bypass: ControlMeasureDefinition<"bypass", typeof createBypassSymbol>;
1216
+ canalize: ControlMeasureDefinition<"canalize", typeof createCanalizeSymbol>;
1217
+ clear: ControlMeasureDefinition<"clear", typeof createClearSymbol>;
1218
+ delay: ControlMeasureDefinition<"delay", typeof createDelaySymbol>;
1219
+ isolate: ControlMeasureDefinition<"isolate", typeof createIsolateSymbol>;
1220
+ "antitank-ditch-under-construction": ControlMeasureDefinition<"antitank-ditch-under-construction", typeof createAntitankDitchUnderConstruction>;
1221
+ "antitank-ditch-completed": ControlMeasureDefinition<"antitank-ditch-completed", typeof createAntitankDitchCompleted>;
1222
+ "antitank-wall": ControlMeasureDefinition<"antitank-wall", typeof createAntitankWall>;
1223
+ "fortified-line": ControlMeasureDefinition<"fortified-line", typeof createFortifiedLine>;
1224
+ "fortified-area": ControlMeasureDefinition<"fortified-area", typeof createFortifiedArea>;
1225
+ block: ControlMeasureDefinition<"block", typeof createBlock>;
1226
+ disrupt: ControlMeasureDefinition<"disrupt", typeof createDisrupt>;
1227
+ fix: ControlMeasureDefinition<"fix", typeof createFix>;
1228
+ turn: ControlMeasureDefinition<"turn", typeof createTurn>;
1229
+ "obstacle-bypass-easy": ControlMeasureDefinition<"obstacle-bypass-easy", typeof createObstacleBypassEasy>;
1230
+ "obstacle-bypass-difficult": ControlMeasureDefinition<"obstacle-bypass-difficult", typeof createObstacleBypassDifficult>;
1231
+ "obstacle-bypass-impossible": ControlMeasureDefinition<"obstacle-bypass-impossible", typeof createObstacleBypassImpossible>;
1232
+ };
1233
+ type Definitions = typeof DEFINITIONS;
1234
+ /** Stable string id of a control measure — the keys of {@link DEFINITIONS}. */
1235
+ type ControlMeasureId = keyof Definitions;
1236
+ /**
1237
+ * The discriminant for {@link ControlMeasure}. Identical to
1238
+ * {@link ControlMeasureId}; kept as a distinct name for the `<K extends
1239
+ * ControlMeasureKind>` generics threaded through rendering and edit sessions.
1240
+ */
1241
+ type ControlMeasureKind = ControlMeasureId;
1242
+ /** Strips the internal `validationMode` knob from a public options surface. */
1243
+ type PublicOptions<T> = Omit<T, "validationMode">;
1244
+ /**
1245
+ * The per-kind public options map, derived covariantly from each definition's
1246
+ * generator (see {@link OptsOf}). Empty-options kinds resolve to `{}` — exactly
1247
+ * as loose as the former hand-written table. See ADR-0013.
1248
+ */
1249
+ type OptionsByKind = { [K in keyof Definitions]: PublicOptions<OptsOf<Definitions[K]>> };
1250
+ /** Insertion-ordered list of every control-measure id. */
1251
+ declare const CONTROL_MEASURE_IDS: readonly ControlMeasureId[];
1252
+ declare const CONTROL_MEASURE_METADATA: Readonly<Record<ControlMeasureId, ControlMeasureMetadata>>;
1253
+ declare function listControlMeasureMetadata(): readonly ControlMeasureMetadata[];
1254
+ declare function getControlMeasureMetadata(id: ControlMeasureId): ControlMeasureMetadata;
1255
+ declare function getControlMeasureMetadataByValue(value: string): ControlMeasureMetadata | undefined;
1256
+ declare function getDefaultOptions<K extends ControlMeasureKind>(kind: K): OptionsByKind[K];
1257
+ //#endregion
1258
+ //#region src/style.d.ts
1259
+ /**
1260
+ * Framework-agnostic style hints attached to a `ControlMeasure`.
1261
+ *
1262
+ * Mirrors the per-feature subset of what map adapters render. The renderer
1263
+ * fans these into each emitted feature's `properties.style` ([[StyleHints]]).
1264
+ * Adapters merge them over their layer-level style; generator-emitted hints
1265
+ * on individual features win over both.
1266
+ */
1267
+ interface ControlMeasureStyle {
1268
+ /**
1269
+ * The single symbol color. Control measures are monocolor: one color paints
1270
+ * every part, stroked or filled. Input-only — resolved into concrete
1271
+ * `strokeColor` / `fillColor` per feature by the renderer and never emitted
1272
+ * on output. `strokeColor` / `fillColor` act as optional per-channel
1273
+ * overrides. See ADR-0011.
1274
+ */
1275
+ color?: string;
1276
+ strokeColor?: string;
1277
+ strokeWidth?: number;
1278
+ strokeDash?: number[];
1279
+ fillColor?: string;
1280
+ }
1281
+ //#endregion
1282
+ //#region src/instance.d.ts
1283
+ interface ControlMeasure<K extends ControlMeasureKind = ControlMeasureKind> {
1284
+ id: string;
1285
+ kind: K;
1286
+ controlPoints: Position[];
1287
+ options?: OptionsByKind[K];
1288
+ style?: ControlMeasureStyle;
1289
+ properties?: Record<string, unknown>;
1290
+ schemaVersion?: 1;
1291
+ }
1292
+ declare function isKind<K extends ControlMeasureKind>(cm: ControlMeasure, kind: K): cm is ControlMeasure<K>;
1293
+ /**
1294
+ * Deep-clone a `ControlMeasure` so held references survive mutations to the
1295
+ * original (and vice versa). Used by the session façade to build the
1296
+ * `measure` half of `ControlMeasureSnapshot`. Nested values inside
1297
+ * `options`, `style`, and `properties` are cloned too — `properties` is
1298
+ * `Record<string, unknown>` and may carry arbitrary host metadata, so a
1299
+ * shallow copy would leak shared references.
1300
+ *
1301
+ * Backed by `structuredClone`: only structured-cloneable values are
1302
+ * supported (no functions, DOM nodes, class instances). Absent optional
1303
+ * fields stay absent on the clone.
1304
+ */
1305
+ declare function cloneControlMeasure<K extends ControlMeasureKind>(cm: ControlMeasure<K>): ControlMeasure<K>;
1306
+ //#endregion
1307
+ //#region src/rendered.d.ts
1308
+ /**
1309
+ * Per-feature style hints carried on `properties.style`.
1310
+ *
1311
+ * These are *resolved*: `renderControlMeasure` cascades `graphicsStyle` →
1312
+ * `cm.style` → any generator pattern hint, then expands the monocolor `color`
1313
+ * into concrete `strokeColor` / `fillColor` per feature (see ADR-0011 and
1314
+ * `resolveSymbolColor`). Output therefore carries concrete colors, never the
1315
+ * input-only `color` key, and a `fillColor` only on parts the generator
1316
+ * marked filled.
1317
+ *
1318
+ * Generators contribute paint *role* and *pattern* (a part is filled; a
1319
+ * sub-line is dashed regardless of the user's stroke), never a hue. Adapters
1320
+ * merge the resulting `StyleHints` over their layer-level style at draw time.
1321
+ */
1322
+ interface StyleHints extends ControlMeasureStyle {}
1323
+ /**
1324
+ * Per-feature properties emitted by `renderControlMeasure`.
1325
+ *
1326
+ * Stable-id contract — every feature produced by the renderer has:
1327
+ * - `feature.id` of the form `${cmId}:${part}:${index}`
1328
+ * - `properties.part` matching the `part` segment of the id
1329
+ * - `properties.index` matching the `index` segment of the id
1330
+ *
1331
+ * Adapters rely on this contract to diff renders in place without keeping
1332
+ * their own bookkeeping. Use `controlMeasureIdFromFeature` to recover the
1333
+ * `cmId` from a picked feature.
1334
+ */
1335
+ interface FeaturePartProps {
1336
+ part: string;
1337
+ index: number;
1338
+ style?: StyleHints;
1339
+ /** Label text emitted by generators (e.g. breach "B"). */
1340
+ text?: string;
1341
+ /** Label rotation in radians, emitted by generators. */
1342
+ rotation?: number;
1343
+ /** Label size in CSS pixels at the draw/reference zoom. */
1344
+ textSizePixels?: number;
1345
+ /** Map zoom at which textSizePixels was captured. */
1346
+ textSizeZoom?: number;
1347
+ /** Map resolution at which textSizePixels was captured. */
1348
+ textSizeResolution?: number;
1349
+ }
1350
+ /**
1351
+ * Output of `renderControlMeasure`. A GeoJSON `FeatureCollection` whose
1352
+ * features satisfy the `FeaturePartProps` stable-id contract. See ADR-0010.
1353
+ */
1354
+ type ControlMeasureRender = FeatureCollection<Geometry, FeaturePartProps>;
1355
+ /**
1356
+ * A `ControlMeasure` paired with its `Render` at a single point in time.
1357
+ *
1358
+ * The unit delivered to `EditChangeEvent` listeners (as `measure` and
1359
+ * `previous`) and resolved from `TacticalDraw.draw()` / `.edit()`. The
1360
+ * `measure` half is a defensive clone (see `cloneControlMeasure`) so held
1361
+ * references remain valid after the originating session has closed.
1362
+ *
1363
+ * See ADR-0010.
1364
+ */
1365
+ interface ControlMeasureSnapshot<K extends ControlMeasureKind = ControlMeasureKind> {
1366
+ measure: ControlMeasure<K>;
1367
+ render: ControlMeasureRender;
1368
+ }
1369
+ /**
1370
+ * Recover the originating control measure id (`cmId`) from a feature emitted
1371
+ * by `renderControlMeasure`. The feature id must match the stable-id contract
1372
+ * `${cmId}:${part}:${index}`; otherwise this throws.
1373
+ */
1374
+ declare function controlMeasureIdFromFeature(feature: Feature<Geometry, FeaturePartProps> | {
1375
+ id?: string | number;
1376
+ }): string;
1377
+ //#endregion
1378
+ //#region src/renderControlMeasure.d.ts
1379
+ interface RenderOptions {
1380
+ validationMode?: ValidationMode;
1381
+ /**
1382
+ * Façade-level default style (third / lowest-priority layer). Merged
1383
+ * shallowly under `cm.style` and any per-feature generator hint. When
1384
+ * omitted, style resolution matches the prior two-layer behavior.
1385
+ */
1386
+ graphicsStyle?: ControlMeasureStyle;
1387
+ }
1388
+ /**
1389
+ * Pure render: `ControlMeasure` → `ControlMeasureRender` (a
1390
+ * `FeatureCollection` of `FeaturePartProps`-typed features). Per-feature
1391
+ * stable ids follow `${cm.id}:${part}:${index}`. Style is resolved from the
1392
+ * three layers (graphicsStyle, cm.style, generator hint) and stamped on
1393
+ * `properties.style` when non-empty.
1394
+ */
1395
+ declare function renderControlMeasure<K extends ControlMeasureKind>(cm: ControlMeasure<K>, opts?: RenderOptions): ControlMeasureRender;
1396
+ //#endregion
1397
+ //#region src/styleResolver.d.ts
1398
+ /**
1399
+ * Three-layer style precedence for `renderControlMeasure`.
1400
+ *
1401
+ * Lower-priority → higher-priority: `graphicsStyle` (façade default) →
1402
+ * `measureStyle` (`cm.style`) → `generatorStyle` (per-feature hint emitted
1403
+ * by a generator). Merge is shallow and per-property; higher-priority layers
1404
+ * win key by key. Explicit `null` / `undefined` in a higher-priority layer
1405
+ * is treated as "no opinion" and does not clear a lower-priority key.
1406
+ *
1407
+ * Returns `undefined` when all three layers are absent so the renderer can
1408
+ * omit `properties.style` entirely — keeps the no-style case byte-identical
1409
+ * to a property-less feature.
1410
+ *
1411
+ * Pure function: inputs are never mutated; the returned object is always a
1412
+ * fresh allocation when defined.
1413
+ */
1414
+ declare function resolveStyleHints(graphicsStyle: ControlMeasureStyle | undefined, measureStyle: ControlMeasureStyle | undefined, generatorStyle: StyleHints | undefined): StyleHints | undefined;
1415
+ //#endregion
1416
+ //#region src/toSimpleStyle.d.ts
1417
+ /**
1418
+ * simplestyle-spec properties (the subset this library can express), flat on
1419
+ * `properties`. All keys are optional.
1420
+ *
1421
+ * @see https://github.com/mapbox/simplestyle-spec
1422
+ */
1423
+ interface SimpleStyleProps extends FeaturePartProps {
1424
+ stroke?: string;
1425
+ "stroke-width"?: number;
1426
+ "stroke-opacity"?: number;
1427
+ fill?: string;
1428
+ "fill-opacity"?: number;
1429
+ }
1430
+ /**
1431
+ * A `FeatureCollection` whose features carry simplestyle-spec keys instead of
1432
+ * the nested `properties.style` slot. The `FeaturePartProps` stable-id
1433
+ * contract (`part`, `index`, `feature.id`) is preserved.
1434
+ */
1435
+ type SimpleStyleRender = FeatureCollection<Geometry, SimpleStyleProps>;
1436
+ /**
1437
+ * Lossy interop transform: `ControlMeasureRender` → a `FeatureCollection`
1438
+ * whose features carry simplestyle-spec keys. Operates on the already-resolved
1439
+ * per-feature `style`, so it composes after `renderControlMeasure`'s
1440
+ * three-layer merge and stays a pure post-processing step.
1441
+ *
1442
+ * Lossy mapping, by design:
1443
+ * - `strokeDash` has no simplestyle equivalent and is dropped — dashed
1444
+ * doctrinal sub-lines render solid in simplestyle consumers.
1445
+ * - colors must be hex or `rgb()/rgba()`; alpha becomes `*-opacity`. Other
1446
+ * color forms (named, `hsl()`) are omitted rather than guessed.
1447
+ */
1448
+ declare function toSimpleStyle(render: ControlMeasureRender): SimpleStyleRender;
1449
+ //#endregion
1450
+ //#region src/internal/graphics-utils.d.ts
1451
+ /**
1452
+ * Small value used to avoid division by zero and floating-point precision issues.
1453
+ */
1454
+ declare const EPSILON = 0.000001;
1455
+ /**
1456
+ * Rounds a number to a specified number of decimal places.
1457
+ */
1458
+ declare const roundToFixed: (v: number, precision?: number) => number;
1459
+ /**
1460
+ * Calculates the meters-per-pixel ratio at a given latitude and zoom level.
1461
+ *
1462
+ * This is essential for maintaining consistent visual sizes on the map
1463
+ * regardless of zoom level. The formula accounts for:
1464
+ * - The Web Mercator projection's tile-based structure
1465
+ * - The latitude-dependent scale distortion in Mercator projection
1466
+ *
1467
+ * @param latitude - The latitude in degrees (affects scale due to projection)
1468
+ * @param zoomLevel - The current map zoom level
1469
+ * @returns The number of meters represented by one pixel at the given location and zoom
1470
+ *
1471
+ * @example
1472
+ * ```typescript
1473
+ * // At zoom 10, latitude 45°
1474
+ * const mpp = getMetersPerPixel(45, 10);
1475
+ * // To get a 20-pixel radius in meters:
1476
+ * const radiusMeters = 20 * mpp;
1477
+ * ```
1478
+ */
1479
+ declare const getMetersPerPixel: (latitude: number, zoomLevel: number) => number;
1480
+ //#endregion
1481
+ //#region src/draw-rules/baseline-frame.d.ts
1482
+ type BaselineFrameOrigin = "p1" | "p2" | "midpoint";
1483
+ type BaselineFrameNormal = "right" | "left";
1484
+ interface BaselineFrameOptions {
1485
+ origin?: BaselineFrameOrigin;
1486
+ normal?: BaselineFrameNormal;
1487
+ }
1488
+ interface BaselineFrame {
1489
+ readonly p1: Point2D;
1490
+ readonly p2: Point2D;
1491
+ readonly origin: Point2D;
1492
+ readonly direction: Point2D;
1493
+ readonly normal: Point2D;
1494
+ readonly length: number;
1495
+ signedNormalDistance(point: Position): number;
1496
+ pointAtNormalDistance(distance: number): Position | null;
1497
+ }
1498
+ declare function createBaselineFrame(p1: Position, p2: Position, options?: BaselineFrameOptions): BaselineFrame | null;
1499
+ //#endregion
1500
+ //#region src/draw-rules/midpoint-perpendicular.d.ts
1501
+ interface MidpointPerpendicularDrawRuleOptions {
1502
+ id: string;
1503
+ defaultDistanceRatio?: number;
1504
+ /** User clicks required to commit. Defaults to `2` (the third point is auto-derived). */
1505
+ minimumUserPoints?: number;
1506
+ /** Raw points at which a live preview can be derived. See {@link ControlMeasureDrawRule}. */
1507
+ minimumPreviewPoints?: number;
1508
+ /**
1509
+ * Index of the slot whose point is constrained to the perpendicular axis
1510
+ * through the configured origin of the other two ("baseline") slots. Must be
1511
+ * `0` or `2`. Defaults to `2`.
1512
+ *
1513
+ * Area11 (Block) and Point12 (obstacle-bypass) use `2`: P1/P2 are the free
1514
+ * baseline endpoints and P3 is constrained. Area7 (Attack-By-Fire) uses `0`:
1515
+ * P1 is the constrained arrowhead tip and P2/P3 are the free back-line
1516
+ * endpoints.
1517
+ */
1518
+ constrainedIndex?: 0 | 2;
1519
+ /** Frame origin for the perpendicular axis. Defaults to `"midpoint"`. */
1520
+ origin?: BaselineFrameOrigin;
1521
+ /** Side the positive normal points to. Defaults to `"right"`. */
1522
+ normal?: BaselineFrameNormal;
1523
+ }
1524
+ declare function createMidpointPerpendicularDrawRule(options: MidpointPerpendicularDrawRuleOptions): ControlMeasureDrawRule;
1525
+ declare function computeDefaultMidpointPerpendicularPoint(p1: Position, p2: Position, distanceRatio?: number): Position | null;
1526
+ declare function getMidpointPerpendicularSignedDistance(p1: Position, p2: Position, controlPoint: Position): number | null;
1527
+ declare function pointOnMidpointPerpendicularAxis(p1: Position, p2: Position, distance: number | null): Position | null;
1528
+ declare function snapToMidpointPerpendicular(p1: Position, p2: Position, controlPoint: Position): Position | null;
1529
+ //#endregion
1530
+ //#region src/draw-rules/area11.d.ts
1531
+ declare const blockDrawRule: ControlMeasureDrawRule;
1532
+ //#endregion
1533
+ //#region src/draw-rules/area12.d.ts
1534
+ /**
1535
+ * Area12 anchor draw rule for Disrupt.
1536
+ *
1537
+ * P1/P2 are the free spine endpoints. P3 is the longest-arrow tip, constrained
1538
+ * to the perpendicular axis through P1 (not the baseline midpoint).
1539
+ */
1540
+ declare const disruptDrawRule: ControlMeasureDrawRule;
1541
+ //#endregion
1542
+ //#region src/draw-rules/point12.d.ts
1543
+ /**
1544
+ * Point12 anchor draw rule for the obstacle-bypass family.
1545
+ *
1546
+ * Shared by `obstacle-bypass-easy`, `obstacle-bypass-difficult`, and
1547
+ * `obstacle-bypass-impossible`: P1/P2 are the arrowhead tips and define the
1548
+ * opening; P3 is constrained to the perpendicular axis through
1549
+ * `midpoint(P1, P2)` and defines the rear of the symbol. Rear-line decoration
1550
+ * (plain, zigzag, barrier marks) is a generator concern, not a draw-rule one.
1551
+ */
1552
+ declare const point12DrawRule: ControlMeasureDrawRule;
1553
+ //#endregion
1554
+ //#region src/draw-rules/area7.d.ts
1555
+ /**
1556
+ * Area7 anchor draw rule for Attack By Fire.
1557
+ *
1558
+ * P2/P3 are the free back-line endpoints; P1 (slot index 0) is the arrowhead
1559
+ * tip, constrained to the perpendicular axis through `midpoint(P2, P3)`.
1560
+ */
1561
+ declare const attackByFireDrawRule: ControlMeasureDrawRule;
1562
+ //#endregion
1563
+ //#region src/draw-rules/line29.d.ts
1564
+ /**
1565
+ * Line29 anchor draw rule for Ambush.
1566
+ *
1567
+ * P2/P3 are the free back-line endpoints; P1 (slot index 0) is the arrowhead
1568
+ * tip, constrained to the perpendicular axis through `midpoint(P2, P3)`.
1569
+ */
1570
+ declare const ambushDrawRule: ControlMeasureDrawRule;
1571
+ //#endregion
1572
+ //#region src/draw-rules/line1.d.ts
1573
+ declare const line1DrawRule: ControlMeasureDrawRule;
1574
+ //#endregion
1575
+ //#region src/draw-rules/line10.d.ts
1576
+ /**
1577
+ * Line10 — PT1 is the arrow tip, PT2 is the rear, and derived PT3 selects
1578
+ * which side of the PT2 -> PT1 chord contains the 90-degree arc.
1579
+ */
1580
+ declare const turnDrawRule: ControlMeasureDrawRule;
1581
+ //#endregion
1582
+ //#region src/draw-rules/line23.d.ts
1583
+ /**
1584
+ * Line23 anchor draw rule for the Clear mission task.
1585
+ *
1586
+ * P1/P2 are the endpoints of the symbol's vertical line (its height); P3 is
1587
+ * constrained to the perpendicular axis through `midpoint(P1, P2)` and defines
1588
+ * the rear of the symbol (the shaft length). Geometrically identical to the
1589
+ * obstacle-bypass `Point12` rule, but kept as its own spec id to match the
1590
+ * doctrinal draw rule for Clear.
1591
+ */
1592
+ declare const line23DrawRule: ControlMeasureDrawRule;
1593
+ //#endregion
1594
+ //#region src/draw-rules/line24.d.ts
1595
+ /**
1596
+ * Line24 anchor draw rule for the Delay mission task.
1597
+ *
1598
+ * PT. 1 and PT. 2 are the free straight-line endpoints. PT. 3 is constrained to
1599
+ * the perpendicular axis through PT. 2, where its signed distance from PT. 2
1600
+ * defines the semicircular arc diameter and side. Unlike the sibling Line23
1601
+ * (Clear) rule, the third point must be placed explicitly (three user clicks),
1602
+ * with a two-point live preview before commit.
1603
+ */
1604
+ declare const line24DrawRule: ControlMeasureDrawRule;
1605
+ //#endregion
1606
+ //#region src/draw-rules/area8.d.ts
1607
+ declare const supportByFireDrawRule: ControlMeasureDrawRule;
1608
+ //#endregion
1609
+ //#region src/draw-rules/axis1.d.ts
1610
+ declare const axis1DrawRule: ControlMeasureDrawRule;
1611
+ //#endregion
1612
+ //#region src/generators/cm14-maneuver-lines/ambush.d.ts
1613
+ /**
1614
+ * Configuration options for the Ambush tactical symbol.
1615
+ */
1616
+ interface AmbushOptions {
1617
+ /** Number of segments used to draw the quadratic curve (default: 30) */
1618
+ resolution?: number;
1619
+ /** Size of arrowhead relative to chord span (default: 0.15) */
1620
+ arrowheadLengthRatio?: number;
1621
+ /** Width of arrowhead wings relative to its length (default: 0.5) */
1622
+ arrowheadWidthRatio?: number;
1623
+ /** Length of parallel hatches relative to chord span (default: 0.15) */
1624
+ hatchLengthRatio?: number;
1625
+ /** Number of parallel hatches along the curve (default: 5) */
1626
+ hatchCount?: number;
1627
+ /** Depth of the curve toward PT 1 relative to chord span (default: 0.25) */
1628
+ curveDepthRatio?: number;
1629
+ }
1630
+ declare const DEFAULT_AMBUSH_OPTIONS: Required<AmbushOptions>;
1631
+ //#endregion
1632
+ //#region src/generators/cm15-maneuver-areas/searchArea.d.ts
1633
+ /**
1634
+ * Configuration options to tweak the tactical arrow's geometry.
1635
+ */
1636
+ interface TacticalArrowOptions {
1637
+ /** Ratio of arrowhead length to total leg length (default: 0.12) */
1638
+ arrowheadLengthRatio?: number;
1639
+ /** Width multiplier for the arrowhead wings (default: 0.5) */
1640
+ arrowheadWidthRatio?: number;
1641
+ /** Percentage along the leg where the zigzag begins, 0.0-1.0 (default: 0.55) */
1642
+ zigzagStart?: number;
1643
+ /** Percentage along the leg where the zigzag returns, 0.0-1.0 (default: 0.45) */
1644
+ zigzagEnd?: number;
1645
+ /** Perpendicular offset for the lightning "kink", relative to leg length (default: 0.07) */
1646
+ zigzagAmplitudeRatio?: number;
1647
+ }
1648
+ /**
1649
+ * Default options for the tactical arrow.
1650
+ */
1651
+ declare const DEFAULT_TACTICAL_ARROW_OPTIONS: Required<TacticalArrowOptions>;
1652
+ //#endregion
1653
+ export { listControlMeasureMetadata as $, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS as $t, SimpleStyleProps as A, BreachOptions as At, controlMeasureIdFromFeature as B, AttackHelicopterOptions as Bt, BaselineFrameNormal as C, DelayOptions as Ct, EPSILON as D, DEFAULT_CANALIZE_OPTIONS as Dt, createBaselineFrame as E, CanalizeOptions as Et, renderControlMeasure as F, FLOTOptions as Ft, CONTROL_MEASURE_IDS as G, SupportingAttackOptions as Gt, cloneControlMeasure as H, AirborneAttackOptions as Ht, ControlMeasureRender as I, AttackByFireOptions as It, ControlMeasureKind as J, calculateMetrics as Jt, CONTROL_MEASURE_METADATA as K, DEFAULT_MAIN_ATTACK_OPTIONS as Kt, ControlMeasureSnapshot as L, DEFAULT_ATTACK_BY_FIRE_OPTIONS as Lt, toSimpleStyle as M, BlockMissionTaskOptions as Mt, resolveStyleHints as N, DEFAULT_BLOCK_MISSION_TASK_OPTIONS as Nt, getMetersPerPixel as O, BypassOptions as Ot, RenderOptions as P, DEFAULT_FLOT_OPTIONS as Pt, getDefaultOptions as Q, unproject as Qt, FeaturePartProps as R, DEFAULT_SUPPORT_BY_FIRE_OPTIONS as Rt, BaselineFrame as S, DEFAULT_DELAY_OPTIONS as St, BaselineFrameOrigin as T, DEFAULT_CLEAR_OPTIONS as Tt, isKind as U, DEFAULT_AIRBORNE_ATTACK_OPTIONS as Ut, ControlMeasure as V, DEFAULT_ATTACK_HELICOPTER_OPTIONS as Vt, ControlMeasureStyle as W, DEFAULT_SUPPORTING_ATTACK_OPTIONS as Wt, getControlMeasureMetadata as X, Point2D as Xt, OptionsByKind as Y, computeInitialWidthPoint as Yt, getControlMeasureMetadataByValue as Z, project as Zt, computeDefaultMidpointPerpendicularPoint as _, FortifiedLineOptions as _t, axis1DrawRule as a, ControlMeasureMetadata as an, ObstacleBypassEasyOptions as at, pointOnMidpointPerpendicularAxis as b, AntitankDitchOptions as bt, line23DrawRule as c, ControlMeasureDrawRule as cn, DEFAULT_FIX_OPTIONS as ct, ambushDrawRule as d, DisruptOptions as dt, FinalProtectiveFireOptions as en, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS as et, attackByFireDrawRule as f, BlockOptions as ft, MidpointPerpendicularDrawRuleOptions as g, DEFAULT_FORTIFIED_LINE_OPTIONS as gt, blockDrawRule as h, FortifiedAreaOptions as ht, DEFAULT_AMBUSH_OPTIONS as i, ControlMeasureGeometryType as in, DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS as it, SimpleStyleRender as j, DEFAULT_BREACH_OPTIONS as jt, roundToFixed as k, DEFAULT_BYPASS_OPTIONS as kt, turnDrawRule as l, FixOptions as lt, disruptDrawRule as m, DEFAULT_FORTIFIED_AREA_OPTIONS as mt, TacticalArrowOptions as n, PrincipalDirectionOfFireOptions as nn, DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS as nt, supportByFireDrawRule as o, ParamDescriptor as on, DEFAULT_TURN_OPTIONS as ot, point12DrawRule as p, DEFAULT_BLOCK_OPTIONS as pt, ControlMeasureId as q, MainAttackOptions as qt, AmbushOptions as r, ControlMeasureGeometry as rn, ObstacleBypassDifficultOptions as rt, line24DrawRule as s, AnchorTransformEvent as sn, TurnOptions as st, DEFAULT_TACTICAL_ARROW_OPTIONS as t, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS as tn, ObstacleBypassImpossibleOptions as tt, line1DrawRule as u, DEFAULT_DISRUPT_OPTIONS as ut, createMidpointPerpendicularDrawRule as v, AntitankWallOptions as vt, BaselineFrameOptions as w, ClearOptions as wt, snapToMidpointPerpendicular as x, DEFAULT_ANTITANK_DITCH_OPTIONS as xt, getMidpointPerpendicularSignedDistance as y, DEFAULT_ANTITANK_WALL_OPTIONS as yt, StyleHints as z, SupportByFireOptions as zt };