gedcom-ts
Version:
TypeScript GEDCOM toolkit for browser apps: import .ged/.zip, edit typed genealogy data, and export GEDCOM or GEDZIP.
44 lines (43 loc) • 1.81 kB
TypeScript
import type { IndiGedcomSubLine } from "../commons/IndiGedcomSubLine";
import { PersonNameTranslation, PersonNameVariant } from "../commons/PersonNameVariant";
/**
* API d’édition cohérente autour d’un {@link PersonNameVariant} existant.
*/
export declare class PersonNameVariantEdit {
private readonly target;
constructor(target: PersonNameVariant);
get value(): PersonNameVariant;
setPayload(payload: string): this;
setType(type: string | null | undefined): this;
clearType(): this;
setParts(parts: readonly IndiGedcomSubLine[]): this;
appendPart(part: IndiGedcomSubLine): this;
clearParts(): this;
setTranslations(translations: readonly PersonNameTranslation[]): this;
appendTranslation(translation: PersonNameTranslation): this;
clearTranslations(): this;
}
export declare function editPersonNameVariant(variant: PersonNameVariant): PersonNameVariantEdit;
/**
* Variants `1 NAME` sur une {@link Person}.
*/
export declare class NameVariantsEdit {
private readonly target;
constructor(target: {
nameVariants: PersonNameVariant[];
});
get value(): PersonNameVariant[];
add(variant: PersonNameVariant): this;
/** Ajoute un variant minimal (`1 NAME` / `2 TYPE` optionnel) et renvoie sa facade. */
addNew(payload: string, type?: string): PersonNameVariantEdit;
insertAt(index: number, variant: PersonNameVariant): this;
insertNewAt(index: number, payload: string, type?: string): PersonNameVariantEdit;
removeLast(): this;
replaceAt(index: number, variant: PersonNameVariant): this;
removeAt(index: number): this;
clear(): this;
at(index: number): PersonNameVariantEdit;
}
export declare function editNameVariants(person: {
nameVariants: PersonNameVariant[];
}): NameVariantsEdit;