gedcom-ts
Version:
TypeScript GEDCOM toolkit for browser apps: import .ged/.zip, edit typed genealogy data, and export GEDCOM or GEDZIP.
48 lines (47 loc) • 2.09 kB
TypeScript
import type { IndiAttribute } from "../commons/IndiAttribute";
import { Person, Sex } from "../commons/Person";
import type { PersonNameVariant } from "../commons/PersonNameVariant";
import { ActsEdit } from "./ActsEdit";
import { IndiAttributesEdit } from "./IndiAttributesEdit";
import { NameVariantsEdit } from "./NameVariantsEdit";
import { NotesEdit } from "./NotesEdit";
import { PersonMediaEdit } from "./PersonMediaEdit";
/**
* API d’édition cohérente autour d'un {@link Person} existant (identité, unions, actes, notes).
*/
export declare class PersonEdit {
private readonly target;
constructor(target: Person);
get value(): Person;
setSex(sex: Sex | undefined): this;
setLastname(lastname: string): this;
setFirstnames(firstnames: readonly string[]): this;
setSosa(sosa: number | undefined): this;
setFamc(famc: number | undefined): this;
/** Efface le lien de filiation (`FAMC`). */
clearFamc(): this;
/** Remplace la liste des unions (`FAMS`). */
setFams(fams: readonly number[]): this;
clearFams(): this;
appendFams(famId: number): this;
/** Retire l’identifiant de famille à l’index donné dans `FAMS`. */
removeFamsAt(index: number): this;
/** Retire la première occurrence de `familyId` dans `FAMS` (no-op si absent). */
removeFamsByFamilyId(familyId: number): this;
setNameVariants(variants: readonly PersonNameVariant[]): this;
/** Édition élément par élément des blocs `1 NAME`. */
nameVariants(): NameVariantsEdit;
setAttributes(attrs: readonly IndiAttribute[]): this;
/** Édition élément par élément des attributs de niveau 1 (`FACT`, …). */
attributes(): IndiAttributesEdit;
acts(): ActsEdit;
notes(): NotesEdit;
/** Médias de niveau individu (fichiers locaux via {@link Person.addMultimedia}). */
multimedia(): PersonMediaEdit;
clearActs(): this;
clearNotes(): this;
clearMultimedia(): this;
clearNameVariants(): this;
clearAttributes(): this;
}
export declare function editPerson(person: Person): PersonEdit;