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

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,1713 @@
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/cm15-maneuver-areas/strongPoint.d.ts
343
+ /** Configuration options for the Strong Point control measure. */
344
+ type StrongPointOptions = BattlePositionOptions;
345
+ /** Default options for the Strong Point control measure. */
346
+ declare const DEFAULT_STRONG_POINT_OPTIONS: StrongPointOptions;
347
+ /**
348
+ * Creates a Strong Point control measure: a Battle Position boundary/echelon
349
+ * with outward tics whose length and spacing are the Field B echelon height.
350
+ * Shares the perimeter and echelon placement with Battle Position via the
351
+ * `area-echelon` primitive (single source of truth for ring and gap).
352
+ *
353
+ * @param positions - Area anchor points (>=3); the input contract is enforced
354
+ * at the render seam (ADR-0014).
355
+ * @param options - {@link StrongPointOptions}.
356
+ */
357
+ declare function createStrongPoint(positions: Position[], options?: StrongPointOptions): FeatureCollection<MultiLineString | MultiPolygon>;
358
+ //#endregion
359
+ //#region src/generators/cm14-maneuver-lines/principalDirectionOfFire.d.ts
360
+ /**
361
+ * Configuration options for the Principal Direction of Fire tactical symbol.
362
+ */
363
+ interface PrincipalDirectionOfFireOptions {
364
+ /** Arrowhead length relative to each arm's own length (default: 0.07) */
365
+ arrowheadLengthRatio?: number;
366
+ /** Arrowhead wing spread relative to the arrowhead length (default: 0.67) */
367
+ arrowheadWidthRatio?: number;
368
+ }
369
+ declare const DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS: Required<PrincipalDirectionOfFireOptions>;
370
+ /**
371
+ * Generates a GeoJSON FeatureCollection for a PRINCIPAL DIRECTION OF FIRE
372
+ * tactical symbol: a "V" of arms from the vertex out to the (independent) tips,
373
+ * each ending in an open arrowhead.
374
+ *
375
+ * Renders one arm per tip, so two points (vertex + one tip) draws the single
376
+ * arm being placed — the live feedback after PT 1 — and three points draws the
377
+ * full V. Points beyond the third are ignored (input contract, ADR-0014).
378
+ *
379
+ * @param coordinates - [PT 1 (vertex), PT 2 (tip), PT 3 (tip)]
380
+ * @param options - Arrowhead sizing parameters
381
+ */
382
+ declare function createPrincipalDirectionOfFire(coordinates: Position[], options?: PrincipalDirectionOfFireOptions): FeatureCollection<MultiLineString, Record<string, never>>;
383
+ //#endregion
384
+ //#region src/generators/cm14-maneuver-lines/finalProtectiveFire.d.ts
385
+ /**
386
+ * Configuration options for the Final Protective Fire tactical symbols.
387
+ *
388
+ * Identical to Principal Direction of Fire (arrowhead sizing), plus a filled
389
+ * "blade" running along the inside of one arm.
390
+ */
391
+ interface FinalProtectiveFireOptions {
392
+ /** Arrowhead length relative to each arm's own length (default: 0.07) */
393
+ arrowheadLengthRatio?: number;
394
+ /** Arrowhead wing spread relative to the arrowhead length (default: 0.67) */
395
+ arrowheadWidthRatio?: number;
396
+ /**
397
+ * Blade height (its perpendicular reach into the inside of the V) relative
398
+ * to the bladed arm's own length (default: 0.03).
399
+ */
400
+ bladeHeight?: number;
401
+ }
402
+ declare const DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS: Required<FinalProtectiveFireOptions>;
403
+ type FpfProps = {
404
+ part?: string;
405
+ fill?: true;
406
+ };
407
+ declare function createFinalProtectiveFireLeft(coordinates: Position[], options?: FinalProtectiveFireOptions): FeatureCollection<MultiLineString | Polygon, FpfProps>;
408
+ declare function createFinalProtectiveFireRight(coordinates: Position[], options?: FinalProtectiveFireOptions): FeatureCollection<MultiLineString | Polygon, FpfProps>;
409
+ //#endregion
410
+ //#region src/generators/cm15-maneuver-areas/encirclement.d.ts
411
+ /** Configuration options for the Encirclement control measure. */
412
+ interface EncirclementOptions {
413
+ /**
414
+ * Spacing between adjacent barbs as a ratio of the symbol's mean radius;
415
+ * smaller values pack the barbs more densely. The barbs are then distributed
416
+ * evenly so they close the ring exactly.
417
+ * @default 0.4
418
+ */
419
+ barbSpacingRatio?: number;
420
+ /**
421
+ * Barb length (height/amplitude) as a ratio of the symbol's mean radius.
422
+ * @default 0.16
423
+ */
424
+ barbLengthRatio?: number;
425
+ /**
426
+ * Round the boundary by curving it through the control points (closed
427
+ * centripetal Catmull-Rom) before tracing the barbs.
428
+ * @default true
429
+ */
430
+ smooth?: boolean;
431
+ /**
432
+ * Number of samples per segment when `smooth` is enabled.
433
+ * @default 16
434
+ */
435
+ smoothResolution?: number;
436
+ }
437
+ /** Default options for the Encirclement control measure. */
438
+ declare const DEFAULT_ENCIRCLEMENT_OPTIONS: Required<EncirclementOptions>;
439
+ /**
440
+ * Creates an Encirclement tactical graphic: a complete smooth boundary ring
441
+ * with outward arrowhead barbs resting on it. The boundary is an unfilled
442
+ * Polygon; the barbs are open "V" strokes (a MultiLineString) whose base is the
443
+ * boundary arc itself.
444
+ *
445
+ * @param positions - Area anchor points (>=3); the input contract is enforced
446
+ * at the render seam (ADR-0014).
447
+ * @param options - {@link EncirclementOptions}.
448
+ */
449
+ declare function createEncirclement(positions: Position[], options?: EncirclementOptions): FeatureCollection<Polygon | MultiLineString>;
450
+ //#endregion
451
+ //#region src/projection.d.ts
452
+ type Point2D = [number, number];
453
+ /**
454
+ * Project WGS84 (Lon/Lat) to Web Mercator (Meters).
455
+ */
456
+ declare const project: (lon: number, lat: number) => Point2D;
457
+ /**
458
+ * Unproject Web Mercator (Meters) back to WGS84 (Lon/Lat).
459
+ */
460
+ declare const unproject: (x: number, y: number) => Position;
461
+ //#endregion
462
+ //#region src/attack-utils.d.ts
463
+ interface AttackOptions {
464
+ shaftWidthRatio?: number;
465
+ roundedBends?: boolean;
466
+ bendSegments?: number;
467
+ }
468
+ /**
469
+ * Calculates the relative metrics (longitudinal and lateral) of the width point
470
+ * relative to the Tip-Neck axis.
471
+ *
472
+ * @param pts - Array of positions [Tip, Neck, ..., WidthPoint]
473
+ * @returns { longitudinal: number, lateral: number } | null
474
+ */
475
+ declare function calculateMetrics(pts: Position[]): {
476
+ longitudinal: number;
477
+ lateral: number;
478
+ } | null;
479
+ /**
480
+ * Computes an initial Width Point based on the Tip and Neck positions.
481
+ * It places the point perpendicular to the neck at a default distance relative to the length.
482
+ *
483
+ * @param tip - Tip position (Lon/Lat)
484
+ * @param neck - Neck position (Lon/Lat)
485
+ * @returns Width Point position (Lon/Lat)
486
+ */
487
+ declare function computeInitialWidthPoint(tip: Position, neck: Position): Position;
488
+ //#endregion
489
+ //#region src/generators/cm15-maneuver-areas/mainAttack.d.ts
490
+ declare const DEFAULT_MAIN_ATTACK_OPTIONS: Required<AttackOptions>;
491
+ type MainAttackOptions = AttackOptions;
492
+ /**
493
+ * Generates a GeoJSON FeatureCollection for a Main Attack tactical symbol.
494
+ *
495
+ * The symbol consists of a single MultiLineString feature containing:
496
+ * 1. **Arrowhead**: A line forming a "chevron" or "roof" shape.
497
+ * 2. **Shaft**: Two parallel lines behind the arrow.
498
+ *
499
+ * The shaft is calculated to terminate exactly where it touches the inner walls
500
+ * of the arrowhead, creating a seamless connection.
501
+ *
502
+ * @param coordinates - An array of GeoJSON Positions (Lon/Lat).
503
+ * Minimum 3 points required.
504
+ * **Order matters:** * - Index 0: **Tip** (The sharp point of the arrow)
505
+ * - Index 1 to N-2: **Spine** (The path the shaft follows)
506
+ * - Index N-1: **Width Control** (Determines the width of the arrowhead)
507
+ * @param options - Configuration for ratios and properties.
508
+ * @returns A GeoJSON FeatureCollection containing a single MultiLineString.
509
+ */
510
+ declare function createMainAttack(coordinates: Position[], options?: MainAttackOptions): FeatureCollection<MultiLineString>;
511
+ //#endregion
512
+ //#region src/generators/cm15-maneuver-areas/supportingAttack.d.ts
513
+ type SupportingAttackOptions = AttackOptions;
514
+ declare const DEFAULT_SUPPORTING_ATTACK_OPTIONS: Required<SupportingAttackOptions>;
515
+ /**
516
+ * Generates a GeoJSON FeatureCollection for a Supporting Attack tactical symbol.
517
+ *
518
+ * The symbol differs from Main Attack in that it is a single LineString
519
+ * outlining the arrow shape, rather than a filled Polygon header + Shaft lines.
520
+ *
521
+ * @param coordinates - An array of GeoJSON Positions.
522
+ * @param options - Configuration options.
523
+ * @returns A GeoJSON FeatureCollection<LineString>.
524
+ */
525
+ declare function createSupportingAttack(coordinates: Position[], options?: SupportingAttackOptions): FeatureCollection<LineString>;
526
+ //#endregion
527
+ //#region src/generators/cm99-generic-arrows/classicArrow.d.ts
528
+ /**
529
+ * A plain, clean arrow for illustrations — not a doctrinal symbol. The shaft is
530
+ * a straight polyline through the drawn control points (Line1 contract) and the
531
+ * tip carries a solid triangular arrowhead. No wobble, no curve: the canonical
532
+ * "draw an arrow" graphic.
533
+ */
534
+ /**
535
+ * Arrowhead silhouette:
536
+ * - `triangle` — solid triangle with a flat back (the default).
537
+ * - `barbed` — swept-back barbs with a forward notch (classic arrowhead).
538
+ * - `concave` — a sharper barbed head with a deep forward notch.
539
+ * - `diamond` — a rhombus, widest at its middle.
540
+ * - `harpoon` — an asymmetric single-sided barb.
541
+ * - `swallowtail` — barbs that sweep back into two trailing tails.
542
+ * - `chevron` — a thick hollow "V".
543
+ * - `circle` — a round dot terminator.
544
+ * - `tee` — a flat crossbar terminator (no point).
545
+ * - `open` — an unfilled "V", drawn as two strokes meeting at the tip.
546
+ */
547
+ type ClassicArrowHeadStyle = "triangle" | "barbed" | "concave" | "diamond" | "harpoon" | "swallowtail" | "chevron" | "circle" | "tee" | "open";
548
+ interface ClassicArrowOptions {
549
+ /** Arrowhead silhouette. */
550
+ arrowheadStyle?: ClassicArrowHeadStyle;
551
+ /** Round the shaft's corners by curving it through the control points. */
552
+ smooth?: boolean;
553
+ /** Number of samples per segment when smooth mode is enabled. */
554
+ smoothResolution?: number;
555
+ /** Arrowhead length as a fraction of the total path length. */
556
+ arrowheadLengthRatio?: number;
557
+ /** Arrowhead base width as a fraction of the total path length. */
558
+ arrowheadWidthRatio?: number;
559
+ }
560
+ /**
561
+ * Generates a GeoJSON FeatureCollection for the Classic Arrow: a shaft
562
+ * LineString (trimmed so it doesn't poke through the head) plus a head feature
563
+ * whose silhouette follows `arrowheadStyle` — a filled Polygon for the solid heads,
564
+ * or an open "V" LineString for `open`.
565
+ */
566
+ declare function createClassicArrow(coordinates: Position[], options?: ClassicArrowOptions): FeatureCollection<LineString | Polygon, {
567
+ part: "shaft" | "head";
568
+ fill?: boolean;
569
+ }>;
570
+ //#endregion
571
+ //#region src/generators/cm99-generic-arrows/blockArrow.d.ts
572
+ /**
573
+ * A solid "block" arrow for illustrations — not a doctrinal symbol. The whole
574
+ * arrow is one filled polygon: a shaft band of controllable width that runs
575
+ * through the drawn Axis1 spine and flares into a wider triangular head at the
576
+ * tip. Axis1 control points are ordered `[tip, neck, ...spine, width]`.
577
+ */
578
+ /**
579
+ * Arrowhead silhouette (all carved from the one filled body):
580
+ * - `triangle` — a flat-backed triangular head (the default).
581
+ * - `barbed` — swept-back barbs with the shaft entering at a forward notch.
582
+ * - `concave` — a sharper barbed head with a deeper notch.
583
+ * - `diamond` — a kite that flares to its widest mid-head.
584
+ * - `harpoon` — an asymmetric single-sided barb.
585
+ * - `swallowtail` — barbs that sweep back into two trailing tails.
586
+ * - `tee` — a flat crossbar terminator (no point).
587
+ */
588
+ type BlockArrowHeadStyle = "triangle" | "barbed" | "concave" | "diamond" | "harpoon" | "swallowtail" | "tee";
589
+ interface BlockArrowOptions {
590
+ /** Shaft band width as a fraction of the total path length. */
591
+ shaftWidth?: number;
592
+ /** Arrowhead silhouette. */
593
+ arrowheadStyle?: BlockArrowHeadStyle;
594
+ /** Arrowhead base width as a fraction of the total path length. */
595
+ arrowheadWidthRatio?: number;
596
+ /** Arrowhead length as a fraction of the total path length. */
597
+ arrowheadLengthRatio?: number;
598
+ /** Round the shaft's corners by curving it through the control points. */
599
+ smooth?: boolean;
600
+ /** Number of samples per segment when smooth mode is enabled. */
601
+ smoothResolution?: number;
602
+ /** Fill the body solid; when false the arrow is drawn as an outline only. */
603
+ filled?: boolean;
604
+ }
605
+ /**
606
+ * Generates a GeoJSON FeatureCollection for the Block Arrow: a single filled
607
+ * Polygon whose outline runs up the left side of the shaft, around the head
608
+ * (whose silhouette follows `arrowheadStyle`) to the tip and back, then down the
609
+ * right side of the shaft.
610
+ */
611
+ declare function createBlockArrow(coordinates: Position[], options?: BlockArrowOptions): FeatureCollection<Polygon, {
612
+ part: "body";
613
+ fill: boolean;
614
+ }>;
615
+ //#endregion
616
+ //#region src/generators/cm15-maneuver-areas/airborneAttack.d.ts
617
+ type AirborneAttackOptions = AttackOptions;
618
+ declare const DEFAULT_AIRBORNE_ATTACK_OPTIONS: Required<AirborneAttackOptions>;
619
+ /**
620
+ * Generates a GeoJSON FeatureCollection for an Airborne Attack tactical symbol.
621
+ *
622
+ * The symbol is similar to Supporting Attack but features a crossover point
623
+ * between the shaft and the head (Points 1 and 2/Neck).
624
+ *
625
+ * @param coordinates - An array of GeoJSON Positions.
626
+ * @param options - Configuration options.
627
+ * @returns A GeoJSON FeatureCollection<LineString>.
628
+ */
629
+ declare function createAirborneAttack(coordinates: Position[], options?: AirborneAttackOptions): FeatureCollection<LineString>;
630
+ //#endregion
631
+ //#region src/generators/cm15-maneuver-areas/attackHelicopter.d.ts
632
+ interface AttackHelicopterOptions extends AttackOptions {
633
+ symbolHeightRatio?: number;
634
+ triangleSizeRatio?: number;
635
+ bottomBarWidthRatio?: number;
636
+ bowtieWidthRatio?: number;
637
+ }
638
+ declare const DEFAULT_ATTACK_HELICOPTER_OPTIONS: Required<AttackHelicopterOptions>;
639
+ /**
640
+ * Generates a GeoJSON FeatureCollection for an Attack Helicopter tactical symbol.
641
+ *
642
+ * The symbol is based on the Airborne Attack (bow tie) geometry but features
643
+ * an additional symbol (vertical line + triangle) at the crossover point.
644
+ *
645
+ * @param coordinates - An array of GeoJSON Positions.
646
+ * @param options - Configuration options.
647
+ * @returns A GeoJSON FeatureCollection containing the main graphic and the symbol.
648
+ */
649
+ declare function createAttackHelicopter(coordinates: Position[], options?: AttackHelicopterOptions): FeatureCollection<LineString | Polygon>;
650
+ //#endregion
651
+ //#region src/generators/cm15-maneuver-areas/supportByFire.d.ts
652
+ interface SupportByFireOptions {
653
+ arrowheadWidthRatio?: number;
654
+ backLineLengthRatio?: number;
655
+ backLineAngle?: number;
656
+ }
657
+ declare const DEFAULT_SUPPORT_BY_FIRE_OPTIONS: Required<SupportByFireOptions>;
658
+ /**
659
+ * Generates a GeoJSON FeatureCollection for a Support By Fire tactical graphic.
660
+ *
661
+ * Input:
662
+ * - PT1: Left Base
663
+ * - PT2: Right Base
664
+ * - PT3: Left Tip
665
+ * - PT4: Right Tip
666
+ */
667
+ declare function createSupportByFire(coordinates: Position[], options?: SupportByFireOptions): FeatureCollection<LineString>;
668
+ //#endregion
669
+ //#region src/generators/cm15-maneuver-areas/attackByFire.d.ts
670
+ interface AttackByFireOptions {
671
+ arrowheadWidthRatio?: number;
672
+ backLineLengthRatio?: number;
673
+ backLineAngle?: number;
674
+ }
675
+ declare const DEFAULT_ATTACK_BY_FIRE_OPTIONS: Required<AttackByFireOptions>;
676
+ /**
677
+ * Generates a GeoJSON FeatureCollection for an Attack By Fire tactical graphic.
678
+ *
679
+ * Input:
680
+ * - PT1: Arrow Tip (Target)
681
+ * - PT2: Left Base
682
+ * - PT3: Right Base
683
+ *
684
+ * Logic:
685
+ * - Shaft: Midpoint(PT2, PT3) -> PT1
686
+ * - Base Line: PT2 -> PT3
687
+ * - Wings: Splayed out from PT2 and PT3
688
+ */
689
+ declare function createAttackByFire(coordinates: Position[], options?: AttackByFireOptions): FeatureCollection<LineString>;
690
+ //#endregion
691
+ //#region src/generators/cm14-maneuver-lines/flot.d.ts
692
+ /**
693
+ * Configuration options for the FLOT (Forward Line of Own Troops) geometry.
694
+ */
695
+ interface FLOTOptions {
696
+ /**
697
+ * The radius of the semicircular arcs in meters.
698
+ * Semicircles are placed tangent to each other (diameter = 2 * radius).
699
+ * This is ignored if radiusPixels is provided along with metersPerPixel.
700
+ * @default 50
701
+ */
702
+ radius?: number;
703
+ /**
704
+ * The radius of the semi-circular arcs in pixels.
705
+ * When provided along with metersPerPixel, the actual meter radius is calculated
706
+ * dynamically to maintain consistent visual size on screen.
707
+ * Takes precedence over radius when metersPerPixel is also provided.
708
+ * @default 10
709
+ */
710
+ radiusPixels?: number;
711
+ /**
712
+ * The meters-per-pixel ratio at the current zoom level and latitude.
713
+ * Required when using radiusPixels for zoom-aware sizing.
714
+ * Can be obtained from the map view's resolution or calculated using getMetersPerPixel().
715
+ */
716
+ metersPerPixel?: number;
717
+ /**
718
+ * The number of points used to render each individual semi-circle.
719
+ * Higher values create smoother arcs.
720
+ * @default 16
721
+ */
722
+ resolution?: number;
723
+ }
724
+ /**
725
+ * Default options for the FLOT graphic.
726
+ */
727
+ declare const DEFAULT_FLOT_OPTIONS: Required<Omit<FLOTOptions, "metersPerPixel">>;
728
+ /**
729
+ * Creates a FLOT (Forward Line of Own Troops) tactical graphic.
730
+ *
731
+ * Generates a scalloped/arc line representing the forward edge of friendly forces.
732
+ * The line consists of semi-circular arcs that bulge perpendicular to the base path,
733
+ * creating a distinctive visual pattern used in military tactical graphics.
734
+ *
735
+ * @param positions - Array of GeoJSON positions defining the base path
736
+ * @param options - Configuration options for the graphic
737
+ * @returns A GeoJSON FeatureCollection containing the scalloped LineString
738
+ *
739
+ * @example
740
+ * ```typescript
741
+ * const flot = createFLOT(
742
+ * [[-122.4194, 37.7749], [-122.4100, 37.7800], [-122.4000, 37.7750]],
743
+ * { radius: 100, resolution: 20 }
744
+ * );
745
+ * ```
746
+ */
747
+ declare function createFLOT(positions: Position[], options?: FLOTOptions): FeatureCollection<LineString>;
748
+ //#endregion
749
+ //#region src/generators/cm34-mission-tasks/block.d.ts
750
+ interface BlockMissionTaskOptions {
751
+ /** Gap for the 'B' label as a ratio of the front length (default: 0.2) */
752
+ labelGapRatio?: number;
753
+ /** Label height in CSS pixels at the draw/reference zoom. */
754
+ labelSizePixels?: number;
755
+ /** Map zoom at which labelSizePixels was captured. */
756
+ labelSizeZoom?: number;
757
+ /** Map resolution at which labelSizePixels was captured. */
758
+ labelSizeResolution?: number;
759
+ }
760
+ declare const DEFAULT_BLOCK_MISSION_TASK_OPTIONS: Required<Omit<BlockMissionTaskOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
761
+ /**
762
+ * Generates a GeoJSON FeatureCollection for a BLOCK mission task symbol (340100).
763
+ *
764
+ * Uses the same T-shape geometry as the protection-area Block symbol, with a
765
+ * "B" label centered on the shaft.
766
+ *
767
+ * @param coordinates - [PT. 1, PT. 2, optional PT. 3] as Position arrays
768
+ * @param options - Configuration options
769
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
770
+ */
771
+ declare function createBlockMissionTaskSymbol(coordinates: Position[], options?: BlockMissionTaskOptions): FeatureCollection<MultiLineString | Point>;
772
+ //#endregion
773
+ //#region src/generators/cm34-mission-tasks/breach.d.ts
774
+ /**
775
+ * Configuration options for the BREACH tactical symbol.
776
+ */
777
+ interface BreachOptions {
778
+ /** Tick mark length ratio relative to front opening (default: 0.15) */
779
+ tickLengthRatio?: number;
780
+ /** Tick mark angle in degrees from perpendicular (default: 45) */
781
+ tickAngle?: number;
782
+ /** Gap for the 'B' label as a ratio of the front length (default: 0.2) */
783
+ labelGapRatio?: number;
784
+ /** Label height in CSS pixels at the draw/reference zoom. */
785
+ labelSizePixels?: number;
786
+ /** Map zoom at which labelSizePixels was captured. */
787
+ labelSizeZoom?: number;
788
+ /** Map resolution at which labelSizePixels was captured. */
789
+ labelSizeResolution?: number;
790
+ }
791
+ /**
792
+ * Default options for the BREACH symbol.
793
+ */
794
+ declare const DEFAULT_BREACH_OPTIONS: Required<Omit<BreachOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
795
+ /**
796
+ * Generates a GeoJSON FeatureCollection for a BREACH mission task symbol (340200).
797
+ *
798
+ * A three-sided bracket (see {@link createBracketSymbol}) whose front opening
799
+ * endpoints terminate in tick marks pointing **outward** (away from the rear
800
+ * "B" line).
801
+ *
802
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
803
+ * @param options - Configuration options
804
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
805
+ */
806
+ declare function createBreachSymbol(coordinates: Position[], options?: BreachOptions): FeatureCollection<MultiLineString | Point>;
807
+ //#endregion
808
+ //#region src/generators/cm34-mission-tasks/bypass.d.ts
809
+ /**
810
+ * Configuration options for the BYPASS tactical symbol.
811
+ */
812
+ interface BypassOptions {
813
+ /** Arrowhead length ratio relative to front opening (default: 0.2) */
814
+ arrowheadLengthRatio?: number;
815
+ /** Gap for the 'B' label as a ratio of the front length (default: 0.2) */
816
+ labelGapRatio?: number;
817
+ /** Label height in CSS pixels at the draw/reference zoom. */
818
+ labelSizePixels?: number;
819
+ /** Map zoom at which labelSizePixels was captured. */
820
+ labelSizeZoom?: number;
821
+ /** Map resolution at which labelSizePixels was captured. */
822
+ labelSizeResolution?: number;
823
+ }
824
+ /**
825
+ * Default options for the BYPASS symbol.
826
+ */
827
+ declare const DEFAULT_BYPASS_OPTIONS: Required<Omit<BypassOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
828
+ /**
829
+ * Generates a GeoJSON FeatureCollection for a BYPASS mission task symbol (340300).
830
+ *
831
+ * A three-sided bracket (see {@link createBracketSymbol}) with a "B" label on
832
+ * the rear line, whose front opening endpoints terminate in outward-flaring
833
+ * chevron arrowheads instead of tick marks.
834
+ *
835
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
836
+ * @param options - Configuration options
837
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
838
+ */
839
+ declare function createBypassSymbol(coordinates: Position[], options?: BypassOptions): FeatureCollection<MultiLineString | Point>;
840
+ //#endregion
841
+ //#region src/generators/cm34-mission-tasks/canalize.d.ts
842
+ /**
843
+ * Configuration options for the CANALIZE tactical symbol.
844
+ */
845
+ interface CanalizeOptions {
846
+ /** Tick mark length ratio relative to front opening (default: 0.15) */
847
+ tickLengthRatio?: number;
848
+ /** Tick mark angle in degrees from perpendicular (default: 45) */
849
+ tickAngle?: number;
850
+ /** Gap for the 'C' label as a ratio of the front length (default: 0.2) */
851
+ labelGapRatio?: number;
852
+ /** Label height in CSS pixels at the draw/reference zoom. */
853
+ labelSizePixels?: number;
854
+ /** Map zoom at which labelSizePixels was captured. */
855
+ labelSizeZoom?: number;
856
+ /** Map resolution at which labelSizePixels was captured. */
857
+ labelSizeResolution?: number;
858
+ }
859
+ /**
860
+ * Default options for the CANALIZE symbol.
861
+ */
862
+ declare const DEFAULT_CANALIZE_OPTIONS: Required<Omit<CanalizeOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
863
+ /**
864
+ * Generates a GeoJSON FeatureCollection for a CANALIZE mission task symbol (340400).
865
+ *
866
+ * A three-sided bracket (see {@link createBracketSymbol}) whose front opening
867
+ * endpoints terminate in tick marks pointing **inward** (toward the rear "C"
868
+ * line), opposite BREACH's outward-facing ticks.
869
+ *
870
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
871
+ * @param options - Configuration options
872
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
873
+ */
874
+ declare function createCanalizeSymbol(coordinates: Position[], options?: CanalizeOptions): FeatureCollection<MultiLineString | Point>;
875
+ //#endregion
876
+ //#region src/generators/cm34-mission-tasks/clear.d.ts
877
+ /**
878
+ * Configuration options for the CLEAR tactical mission task symbol.
879
+ */
880
+ interface ClearOptions {
881
+ /**
882
+ * Padding between the vertical line's endpoints and the outer arrows, as a
883
+ * ratio of the symbol height. Insets the top and bottom arrows so they sit
884
+ * clear of PT. 1 / PT. 2 (default: 0.15).
885
+ */
886
+ arrowInsetRatio?: number;
887
+ /** Arrowhead depth (toward the rear) as a ratio of the symbol height (default: 0.15). */
888
+ arrowheadLengthRatio?: number;
889
+ /** Arrowhead width (along the vertical line) as a ratio of the symbol height (default: 0.2). */
890
+ arrowheadWidthRatio?: number;
891
+ /** Gap for the 'C' label as a ratio of the shaft length (default: 0.2). */
892
+ labelGapRatio?: number;
893
+ /** Label height in CSS pixels at the draw/reference zoom. */
894
+ labelSizePixels?: number;
895
+ /** Map zoom at which labelSizePixels was captured. */
896
+ labelSizeZoom?: number;
897
+ /** Map resolution at which labelSizePixels was captured. */
898
+ labelSizeResolution?: number;
899
+ }
900
+ /**
901
+ * Default options for the CLEAR symbol.
902
+ */
903
+ declare const DEFAULT_CLEAR_OPTIONS: Required<Omit<ClearOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
904
+ /**
905
+ * Generates a GeoJSON FeatureCollection for a CLEAR mission task symbol (340500).
906
+ *
907
+ * A vertical line (PT. 1 → PT. 2) with three arrows pointing at it,
908
+ * perpendicular to the line. The arrows come from the rear — the side PT. 3
909
+ * sits on — and their tips touch the vertical line; each carries a shaft
910
+ * reaching back to the rear. The arrows are evenly spaced along the line, so
911
+ * the middle arrow's tip sits at the midpoint of the vertical line and its
912
+ * shaft carries the 'C' glyph. The arrows stay perpendicular to the vertical
913
+ * line at any rotation.
914
+ *
915
+ * Input Points:
916
+ * - PT. 1: Top endpoint of the vertical line
917
+ * - PT. 2: Bottom endpoint of the vertical line — defines height with PT. 1
918
+ * - PT. 3: Rear point — defines the shaft length (and which side the arrows
919
+ * come from)
920
+ *
921
+ * @param coordinates - [PT. 1, PT. 2, PT. 3] as Position arrays
922
+ * @param options - Configuration options
923
+ * @returns GeoJSON FeatureCollection containing MultiLineString and Point features
924
+ */
925
+ declare function createClearSymbol(coordinates: Position[], options?: ClearOptions): FeatureCollection<MultiLineString | Point>;
926
+ //#endregion
927
+ //#region src/generators/cm34-mission-tasks/delay.d.ts
928
+ interface DelayOptions {
929
+ /** Arrowhead depth as a ratio of the straight-line length (default: 0.12). */
930
+ arrowheadLengthRatio?: number;
931
+ /** Arrowhead width as a ratio of the straight-line length (default: 0.12). */
932
+ arrowheadWidthRatio?: number;
933
+ /** Gap for the 'D' label as a ratio of the straight-line length (default: 0.18). */
934
+ labelGapRatio?: number;
935
+ /** Number of segments used to approximate the 180-degree arc (default: 32). */
936
+ arcSegments?: number;
937
+ /** Label height in CSS pixels at the draw/reference zoom. */
938
+ labelSizePixels?: number;
939
+ /** Map zoom at which labelSizePixels was captured. */
940
+ labelSizeZoom?: number;
941
+ /** Map resolution at which labelSizePixels was captured. */
942
+ labelSizeResolution?: number;
943
+ }
944
+ declare const DEFAULT_DELAY_OPTIONS: Required<Omit<DelayOptions, "labelSizePixels" | "labelSizeZoom" | "labelSizeResolution">>;
945
+ declare function createDelaySymbol(coordinates: Position[], options?: DelayOptions): FeatureCollection<MultiLineString | Point>;
946
+ //#endregion
947
+ //#region src/generators/cm34-mission-tasks/isolate.d.ts
948
+ /**
949
+ * Configuration options for the ISOLATE tactical mission task symbol.
950
+ */
951
+ interface IsolateOptions {
952
+ /** Angular size of the opening on the friendly side, in degrees (default: 30). */
953
+ openingAngle?: number;
954
+ /** Number of inward-pointing arrowhead barbs spaced around the closed arc (default: 9). */
955
+ barbCount?: number;
956
+ /** Barb length as a ratio of the symbol radius (default: 0.18). */
957
+ barbLengthRatio?: number;
958
+ }
959
+ /**
960
+ * Generates a GeoJSON FeatureCollection for an ISOLATE mission task symbol (341500).
961
+ *
962
+ * A near-complete circle centered on PT. 1 whose radius reaches PT. 2. The arc
963
+ * starts (bare) at PT. 2's bearing and sweeps clockwise around the closed
964
+ * portion to a single arrow tip at the far end; the wedge-shaped gap (default
965
+ * 30°) between that arrow tip and PT. 2 is the opening — the "friendly side".
966
+ * Inward-pointing arrowhead barbs are spaced along the closed arc, set in from
967
+ * both ends so they never touch PT. 2 or the arrow tip, conveying the
968
+ * sealing-off of the enclosed force. Unlike the bracket mission tasks, isolate
969
+ * carries no glyph label.
970
+ *
971
+ * Input Points:
972
+ * - PT. 1: Center point
973
+ * - PT. 2: Start point — fixes the radius and the bearing of the opening
974
+ *
975
+ * @param coordinates - [PT. 1, PT. 2] as Position arrays
976
+ * @param options - Configuration options
977
+ * @returns GeoJSON FeatureCollection containing a single MultiLineString feature
978
+ */
979
+ declare function createIsolateSymbol(coordinates: Position[], options?: IsolateOptions): FeatureCollection<MultiLineString>;
980
+ //#endregion
981
+ //#region src/generators/cm29-protection-lines/antitankDitch.d.ts
982
+ interface AntitankDitchOptions {
983
+ /**
984
+ * The tooth depth in meters. Target tooth spacing is roughly 1.15x this depth.
985
+ * Ignored when toothHeightPixels is provided with metersPerPixel.
986
+ * @default 50
987
+ */
988
+ toothHeight?: number;
989
+ /**
990
+ * The tooth depth in pixels. When provided with metersPerPixel, the meter
991
+ * size is calculated dynamically to maintain a consistent visual size.
992
+ * @default 10
993
+ */
994
+ toothHeightPixels?: number;
995
+ /**
996
+ * The target base span of each triangular tooth as a multiple of tooth depth.
997
+ * Lower values make sharper, denser teeth; higher values make flatter teeth.
998
+ * @default 1.15
999
+ */
1000
+ toothWidthRatio?: number;
1001
+ /**
1002
+ * The meters-per-pixel ratio at the current zoom level and latitude. Required
1003
+ * when using toothHeightPixels for zoom-aware sizing.
1004
+ */
1005
+ metersPerPixel?: number;
1006
+ }
1007
+ declare const DEFAULT_ANTITANK_DITCH_OPTIONS: Required<Omit<AntitankDitchOptions, "metersPerPixel">>;
1008
+ declare function createAntitankDitchUnderConstruction(positions: Position[], options?: AntitankDitchOptions): FeatureCollection<MultiLineString, {
1009
+ part: "ditch";
1010
+ }>;
1011
+ declare function createAntitankDitchCompleted(positions: Position[], options?: AntitankDitchOptions): FeatureCollection<MultiPolygon, {
1012
+ part: "teeth";
1013
+ fill: boolean;
1014
+ }>;
1015
+ //#endregion
1016
+ //#region src/generators/cm29-protection-lines/antitankWall.d.ts
1017
+ interface AntitankWallOptions extends AntitankDitchOptions {
1018
+ /**
1019
+ * The total gap between consecutive tooth bases as a multiple of tooth base
1020
+ * width. Use 0 for touching teeth; higher values create wider gaps.
1021
+ * @default 1.35
1022
+ */
1023
+ toothSpacingRatio?: number;
1024
+ }
1025
+ declare const DEFAULT_ANTITANK_WALL_OPTIONS: Required<Omit<AntitankWallOptions, "metersPerPixel">>;
1026
+ declare function createAntitankWall(positions: Position[], options?: AntitankWallOptions): FeatureCollection<MultiLineString, {
1027
+ part: "wall";
1028
+ }>;
1029
+ //#endregion
1030
+ //#region src/generators/cm29-protection-lines/fortifiedLine.d.ts
1031
+ /**
1032
+ * Configuration options for the Fortified Line geometry.
1033
+ */
1034
+ interface FortifiedLineOptions {
1035
+ /**
1036
+ * The size of the square teeth in meters.
1037
+ * This controls both the width and height of the castellated pattern.
1038
+ * This is ignored if sizePixels is provided along with metersPerPixel.
1039
+ * @default 50
1040
+ */
1041
+ size?: number;
1042
+ /**
1043
+ * The size of the square teeth in pixels.
1044
+ * When provided along with metersPerPixel, the actual meter size is calculated
1045
+ * dynamically to maintain consistent visual size on screen.
1046
+ * Takes precedence over size when metersPerPixel is also provided.
1047
+ * @default 10
1048
+ */
1049
+ sizePixels?: number;
1050
+ /**
1051
+ * The meters-per-pixel ratio at the current zoom level and latitude.
1052
+ * Required when using sizePixels for zoom-aware sizing.
1053
+ */
1054
+ metersPerPixel?: number;
1055
+ /**
1056
+ * Round the line's corners by curving the base path through the control
1057
+ * points (centripetal Catmull-Rom spline) before generating the castellated
1058
+ * teeth, matching the rounded shape option on the Fortified Area and Battle
1059
+ * Position measures. With fewer than three control points the path is left
1060
+ * unchanged (a single segment cannot be smoothed).
1061
+ * @default false
1062
+ */
1063
+ smooth?: boolean;
1064
+ /**
1065
+ * Number of samples per segment when `smooth` is enabled. Higher values yield
1066
+ * a denser, smoother curve.
1067
+ * @default 16
1068
+ */
1069
+ smoothResolution?: number;
1070
+ }
1071
+ /**
1072
+ * Default options for the Fortified Line graphic.
1073
+ */
1074
+ declare const DEFAULT_FORTIFIED_LINE_OPTIONS: Required<Omit<FortifiedLineOptions, "metersPerPixel">>;
1075
+ /**
1076
+ * Creates a Fortified Line tactical graphic.
1077
+ *
1078
+ * Generates a castellated/square-wave line representing a fortified line.
1079
+ * The line consists of square "teeth" that project perpendicular to the base path.
1080
+ *
1081
+ * @param positions - Array of GeoJSON positions defining the base path
1082
+ * @param options - Configuration options for the graphic
1083
+ * @returns A GeoJSON FeatureCollection containing the castellated LineString
1084
+ */
1085
+ declare function createFortifiedLine(positions: Position[], options?: FortifiedLineOptions): FeatureCollection<LineString>;
1086
+ //#endregion
1087
+ //#region src/generators/cm15-maneuver-areas/fortifiedArea.d.ts
1088
+ /**
1089
+ * Configuration options for the Fortified Area. Inherits the Fortified Line
1090
+ * options (including `smooth`/`smoothResolution`) unchanged; the area applies
1091
+ * the smoothing as a closed Catmull-Rom ring rather than an open spline.
1092
+ */
1093
+ type FortifiedAreaOptions = FortifiedLineOptions;
1094
+ declare const DEFAULT_FORTIFIED_AREA_OPTIONS: Required<Omit<FortifiedLineOptions, "metersPerPixel">>;
1095
+ /**
1096
+ * Creates a Fortified Area tactical graphic.
1097
+ *
1098
+ * Generates a polygon with a castellated/square-wave boundary representing a fortified area.
1099
+ * The boundary consists of square "teeth" that project perpendicular to the path.
1100
+ *
1101
+ * @param positions - Array of GeoJSON positions defining the area boundary.
1102
+ * The first and last positions should match to close the polygon,
1103
+ * or it will be closed automatically.
1104
+ * @param options - Configuration options for the graphic
1105
+ * @returns A GeoJSON FeatureCollection containing the castellated Polygon
1106
+ */
1107
+ declare function createFortifiedArea(positions: Position[], options?: FortifiedAreaOptions): FeatureCollection<Polygon>;
1108
+ //#endregion
1109
+ //#region src/generators/cm27-protection-areas/block.d.ts
1110
+ type BlockOptions = Record<never, never>;
1111
+ declare const DEFAULT_BLOCK_OPTIONS: BlockOptions;
1112
+ /**
1113
+ * Generates a GeoJSON FeatureCollection for a "Block" tactical symbol (T-shape).
1114
+ *
1115
+ * @param coordinates - An array of GeoJSON Positions (Lon/Lat).
1116
+ * Expects exactly 3 points:
1117
+ * - PT1 & PT2: Endpoints of the vertical line.
1118
+ * - PT3: Defines the endpoint of the horizontal line (stem).
1119
+ * @param options - Configuration options.
1120
+ * @returns A GeoJSON FeatureCollection containing a LineString.
1121
+ */
1122
+ declare function createBlock(coordinates: Position[], _options?: BlockOptions): FeatureCollection<LineString>;
1123
+ //#endregion
1124
+ //#region src/generators/cm27-protection-areas/disrupt.d.ts
1125
+ interface DisruptOptions {
1126
+ middleArrowLengthRatio?: number;
1127
+ bottomArrowLengthRatio?: number;
1128
+ shaftLengthRatio?: number;
1129
+ arrowheadLengthRatio?: number;
1130
+ arrowheadWidthRatio?: number;
1131
+ }
1132
+ declare const DEFAULT_DISRUPT_OPTIONS: Required<DisruptOptions>;
1133
+ /**
1134
+ * Generates a GeoJSON FeatureCollection for a DISRUPT tactical symbol.
1135
+ *
1136
+ * Input:
1137
+ * - PT1: Top endpoint of the vertical spine
1138
+ * - PT2: Bottom endpoint of the vertical spine
1139
+ * - PT3: Reference point used to determine the longest-arrow offset
1140
+ *
1141
+ * Geometry:
1142
+ * - Spine: PT1 -> PT2
1143
+ * - PT2 -> PT1 defines the baseline orientation; arrow direction is constrained to its perpendicular axis
1144
+ * - PT3 is decomposed and projected onto the perpendicular axis through PT1 to derive a valid longest-arrow tip
1145
+ * - Three arrows placed at PT1, midpoint(PT1, PT2), and PT2
1146
+ * - Center shaft extends opposite arrow direction from midpoint with the same length as the middle arrow
1147
+ * - Top arrow is longest
1148
+ * - Middle and bottom arrows are proportional to the longest arrow
1149
+ * - Arrow heads are returned as filled triangle polygons
1150
+ */
1151
+ declare function createDisrupt(coordinates: Position[], options?: DisruptOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1152
+ //#endregion
1153
+ //#region src/generators/cm27-protection-areas/fix.d.ts
1154
+ interface FixOptions {
1155
+ arrowheadAngle?: number;
1156
+ arrowheadLengthRatio?: number;
1157
+ endSegmentRatio?: number;
1158
+ }
1159
+ declare const DEFAULT_FIX_OPTIONS: Required<FixOptions>;
1160
+ /**
1161
+ * Generates a GeoJSON FeatureCollection for a FIX tactical symbol.
1162
+ *
1163
+ * Input:
1164
+ * - PT1: Arrow tip end
1165
+ * - PT2: Opposite end
1166
+ *
1167
+ * Notes:
1168
+ * - Requires exactly two points.
1169
+ * - Produces one MultiLineString feature containing the zigzag body and open arrowhead wings.
1170
+ */
1171
+ declare function createFix(coordinates: Position[], options?: FixOptions): FeatureCollection<MultiLineString>;
1172
+ //#endregion
1173
+ //#region src/generators/cm27-protection-areas/turn.d.ts
1174
+ interface TurnOptions {
1175
+ arrowheadLengthRatio?: number;
1176
+ arrowheadWidthRatio?: number;
1177
+ arcSegments?: number;
1178
+ }
1179
+ declare const DEFAULT_TURN_OPTIONS: Required<TurnOptions>;
1180
+ /**
1181
+ * Generates a quarter-circle shaft from PT2 (rear) to the arrowhead base.
1182
+ * The arrowhead continues tangent to the arc and places its tip at PT1.
1183
+ * PT3 selects which side of the PT2 -> PT1 chord contains the arc.
1184
+ */
1185
+ declare function createTurn(coordinates: Position[], options?: TurnOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1186
+ //#endregion
1187
+ //#region src/generators/cm27-protection-areas/obstacleBypassEasy.d.ts
1188
+ interface ObstacleBypassEasyOptions {
1189
+ arrowheadLengthRatio?: number;
1190
+ arrowheadWidthRatio?: number;
1191
+ defaultLengthRatio?: number;
1192
+ }
1193
+ declare const DEFAULT_OBSTACLE_BYPASS_EASY_OPTIONS: Required<ObstacleBypassEasyOptions>;
1194
+ /**
1195
+ * Generates a GeoJSON FeatureCollection for an "Obstacle Bypass Easy" symbol.
1196
+ *
1197
+ * Input:
1198
+ * - PT1 and PT2 define the tips of the two arrowheads (opening and symbol height)
1199
+ * - PT3 defines signed symbol length along the perpendicular axis through midpoint(PT1, PT2)
1200
+ *
1201
+ * Geometry:
1202
+ * - Rear line is parallel to opening(PT1-PT2) and has equal length
1203
+ * - Two side rails run from rear endpoints to the arrowheads and are parallel to each other
1204
+ * - Rear line is perpendicular to both side rails
1205
+ * - Arrow heads are filled triangle polygons at PT1 and PT2
1206
+ */
1207
+ declare function createObstacleBypassEasy(coordinates: Position[], options?: ObstacleBypassEasyOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1208
+ //#endregion
1209
+ //#region src/generators/cm27-protection-areas/obstacleBypassDifficult.d.ts
1210
+ interface ObstacleBypassDifficultOptions {
1211
+ arrowheadLengthRatio?: number;
1212
+ arrowheadWidthRatio?: number;
1213
+ defaultLengthRatio?: number;
1214
+ zigzagAmplitudeRatio?: number;
1215
+ zigzagSpacingRatio?: number;
1216
+ }
1217
+ declare const DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS: Required<ObstacleBypassDifficultOptions>;
1218
+ declare function createObstacleBypassDifficult(coordinates: Position[], options?: ObstacleBypassDifficultOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1219
+ //#endregion
1220
+ //#region src/generators/cm27-protection-areas/obstacleBypassImpossible.d.ts
1221
+ interface ObstacleBypassImpossibleOptions {
1222
+ arrowheadLengthRatio?: number;
1223
+ arrowheadWidthRatio?: number;
1224
+ defaultLengthRatio?: number;
1225
+ rearBarLengthRatio?: number;
1226
+ rearGapRatio?: number;
1227
+ }
1228
+ declare const DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS: Required<ObstacleBypassImpossibleOptions>;
1229
+ /**
1230
+ * Generates a GeoJSON FeatureCollection for an "Obstacle Bypass Impossible" symbol.
1231
+ *
1232
+ * Input:
1233
+ * - PT1 and PT2 define the tips of the two arrowheads (opening and symbol height)
1234
+ * - PT3 defines signed symbol length along the perpendicular axis through midpoint(PT1, PT2)
1235
+ *
1236
+ * Geometry:
1237
+ * - Same base as obstacle bypass easy
1238
+ * - Rear line has two short perpendicular bars on the rear side
1239
+ */
1240
+ declare function createObstacleBypassImpossible(coordinates: Position[], options?: ObstacleBypassImpossibleOptions): FeatureCollection<MultiLineString | MultiPolygon>;
1241
+ //#endregion
1242
+ //#region src/registry.d.ts
1243
+ /**
1244
+ * The single source of truth for the catalog: one **control measure
1245
+ * definition** record per measure, co-located with its generator and collected
1246
+ * here. The `ControlMeasureId` union, `OptionsByKind`, the generator dispatch,
1247
+ * the default options, and rule resolution are all *derived* from this map
1248
+ * rather than maintained as parallel tables. Adding a measure is a one-file
1249
+ * change plus one line here. See ADR-0013.
1250
+ */
1251
+ declare const DEFINITIONS: {
1252
+ boundary: ControlMeasureDefinition<"boundary", typeof createBoundary>;
1253
+ "battle-position": ControlMeasureDefinition<"battle-position", typeof createBattlePosition>;
1254
+ "strong-point": ControlMeasureDefinition<"strong-point", typeof createStrongPoint>;
1255
+ ambush: ControlMeasureDefinition<"ambush", (controlPoints: import("geojson").Position[], options?: AmbushOptions) => import("geojson").FeatureCollection<import("geojson").MultiLineString, Record<string, never>>>;
1256
+ "principal-direction-of-fire": ControlMeasureDefinition<"principal-direction-of-fire", typeof createPrincipalDirectionOfFire>;
1257
+ "final-protective-fire-left": ControlMeasureDefinition<"final-protective-fire-left", typeof createFinalProtectiveFireLeft>;
1258
+ "final-protective-fire-right": ControlMeasureDefinition<"final-protective-fire-right", typeof createFinalProtectiveFireRight>;
1259
+ "search-area": ControlMeasureDefinition<"search-area", (controlPoints: import("geojson").Position[], options?: TacticalArrowOptions) => import("geojson").FeatureCollection<import("geojson").MultiLineString | import("geojson").MultiPolygon, {
1260
+ part: "shaft" | "head";
1261
+ fill?: boolean;
1262
+ }>>;
1263
+ encirclement: ControlMeasureDefinition<"encirclement", typeof createEncirclement>;
1264
+ "main-attack": ControlMeasureDefinition<"main-attack", typeof createMainAttack>;
1265
+ "supporting-attack": ControlMeasureDefinition<"supporting-attack", typeof createSupportingAttack>;
1266
+ "classic-arrow": ControlMeasureDefinition<"classic-arrow", typeof createClassicArrow>;
1267
+ "block-arrow": ControlMeasureDefinition<"block-arrow", typeof createBlockArrow>;
1268
+ "airborne-attack": ControlMeasureDefinition<"airborne-attack", typeof createAirborneAttack>;
1269
+ "attack-helicopter": ControlMeasureDefinition<"attack-helicopter", typeof createAttackHelicopter>;
1270
+ "support-by-fire": ControlMeasureDefinition<"support-by-fire", typeof createSupportByFire>;
1271
+ "attack-by-fire": ControlMeasureDefinition<"attack-by-fire", typeof createAttackByFire>;
1272
+ flot: ControlMeasureDefinition<"flot", typeof createFLOT>;
1273
+ "block-mission-task": ControlMeasureDefinition<"block-mission-task", typeof createBlockMissionTaskSymbol>;
1274
+ breach: ControlMeasureDefinition<"breach", typeof createBreachSymbol>;
1275
+ bypass: ControlMeasureDefinition<"bypass", typeof createBypassSymbol>;
1276
+ canalize: ControlMeasureDefinition<"canalize", typeof createCanalizeSymbol>;
1277
+ clear: ControlMeasureDefinition<"clear", typeof createClearSymbol>;
1278
+ delay: ControlMeasureDefinition<"delay", typeof createDelaySymbol>;
1279
+ isolate: ControlMeasureDefinition<"isolate", typeof createIsolateSymbol>;
1280
+ "antitank-ditch-under-construction": ControlMeasureDefinition<"antitank-ditch-under-construction", typeof createAntitankDitchUnderConstruction>;
1281
+ "antitank-ditch-completed": ControlMeasureDefinition<"antitank-ditch-completed", typeof createAntitankDitchCompleted>;
1282
+ "antitank-wall": ControlMeasureDefinition<"antitank-wall", typeof createAntitankWall>;
1283
+ "fortified-line": ControlMeasureDefinition<"fortified-line", typeof createFortifiedLine>;
1284
+ "fortified-area": ControlMeasureDefinition<"fortified-area", typeof createFortifiedArea>;
1285
+ block: ControlMeasureDefinition<"block", typeof createBlock>;
1286
+ disrupt: ControlMeasureDefinition<"disrupt", typeof createDisrupt>;
1287
+ fix: ControlMeasureDefinition<"fix", typeof createFix>;
1288
+ turn: ControlMeasureDefinition<"turn", typeof createTurn>;
1289
+ "obstacle-bypass-easy": ControlMeasureDefinition<"obstacle-bypass-easy", typeof createObstacleBypassEasy>;
1290
+ "obstacle-bypass-difficult": ControlMeasureDefinition<"obstacle-bypass-difficult", typeof createObstacleBypassDifficult>;
1291
+ "obstacle-bypass-impossible": ControlMeasureDefinition<"obstacle-bypass-impossible", typeof createObstacleBypassImpossible>;
1292
+ };
1293
+ type Definitions = typeof DEFINITIONS;
1294
+ /** Stable string id of a control measure — the keys of {@link DEFINITIONS}. */
1295
+ type ControlMeasureId = keyof Definitions;
1296
+ /**
1297
+ * The discriminant for {@link ControlMeasure}. Identical to
1298
+ * {@link ControlMeasureId}; kept as a distinct name for the `<K extends
1299
+ * ControlMeasureKind>` generics threaded through rendering and edit sessions.
1300
+ */
1301
+ type ControlMeasureKind = ControlMeasureId;
1302
+ /** Strips the internal `validationMode` knob from a public options surface. */
1303
+ type PublicOptions<T> = Omit<T, "validationMode">;
1304
+ /**
1305
+ * The per-kind public options map, derived covariantly from each definition's
1306
+ * generator (see {@link OptsOf}). Empty-options kinds resolve to `{}` — exactly
1307
+ * as loose as the former hand-written table. See ADR-0013.
1308
+ */
1309
+ type OptionsByKind = { [K in keyof Definitions]: PublicOptions<OptsOf<Definitions[K]>> };
1310
+ /** Insertion-ordered list of every control-measure id. */
1311
+ declare const CONTROL_MEASURE_IDS: readonly ControlMeasureId[];
1312
+ declare const CONTROL_MEASURE_METADATA: Readonly<Record<ControlMeasureId, ControlMeasureMetadata>>;
1313
+ declare function listControlMeasureMetadata(): readonly ControlMeasureMetadata[];
1314
+ declare function getControlMeasureMetadata(id: ControlMeasureId): ControlMeasureMetadata;
1315
+ declare function getControlMeasureMetadataByValue(value: string): ControlMeasureMetadata | undefined;
1316
+ declare function getDefaultOptions<K extends ControlMeasureKind>(kind: K): OptionsByKind[K];
1317
+ //#endregion
1318
+ //#region src/style.d.ts
1319
+ /**
1320
+ * Framework-agnostic style hints attached to a `ControlMeasure`.
1321
+ *
1322
+ * Mirrors the per-feature subset of what map adapters render. The renderer
1323
+ * fans these into each emitted feature's `properties.style` ([[StyleHints]]).
1324
+ * Adapters merge them over their layer-level style; generator-emitted hints
1325
+ * on individual features win over both.
1326
+ */
1327
+ interface ControlMeasureStyle {
1328
+ /**
1329
+ * The single symbol color. Control measures are monocolor: one color paints
1330
+ * every part, stroked or filled. Input-only — resolved into concrete
1331
+ * `strokeColor` / `fillColor` per feature by the renderer and never emitted
1332
+ * on output. `strokeColor` / `fillColor` act as optional per-channel
1333
+ * overrides. See ADR-0011.
1334
+ */
1335
+ color?: string;
1336
+ strokeColor?: string;
1337
+ strokeWidth?: number;
1338
+ strokeDash?: number[];
1339
+ fillColor?: string;
1340
+ }
1341
+ //#endregion
1342
+ //#region src/instance.d.ts
1343
+ interface ControlMeasure<K extends ControlMeasureKind = ControlMeasureKind> {
1344
+ id: string;
1345
+ kind: K;
1346
+ controlPoints: Position[];
1347
+ options?: OptionsByKind[K];
1348
+ style?: ControlMeasureStyle;
1349
+ properties?: Record<string, unknown>;
1350
+ schemaVersion?: 1;
1351
+ }
1352
+ declare function isKind<K extends ControlMeasureKind>(cm: ControlMeasure, kind: K): cm is ControlMeasure<K>;
1353
+ /**
1354
+ * Deep-clone a `ControlMeasure` so held references survive mutations to the
1355
+ * original (and vice versa). Used by the session façade to build the
1356
+ * `measure` half of `ControlMeasureSnapshot`. Nested values inside
1357
+ * `options`, `style`, and `properties` are cloned too — `properties` is
1358
+ * `Record<string, unknown>` and may carry arbitrary host metadata, so a
1359
+ * shallow copy would leak shared references.
1360
+ *
1361
+ * Backed by `structuredClone`: only structured-cloneable values are
1362
+ * supported (no functions, DOM nodes, class instances). Absent optional
1363
+ * fields stay absent on the clone.
1364
+ */
1365
+ declare function cloneControlMeasure<K extends ControlMeasureKind>(cm: ControlMeasure<K>): ControlMeasure<K>;
1366
+ //#endregion
1367
+ //#region src/rendered.d.ts
1368
+ /**
1369
+ * Per-feature style hints carried on `properties.style`.
1370
+ *
1371
+ * These are *resolved*: `renderControlMeasure` cascades `graphicsStyle` →
1372
+ * `cm.style` → any generator pattern hint, then expands the monocolor `color`
1373
+ * into concrete `strokeColor` / `fillColor` per feature (see ADR-0011 and
1374
+ * `resolveSymbolColor`). Output therefore carries concrete colors, never the
1375
+ * input-only `color` key, and a `fillColor` only on parts the generator
1376
+ * marked filled.
1377
+ *
1378
+ * Generators contribute paint *role* and *pattern* (a part is filled; a
1379
+ * sub-line is dashed regardless of the user's stroke), never a hue. Adapters
1380
+ * merge the resulting `StyleHints` over their layer-level style at draw time.
1381
+ */
1382
+ interface StyleHints extends ControlMeasureStyle {}
1383
+ /**
1384
+ * Per-feature properties emitted by `renderControlMeasure`.
1385
+ *
1386
+ * Stable-id contract — every feature produced by the renderer has:
1387
+ * - `feature.id` of the form `${cmId}:${part}:${index}`
1388
+ * - `properties.part` matching the `part` segment of the id
1389
+ * - `properties.index` matching the `index` segment of the id
1390
+ *
1391
+ * Adapters rely on this contract to diff renders in place without keeping
1392
+ * their own bookkeeping. Use `controlMeasureIdFromFeature` to recover the
1393
+ * `cmId` from a picked feature.
1394
+ */
1395
+ interface FeaturePartProps {
1396
+ part: string;
1397
+ index: number;
1398
+ style?: StyleHints;
1399
+ /** Label text emitted by generators (e.g. breach "B"). */
1400
+ text?: string;
1401
+ /** Label rotation in radians, emitted by generators. */
1402
+ rotation?: number;
1403
+ /** Label size in CSS pixels at the draw/reference zoom. */
1404
+ textSizePixels?: number;
1405
+ /** Map zoom at which textSizePixels was captured. */
1406
+ textSizeZoom?: number;
1407
+ /** Map resolution at which textSizePixels was captured. */
1408
+ textSizeResolution?: number;
1409
+ }
1410
+ /**
1411
+ * Output of `renderControlMeasure`. A GeoJSON `FeatureCollection` whose
1412
+ * features satisfy the `FeaturePartProps` stable-id contract. See ADR-0010.
1413
+ */
1414
+ type ControlMeasureRender = FeatureCollection<Geometry, FeaturePartProps>;
1415
+ /**
1416
+ * A `ControlMeasure` paired with its `Render` at a single point in time.
1417
+ *
1418
+ * The unit delivered to `EditChangeEvent` listeners (as `measure` and
1419
+ * `previous`) and resolved from `TacticalDraw.draw()` / `.edit()`. The
1420
+ * `measure` half is a defensive clone (see `cloneControlMeasure`) so held
1421
+ * references remain valid after the originating session has closed.
1422
+ *
1423
+ * See ADR-0010.
1424
+ */
1425
+ interface ControlMeasureSnapshot<K extends ControlMeasureKind = ControlMeasureKind> {
1426
+ measure: ControlMeasure<K>;
1427
+ render: ControlMeasureRender;
1428
+ }
1429
+ /**
1430
+ * Recover the originating control measure id (`cmId`) from a feature emitted
1431
+ * by `renderControlMeasure`. The feature id must match the stable-id contract
1432
+ * `${cmId}:${part}:${index}`; otherwise this throws.
1433
+ */
1434
+ declare function controlMeasureIdFromFeature(feature: Feature<Geometry, FeaturePartProps> | {
1435
+ id?: string | number;
1436
+ }): string;
1437
+ //#endregion
1438
+ //#region src/renderControlMeasure.d.ts
1439
+ interface RenderOptions {
1440
+ validationMode?: ValidationMode;
1441
+ /**
1442
+ * Façade-level default style (third / lowest-priority layer). Merged
1443
+ * shallowly under `cm.style` and any per-feature generator hint. When
1444
+ * omitted, style resolution matches the prior two-layer behavior.
1445
+ */
1446
+ graphicsStyle?: ControlMeasureStyle;
1447
+ }
1448
+ /**
1449
+ * Pure render: `ControlMeasure` → `ControlMeasureRender` (a
1450
+ * `FeatureCollection` of `FeaturePartProps`-typed features). Per-feature
1451
+ * stable ids follow `${cm.id}:${part}:${index}`. Style is resolved from the
1452
+ * three layers (graphicsStyle, cm.style, generator hint) and stamped on
1453
+ * `properties.style` when non-empty.
1454
+ */
1455
+ declare function renderControlMeasure<K extends ControlMeasureKind>(cm: ControlMeasure<K>, opts?: RenderOptions): ControlMeasureRender;
1456
+ //#endregion
1457
+ //#region src/styleResolver.d.ts
1458
+ /**
1459
+ * Three-layer style precedence for `renderControlMeasure`.
1460
+ *
1461
+ * Lower-priority → higher-priority: `graphicsStyle` (façade default) →
1462
+ * `measureStyle` (`cm.style`) → `generatorStyle` (per-feature hint emitted
1463
+ * by a generator). Merge is shallow and per-property; higher-priority layers
1464
+ * win key by key. Explicit `null` / `undefined` in a higher-priority layer
1465
+ * is treated as "no opinion" and does not clear a lower-priority key.
1466
+ *
1467
+ * Returns `undefined` when all three layers are absent so the renderer can
1468
+ * omit `properties.style` entirely — keeps the no-style case byte-identical
1469
+ * to a property-less feature.
1470
+ *
1471
+ * Pure function: inputs are never mutated; the returned object is always a
1472
+ * fresh allocation when defined.
1473
+ */
1474
+ declare function resolveStyleHints(graphicsStyle: ControlMeasureStyle | undefined, measureStyle: ControlMeasureStyle | undefined, generatorStyle: StyleHints | undefined): StyleHints | undefined;
1475
+ //#endregion
1476
+ //#region src/toSimpleStyle.d.ts
1477
+ /**
1478
+ * simplestyle-spec properties (the subset this library can express), flat on
1479
+ * `properties`. All keys are optional.
1480
+ *
1481
+ * @see https://github.com/mapbox/simplestyle-spec
1482
+ */
1483
+ interface SimpleStyleProps extends FeaturePartProps {
1484
+ stroke?: string;
1485
+ "stroke-width"?: number;
1486
+ "stroke-opacity"?: number;
1487
+ fill?: string;
1488
+ "fill-opacity"?: number;
1489
+ }
1490
+ /**
1491
+ * A `FeatureCollection` whose features carry simplestyle-spec keys instead of
1492
+ * the nested `properties.style` slot. The `FeaturePartProps` stable-id
1493
+ * contract (`part`, `index`, `feature.id`) is preserved.
1494
+ */
1495
+ type SimpleStyleRender = FeatureCollection<Geometry, SimpleStyleProps>;
1496
+ /**
1497
+ * Lossy interop transform: `ControlMeasureRender` → a `FeatureCollection`
1498
+ * whose features carry simplestyle-spec keys. Operates on the already-resolved
1499
+ * per-feature `style`, so it composes after `renderControlMeasure`'s
1500
+ * three-layer merge and stays a pure post-processing step.
1501
+ *
1502
+ * Lossy mapping, by design:
1503
+ * - `strokeDash` has no simplestyle equivalent and is dropped — dashed
1504
+ * doctrinal sub-lines render solid in simplestyle consumers.
1505
+ * - colors must be hex or `rgb()/rgba()`; alpha becomes `*-opacity`. Other
1506
+ * color forms (named, `hsl()`) are omitted rather than guessed.
1507
+ */
1508
+ declare function toSimpleStyle(render: ControlMeasureRender): SimpleStyleRender;
1509
+ //#endregion
1510
+ //#region src/internal/graphics-utils.d.ts
1511
+ /**
1512
+ * Small value used to avoid division by zero and floating-point precision issues.
1513
+ */
1514
+ declare const EPSILON = 0.000001;
1515
+ /**
1516
+ * Rounds a number to a specified number of decimal places.
1517
+ */
1518
+ declare const roundToFixed: (v: number, precision?: number) => number;
1519
+ /**
1520
+ * Calculates the meters-per-pixel ratio at a given latitude and zoom level.
1521
+ *
1522
+ * This is essential for maintaining consistent visual sizes on the map
1523
+ * regardless of zoom level. The formula accounts for:
1524
+ * - The Web Mercator projection's tile-based structure
1525
+ * - The latitude-dependent scale distortion in Mercator projection
1526
+ *
1527
+ * @param latitude - The latitude in degrees (affects scale due to projection)
1528
+ * @param zoomLevel - The current map zoom level
1529
+ * @returns The number of meters represented by one pixel at the given location and zoom
1530
+ *
1531
+ * @example
1532
+ * ```typescript
1533
+ * // At zoom 10, latitude 45°
1534
+ * const mpp = getMetersPerPixel(45, 10);
1535
+ * // To get a 20-pixel radius in meters:
1536
+ * const radiusMeters = 20 * mpp;
1537
+ * ```
1538
+ */
1539
+ declare const getMetersPerPixel: (latitude: number, zoomLevel: number) => number;
1540
+ //#endregion
1541
+ //#region src/draw-rules/baseline-frame.d.ts
1542
+ type BaselineFrameOrigin = "p1" | "p2" | "midpoint";
1543
+ type BaselineFrameNormal = "right" | "left";
1544
+ interface BaselineFrameOptions {
1545
+ origin?: BaselineFrameOrigin;
1546
+ normal?: BaselineFrameNormal;
1547
+ }
1548
+ interface BaselineFrame {
1549
+ readonly p1: Point2D;
1550
+ readonly p2: Point2D;
1551
+ readonly origin: Point2D;
1552
+ readonly direction: Point2D;
1553
+ readonly normal: Point2D;
1554
+ readonly length: number;
1555
+ signedNormalDistance(point: Position): number;
1556
+ pointAtNormalDistance(distance: number): Position | null;
1557
+ }
1558
+ declare function createBaselineFrame(p1: Position, p2: Position, options?: BaselineFrameOptions): BaselineFrame | null;
1559
+ //#endregion
1560
+ //#region src/draw-rules/midpoint-perpendicular.d.ts
1561
+ interface MidpointPerpendicularDrawRuleOptions {
1562
+ id: string;
1563
+ defaultDistanceRatio?: number;
1564
+ /** User clicks required to commit. Defaults to `2` (the third point is auto-derived). */
1565
+ minimumUserPoints?: number;
1566
+ /** Raw points at which a live preview can be derived. See {@link ControlMeasureDrawRule}. */
1567
+ minimumPreviewPoints?: number;
1568
+ /**
1569
+ * Index of the slot whose point is constrained to the perpendicular axis
1570
+ * through the configured origin of the other two ("baseline") slots. Must be
1571
+ * `0` or `2`. Defaults to `2`.
1572
+ *
1573
+ * Area11 (Block) and Point12 (obstacle-bypass) use `2`: P1/P2 are the free
1574
+ * baseline endpoints and P3 is constrained. Area7 (Attack-By-Fire) uses `0`:
1575
+ * P1 is the constrained arrowhead tip and P2/P3 are the free back-line
1576
+ * endpoints.
1577
+ */
1578
+ constrainedIndex?: 0 | 2;
1579
+ /** Frame origin for the perpendicular axis. Defaults to `"midpoint"`. */
1580
+ origin?: BaselineFrameOrigin;
1581
+ /** Side the positive normal points to. Defaults to `"right"`. */
1582
+ normal?: BaselineFrameNormal;
1583
+ }
1584
+ declare function createMidpointPerpendicularDrawRule(options: MidpointPerpendicularDrawRuleOptions): ControlMeasureDrawRule;
1585
+ declare function computeDefaultMidpointPerpendicularPoint(p1: Position, p2: Position, distanceRatio?: number): Position | null;
1586
+ declare function getMidpointPerpendicularSignedDistance(p1: Position, p2: Position, controlPoint: Position): number | null;
1587
+ declare function pointOnMidpointPerpendicularAxis(p1: Position, p2: Position, distance: number | null): Position | null;
1588
+ declare function snapToMidpointPerpendicular(p1: Position, p2: Position, controlPoint: Position): Position | null;
1589
+ //#endregion
1590
+ //#region src/draw-rules/area11.d.ts
1591
+ declare const blockDrawRule: ControlMeasureDrawRule;
1592
+ //#endregion
1593
+ //#region src/draw-rules/area12.d.ts
1594
+ /**
1595
+ * Area12 anchor draw rule for Disrupt.
1596
+ *
1597
+ * P1/P2 are the free spine endpoints. P3 is the longest-arrow tip, constrained
1598
+ * to the perpendicular axis through P1 (not the baseline midpoint).
1599
+ */
1600
+ declare const disruptDrawRule: ControlMeasureDrawRule;
1601
+ //#endregion
1602
+ //#region src/draw-rules/point12.d.ts
1603
+ /**
1604
+ * Point12 anchor draw rule for the obstacle-bypass family.
1605
+ *
1606
+ * Shared by `obstacle-bypass-easy`, `obstacle-bypass-difficult`, and
1607
+ * `obstacle-bypass-impossible`: P1/P2 are the arrowhead tips and define the
1608
+ * opening; P3 is constrained to the perpendicular axis through
1609
+ * `midpoint(P1, P2)` and defines the rear of the symbol. Rear-line decoration
1610
+ * (plain, zigzag, barrier marks) is a generator concern, not a draw-rule one.
1611
+ */
1612
+ declare const point12DrawRule: ControlMeasureDrawRule;
1613
+ //#endregion
1614
+ //#region src/draw-rules/area7.d.ts
1615
+ /**
1616
+ * Area7 anchor draw rule for Attack By Fire.
1617
+ *
1618
+ * P2/P3 are the free back-line endpoints; P1 (slot index 0) is the arrowhead
1619
+ * tip, constrained to the perpendicular axis through `midpoint(P2, P3)`.
1620
+ */
1621
+ declare const attackByFireDrawRule: ControlMeasureDrawRule;
1622
+ //#endregion
1623
+ //#region src/draw-rules/line29.d.ts
1624
+ /**
1625
+ * Line29 anchor draw rule for Ambush.
1626
+ *
1627
+ * P2/P3 are the free back-line endpoints; P1 (slot index 0) is the arrowhead
1628
+ * tip, constrained to the perpendicular axis through `midpoint(P2, P3)`.
1629
+ */
1630
+ declare const ambushDrawRule: ControlMeasureDrawRule;
1631
+ //#endregion
1632
+ //#region src/draw-rules/line1.d.ts
1633
+ declare const line1DrawRule: ControlMeasureDrawRule;
1634
+ //#endregion
1635
+ //#region src/draw-rules/line10.d.ts
1636
+ /**
1637
+ * Line10 — PT1 is the arrow tip, PT2 is the rear, and derived PT3 selects
1638
+ * which side of the PT2 -> PT1 chord contains the 90-degree arc.
1639
+ */
1640
+ declare const turnDrawRule: ControlMeasureDrawRule;
1641
+ //#endregion
1642
+ //#region src/draw-rules/line23.d.ts
1643
+ /**
1644
+ * Line23 anchor draw rule for the Clear mission task.
1645
+ *
1646
+ * P1/P2 are the endpoints of the symbol's vertical line (its height); P3 is
1647
+ * constrained to the perpendicular axis through `midpoint(P1, P2)` and defines
1648
+ * the rear of the symbol (the shaft length). Geometrically identical to the
1649
+ * obstacle-bypass `Point12` rule, but kept as its own spec id to match the
1650
+ * doctrinal draw rule for Clear.
1651
+ */
1652
+ declare const line23DrawRule: ControlMeasureDrawRule;
1653
+ //#endregion
1654
+ //#region src/draw-rules/line24.d.ts
1655
+ /**
1656
+ * Line24 anchor draw rule for the Delay mission task.
1657
+ *
1658
+ * PT. 1 and PT. 2 are the free straight-line endpoints. PT. 3 is constrained to
1659
+ * the perpendicular axis through PT. 2, where its signed distance from PT. 2
1660
+ * defines the semicircular arc diameter and side. Unlike the sibling Line23
1661
+ * (Clear) rule, the third point must be placed explicitly (three user clicks),
1662
+ * with a two-point live preview before commit.
1663
+ */
1664
+ declare const line24DrawRule: ControlMeasureDrawRule;
1665
+ //#endregion
1666
+ //#region src/draw-rules/area8.d.ts
1667
+ declare const supportByFireDrawRule: ControlMeasureDrawRule;
1668
+ //#endregion
1669
+ //#region src/draw-rules/axis1.d.ts
1670
+ declare const axis1DrawRule: ControlMeasureDrawRule;
1671
+ //#endregion
1672
+ //#region src/generators/cm14-maneuver-lines/ambush.d.ts
1673
+ /**
1674
+ * Configuration options for the Ambush tactical symbol.
1675
+ */
1676
+ interface AmbushOptions {
1677
+ /** Number of segments used to draw the quadratic curve (default: 30) */
1678
+ resolution?: number;
1679
+ /** Size of arrowhead relative to chord span (default: 0.15) */
1680
+ arrowheadLengthRatio?: number;
1681
+ /** Width of arrowhead wings relative to its length (default: 0.5) */
1682
+ arrowheadWidthRatio?: number;
1683
+ /** Length of parallel hatches relative to chord span (default: 0.15) */
1684
+ hatchLengthRatio?: number;
1685
+ /** Number of parallel hatches along the curve (default: 5) */
1686
+ hatchCount?: number;
1687
+ /** Depth of the curve toward PT 1 relative to chord span (default: 0.25) */
1688
+ curveDepthRatio?: number;
1689
+ }
1690
+ declare const DEFAULT_AMBUSH_OPTIONS: Required<AmbushOptions>;
1691
+ //#endregion
1692
+ //#region src/generators/cm15-maneuver-areas/searchArea.d.ts
1693
+ /**
1694
+ * Configuration options to tweak the tactical arrow's geometry.
1695
+ */
1696
+ interface TacticalArrowOptions {
1697
+ /** Ratio of arrowhead length to total leg length (default: 0.12) */
1698
+ arrowheadLengthRatio?: number;
1699
+ /** Width multiplier for the arrowhead wings (default: 0.5) */
1700
+ arrowheadWidthRatio?: number;
1701
+ /** Percentage along the leg where the zigzag begins, 0.0-1.0 (default: 0.55) */
1702
+ zigzagStart?: number;
1703
+ /** Percentage along the leg where the zigzag returns, 0.0-1.0 (default: 0.45) */
1704
+ zigzagEnd?: number;
1705
+ /** Perpendicular offset for the lightning "kink", relative to leg length (default: 0.07) */
1706
+ zigzagAmplitudeRatio?: number;
1707
+ }
1708
+ /**
1709
+ * Default options for the tactical arrow.
1710
+ */
1711
+ declare const DEFAULT_TACTICAL_ARROW_OPTIONS: Required<TacticalArrowOptions>;
1712
+ //#endregion
1713
+ export { listControlMeasureMetadata as $, DEFAULT_ENCIRCLEMENT_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, DEFAULT_STRONG_POINT_OPTIONS as an, ObstacleBypassEasyOptions as at, pointOnMidpointPerpendicularAxis as b, AntitankDitchOptions as bt, line23DrawRule as c, ControlMeasureGeometryType as cn, DEFAULT_FIX_OPTIONS as ct, ambushDrawRule as d, AnchorTransformEvent as dn, DisruptOptions as dt, EncirclementOptions as en, DEFAULT_OBSTACLE_BYPASS_IMPOSSIBLE_OPTIONS as et, attackByFireDrawRule as f, ControlMeasureDrawRule as fn, BlockOptions as ft, MidpointPerpendicularDrawRuleOptions as g, DEFAULT_FORTIFIED_LINE_OPTIONS as gt, blockDrawRule as h, FortifiedAreaOptions as ht, DEFAULT_AMBUSH_OPTIONS as i, PrincipalDirectionOfFireOptions 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, ControlMeasureMetadata as ln, FixOptions as lt, disruptDrawRule as m, DEFAULT_FORTIFIED_AREA_OPTIONS as mt, TacticalArrowOptions as n, FinalProtectiveFireOptions as nn, DEFAULT_OBSTACLE_BYPASS_DIFFICULT_OPTIONS as nt, supportByFireDrawRule as o, StrongPointOptions as on, DEFAULT_TURN_OPTIONS as ot, point12DrawRule as p, DEFAULT_BLOCK_OPTIONS as pt, ControlMeasureId as q, MainAttackOptions as qt, AmbushOptions as r, DEFAULT_PRINCIPAL_DIRECTION_OF_FIRE_OPTIONS as rn, ObstacleBypassDifficultOptions as rt, line24DrawRule as s, ControlMeasureGeometry as sn, TurnOptions as st, DEFAULT_TACTICAL_ARROW_OPTIONS as t, DEFAULT_FINAL_PROTECTIVE_FIRE_OPTIONS as tn, ObstacleBypassImpossibleOptions as tt, line1DrawRule as u, ParamDescriptor as un, 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 };