@treeviz/gedcom-parser 1.0.22 → 2.0.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,40 @@
1
+ import { ac as IndiKey, aB as Path, ag as Individuals, aH as ProfilePicture, p as GedComType } from './index-CzYZg44D.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<`${string}:${IndiKey}|${IndiKey}`, Path> | undefined;
13
+ relativesOnLevelCache: Record<`${string}:${IndiKey}`, Record<number, Individuals>> | undefined;
14
+ relativesOnDegreeCache: Record<`${string}:${IndiKey}`, Record<number, Individuals>> | undefined;
15
+ profilePictureCache: Record<`${string}:${IndiKey}`, ProfilePicture> | undefined;
16
+ }
17
+ 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];
18
+ declare const initializeCache: () => Promise<void>;
19
+ declare const resetRelativesCache: () => void;
20
+ declare const relativesCache: (cacheKey: "relativesOnLevelCache" | "relativesOnDegreeCache") => <T extends Individuals | undefined>(gedcom: GedComType | undefined, key: IndiKey, subKey: number, value?: T) => T;
21
+ declare const pathCache: <T extends Path | undefined>(gedcom: GedComType | undefined, key: `${IndiKey}|${IndiKey}`, value?: T) => T;
22
+ declare const profilePictureCache: <T extends ProfilePicture | undefined>(gedcom: GedComType | undefined, key: IndiKey, value?: T) => T;
23
+
24
+ /**
25
+ * Minimal place parsing stub for gedcom-parser
26
+ * This is a simplified version - consumer apps can implement full place parsing if needed
27
+ */
28
+ interface PlaceParts {
29
+ leftParts?: string[];
30
+ town?: string;
31
+ county?: string;
32
+ country?: string;
33
+ }
34
+ /**
35
+ * Simple place parser - splits by commas
36
+ * Consumer apps can implement more sophisticated parsing if needed
37
+ */
38
+ declare const getPlaceParts: (place?: string | (string | undefined)[]) => PlaceParts[];
39
+
40
+ export { type CacheRelatives as C, type ICacheManager as I, type PlaceParts as P, profilePictureCache as a, resetRelativesCache as b, getPlaceParts as g, initializeCache as i, pathCache as p, relativesCache as r };
@@ -1,11 +1,13 @@
1
- import { l as Settings, ak as GedComType, M as MultiTag, ao as Common, t as IdType, bl as IDateStructure, aj as FamType, az as CommonDate, a1 as IndiType, n as IndiKey, J as NestedGroup, aP as Individuals } from './index-BPEVN_DY.js';
1
+ import { aU as Settings, p as GedComType, ao as MultiTag, a as Common, a7 as IdType, D as IDateStructure, af as IndiType, ac as IndiKey, j as FamType, b as CommonDate, aq as NestedGroup, ag as Individuals } from './index-CzYZg44D.js';
2
2
 
