@chrtco/sdk 0.10.53 → 0.10.55

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.
@@ -61,33 +61,35 @@ declare function getColorTable(name: ColorTableName): Record<string, string>;
61
61
  declare function resolveColor(token: string, table?: ColorTableName): string;
62
62
 
63
63
  /**
64
- * The symbol-artwork families, as one shared vocabulary.
64
+ * The symbol-artwork family ids, and the one name that used to be an id.
65
65
  *
66
- * `applyS101SymbolSet` / `applyChrtSymbolSet` / `applyRasterSymbolSet`
67
- * switch a whole generated style document. Consumers that build layers
68
- * class-by-class (the /map viewer's renderer) need the same decision at
69
- * the level of a single class — that's `iconExpressionForFamily`, so the
70
- * viewer and the Style API can never disagree about what a family means.
66
+ * No imports, on purpose: the style generator, the family helpers and the
67
+ * workers all read these, and none of them should pull another module in to
68
+ * do it.
69
+ *
70
+ * `raster` WAS the id of the paper-chart family until 2026-11 (shown as
71
+ * "CHRTraster"). It is `int1` now, after the standard it draws: IHO INT 1, the
72
+ * symbols of paper charts. The old id is stored and sent in too many places
73
+ * to drop: the Style API's `?symbols=`, offline packs on devices, CHRTweb's
74
+ * saved and synced settings, `/map?symbols=` links, and every published SDK.
75
+ * So every input accepts it, forever, and turns it into `int1` once, where it
76
+ * comes in. It is never listed as a family of its own.
71
77
  */
72
- type SymbolFamily = "s52" | "s101" | "chrt" | "raster";
73
- /** Every family, in presentation order. Mirrors the Style API's
74
- * `?symbols=` values (SYMBOL_SET_PARAMS in the tile worker). */
75
- declare const SYMBOL_FAMILIES: readonly SymbolFamily[];
76
- interface SymbolFamilyMeta {
77
- /** Short UI label. */
78
- label: string;
79
- /** One-line description of what the family is. */
80
- description: string;
81
- }
82
- declare const SYMBOL_FAMILY_META: Record<SymbolFamily, SymbolFamilyMeta>;
83
- /** Narrow an arbitrary string to a family, or null. Case-insensitive. */
84
- declare function parseSymbolFamily(raw: string | null | undefined): SymbolFamily | null;
85
78
  /**
86
- * The icon-image expression for one S-57 class under a given family —
87
- * the per-class equivalent of the `apply*SymbolSet` style rewrites.
88
- * Classes a family doesn't restyle fall back to the S-52 expression,
89
- * exactly as they do on a served style.
79
+ * A symbol-artwork family: what a style draws its symbols with. `uschart1` is
80
+ * INT-1 with the aids drawn as U.S. Chart No. 1's NOAA column draws them
81
+ * (diamond buoys, filled daybeacons; uschart1-marks.ts).
90
82
  */
91
- declare function iconExpressionForFamily(objectClass: string, family: SymbolFamily): string | unknown[];
83
+ type SymbolFamily = "s52" | "s101" | "chrt" | "int1" | "uschart1";
84
+ /** The family ids before 2026-11 that are no longer ids, and what each became. */
85
+ declare const LEGACY_SYMBOL_FAMILY_ALIASES: {
86
+ readonly raster: "int1";
87
+ };
88
+ /** An old family id that is still accepted as input. */
89
+ type LegacySymbolFamily = keyof typeof LEGACY_SYMBOL_FAMILY_ALIASES;
90
+ /** What an input may say: a family, or an old id for one. */
91
+ type SymbolFamilyInput = SymbolFamily | LegacySymbolFamily;
92
+ /** The family an input names: itself, or what an old id became. */
93
+ declare function normalizeSymbolFamily(family: SymbolFamilyInput): SymbolFamily;
92
94
 
93
- export { type ColorTableName as C, EINK_COLOR_TABLES as E, S52_COLORS as S, EINK_MONO_GREYS as a, S52_DAY as b, S52_DUSK as c, S52_EINK_COLOR as d, S52_EINK_MONO as e, S52_EINK_NIGHT as f, S52_NIGHT as g, SYMBOL_FAMILIES as h, SYMBOL_FAMILY_META as i, type SymbolFamily as j, type SymbolFamilyMeta as k, getColorTable as l, iconExpressionForFamily as m, isEinkColorTable as n, isEinkGreyTable as o, parseSymbolFamily as p, resolveColor as r };
95
+ export { type ColorTableName as C, EINK_COLOR_TABLES as E, LEGACY_SYMBOL_FAMILY_ALIASES as L, type SymbolFamilyInput as S, type SymbolFamily as a, EINK_MONO_GREYS as b, type LegacySymbolFamily as c, S52_COLORS as d, S52_DAY as e, S52_DUSK as f, S52_EINK_COLOR as g, S52_EINK_MONO as h, S52_EINK_NIGHT as i, S52_NIGHT as j, getColorTable as k, isEinkColorTable as l, isEinkGreyTable as m, normalizeSymbolFamily as n, resolveColor as r };
@@ -61,33 +61,35 @@ declare function getColorTable(name: ColorTableName): Record<string, string>;
61
61
  declare function resolveColor(token: string, table?: ColorTableName): string;
