gedcom-ts 2026.6.0 → 2026.6.2

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.
@@ -22,13 +22,15 @@ export type GedcomExportOptions = {
22
22
  * Valeur `1 DEST` sous `HEAD` (URI ou identifiant d’application cible, ex. `https://gedcom.io/`).
23
23
  */
24
24
  headDestination?: string | null;
25
+ /** Rapport d’avancement import / export (0–100 %). */
26
+ onProgress?: import("../utils/gedcom/transferProgress").GedcomTransferProgressCallback;
25
27
  };
26
28
  declare class GEDCOM {
27
29
  protected title: string;
28
30
  protected persons: Array<Person>;
29
31
  protected onCreate: number;
30
32
  private haveFiles;
31
- private readonly exportOptions;
33
+ protected readonly exportOptions: GedcomExportOptions;
32
34
  constructor(title: string | undefined, persons: Array<Person>, haveFiles: boolean, exportOptions?: GedcomExportOptions | null);
33
35
  private get beginGedcom();
34
36
  private get defaultSubmitterRecord();
@@ -40,19 +42,22 @@ declare class GEDCOM {
40
42
  }
41
43
  export declare class ExportGedzipFile extends GEDCOM {
42
44
  constructor(...args: [Person[]] | [string, Person[]] | [Person[], GedcomExportOptions] | [string, Person[], GedcomExportOptions]);
45
+ gedzipBlob(): Promise<Blob>;
43
46
  download(): Promise<void>;
47
+ private collectGedzipMediaEntries;
44
48
  private resolvePersonIndi;
45
49
  private resolveActIndis;
46
50
  private resolveZipPath;
47
- private zipFile;
48
51
  }
49
52
  export declare class ExportGedcomFile extends GEDCOM {
50
53
  constructor(...args: [Person[]] | [string, Person[]] | [Person[], GedcomExportOptions] | [string, Person[], GedcomExportOptions]);
51
54
  download(): void;
52
55
  }
53
56
  export declare class FamilyLine {
57
+ private readonly persons;
58
+ private readonly haveFiles;
54
59
  private informationFamilies;
55
- constructor(persons: Person[]);
60
+ constructor(persons: Person[], haveFiles: boolean);
56
61
  lines(): string;
57
62
  private setInformationFamilies;
58
63
  }
@@ -67,7 +72,7 @@ export declare class PersonLine {
67
72
  private readonly ACTS;
68
73
  private readonly NOTES;
69
74
  private readonly haveFiles;
70
- constructor(person: Person, haveFiles: boolean);
75
+ constructor(person: Person, haveFiles: boolean, allPersons: readonly Person[]);
71
76
  line(): string;
72
77
  private getIndi;
73
78
  private getName;
@@ -0,0 +1,10 @@
1
+ import { type GedcomTransferProgressCallback } from "../utils/gedcom/transferProgress";
2
+ export interface GedzipMediaEntry {
3
+ readonly path: string;
4
+ readonly file: File;
5
+ }
6
+ /**
7
+ * Construit un GEDZIP en écrivant chaque entrée via {@link BlobReader}
8
+ * (sans assembler un dictionnaire `fflate` ni charger tous les médias en RAM).
9
+ */
10
+ export declare function buildGedzipBlob(gedPath: string, gedcomBlob: Blob, mediaEntries: readonly GedzipMediaEntry[], onProgress?: GedcomTransferProgressCallback): Promise<Blob>;
@@ -0,0 +1,10 @@
1
+ import { Act } from "../commons/Act";
2
+ import type { Person } from "../commons/Person";
3
+ export declare function familyUnionActDedupeKey(act: Act): string;
4
+ export declare function isFamilyUnionAct(act: Act): boolean;
5
+ export declare function partnerIndisForFam(persons: readonly Person[], famId: number): Set<number>;
6
+ export declare function actBelongsToFamPartners(act: Act, famPartnerIndis: ReadonlySet<number>): boolean;
7
+ export declare function shouldExportUnionActOnFam(act: Act, famId: number, persons: readonly Person[]): boolean;
8
+ export declare function collectUnionActsForFamExport(persons: readonly Person[], famId: number): Act[];
9
+ export declare function unionActKeysExportedOnFam(person: Person, persons: readonly Person[]): Set<string>;
10
+ export declare function actsForIndiGedcomExport(person: Person, persons: readonly Person[]): Act[];
@@ -1,5 +1,6 @@
1
1
  import { ReadGed } from './ReadGed';
2
2
  import type { Place } from '../commons/Place';
3
+ import { type GedcomTransferProgressCallback } from "../utils/gedcom/transferProgress";
3
4
  /**
4
5
  * Erreur levée quand une entrée `.ged` dans un ZIP ne se décode pas comme du GEDCOM valide
5
6
  * (en-tête `0 HEAD` absent au début). Cause la plus fréquente : **ZIP chiffré** (mot de passe),
@@ -13,4 +14,7 @@ export declare const createEmptyReadGed: (options?: {
13
14
  mapFiles?: Map<string, File>;
14
15
  placesMap?: Map<string, Place>;
15
16
  }) => ReadGed;
16
- export declare const importGedFile: (file: File) => Promise<ReadGed>;
17
+ export type ImportGedFileOptions = {
18
+ onProgress?: GedcomTransferProgressCallback;
19
+ };
20
+ export declare const importGedFile: (file: File, options?: ImportGedFileOptions) => Promise<ReadGed>;
@@ -3,6 +3,7 @@ import { Person } from '../commons/Person';
3
3
  import { SplitGedcom } from "./SplitedInformations";
4
4
  import { Place } from "../commons/Place";
5
5
  import { type GedcomDatasetVersion } from "../utils/gedcom/datasetVersion";
6
+ import type { GedcomTransferProgressCallback } from "../utils/gedcom/transferProgress";
6
7
  /**
7
8
  * Graphe importé depuis un fichier GEDCOM. Les enregistrements de niveau `0` non intégrés au modèle
8
9
  * typé (OBJE, REPO, SOUR, etc.) restent accessibles via {@link preservedTopLevelRecords}.
@@ -36,7 +37,7 @@ export declare class ReadGed extends SplitGedcom {
36
37
  mapFiles?: Map<string, File>;
37
38
  placesMap?: Map<string, Place>;
38
39
  }): ReadGed;
39
- static fromGedcomFile(gedcomFile: File, mapFiles?: Map<string, File>, placesMap?: Map<string, Place>, mapPersons?: Map<number, Person>): Promise<ReadGed>;
40
+ static fromGedcomFile(gedcomFile: File, mapFiles?: Map<string, File>, placesMap?: Map<string, Place>, mapPersons?: Map<number, Person>, onProgress?: GedcomTransferProgressCallback, percentRange?: readonly [number, number]): Promise<ReadGed>;
40
41
  private finalizeAfterParse;
41
42
  /**
42
43
  * Reconstruit {@link partnersMap} et {@link childsMap} à partir des pointeurs `FAMS` / `FAMC`
@@ -44,6 +45,11 @@ export declare class ReadGed extends SplitGedcom {
44
45
  * cartes (pas d’accumulation).
45
46
  */
46
47
  groupPartners(): void;
48
+ /**
49
+ * Complète les participants (`act.INDIS`) des actes d’union à partir des familles `FAMS`.
50
+ * Appelé automatiquement après import ; peut être rappelé après restauration ou édition des liens.
51
+ */
52
+ enrichUnionActParticipants(): void;
47
53
  createDirectAncestries(person: Person): Person[];
48
54
  generateUniqueIndi(): number;
49
55
  /**
@@ -1,4 +1,5 @@
1
1
  import type { ObjeRecord } from "../commons/ObjeRecord";
2
+ import { type GedcomTransferProgressCallback } from "../utils/gedcom/transferProgress";
2
3
  export declare class SplitGedcom {
3
4
  /** Lignes du premier enregistrement `0 HEAD` (y compris la ligne `0 HEAD`), si présent. */
4
5
  protected informationHeaderLines: string[] | null;
@@ -22,7 +23,7 @@ export declare class SplitGedcom {
22
23
  clearPreservedTopLevelRecords(): void;
23
24
  constructor(gedcomContent?: string);
24
25
  protected ingestGedcomText(gedcomContent: string): void;
25
- protected ingestGedcomFileStream(file: File): Promise<void>;
26
+ protected ingestGedcomFileStream(file: File, onProgress?: GedcomTransferProgressCallback, percentRange?: readonly [number, number]): Promise<void>;
26
27
  private ingestRecordBlock;
27
28
  /** N’ajoute pas `0 TRLR` (terminaison du fichier). */
28
29
  private preserveTopLevelRecord;
@@ -0,0 +1,6 @@
1
+ import type { ReadGed } from "./ReadGed";
2
+ /**
3
+ * Complète `act.INDIS` des actes d’union lorsque le conjoint est connu via `FAMS` / `partnersMap`
4
+ * mais absent des participants de l’acte (fichiers sans `ASSO` ni `HUSB`/`WIFE` sous l’événement).
5
+ */
6
+ export declare function enrichMarriageActsFromUnions(readGed: ReadGed): void;
@@ -0,0 +1,6 @@
1
+ import { type GedcomTransferProgressCallback } from "../utils/gedcom/transferProgress";
2
+ /**
3
+ * Extrait les entrées d’un GEDZIP via lectures aléatoires sur le `Blob`
4
+ * (sans `arrayBuffer()` sur l’archive entière ni `unzipSync` monolithique).
5
+ */
6
+ export declare function extractZipContent(zipFile: Blob, onProgress?: GedcomTransferProgressCallback): Promise<Map<string, File>>;