@chrtco/sdk 0.10.42 → 0.10.44

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,47 @@
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 };
@@ -0,0 +1,47 @@
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrtco/sdk",
3
- "version": "0.10.42",
3
+ "version": "0.10.44",
4
4
  "description": "Official TypeScript SDK for the CHRT nautical chart API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,17 +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
- export { type ColorTableName as C, S52_COLORS as S, S52_DAY as a, S52_DUSK as b, S52_NIGHT as c, getColorTable as g, resolveColor as r };
@@ -1,17 +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
- export { type ColorTableName as C, S52_COLORS as S, S52_DAY as a, S52_DUSK as b, S52_NIGHT as c, getColorTable as g, resolveColor as r };