62
62
 
63
63
  /**
64
- * The symbol-artwork families, as one shared vocabulary.
64
+ * The symbol-artwork family ids, and the one name that used to be an id.
65
65
  *
66
- * `applyS101SymbolSet` / `applyChrtSymbolSet` / `applyRasterSymbolSet`
67
- * switch a whole generated style document. Consumers that build layers
68
- * class-by-class (the /map viewer's renderer) need the same decision at
69
- * the level of a single class — that's `iconExpressionForFamily`, so the
70
- * viewer and the Style API can never disagree about what a family means.
66
+ * No imports, on purpose: the style generator, the family helpers and the
67
+ * workers all read these, and none of them should pull another module in to
68
+ * do it.
69
+ *
70
+ * `raster` WAS the id of the paper-chart family until 2026-11 (shown as
71
+ * "CHRTraster"). It is `int1` now, after the standard it draws: IHO INT 1, the
72
+ * symbols of paper charts. The old id is stored and sent in too many places
73
+ * to drop: the Style API's `?symbols=`, offline packs on devices, CHRTweb's
74
+ * saved and synced settings, `/map?symbols=` links, and every published SDK.
75
+ * So every input accepts it, forever, and turns it into `int1` once, where it
76
+ * comes in. It is never listed as a family of its own.
71
77
  */
72
- type SymbolFamily = "s52" | "s101" | "chrt" | "raster";
73
- /** Every family, in presentation order. Mirrors the Style API's
74
- * `?symbols=` values (SYMBOL_SET_PARAMS in the tile worker). */
75
- declare const SYMBOL_FAMILIES: readonly SymbolFamily[];
76
- interface SymbolFamilyMeta {
77
- /** Short UI label. */
78
- label: string;
79
- /** One-line description of what the family is. */
80
- description: string;
81
- }
82
- declare const SYMBOL_FAMILY_META: Record<SymbolFamily, SymbolFamilyMeta>;
83
- /** Narrow an arbitrary string to a family, or null. Case-insensitive. */
84
- declare function parseSymbolFamily(raw: string | null | undefined): SymbolFamily | null;
85
78
  /**
86
- * The icon-image expression for one S-57 class under a given family —
87
- * the per-class equivalent of the `apply*SymbolSet` style rewrites.
88
- * Classes a family doesn't restyle fall back to the S-52 expression,
89
- * exactly as they do on a served style.
79
+ * A symbol-artwork family: what a style draws its symbols with. `uschart1` is
80
+ * INT-1 with the aids drawn as U.S. Chart No. 1's NOAA column draws them
81
+ * (diamond buoys, filled daybeacons; uschart1-marks.ts).
90
82
  */
91
- declare function iconExpressionForFamily(objectClass: string, family: SymbolFamily): string | unknown[];
83
+ type SymbolFamily = "s52" | "s101" | "chrt" | "int1" | "uschart1";
84
+ /** The family ids before 2026-11 that are no longer ids, and what each became. */
85
+ declare const LEGACY_SYMBOL_FAMILY_ALIASES: {
86
+ readonly raster: "int1";
87
+ };
88
+ /** An old family id that is still accepted as input. */
89
+ type LegacySymbolFamily = keyof typeof LEGACY_SYMBOL_FAMILY_ALIASES;
90
+ /** What an input may say: a family, or an old id for one. */
91
+ type SymbolFamilyInput = SymbolFamily | LegacySymbolFamily;
92
+ /** The family an input names: itself, or what an old id became. */
93
+ declare function normalizeSymbolFamily(family: SymbolFamilyInput): SymbolFamily;
92
94
 
93
- export { type ColorTableName as C, EINK_COLOR_TABLES as E, S52_COLORS as S, EINK_MONO_GREYS as a, S52_DAY as b, S52_DUSK as c, S52_EINK_COLOR as d, S52_EINK_MONO as e, S52_EINK_NIGHT as f, S52_NIGHT as g, SYMBOL_FAMILIES as h, SYMBOL_FAMILY_META as i, type SymbolFamily as j, type SymbolFamilyMeta as k, getColorTable as l, iconExpressionForFamily as m, isEinkColorTable as n, isEinkGreyTable as o, parseSymbolFamily as p, resolveColor as r };
95
+ export { type ColorTableName as C, EINK_COLOR_TABLES as E, LEGACY_SYMBOL_FAMILY_ALIASES as L, type SymbolFamilyInput as S, type SymbolFamily as a, EINK_MONO_GREYS as b, type LegacySymbolFamily as c, S52_COLORS as d, S52_DAY as e, S52_DUSK as f, S52_EINK_COLOR as g, S52_EINK_MONO as h, S52_EINK_NIGHT as i, S52_NIGHT as j, getColorTable as k, isEinkColorTable as l, isEinkGreyTable as m, normalizeSymbolFamily as n, resolveColor as r };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrtco/sdk",
3
- "version": "0.10.53",
3
+ "version": "0.10.55",
4
4
  "description": "Official TypeScript SDK for the CHRT nautical chart API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",