@chrtco/sdk 0.10.46 → 0.10.48

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,93 @@
1
+ /**
2
+ * IHO S-52 Colour Tables: DAY_BRIGHT, DUSK, and NIGHT — plus CHRT's two
3
+ * e-ink tables, EINK_COLOR and EINK_MONO, which are NOT S-52 tables (see
4
+ * their block below).
5
+ * Each token maps to a hex colour string.
6
+ * Source: IHO S-52 Presentation Library, Edition 4.0 – Annex A
7
+ */
8
+ type ColorTableName = "DAY" | "DUSK" | "NIGHT" | "EINK_COLOR" | "EINK_MONO" | "EINK_NIGHT";
9
+ /**
10
+ * The e-ink chart palettes, by what a client calls the mode. Import this
11
+ * rather than spelling the strings: a client that keys its e-ink setting off
12
+ * these names can never ask for a table the SDK does not have.
13
+ *
14
+ * color E Ink Kaleido 3 and other colour e-paper (150 ppi colour layer over
15
+ * a 300 ppi black-and-white one). Paper ground, black ink, a few
16
+ * strong colours as fills and thick lines only.
17
+ * mono Monochrome e-paper (Carta), e-ink monitors, and colour panels run
18
+ * in black-and-white. Four greys; every distinction the colour chart
19
+ * makes by hue is made here by weight, dash, pattern or symbol.
20
+ * night E-ink at night, front light on (any e-ink panel, colour or mono).
21
+ * The mono chart inverted: a black page, so the front light the
22
+ * page reflects into a dark-adapted eye is small. Replaces red night
23
+ * on e-ink, where no front light is red (owner, 2026-10-05).
24
+ *
25
+ * Wire names on the served style (`?theme=`) are the lowercase table names:
26
+ * `eink_color`, `eink_mono`, `eink_night`.
27
+ */
28
+ declare const EINK_COLOR_TABLES: {
29
+ readonly color: "EINK_COLOR";
30
+ readonly mono: "EINK_MONO";
31
+ readonly night: "EINK_NIGHT";
32
+ };
33
+ /** True for the e-ink tables. */
34
+ declare function isEinkColorTable(ct: ColorTableName): ct is "EINK_COLOR" | "EINK_MONO" | "EINK_NIGHT";
35
+ /** True for the e-ink tables drawn in the four greys only (mono and night). */
36
+ declare function isEinkGreyTable(ct: ColorTableName): ct is "EINK_MONO" | "EINK_NIGHT";
37
+ /**
38
+ * The four greys EINK_MONO is built from, and nothing else. Carta panels show
39
+ * 16 grey levels, of which about four are reliably distinct at a glance (fewer
40
+ * in sunlight) — so the mono chart uses exactly four, a third of the range
41
+ * apart, and every further distinction is a line weight, dash or fill pattern.
42
+ * Owner decision 2026-10-05: one mono palette, four greys.
43
+ */
44
+ declare const EINK_MONO_GREYS: {
45
+ readonly INK: "#000000";
46
+ readonly DARK: "#555555";
47
+ readonly MID: "#aaaaaa";
48
+ readonly PAPER: "#ffffff";
49
+ };
50
+ declare const S52_DAY: Record<string, string>;
51
+ declare const S52_DUSK: Record<string, string>;
52
+ declare const S52_NIGHT: Record<string, string>;
53
+ declare const S52_EINK_COLOR: Record<string, string>;
54
+ declare const S52_EINK_MONO: Record<string, string>;
55
+ declare const S52_EINK_NIGHT: Record<string, string>;
56
+ /** Backward-compatible alias – the DAY_BRIGHT table */
57
+ declare const S52_COLORS: Record<string, string>;
58
+ /** Get a full colour table by name */
59
+ declare function getColorTable(name: ColorTableName): Record<string, string>;
60
+ /** Resolve an S-52 colour token to a hex string. Falls back to black/amber. */
61
+ declare function resolveColor(token: string, table?: ColorTableName): string;
62
+
63
+ /**
64
+ * The symbol-artwork families, as one shared vocabulary.
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.
71
+ */
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
+ /**
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.
90
+ */
91
+ declare function iconExpressionForFamily(objectClass: string, family: SymbolFamily): string | unknown[];
92
+
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 };
@@ -0,0 +1,93 @@
1
+ /**
2
+ * IHO S-52 Colour Tables: DAY_BRIGHT, DUSK, and NIGHT — plus CHRT's two
3
+ * e-ink tables, EINK_COLOR and EINK_MONO, which are NOT S-52 tables (see
4
+ * their block below).
5
+ * Each token maps to a hex colour string.
6
+ * Source: IHO S-52 Presentation Library, Edition 4.0 – Annex A
7
+ */
8
+ type ColorTableName = "DAY" | "DUSK" | "NIGHT" | "EINK_COLOR" | "EINK_MONO" | "EINK_NIGHT";
9
+ /**
10
+ * The e-ink chart palettes, by what a client calls the mode. Import this
11
+ * rather than spelling the strings: a client that keys its e-ink setting off
12
+ * these names can never ask for a table the SDK does not have.
13
+ *
14
+ * color E Ink Kaleido 3 and other colour e-paper (150 ppi colour layer over
15
+ * a 300 ppi black-and-white one). Paper ground, black ink, a few
16
+ * strong colours as fills and thick lines only.
17
+ * mono Monochrome e-paper (Carta), e-ink monitors, and colour panels run
18
+ * in black-and-white. Four greys; every distinction the colour chart
19
+ * makes by hue is made here by weight, dash, pattern or symbol.
20
+ * night E-ink at night, front light on (any e-ink panel, colour or mono).
21
+ * The mono chart inverted: a black page, so the front light the
22
+ * page reflects into a dark-adapted eye is small. Replaces red night
23
+ * on e-ink, where no front light is red (owner, 2026-10-05).
24
+ *
25
+ * Wire names on the served style (`?theme=`) are the lowercase table names:
26
+ * `eink_color`, `eink_mono`, `eink_night`.
27
+ */
28
+ declare const EINK_COLOR_TABLES: {
29
+ readonly color: "EINK_COLOR";
30
+ readonly mono: "EINK_MONO";
31
+ readonly night: "EINK_NIGHT";
32
+ };
33
+ /** True for the e-ink tables. */
34
+ declare function isEinkColorTable(ct: ColorTableName): ct is "EINK_COLOR" | "EINK_MONO" | "EINK_NIGHT";
35
+ /** True for the e-ink tables drawn in the four greys only (mono and night). */
36
+ declare function isEinkGreyTable(ct: ColorTableName): ct is "EINK_MONO" | "EINK_NIGHT";
37
+ /**
38
+ * The four greys EINK_MONO is built from, and nothing else. Carta panels show
39
+ * 16 grey levels, of which about four are reliably distinct at a glance (fewer
40
+ * in sunlight) — so the mono chart uses exactly four, a third of the range
41
+ * apart, and every further distinction is a line weight, dash or fill pattern.
42
+ * Owner decision 2026-10-05: one mono palette, four greys.
43
+ */
44
+ declare const EINK_MONO_GREYS: {
45
+ readonly INK: "#000000";
46
+ readonly DARK: "#555555";
47
+ readonly MID: "#aaaaaa";
48
+ readonly PAPER: "#ffffff";
49
+ };
50
+ declare const S52_DAY: Record<string, string>;
51
+ declare const S52_DUSK: Record<string, string>;
52
+ declare const S52_NIGHT: Record<string, string>;
53
+ declare const S52_EINK_COLOR: Record<string, string>;
54
+ declare const S52_EINK_MONO: Record<string, string>;
55
+ declare const S52_EINK_NIGHT: Record<string, string>;
56
+ /** Backward-compatible alias – the DAY_BRIGHT table */
57
+ declare const S52_COLORS: Record<string, string>;
58
+ /** Get a full colour table by name */
59
+ declare function getColorTable(name: ColorTableName): Record<string, string>;
60
+ /** Resolve an S-52 colour token to a hex string. Falls back to black/amber. */
61
+ declare function resolveColor(token: string, table?: ColorTableName): string;
62
+
63
+ /**
64
+ * The symbol-artwork families, as one shared vocabulary.
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.
71
+ */
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
+ /**
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.
90
+ */
91
+ declare function iconExpressionForFamily(objectClass: string, family: SymbolFamily): string | unknown[];
92
+
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrtco/sdk",
3
- "version": "0.10.46",
3
+ "version": "0.10.48",
4
4
  "description": "Official TypeScript SDK for the CHRT nautical chart API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,47 +0,0 @@
