@treeviz/gedcom-parser 1.0.23 → 2.0.1

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": "@treeviz/gedcom-parser",
3
- "version": "1.0.23",
3
+ "version": "2.0.1",
4
4
  "description": "Lightweight, pluggable GEDCOM parser for JavaScript/TypeScript with optional caching and place matching. Zero browser dependencies.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1 +0,0 @@
1
- #!/usr/bin/env node
@@ -1,37 +0,0 @@
1
- import { ac as IndiKey, aB as Path, ag as Individuals } from './index-CSjQRlxq.js';
2
-
3
- /**
4
- * Cache manager interface for pluggable cache implementations.
5
- * The main project can inject custom implementations (e.g., IndexedDB) via setCacheManagerFactory.
6
- */
7
- interface ICacheManager<T> {
8
- getItem: () => Promise<T | null>;
9
- setItem: (value: T) => Promise<void>;
10
- }
11
- interface Caches {
12
- pathCache: Record<`${IndiKey}|${IndiKey}`, Path> | undefined;
13
- relativesOnLevelCache: Record<IndiKey, Record<number, Individuals>> | undefined;
14
- relativesOnDegreeCache: Record<IndiKey, Record<number, Individuals>> | undefined;
15
- }
16
- type CacheRelatives<O extends keyof Caches = "pathCache"> = <T extends keyof Omit<Caches, O>, K extends keyof NonNullable<Omit<Caches, O>[T]>>(cacheKey: T) => (key: K, subKey: number, ...values: [keyof NonNullable<Omit<Caches, O>[T]>[K]]) => NonNullable<Omit<Caches, O>[T]>[K];
17
- declare const resetRelativesCache: () => void;
18
- declare const relativesCache: (cacheKey: keyof Omit<Caches, "pathCache">) => <T extends Individuals | undefined>(key: IndiKey, subKey: number, value?: T) => T;
19
- declare const pathCache: <T extends Path | undefined>(key: `${IndiKey}|${IndiKey}`, value?: T) => T;
20
-
21
- /**
22
- * Minimal place parsing stub for gedcom-parser
23
- * This is a simplified version - consumer apps can implement full place parsing if needed
24
- */
25
- interface PlaceParts {
26
- leftParts?: string[];
27
- town?: string;
28
- county?: string;
29
- country?: string;
30
- }
31
- /**
32
- * Simple place parser - splits by commas
33
- * Consumer apps can implement more sophisticated parsing if needed
34
- */
35
- declare const getPlaceParts: (place?: string | (string | undefined)[]) => PlaceParts[];
36
-
37
- export { type CacheRelatives as C, type ICacheManager as I, type PlaceParts as P, resetRelativesCache as a, getPlaceParts as g, pathCache as p, relativesCache as r };