gedcom-ts 2.0.2 → 2.1.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.
- package/CHANGELOG.md +92 -0
- package/README.md +370 -89
- package/dist/commons/Act.d.ts +38 -6
- package/dist/commons/DateAct.d.ts +40 -2
- package/dist/commons/Identifier.enum.d.ts +3 -0
- package/dist/commons/IndiAttribute.d.ts +11 -0
- package/dist/commons/IndiGedcomSubLine.d.ts +6 -0
- package/dist/commons/MultimediaFile.d.ts +13 -2
- package/dist/commons/Person.d.ts +21 -3
- package/dist/commons/PersonNameVariant.d.ts +21 -0
- package/dist/commons/Place.d.ts +19 -0
- package/dist/commons/gedcomEventTags.d.ts +10 -0
- package/dist/edit/ActEdit.d.ts +29 -0
- package/dist/edit/ActsEdit.d.ts +17 -0
- package/dist/edit/DateActEdit.d.ts +37 -0
- package/dist/edit/NotesEdit.d.ts +14 -0
- package/dist/edit/PersonEdit.d.ts +27 -0
- package/dist/edit/PlaceEdit.d.ts +23 -0
- package/dist/edit/index.d.ts +19 -0
- package/dist/export/GEDCOM.d.ts +33 -4
- package/dist/import/LoadFile.d.ts +14 -0
- package/dist/import/ReadGed.d.ts +43 -0
- package/dist/import/SplitedInformations.d.ts +29 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -4
- package/dist/index.mjs +1 -1
- package/dist/utils/gedcom/actExtraction.d.ts +3 -1
- package/dist/utils/gedcom/datasetVersion.d.ts +7 -0
- package/dist/utils/gedcom/extractIndiNamesAndAttributes.d.ts +4 -0
- package/dist/utils/gedcom/labelKeyedRecords.d.ts +13 -0
- package/dist/utils/gedcom/mediaFormFromUri.d.ts +2 -0
- package/dist/utils/gedcom/parseStandaloneObje.d.ts +9 -0
- package/dist/utils/gedcom/personName.d.ts +7 -0
- package/dist/utils/gedcom/pointers.d.ts +16 -0
- package/dist/version.d.ts +6 -0
- package/package.json +1 -1
package/dist/import/ReadGed.d.ts
CHANGED
|
@@ -1,21 +1,64 @@
|
|
|
1
1
|
import { Person } from '../commons/Person';
|
|
2
2
|
import { SplitGedcom } from "./SplitedInformations";
|
|
3
3
|
import { Place } from "../commons/Place";
|
|
4
|
+
import { type GedcomDatasetVersion } from "../utils/gedcom/datasetVersion";
|
|
5
|
+
/**
|
|
6
|
+
* Graphe importé depuis un fichier GEDCOM. Les enregistrements de niveau `0` non intégrés au modèle
|
|
7
|
+
* typé (OBJE, REPO, SOUR, etc.) restent accessibles via {@link preservedTopLevelRecords}.
|
|
8
|
+
*/
|
|
4
9
|
export declare class ReadGed extends SplitGedcom {
|
|
10
|
+
private resolvedInformationFamilies;
|
|
11
|
+
private resolvedInformationNotes;
|
|
12
|
+
private famPointerToId;
|
|
13
|
+
private notePointerToId;
|
|
14
|
+
private objePayloadById;
|
|
15
|
+
/** Déduit du bloc `HEAD` (`GEDC`.`VERS`). */
|
|
16
|
+
datasetVersion: GedcomDatasetVersion;
|
|
5
17
|
persons: Person[];
|
|
6
18
|
mapPersons: Map<number, Person>;
|
|
7
19
|
partnersMap: Map<number, Person[]>;
|
|
8
20
|
childsMap: Map<number, Person[]>;
|
|
9
21
|
mapFiles: Map<string, File>;
|
|
10
22
|
placesMap: Map<string, Place>;
|
|
23
|
+
/**
|
|
24
|
+
* Index des pointeurs d’individu GEDCOM vers {@link Person.INDI} interne.
|
|
25
|
+
* Clés typiques : `Homer_Simpson` (xref textuelle), `I12` (xref `@I12@`).
|
|
26
|
+
*/
|
|
27
|
+
private individualPointerToIndiNumber;
|
|
11
28
|
constructor(gedcomContent?: string, mapFiles?: Map<string, File>, placesMap?: Map<string, Place>, mapPersons?: Map<number, Person>);
|
|
29
|
+
/**
|
|
30
|
+
* Empty genealogy (no INDI/FAM), same runtime shape as after {@link importGedFile}:
|
|
31
|
+
* `persons`, `partnersMap`, `childsMap`, `mapPersons`, `placesMap`, `mapFiles` are initialized.
|
|
32
|
+
*/
|
|
33
|
+
static empty(options?: {
|
|
34
|
+
mapFiles?: Map<string, File>;
|
|
35
|
+
placesMap?: Map<string, Place>;
|
|
36
|
+
}): ReadGed;
|
|
12
37
|
static fromGedcomFile(gedcomFile: File, mapFiles?: Map<string, File>, placesMap?: Map<string, Place>, mapPersons?: Map<number, Person>): Promise<ReadGed>;
|
|
13
38
|
private finalizeAfterParse;
|
|
39
|
+
/**
|
|
40
|
+
* Reconstruit {@link partnersMap} et {@link childsMap} à partir des pointeurs `FAMS` / `FAMC`
|
|
41
|
+
* de chaque personne. Peut être rappelé après édition des liens ; chaque appel remplace les
|
|
42
|
+
* cartes (pas d’accumulation).
|
|
43
|
+
*/
|
|
14
44
|
groupPartners(): void;
|
|
15
45
|
createDirectAncestries(person: Person): Person[];
|
|
16
46
|
generateUniqueIndi(): number;
|
|
47
|
+
/**
|
|
48
|
+
* Résout un pointeur GEDCOM d’individu (`@Homer_Simpson@`, `Homer_Simpson`, `@I5@`, `I5`) vers la personne importée.
|
|
49
|
+
* Utile pour interpréter `1 CHIL @…@` ou `1 HUSB @…@` dans des fichiers à xref textuelle.
|
|
50
|
+
*/
|
|
51
|
+
resolveIndividualPointer(raw: string): Person | undefined;
|
|
52
|
+
/** Enfants rattachés aux unions listées dans `parent.FAMS` (même logique que {@link childsMap}). */
|
|
53
|
+
getChildrenForParent(parent: Person): Person[];
|
|
54
|
+
/** Enfants d’une famille donnée (identifiant interne `F`, ex. `0` pour `@F0000@`). */
|
|
55
|
+
getChildrenOfFamily(familyId: number): Person[];
|
|
17
56
|
private haveParentsOfPerson;
|
|
18
57
|
private createPersons;
|
|
58
|
+
/**
|
|
59
|
+
* Xrefs textuelles `0 @Homer_Simpson@ INDI` → entiers uniques (après le max des `@I{n}@` du fichier).
|
|
60
|
+
*/
|
|
61
|
+
private buildTextualIndiXrefToSyntheticIdMap;
|
|
19
62
|
private buildPerson;
|
|
20
63
|
private hydratePlacesFromActs;
|
|
21
64
|
private upsertPlace;
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
export declare class SplitGedcom {
|
|
2
|
+
/** Lignes du premier enregistrement `0 HEAD` (y compris la ligne `0 HEAD`), si présent. */
|
|
3
|
+
protected informationHeaderLines: string[] | null;
|
|
2
4
|
protected informationPersons: string[][];
|
|
3
|
-
|
|
4
|
-
protected
|
|
5
|
+
/** Lignes sous `0 @F…@ FAM` indexées par libellé xref canonique (`1`, `famA`, …). */
|
|
6
|
+
protected informationFamiliesByLabel: Map<string, string[]>;
|
|
7
|
+
/** Lignes sous `0 @N…@ NOTE|SNOTE` indexées par libellé xref canonique. */
|
|
8
|
+
protected informationNotesByLabel: Map<string, string[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Enregistrements `0 …` non intégrés au modèle typé (OBJE, REPO, SOUR, SUBM, FAM/NOTE à xref non
|
|
11
|
+
* numérique, etc.). Conservés dans l’ordre du fichier pour diagnostic ou futur re‑export.
|
|
12
|
+
* `0 TRLR` n’est pas conservé (terminaison standard).
|
|
13
|
+
*/
|
|
14
|
+
private readonly _preservedTopLevelRecords;
|
|
15
|
+
get preservedTopLevelRecords(): readonly string[];
|
|
5
16
|
constructor(gedcomContent?: string);
|
|
6
17
|
protected ingestGedcomText(gedcomContent: string): void;
|
|
7
18
|
protected ingestGedcomFileStream(file: File): Promise<void>;
|
|
8
19
|
private ingestRecordBlock;
|
|
20
|
+
/** N’ajoute pas `0 TRLR` (terminaison du fichier). */
|
|
21
|
+
private preserveTopLevelRecord;
|
|
22
|
+
/** Tout enregistrement `0 @xref@ INDI` (xref numérique `@I1@` ou textuelle `@Homer_Simpson@`). */
|
|
23
|
+
private isIndiRecordFirstLine;
|
|
24
|
+
/**
|
|
25
|
+
* Retire de {@link preservedTopLevelRecords} les blocs `0 @O…@ OBJE` décodables et renvoie leurs
|
|
26
|
+
* charges utiles pour l’hydratation des pointeurs `OBJE` sous `INDI` / actes.
|
|
27
|
+
*/
|
|
28
|
+
protected absorbStandaloneObjeBlocksInto(): Map<number, {
|
|
29
|
+
sourceUri: string;
|
|
30
|
+
}>;
|
|
31
|
+
private splitInformationHeader;
|
|
9
32
|
private splitInformationPersons;
|
|
33
|
+
/** @returns `true` si le bloc a été stocké dans {@link informationFamiliesByLabel}. */
|
|
10
34
|
private splitInformationFamilies;
|
|
35
|
+
/** @returns `true` si le bloc a été stocké dans {@link informationNotesByLabel}. */
|
|
11
36
|
private splitInformationNotes;
|
|
12
|
-
private
|
|
37
|
+
private extractFamRecordLabel;
|
|
38
|
+
private extractNoteRecordLabel;
|
|
13
39
|
}
|