1
- /**
2
- * IHO S-52 Colour Tables: DAY_BRIGHT, DUSK, and NIGHT.
3
- * Each token maps to a hex colour string.
4
- * Source: IHO S-52 Presentation Library, Edition 4.0 – Annex A
5
- */
6
- type ColorTableName = "DAY" | "DUSK" | "NIGHT";
7
- declare const S52_DAY: Record<string, string>;
8
- declare const S52_DUSK: Record<string, string>;
9
- declare const S52_NIGHT: Record<string, string>;
10
- /** Backward-compatible alias – the DAY_BRIGHT table */
11
- declare const S52_COLORS: Record<string, string>;
12
- /** Get a full colour table by name */
13
- declare function getColorTable(name: ColorTableName): Record<string, string>;
14
- /** Resolve an S-52 colour token to a hex string. Falls back to black/amber. */
15
- declare function resolveColor(token: string, table?: ColorTableName): string;
16
-
17
- /**
18
- * The symbol-artwork families, as one shared vocabulary.
19
- *
20
- * `applyS101SymbolSet` / `applyChrtSymbolSet` / `applyRasterSymbolSet`
21
- * switch a whole generated style document. Consumers that build layers
22
- * class-by-class (the /map viewer's renderer) need the same decision at
23
- * the level of a single class — that's `iconExpressionForFamily`, so the
24
- * viewer and the Style API can never disagree about what a family means.
25
- */
26
- type SymbolFamily = "s52" | "s101" | "chrt" | "raster";
27
- /** Every family, in presentation order. Mirrors the Style API's
28
- * `?symbols=` values (SYMBOL_SET_PARAMS in the tile worker). */
29
- declare const SYMBOL_FAMILIES: readonly SymbolFamily[];
30
- interface SymbolFamilyMeta {
31
- /** Short UI label. */
32
- label: string;
33
- /** One-line description of what the family is. */
34
- description: string;
35
- }
36
- declare const SYMBOL_FAMILY_META: Record<SymbolFamily, SymbolFamilyMeta>;
37
- /** Narrow an arbitrary string to a family, or null. Case-insensitive. */
38
- declare function parseSymbolFamily(raw: string | null | undefined): SymbolFamily | null;
39
- /**
40
- * The icon-image expression for one S-57 class under a given family —
41
- * the per-class equivalent of the `apply*SymbolSet` style rewrites.
42
- * Classes a family doesn't restyle fall back to the S-52 expression,
43
- * exactly as they do on a served style.
44
- */
45
- declare function iconExpressionForFamily(objectClass: string, family: SymbolFamily): string | unknown[];
46
-
47
- export { type ColorTableName as C, S52_COLORS as S, S52_DAY as a, S52_DUSK as b, S52_NIGHT as c, SYMBOL_FAMILIES as d, SYMBOL_FAMILY_META as e, type SymbolFamily as f, type SymbolFamilyMeta as g, getColorTable as h, iconExpressionForFamily as i, parseSymbolFamily as p, resolveColor as r };
@@ -1,47 +0,0 @@
1
- /**
2
- * IHO S-52 Colour Tables: DAY_BRIGHT, DUSK, and NIGHT.
3
- * Each token maps to a hex colour string.
4
- * Source: IHO S-52 Presentation Library, Edition 4.0 – Annex A
5
- */
6
- type ColorTableName = "DAY" | "DUSK" | "NIGHT";
7
- declare const S52_DAY: Record<string, string>;
8
- declare const S52_DUSK: Record<string, string>;
9
- declare const S52_NIGHT: Record<string, string>;
10
- /** Backward-compatible alias – the DAY_BRIGHT table */
11
- declare const S52_COLORS: Record<string, string>;
12
- /** Get a full colour table by name */
13
- declare function getColorTable(name: ColorTableName): Record<string, string>;
14
- /** Resolve an S-52 colour token to a hex string. Falls back to black/amber. */
15
- declare function resolveColor(token: string, table?: ColorTableName): string;
16
-
17
- /**
18
- * The symbol-artwork families, as one shared vocabulary.
19
- *
20
- * `applyS101SymbolSet` / `applyChrtSymbolSet` / `applyRasterSymbolSet`
21
- * switch a whole generated style document. Consumers that build layers
22
- * class-by-class (the /map viewer's renderer) need the same decision at
23
- * the level of a single class — that's `iconExpressionForFamily`, so the
24
- * viewer and the Style API can never disagree about what a family means.
25
- */
26
- type SymbolFamily = "s52" | "s101" | "chrt" | "raster";
27
- /** Every family, in presentation order. Mirrors the Style API's
28
- * `?symbols=` values (SYMBOL_SET_PARAMS in the tile worker). */
29
- declare const SYMBOL_FAMILIES: readonly SymbolFamily[];
30
- interface SymbolFamilyMeta {
31
- /** Short UI label. */
32
- label: string;
33
- /** One-line description of what the family is. */
34
- description: string;
35
- }
36
- declare const SYMBOL_FAMILY_META: Record<SymbolFamily, SymbolFamilyMeta>;
37
- /** Narrow an arbitrary string to a family, or null. Case-insensitive. */
38
- declare function parseSymbolFamily(raw: string | null | undefined): SymbolFamily | null;
39
- /**
40
- * The icon-image expression for one S-57 class under a given family —
41
- * the per-class equivalent of the `apply*SymbolSet` style rewrites.
42
- * Classes a family doesn't restyle fall back to the S-52 expression,
43
- * exactly as they do on a served style.
44
- */
45
- declare function iconExpressionForFamily(objectClass: string, family: SymbolFamily): string | unknown[];
46
-
47
- export { type ColorTableName as C, S52_COLORS as S, S52_DAY as a, S52_DUSK as b, S52_NIGHT as c, SYMBOL_FAMILIES as d, SYMBOL_FAMILY_META as e, type SymbolFamily as f, type SymbolFamilyMeta as g, getColorTable as h, iconExpressionForFamily as i, parseSymbolFamily as p, resolveColor as r };