@zaes/sidc 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,142 @@
1
+ /**
2
+ * The fixed code tables of the numeric SIDC, transcribed from MIL-STD-2525E Change 1, Appendix A.
3
+ * Each table names its source so a reviewer can check it against the standard line by line.
4
+ * The entity and modifier tables (A-XI onward) are generated, not typed here.
5
+ */
6
+ /**
7
+ * Table A-I, Version. Value 10 is shared by 2525D and APP-6(D)(1), which the standard says carry
8
+ * the same versioning; `standard` gives the US one. 12, APP-6(D)(2), was withdrawn but codes
9
+ * carrying it may still exist. 17–3F are reserved.
10
+ */
11
+ export const VERSIONS = [
12
+ { value: '10', name: 'MIL-STD-2525D / APP-06(D)(1)', standard: '2525D', released: 'June 2014' },
13
+ { value: '11', name: 'MIL-STD-2525D(1)', standard: '2525D', released: '2018-08-02' },
14
+ { value: '12', name: 'APP-06(D)(2)', standard: 'APP-6D', released: 'Withdrawn' },
15
+ { value: '13', name: 'MIL-STD-2525E', standard: '2525E', released: '2022-12-31' },
16
+ { value: '14', name: 'APP-06(E)(1)', standard: 'APP-6E', released: 'October 2023' },
17
+ { value: '15', name: 'MIL-STD-2525E(1)', standard: '2525E', released: '2025-03-02' },
18
+ { value: '16', name: 'APP-06(E)(2)', standard: 'APP-6E', released: '2025-10-14' },
19
+ ];
20
+ /** Table A-II, first position: the context. */
21
+ export const CONTEXTS = [
22
+ { value: '0', name: 'Reality' },
23
+ { value: '1', name: 'Exercise' },
24
+ { value: '2', name: 'Simulation' },
25
+ { value: '3', name: 'Restricted Target – Reality' },
26
+ { value: '4', name: 'No-Strike Entity – Reality' },
27
+ { value: '5', name: 'Restricted Target – Exercise' },
28
+ { value: '6', name: 'No-Strike Entity – Exercise' },
29
+ { value: '7', name: 'Restricted Target – Simulation' },
30
+ { value: '8', name: 'No-Strike Entity – Simulation' },
31
+ ];
32
+ /** Table A-II, second position: the standard identity, with its Table A-III group. */
33
+ export const STANDARD_IDENTITIES = [
34
+ { value: '0', name: 'Pending', group: 'Unknown' },
35
+ { value: '1', name: 'Unknown', group: 'Unknown' },
36
+ { value: '2', name: 'Assumed Friend', group: 'Friend' },
37
+ { value: '3', name: 'Friend', group: 'Friend' },
38
+ { value: '4', name: 'Neutral', group: 'Neutral' },
39
+ { value: '5', name: 'Suspect/Joker', group: 'Hostile' },
40
+ { value: '6', name: 'Hostile/Faker', group: 'Hostile' },
41
+ ];
42
+ /** Table A-IV, Symbol sets (2525E). 2525D's 51–54 are not here: E folded them into 50. */
43
+ export const SYMBOL_SETS = [
44
+ { value: '00', name: 'Unknown' },
45
+ { value: '01', name: 'Air' },
46
+ { value: '02', name: 'Air Missile' },
47
+ { value: '05', name: 'Space' },
48
+ { value: '06', name: 'Space Missile' },
49
+ { value: '10', name: 'Land Unit' },
50
+ { value: '11', name: 'Land Civilian Unit/Organization' },
51
+ { value: '15', name: 'Land Equipment' },
52
+ { value: '20', name: 'Land Installation' },
53
+ { value: '25', name: 'Control Measures and Planning Symbols' },
54
+ { value: '27', name: 'Dismounted Individuals' },
55
+ { value: '30', name: 'Sea Surface' },
56
+ { value: '35', name: 'Sea Subsurface' },
57
+ { value: '36', name: 'Mine Warfare' },
58
+ { value: '40', name: 'Activities' },
59
+ { value: '45', name: 'Atmospheric' },
60
+ { value: '46', name: 'Oceanographic' },
61
+ { value: '47', name: 'Meteorological Space' },
62
+ { value: '50', name: 'Signals Intelligence' },
63
+ { value: '60', name: 'Cyberspace - Virtual' },
64
+ ];
65
+ /** 2525D's signals-intelligence sets (2525D Table A-IV), accepted as 2525D input only. */
66
+ export const SYMBOL_SETS_2525D_ONLY = [
67
+ { value: '50', name: 'Signals Intelligence – Space' },
68
+ { value: '51', name: 'Signals Intelligence – Air' },
69
+ { value: '52', name: 'Signals Intelligence – Land' },
70
+ { value: '53', name: 'Signals Intelligence – Surface' },
71
+ { value: '54', name: 'Signals Intelligence – Subsurface' },
72
+ ];
73
+ /** Table A-VI, Status. The same position may carry an operational condition instead (A.5.3.4.1). */
74
+ export const STATUSES = [
75
+ { value: '0', name: 'Present' },
76
+ { value: '1', name: 'Planned/Anticipated/Suspect' },
77
+ { value: '2', name: 'Present/Fully capable' },
78
+ { value: '3', name: 'Present/Damaged' },
79
+ { value: '4', name: 'Present/Destroyed' },
80
+ { value: '5', name: 'Present/Full to capacity' },
81
+ ];
82
+ /** Table A-VII, Headquarters/task force/dummy: three flags, one digit. */
83
+ export const HQ_TF_DUMMY = [
84
+ { value: '0', name: 'Unknown' },
85
+ { value: '1', name: 'Feint/Decoy/Dummy' },
86
+ { value: '2', name: 'Headquarters' },
87
+ { value: '3', name: 'Feint/Dummy Headquarters' },
88
+ { value: '4', name: 'Task Force' },
89
+ { value: '5', name: 'Feint/Dummy Task Force' },
90
+ { value: '6', name: 'Task Force Headquarters' },
91
+ { value: '7', name: 'Feint/Dummy Task Force Headquarters' },
92
+ ];
93
+ /** Table A-VIII, Amplifying descriptor (positions 9–10): echelon, mobility, towed array or leadership. */
94
+ export const AMPLIFYING_DESCRIPTORS = [
95
+ { value: '00', name: 'Unknown', kind: 'none' },
96
+ { value: '11', name: 'Team/Crew', kind: 'echelon' },
97
+ { value: '12', name: 'Squad', kind: 'echelon' },
98
+ { value: '13', name: 'Section', kind: 'echelon' },
99
+ { value: '14', name: 'Platoon/Detachment', kind: 'echelon' },
100
+ { value: '15', name: 'Company/Battery/Troop', kind: 'echelon' },
101
+ { value: '16', name: 'Battalion/Squadron', kind: 'echelon' },
102
+ { value: '17', name: 'Regiment/Group', kind: 'echelon' },
103
+ { value: '18', name: 'Brigade', kind: 'echelon' },
104
+ { value: '21', name: 'Division', kind: 'echelon' },
105
+ { value: '22', name: 'Corps/MEF', kind: 'echelon' },
106
+ { value: '23', name: 'Army', kind: 'echelon' },
107
+ { value: '24', name: 'Army Group/Front', kind: 'echelon' },
108
+ { value: '25', name: 'Region/Theater', kind: 'echelon' },
109
+ { value: '26', name: 'Command', kind: 'echelon' },
110
+ { value: '31', name: 'Wheeled limited cross country', kind: 'mobility' },
111
+ { value: '32', name: 'Wheeled cross country', kind: 'mobility' },
112
+ { value: '33', name: 'Tracked', kind: 'mobility' },
113
+ { value: '34', name: 'Wheeled and tracked combination', kind: 'mobility' },
114
+ { value: '35', name: 'Towed', kind: 'mobility' },
115
+ { value: '36', name: 'Rail', kind: 'mobility' },
116
+ { value: '37', name: 'Pack animals', kind: 'mobility' },
117
+ { value: '41', name: 'Over-snow (prime mover)', kind: 'mobility' },
118
+ { value: '42', name: 'Sled', kind: 'mobility' },
119
+ { value: '51', name: 'Barge', kind: 'mobility' },
120
+ { value: '52', name: 'Amphibious', kind: 'mobility' },
121
+ { value: '61', name: 'Short towed array', kind: 'towedArray' },
122
+ { value: '62', name: 'Long towed array', kind: 'towedArray' },
123
+ { value: '71', name: 'Leader Individual', kind: 'leadership' },
124
+ ];
125
+ /** Table A-LX, Frame shape (position 23): overrides the frame the symbol set would draw. */
126
+ export const FRAME_SHAPES = [
127
+ { value: '0', name: 'Unknown' },
128
+ { value: '1', name: 'Space' },
129
+ { value: '2', name: 'Air' },
130
+ { value: '3', name: 'Land Unit' },
131
+ { value: '4', name: 'Land Equipment' },
132
+ { value: '5', name: 'Land Installation' },
133
+ { value: '6', name: 'Dismounted Individuals' },
134
+ { value: '7', name: 'Sea Subsurface' },
135
+ { value: '8', name: 'Activity/Event' },
136
+ { value: '9', name: 'Cyberspace' },
137
+ { value: 'A', name: 'Sea Surface' },
138
+ ];
139
+ /** Looks a value up in one of the tables above. */
140
+ export function lookup(table, value) {
141
+ return table.find((e) => e.value === value);
142
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 2525C letter codes to later symbols: [version, symbol set, entity, sector 1, sector 2, note]. The
3
+ * version is 2525D's (10, 11) but for a few rows that need 2525E's common modifiers (15). A code with
4
+ * per-use positions is keyed by coding scheme, battle dimension or category, and function ID
5
+ * (positions 1, 3 and 5-10); a weather code, which has none, by '=' and all 15 positions. The note
6
+ * says where the two versions draw a symbol differently. Generated from the crosswalk named in
7
+ * THIRD-PARTY-NOTICES. Do not edit.
8
+ */
9
+ /** 1951 symbols. */
10
+ export declare const C_TO_D: Readonly<Record<string, readonly [string, string, string, string, string, string]>>;
@@ -0,0 +1,22 @@
1
+ import { type Problem } from '../numeric.js';
2
+ import { C_TO_D } from './data2525c.js';
3
+ export { C_TO_D };
4
+ export type Convert2525CResult = {
5
+ readonly ok: true;
6
+ /** The 30-position code: 2525D (version 10 or 11), or 2525E (15) where the symbol needs its common modifiers. */
7
+ readonly sidc: string;
8
+ readonly problems: readonly Problem[];
9
+ /** Where the crosswalk says 2525C and 2525D draw or name the symbol differently. */
10
+ readonly note?: string;
11
+ /** The function ID the crosswalk matched, when the code's own was not listed and a parent's was. */
12
+ readonly matched?: string;
13
+ } | {
14
+ readonly ok: false;
15
+ readonly problems: readonly Problem[];
16
+ };
17
+ /**
18
+ * Converts a 2525C letter code to a 30-position 2525D (or 2525E) code. A function ID the crosswalk does not list
19
+ * is converted as its nearest listed parent, with a problem; values the tables don't define are
20
+ * problems too, and only a code with no listed parent at all fails.
21
+ */
22
+ export declare function convert2525C(input: string): Convert2525CResult;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * MIL-STD-2525E Change 1: every entity (Appendix A, Tables A-XI to A-LVII) with its kind, Appendix A
3
+ * geometry, draw rule (Appendix L, or M for sets 45 and 46) and icon type (Appendices C-K), and
4
+ * every sector modifier (Tables A-IX to A-LIX).
5
+ *
6
+ * Generated from the standard's text. Do not edit: correct the reading instead.
7
+ */
8
+ import type { EntityRow, ModifierRow } from './types.js';
9
+ /** 2057 entities: 14 frame, 171 hierarchy, 977 icon, 436 multipoint, 459 point. */
10
+ export declare const ENTITIES_2525E: readonly EntityRow[];
11
+ /** 638 sector modifiers; `common` rows are Tables A-IX and A-X, their code led by the identifier. */
12
+ export declare const MODIFIERS_2525E: readonly ModifierRow[];
@@ -0,0 +1,27 @@
1
+ import type { NumericSidc } from '../numeric.js';
2
+ import type { Entity, EntityKind, SectorModifier } from './types.js';
3
+ export type { Entity, EntityKind, SectorModifier } from './types.js';
4
+ /** The entity a symbol set and positions 11–16 name, or undefined if 2525E Change 1 has none. */
5
+ export declare function getEntity(symbolSet: string, code: string): Entity | undefined;
6
+ /** Every entity, in the standard's order, optionally of one symbol set or kind. */
7
+ export declare function listEntities(filter?: {
8
+ symbolSet?: string;
9
+ kind?: EntityKind;
10
+ }): Entity[];
11
+ /**
12
+ * The sector modifier a code names. `identifier` is SIDC position 21 (sector 1) or 22 (sector 2):
13
+ * '0' looks in the symbol set's own table, anything else in the common table (A-IX, A-X), whose
14
+ * codes are the identifier followed by the two modifier positions.
15
+ */
16
+ export declare function getSectorModifier(symbolSet: string, sector: 1 | 2, code: string, identifier?: string): SectorModifier | undefined;
17
+ /** The sector modifiers of one symbol set (or `common`), in the standard's order. */
18
+ export declare function listSectorModifiers(symbolSet: string, sector: 1 | 2): SectorModifier[];
19
+ export interface SidcDescription {
20
+ readonly entity?: Entity;
21
+ readonly sector1?: SectorModifier;
22
+ readonly sector2?: SectorModifier;
23
+ /** Codes in positions 11–20 that 2525E Change 1 does not define. */
24
+ readonly problems: readonly string[];
25
+ }
26
+ /** What positions 11–20 of a 2525D/E code mean, by the 2525E Change 1 tables. */
27
+ export declare function describeSidc(sidc: NumericSidc | string): SidcDescription;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * What kind of drawing an entity is:
3
+ *
4
+ * - `icon`: an icon inside a frame (every framed symbol set);
5
+ * - `frame`: the `000000` Unspecified entity, a frame with no icon;
6
+ * - `point`: a control measure or METOC symbol placed at one anchor point at a fixed screen size;
7
+ * - `multipoint`: a line, an area, or a one-anchor shape sized in map units (a range fan, a circular
8
+ * target);
9
+ * - `hierarchy`: a heading in the table with nothing of its own to draw.
10
+ */
11
+ export type EntityKind = 'icon' | 'frame' | 'point' | 'multipoint' | 'hierarchy';
12
+ /** One generated entity row: [symbolSet, code, name, kind, Appendix A geometry, draw rule, icon type]. */
13
+ export type EntityRow = readonly [string, string, string, EntityKind, string, string, string];
14
+ /** One generated sector-modifier row: [symbolSet or 'common', sector, code, name, category]. */
15
+ export type ModifierRow = readonly [string, 1 | 2 | number, string, string, string];
16
+ export interface Entity {
17
+ readonly symbolSet: string;
18
+ /** Positions 11–16. */
19
+ readonly code: string;
20
+ /** The name as Appendix A gives it, at its own level (an entity subtype names only itself). */
21
+ readonly name: string;
22
+ /** Names from the entity down to this one, for display: `['Weapon/Weapon System', 'Machine Gun', 'Light']`. */
23
+ readonly path: readonly string[];
24
+ readonly kind: EntityKind;
25
+ /** Appendix A's geometry column (sets 25, 45, 46), where it has one. The draw rule is authoritative. */
26
+ readonly tableGeometry?: 'Point' | 'Line' | 'Area';
27
+ /** The draw rule: Appendix L's for set 25, Appendix M's (its own numbering) for sets 45 and 46. */
28
+ readonly drawRule?: string;
29
+ readonly drawRuleAppendix?: 'L' | 'M';
30
+ /** How the icon fills the frame (Appendices C–K): `Main`, `Main+1`, `Full Octagon` or `Full Frame`. */
31
+ readonly iconType?: string;
32
+ }
33
+ export interface SectorModifier {
34
+ /** The symbol set, or `common` for Appendix A Tables A-IX and A-X. */
35
+ readonly symbolSet: string;
36
+ readonly sector: 1 | 2;
37
+ /** As the table prints it: two characters, or three for a common modifier (identifier first). */
38
+ readonly code: string;
39
+ readonly name: string;
40
+ readonly category: string;
41
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * GENC (Geopolitical Entities, Names, and Codes) countries and entities by numeric code: SIDC
3
+ * positions 28–30 (MIL-STD-2525E A.5.5.4). Generated; do not edit.
4
+ */
5
+ /** [numeric, trigraph, digraph ('' where none is assigned), name]. 280 entries. */
6
+ export declare const GENC_COUNTRIES: readonly (readonly [string, string, string, string])[];
7
+ /** The country a three-digit GENC numeric code names, or undefined for '000' and unknown codes. */
8
+ export declare function gencCountry(numeric: string): {
9
+ trigraph: string;
10
+ digraph: string;
11
+ name: string;
12
+ } | undefined;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @zaes/sidc — symbol identification codes of MIL-STD-2525C, 2525D and 2525E (and APP-6 D/E):
3
+ * read, validate and write them. No dependencies, no DOM, no drawing.
4
+ *
5
+ * @module @zaes/sidc
6
+ */
7
+ import { type LetterSidc } from './letter.js';
8
+ import { type NumericSidc, type ParseResult } from './numeric.js';
9
+ export * from './tables.js';
10
+ export { parseNumericSidc, formatNumericSidc, type NumericSidc, type NumericSidcFields, type ParseResult, type Problem } from './numeric.js';
11
+ export { parseLetterSidc, CODING_SCHEMES, LETTER_IDENTITIES, BATTLE_DIMENSIONS, LETTER_STATUSES, ORDERS_OF_BATTLE, GRAPHIC_ORDERS_OF_BATTLE, type LetterSidc } from './letter.js';
12
+ export type Sidc = NumericSidc | LetterSidc;
13
+ /** Reads any SIDC: starting with a letter is 2525C (15 characters); 20 or 30 digits is numeric. */
14
+ export declare function parseSidc(input: string): ParseResult<Sidc>;
15
+ export { GENC_COUNTRIES, gencCountry } from './genc.js';
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The 15-character letter SIDC of MIL-STD-2525C (Appendix A, A.5.2 and Table A-I):
3
+ *
4
+ * 1 coding scheme · 2 standard identity · 3 battle dimension (or category) · 4 status ·
5
+ * 5–10 function ID · 11–12 symbol modifier · 13–14 country (ISO 3166-1) · 15 order of battle
6
+ *
7
+ * A dash fills an unused position and an asterisk a user-defined one. METOC (`W`) codes use their
8
+ * own layout (2525C Appendix C) and are read only for scheme and length here.
9
+ */
10
+ import type { CodeEntry, StandardIdentityGroup } from './tables.js';
11
+ import type { ParseResult } from './numeric.js';
12
+ /** 2525C Table A-I, position 1, with the appendix each scheme is defined in. */
13
+ export declare const CODING_SCHEMES: readonly (CodeEntry & {
14
+ appendix: string;
15
+ })[];
16
+ /** 2525C Table A-I, position 2, with whether it is the exercise form and its frame family. */
17
+ export declare const LETTER_IDENTITIES: readonly (CodeEntry & {
18
+ exercise: boolean;
19
+ group: StandardIdentityGroup;
20
+ })[];
21
+ /** 2525C Table A-I, position 3, for the warfighting scheme. */
22
+ export declare const BATTLE_DIMENSIONS: readonly CodeEntry[];
23
+ /** 2525C Table A-I, position 4. */
24
+ export declare const LETTER_STATUSES: readonly CodeEntry[];
25
+ /** 2525C Table A-I, position 15. */
26
+ export declare const ORDERS_OF_BATTLE: readonly CodeEntry[];
27
+ /** 2525C Table B-I, position 15 of a tactical graphic (coding scheme G). */
28
+ export declare const GRAPHIC_ORDERS_OF_BATTLE: readonly CodeEntry[];
29
+ export interface LetterSidc {
30
+ readonly kind: 'letter';
31
+ readonly standard: '2525C';
32
+ readonly code: string;
33
+ readonly scheme: string;
34
+ readonly standardIdentity: string;
35
+ readonly standardIdentityGroup: StandardIdentityGroup | undefined;
36
+ readonly exercise: boolean;
37
+ /** Battle dimension for the warfighting scheme; the category for the others. */
38
+ readonly dimension: string;
39
+ readonly status: string;
40
+ readonly functionId: string;
41
+ readonly modifier: string;
42
+ readonly country: string;
43
+ readonly orderOfBattle: string;
44
+ }
45
+ /**
46
+ * Reads a 2525C letter SIDC. Values the tables don't define are listed in `problems`. A code given
47
+ * without its trailing unused positions (`SFGPUCI` for `SFGPUCI--------`, as some systems store
48
+ * them) is read with dashes filling them, and `problems` says so; at least scheme, identity, dimension
49
+ * and status (4 characters) are needed.
50
+ */
51
+ export declare function parseLetterSidc(input: string): ParseResult<LetterSidc>;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The numeric SIDC of MIL-STD-2525D and 2525E (Appendix A, A.5): 20 positions in 2525D, 30 in
3
+ * 2525E. A 20-position code read as 2525E has an all-zero Set C.
4
+ *
5
+ * Set A 1–2 version · 3 context · 4 standard identity · 5–6 symbol set · 7 status ·
6
+ * 8 headquarters/task force/dummy · 9–10 amplifying descriptor
7
+ * Set B 11–16 entity, entity type, entity subtype · 17–18 sector 1 modifier · 19–20 sector 2 modifier
8
+ * Set C 21 sector 1 modifier identifier · 22 sector 2 modifier identifier · 23 frame shape ·
9
+ * 24–27 reserved · 28–30 country (GENC numeric)
10
+ */
11
+ import { type NumericStandard, type StandardIdentityGroup } from './tables.js';
12
+ export interface NumericSidc {
13
+ readonly kind: 'numeric';
14
+ /** The code as given, 20 or 30 positions. */
15
+ readonly code: string;
16
+ /** The standard named by the version; undefined for a reserved version. */
17
+ readonly standard: NumericStandard | undefined;
18
+ readonly version: string;
19
+ readonly context: string;
20
+ readonly standardIdentity: string;
21
+ readonly standardIdentityGroup: StandardIdentityGroup | undefined;
22
+ readonly symbolSet: string;
23
+ readonly status: string;
24
+ readonly hqTfDummy: string;
25
+ readonly headquarters: boolean;
26
+ readonly taskForce: boolean;
27
+ readonly feintDummy: boolean;
28
+ readonly amplifyingDescriptor: string;
29
+ /** Positions 11–16. */
30
+ readonly entityCode: string;
31
+ readonly sector1: string;
32
+ readonly sector2: string;
33
+ /** Position 21: '0' means the symbol set's own sector 1 modifiers; more is a common-modifier table (Appendix B). */
34
+ readonly sector1Identifier: string;
35
+ readonly sector2Identifier: string;
36
+ /** Position 23. */
37
+ readonly frameShape: string;
38
+ /** Positions 28–30, GENC numeric; '000' when absent. */
39
+ readonly country: string;
40
+ }
41
+ export interface Problem {
42
+ /** 1-based first position the problem is about. */
43
+ readonly position: number;
44
+ readonly message: string;
45
+ }
46
+ export type ParseResult<T> = {
47
+ ok: true;
48
+ sidc: T;
49
+ problems: readonly Problem[];
50
+ } | {
51
+ ok: false;
52
+ problems: readonly Problem[];
53
+ };
54
+ /**
55
+ * Reads a numeric SIDC. A code of the wrong length or with characters outside [0-9A-F] fails; a
56
+ * well-formed code with values the tables don't define parses, with each one listed in `problems`,
57
+ * so a caller can decide whether to draw it.
58
+ */
59
+ export declare function parseNumericSidc(input: string): ParseResult<NumericSidc>;
60
+ /** The fields a numeric SIDC is written from; anything left out is 0. */
61
+ export type NumericSidcFields = Partial<Omit<NumericSidc, 'kind' | 'code' | 'standard' | 'standardIdentityGroup' | 'headquarters' | 'taskForce' | 'feintDummy'>>;
62
+ /** Writes a 30-position 2525E SIDC (version 15 unless given). Each field is padded to its width. */
63
+ export declare function formatNumericSidc(fields: NumericSidcFields): string;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The fixed code tables of the numeric SIDC, transcribed from MIL-STD-2525E Change 1, Appendix A.
3
+ * Each table names its source so a reviewer can check it against the standard line by line.
4
+ * The entity and modifier tables (A-XI onward) are generated, not typed here.
5
+ */
6
+ /** A code value and what the standard calls it. */
7
+ export interface CodeEntry<V extends string = string> {
8
+ readonly value: V;
9
+ readonly name: string;
10
+ }
11
+ /** The standard a numeric SIDC's version (positions 1–2) belongs to. */
12
+ export type NumericStandard = '2525D' | '2525E' | 'APP-6D' | 'APP-6E';
13
+ export interface VersionEntry extends CodeEntry {
14
+ readonly standard: NumericStandard;
15
+ /** The edition's release, as Table A-I gives it. */
16
+ readonly released: string;
17
+ }
18
+ /**
19
+ * Table A-I, Version. Value 10 is shared by 2525D and APP-6(D)(1), which the standard says carry
20
+ * the same versioning; `standard` gives the US one. 12, APP-6(D)(2), was withdrawn but codes
21
+ * carrying it may still exist. 17–3F are reserved.
22
+ */
23
+ export declare const VERSIONS: readonly VersionEntry[];
24
+ /** Table A-II, first position: the context. */
25
+ export declare const CONTEXTS: readonly CodeEntry[];
26
+ /** The four frame families of Table A-III. */
27
+ export type StandardIdentityGroup = 'Unknown' | 'Friend' | 'Neutral' | 'Hostile';
28
+ export interface StandardIdentityEntry extends CodeEntry {
29
+ /** Table A-III: which frame family the identity draws with. */
30
+ readonly group: StandardIdentityGroup;
31
+ }
32
+ /** Table A-II, second position: the standard identity, with its Table A-III group. */
33
+ export declare const STANDARD_IDENTITIES: readonly StandardIdentityEntry[];
34
+ /** Table A-IV, Symbol sets (2525E). 2525D's 51–54 are not here: E folded them into 50. */
35
+ export declare const SYMBOL_SETS: readonly CodeEntry[];
36
+ /** 2525D's signals-intelligence sets (2525D Table A-IV), accepted as 2525D input only. */
37
+ export declare const SYMBOL_SETS_2525D_ONLY: readonly CodeEntry[];
38
+ /** Table A-VI, Status. The same position may carry an operational condition instead (A.5.3.4.1). */
39
+ export declare const STATUSES: readonly CodeEntry[];
40
+ /** Table A-VII, Headquarters/task force/dummy: three flags, one digit. */
41
+ export declare const HQ_TF_DUMMY: readonly CodeEntry[];
42
+ export type AmplifierKind = 'none' | 'echelon' | 'mobility' | 'towedArray' | 'leadership';
43
+ export interface AmplifierEntry extends CodeEntry {
44
+ readonly kind: AmplifierKind;
45
+ }
46
+ /** Table A-VIII, Amplifying descriptor (positions 9–10): echelon, mobility, towed array or leadership. */
47
+ export declare const AMPLIFYING_DESCRIPTORS: readonly AmplifierEntry[];
48
+ /** Table A-LX, Frame shape (position 23): overrides the frame the symbol set would draw. */
49
+ export declare const FRAME_SHAPES: readonly CodeEntry[];
50
+ /** Looks a value up in one of the tables above. */
51
+ export declare function lookup<E extends CodeEntry>(table: readonly E[], value: string): E | undefined;
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
- {
2
- "name": "@zaes/sidc",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@zaes/sidc",
3
+ "version": "0.1.0",
4
+ "author": "ZAES",
5
+ "contributors": [
6
+ "Edwin Sanchez <edwin.sanchez@zaes.com>"
7
+ ],
8
+ "description": "MIL-STD-2525C, 2525D and 2525E symbol identification codes (SIDC): read, validate and write them. No dependencies.",
9
+ "keywords": [
10
+ "mil-std-2525",
11
+ "mil-std-2525e",
12
+ "mil-std-2525d",
13
+ "mil-std-2525c",
14
+ "app-6",
15
+ "sidc",
16
+ "military-symbols",
17
+ "military-symbology",
18
+ "symbology"
19
+ ],
20
+ "license": "MIT AND Apache-2.0",
21
+ "main": "dist/cjs/index.js",
22
+ "module": "dist/esm/index.js",
23
+ "types": "dist/types/index.d.ts",
24
+ "files": [
25
+ "dist",
26
+ "README.md",
27
+ "LICENSE",
28
+ "THIRD-PARTY-NOTICES"
29
+ ],
30
+ "sideEffects": false,
31
+ "engines": {
32
+ "node": ">=18"
33
+ },
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/types/index.d.ts",
37
+ "import": "./dist/esm/index.js",
38
+ "require": "./dist/cjs/index.js"
39
+ },
40
+ "./catalog": {
41
+ "types": "./dist/types/catalog/index.d.ts",
42
+ "import": "./dist/esm/catalog/index.js",
43
+ "require": "./dist/cjs/catalog/index.js"
44
+ },
45
+ "./2525c": {
46
+ "types": "./dist/types/2525c/index.d.ts",
47
+ "import": "./dist/esm/2525c/index.js",
48
+ "require": "./dist/cjs/2525c/index.js"
49
+ },
50
+ "./package.json": "./package.json"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "typesVersions": {
56
+ "*": {
57
+ "catalog": [
58
+ "dist/types/catalog/index.d.ts"
59
+ ],
60
+ "2525c": [
61
+ "dist/types/2525c/index.d.ts"
62
+ ]
63
+ }
64
+ }
65
+ }