3
3
  declare const GedcomTree: {
4
4
  parse: (content: string, options?: {
5
5
  settings?: Settings;
6
+ filename?: string;
6
7
  }) => any;
7
8
  parseHierarchy: (content: string, options?: {
8
9
  settings?: Settings;
10
+ filename?: string;
9
11
  }) => {
10
12
  gedcom: GedComType;
11
13
  raw: string;
@@ -85,4 +87,4 @@ declare const hungarianOrdinalize: (n: number) => string;
85
87
  */
86
88
  declare const placeTranslator: (place: string | string[]) => string;
87
89
 
88
- export { ACCEPTED_DATE_FORMATS as A, GedcomTree as G, ACCEPTED_DATE_FORMATS_REGEX as a, commonDateFormatter as b, create as c, dateFormatter as d, getAllProp as e, getFamilyWith as f, getRawSize as g, getVersion as h, isDevelopment as i, getName as j, implemented as k, notImplemented as l, marriageDateFormatter as m, noteDateFormatter as n, nameFormatter as o, ordinalize as p, hungarianOrdinalize as q, placeTranslator as r, setNestedGroup as s };
90
+ export { ACCEPTED_DATE_FORMATS as A, GedcomTree as G, ACCEPTED_DATE_FORMATS_REGEX as a, create as b, commonDateFormatter as c, dateFormatter as d, getFamilyWith as e, getName as f, getAllProp as g, getRawSize as h, getVersion as i, hungarianOrdinalize as j, implemented as k, isDevelopment as l, marriageDateFormatter as m, nameFormatter as n, notImplemented as o, noteDateFormatter as p, ordinalize as q, placeTranslator as r, setNestedGroup as s };
@@ -1,5 +1,5 @@
1
- import { ao as Common, bx as INoteStructure, bA as ISourceCitationStructure } from '../index-BPEVN_DY.js';
2
- export { bh as IAddress, bi as IAssociation, bj as IChangeDate, bk as ICreationDate, bl as IDate, bm as IEventDetail, bm as IEventDetailStructure, bn as IFamily, bo as IGedcomStructure, br as IIndividual, bq as IIndividualEvent, bp as IIndividualEventDetail, br as IIndividualStructure, bs as ILdsOrdinanceDetail, bt as ILdsSpouseSealing, bu as IMarriageDate, bv as IMultimediaLink, bw as INonEvent, by as IPlace, bz as IRepository, bC as ISource, bB as ISourceRepositoryCitation } from '../index-BPEVN_DY.js';
1
+ import { a as Common, Z as INoteStructure, a4 as ISourceCitationStructure } from '../index-CzYZg44D.js';
2
+ export { I as IAddress, y as IAssociation, z as IChangeDate, B as ICreationDate, D as IDate, H as IEventDetail, H as IEventDetailStructure, L as IFamily, N as IGedcomStructure, P as IIndividual, Q as IIndividualEvent, R as IIndividualEventDetail, P as IIndividualStructure, T as ILdsOrdinanceDetail, U as ILdsSpouseSealing, W as IMarriageDate, X as IMultimediaLink, Y as INonEvent, $ as IPlace, a1 as IRepository, a3 as ISource, a5 as ISourceRepositoryCitation } from '../index-CzYZg44D.js';
3
3
  import 'date-fns';
4
4
 
5
5
  interface IPersonalNamePiecesStructure extends Common {
@@ -1,4 +1,4 @@
1
- export { m as ConvertType, F as FamKey, x as Filter, w as FilterIterator, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, t as IdType, n as IndiKey, V as LinkedPersons, v as ListTag, M as MultiTag, K as NameOrder, J as NestedGroup, N as NonStandard, O as ObjeKey, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, Q as PlaceOrder, Y as Range, W as RelationType, o as RepoKey, y as RequiredFilter, l as Settings, q as SourKey, r as SubmKey, u as Tag, T as TagKey, U as UnknownKey } from '../index-BPEVN_DY.js';
1
+ export { e as ConvertType, i as FamKey, n as Filter, o as FilterIterator, u as Group, v as GroupDefinition, w as GroupIterator, x as GroupMarker, a7 as IdType, ac as IndiKey, aj as LinkedPersons, al as ListTag, ao as MultiTag, ap as NameOrder, aq as NestedGroup, as as NonStandard, au as ObjeKey, ax as Order, ay as OrderDefinition, az as OrderIterator, aA as PartnerType, aE as PlaceOrder, aL as Range, aO as RelationType, aQ as RepoKey, aT as RequiredFilter, aU as Settings, aW as SourKey, a$ as SubmKey, b2 as Tag, b3 as TagKey, b5 as UnknownKey } from '../index-CzYZg44D.js';
2
2
  import 'date-fns';
3
3
 
4
4
  interface AncestryMedia {
@@ -1,6 +1,6 @@
1
- export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from '../place-parser-CM0TJFj8.js';
2
- export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, b as commonDateFormatter, c as create, d as dateFormatter, e as getAllProp, f as getFamilyWith, j as getName, g as getRawSize, h as getVersion, q as hungarianOrdinalize, k as implemented, i as isDevelopment, m as marriageDateFormatter, o as nameFormatter, l as notImplemented, n as noteDateFormatter, p as ordinalize, r as placeTranslator, s as setNestedGroup } from '../place-translator-CRiaOO9v.js';
3
- export { bD as Place, bE as PlaceType, P as PrimitiveRange, R as Range, S as SplitResult, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, bF as getPlaces, i as inRange, a as isIntersectedRange, b as isRangeContained, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange } from '../index-BPEVN_DY.js';
1
+ export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, i as initializeCache, p as pathCache, a as profilePictureCache, r as relativesCache, b as resetRelativesCache } from '../place-parser-CJ3EbFmb.js';
2
+ export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, c as commonDateFormatter, b as create, d as dateFormatter, g as getAllProp, e as getFamilyWith, f as getName, h as getRawSize, i as getVersion, j as hungarianOrdinalize, k as implemented, l as isDevelopment, m as marriageDateFormatter, n as nameFormatter, o as notImplemented, p as noteDateFormatter, q as ordinalize, r as placeTranslator, s as setNestedGroup } from '../place-translator-Ci5rEY6p.js';
3
+ export { aD as Place, aF as PlaceType, aG as PrimitiveRange, aM as Range, aZ as SplitResult, bi as extractSeparationYears, bj as extractSplitPoints, bk as findMatchingRangeForSplitRange, bl as fromTuple, bm as generateSplitRanges, bo as getPlaces, bt as inRange, bx as isIntersectedRange, bz as isRangeContained, bC as parseRangeBounds, bD as splitOverlappingRanges, bE as splitRange } from '../index-CzYZg44D.js';
4
4
  import 'date-fns';
5
5
 
6
6
  /**