gedcom-ts
Version:
TypeScript GEDCOM toolkit for browser apps: import .ged/.zip, edit typed genealogy data, and export GEDCOM or GEDZIP.
39 lines (38 loc) • 1.52 kB
TypeScript
import type { IndiGedcomSubLine } from "../commons/IndiGedcomSubLine";
import type { IndiAttribute } from "../commons/IndiAttribute";
/**
* API d’édition cohérente autour d’un {@link IndiAttribute} existant.
*/
export declare class IndiAttributeEdit {
private readonly target;
constructor(target: IndiAttribute);
get value(): IndiAttribute;
setTag(tag: string): this;
setValue(value: string): this;
setChildren(children: readonly IndiGedcomSubLine[]): this;
appendChild(child: IndiGedcomSubLine): this;
clearChildren(): this;
}
export declare function editIndiAttribute(attr: IndiAttribute): IndiAttributeEdit;
/**
* Liste d’attributs individuels (`FACT`, `DSCR`, …) sur une {@link Person}.
*/
export declare class IndiAttributesEdit {
private readonly target;
constructor(target: {
attributes: IndiAttribute[];
});
get value(): IndiAttribute[];
add(attr: IndiAttribute): this;
addNew(tag: string, value?: string, children?: readonly IndiGedcomSubLine[]): IndiAttributeEdit;
insertAt(index: number, attr: IndiAttribute): this;
insertNewAt(index: number, tag: string, value?: string, children?: readonly IndiGedcomSubLine[]): IndiAttributeEdit;
removeLast(): this;
replaceAt(index: number, attr: IndiAttribute): this;
removeAt(index: number): this;
clear(): this;
at(index: number): IndiAttributeEdit;
}
export declare function editIndiAttributes(person: {
attributes: IndiAttribute[];
}): IndiAttributesEdit;