glossarist 0.4.6 → 0.4.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glossarist",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "JavaScript SDK for Glossarist GCR packages — read, write, validate, and manage terminology concepts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -42,6 +42,11 @@
42
42
  "import": "./src/rdf/index.js",
43
43
  "default": "./src/rdf/index.js"
44
44
  },
45
+ "./rdf/prefixes": {
46
+ "types": "./src/rdf/predicates.d.ts",
47
+ "import": "./src/rdf/predicates.js",
48
+ "default": "./src/rdf/predicates.js"
49
+ },
45
50
  "./transforms": {
46
51
  "types": "./src/transforms/index.d.ts",
47
52
  "import": "./src/transforms/index.js",
@@ -1,4 +1,49 @@
1
1
  export const ORDERING_METHODS: readonly string[];
2
+
3
+ // Dataset color spec (light/dark variants)
4
+ export type DatasetColorSpec = string;
5
+ export interface DatasetColorPair {
6
+ light: string;
7
+ dark: string;
8
+ }
9
+ export type DatasetColor = DatasetColorSpec | DatasetColorPair;
10
+ export const COLOR_MODES: readonly ['light', 'dark'];
11
+ export function resolveColor(color: DatasetColor | null | undefined, mode: 'light' | 'dark'): string | null;
12
+ export function isColorPair(color: unknown): color is DatasetColorPair;
13
+ export function validateColor(color: unknown): string | null;
14
+
15
+ // Relation categories + color registry
16
+ export interface RelationCategoryDef {
17
+ readonly label: string;
18
+ readonly description: string;
19
+ readonly types: readonly string[];
20
+ }
21
+ export const RELATION_CATEGORIES: Readonly<Record<string, RelationCategoryDef>>;
22
+ export function categoryOf(type: string): string | null;
23
+ export function categoryDefinition(categoryKey: string): RelationCategoryDef | null;
24
+ export function uncategorizedTypes(): string[];
25
+ export function duplicatedTypes(): Array<{ type: string; count: number }>;
26
+
27
+ export interface RelationColorPair {
28
+ light: string;
29
+ dark: string;
30
+ }
31
+ export const RELATION_COLOR_DEFAULTS: Readonly<{
32
+ byCategory: Readonly<Record<string, RelationColorPair>>;
33
+ byType: Readonly<Record<string, RelationColorPair>>;
34
+ }>;
35
+ export function resolveRelationColor(
36
+ type: string,
37
+ options?: {
38
+ overrides?: { byType?: Record<string, RelationColorPair | string>; byCategory?: Record<string, RelationColorPair | string> };
39
+ mode?: 'light' | 'dark';
40
+ },
41
+ ): string | null;
42
+ export function categoryColorPair(
43
+ categoryKey: string,
44
+ overrides?: { byCategory?: Record<string, RelationColorPair | string> },
45
+ ): RelationColorPair | null;
46
+
2
47
  export class Section extends GlossaristModel {
3
48
  readonly id: string | null;
4
49
  readonly names: Record<string, string>;