@chrtco/sdk 0.5.0 → 0.6.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,17 @@
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 };
@@ -0,0 +1,17 @@
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrtco/sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Official TypeScript SDK for the CHRT nautical chart API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -16,10 +16,17 @@
16
16
  "types": "./dist/node/index.d.ts",
17
17
  "import": "./dist/node/index.js",
18
18
  "require": "./dist/node/index.cjs"
19
+ },
20
+ "./atlas/browser": {
21
+ "types": "./dist/atlas/browser.d.ts",
22
+ "import": "./dist/atlas/browser.js",
23
+ "require": "./dist/atlas/browser.cjs"
19
24
  }
20
25
  },
21
26
  "files": ["dist", "README.md", "CHANGELOG.md"],
22
27
  "scripts": {
28
+ "gen:svgs": "bun run scripts/gen-s52-svgs.ts",
29
+ "prebuild": "bun run gen:svgs",
23
30
  "build": "tsup",
24
31
  "dev": "tsup --watch",
25
32
  "typecheck": "tsc --noEmit",
@@ -33,8 +40,18 @@
33
40
  "directory": "packages/sdk"
34
41
  },
35
42
  "homepage": "https://chrt.co/docs/sdks",
43
+ "peerDependencies": {
44
+ "maplibre-gl": "^4.0.0 || ^5.0.0"
45
+ },
46
+ "peerDependenciesMeta": {
47
+ "maplibre-gl": {
48
+ "optional": true
49
+ }
50
+ },
36
51
  "devDependencies": {
52
+ "@maplibre/maplibre-gl-style-spec": "^20.4.0",
37
53
  "@types/node": "^20.0.0",
54
+ "maplibre-gl": "^4.7.1",
38
55
  "tsup": "^8.0.0",
39
56
  "typescript": "^5.4.0",
40
57
  "vitest": "^2.1.0"