@treeviz/gedcom-parser 2.0.0 → 2.0.3
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/dist/classes/common.d.ts +118 -0
- package/dist/classes/common.d.ts.map +1 -0
- package/dist/classes/date.d.ts +27 -0
- package/dist/classes/date.d.ts.map +1 -0
- package/dist/classes/fam.d.ts +19 -0
- package/dist/classes/fam.d.ts.map +1 -0
- package/dist/classes/fams.d.ts +16 -0
- package/dist/classes/fams.d.ts.map +1 -0
- package/dist/classes/gedcom.d.ts +148 -0
- package/dist/classes/gedcom.d.ts.map +1 -0
- package/dist/classes/index.d.ts +28 -2
- package/dist/classes/index.d.ts.map +1 -0
- package/dist/classes/index.js +7 -10
- package/dist/classes/indi.d.ts +351 -0
- package/dist/classes/indi.d.ts.map +1 -0
- package/dist/classes/indis.d.ts +55 -0
- package/dist/classes/indis.d.ts.map +1 -0
- package/dist/classes/list.d.ts +55 -0
- package/dist/classes/list.d.ts.map +1 -0
- package/dist/classes/name.d.ts +20 -0
- package/dist/classes/name.d.ts.map +1 -0
- package/dist/classes/note.d.ts +12 -0
- package/dist/classes/note.d.ts.map +1 -0
- package/dist/classes/obje.d.ts +12 -0
- package/dist/classes/obje.d.ts.map +1 -0
- package/dist/classes/objes.d.ts +8 -0
- package/dist/classes/objes.d.ts.map +1 -0
- package/dist/classes/repo.d.ts +11 -0
- package/dist/classes/repo.d.ts.map +1 -0
- package/dist/classes/repos.d.ts +8 -0
- package/dist/classes/repos.d.ts.map +1 -0
- package/dist/classes/sour.d.ts +11 -0
- package/dist/classes/sour.d.ts.map +1 -0
- package/dist/classes/sours.d.ts +8 -0
- package/dist/classes/sours.d.ts.map +1 -0
- package/dist/classes/subm.d.ts +10 -0
- package/dist/classes/subm.d.ts.map +1 -0
- package/dist/classes/subms.d.ts +8 -0
- package/dist/classes/subms.d.ts.map +1 -0
- package/dist/cli/commands/convert.d.ts +3 -0
- package/dist/cli/commands/convert.d.ts.map +1 -0
- package/dist/cli/commands/extract.d.ts +3 -0
- package/dist/cli/commands/extract.d.ts.map +1 -0
- package/dist/cli/commands/find.d.ts +28 -0
- package/dist/cli/commands/find.d.ts.map +1 -0
- package/dist/cli/commands/get.d.ts +22 -0
- package/dist/cli/commands/get.d.ts.map +1 -0
- package/dist/cli/commands/info.d.ts +3 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/merge.d.ts +3 -0
- package/dist/cli/commands/merge.d.ts.map +1 -0
- package/dist/cli/commands/open.d.ts +3 -0
- package/dist/cli/commands/open.d.ts.map +1 -0
- package/dist/cli/commands/relatives.d.ts +3 -0
- package/dist/cli/commands/relatives.d.ts.map +1 -0
- package/dist/cli/commands/select.d.ts +13 -0
- package/dist/cli/commands/select.d.ts.map +1 -0
- package/dist/cli/commands/show.d.ts +9 -0
- package/dist/cli/commands/show.d.ts.map +1 -0
- package/dist/cli/commands/stats.d.ts +8 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/validate.d.ts +3 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +254 -106
- package/dist/cli/repl.d.ts +17 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/utils/formatters.d.ts +71 -0
- package/dist/cli/utils/formatters.d.ts.map +1 -0
- package/dist/cli/utils/helpers.d.ts +21 -0
- package/dist/cli/utils/helpers.d.ts.map +1 -0
- package/dist/constants/constants.d.ts +14 -0
- package/dist/constants/constants.d.ts.map +1 -0
- package/dist/constants/filters.d.ts +18 -0
- package/dist/constants/filters.d.ts.map +1 -0
- package/dist/constants/index.d.ts +4 -49
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +6 -9
- package/dist/constants/orders.d.ts +17 -0
- package/dist/constants/orders.d.ts.map +1 -0
- package/dist/factories/cache-factory.d.ts +30 -0
- package/dist/factories/cache-factory.d.ts.map +1 -0
- package/dist/factories/date-locale-factory.d.ts +30 -0
- package/dist/factories/date-locale-factory.d.ts.map +1 -0
- package/dist/factories/i18n-factory.d.ts +40 -0
- package/dist/factories/i18n-factory.d.ts.map +1 -0
- package/dist/factories/index.d.ts +13 -202
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +6 -9
- package/dist/factories/kinship-factory.d.ts +38 -0
- package/dist/factories/kinship-factory.d.ts.map +1 -0
- package/dist/factories/place-parser-provider.d.ts +32 -0
- package/dist/factories/place-parser-provider.d.ts.map +1 -0
- package/dist/factories/place-translator-provider.d.ts +32 -0
- package/dist/factories/place-translator-provider.d.ts.map +1 -0
- package/dist/index.d.ts +28 -9
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -10
- package/dist/interfaces/common.d.ts +43 -0
- package/dist/interfaces/common.d.ts.map +1 -0
- package/dist/interfaces/fam.d.ts +11 -0
- package/dist/interfaces/fam.d.ts.map +1 -0
- package/dist/interfaces/fams.d.ts +9 -0
- package/dist/interfaces/fams.d.ts.map +1 -0
- package/dist/interfaces/gedcom.d.ts +30 -0
- package/dist/interfaces/gedcom.d.ts.map +1 -0
- package/dist/interfaces/index.d.ts +12 -2
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/indi.d.ts +114 -0
- package/dist/interfaces/indi.d.ts.map +1 -0
- package/dist/interfaces/indis.d.ts +31 -0
- package/dist/interfaces/indis.d.ts.map +1 -0
- package/dist/interfaces/list.d.ts +52 -0
- package/dist/interfaces/list.d.ts.map +1 -0
- package/dist/interfaces/obje.d.ts +7 -0
- package/dist/interfaces/obje.d.ts.map +1 -0
- package/dist/interfaces/repo.d.ts +7 -0
- package/dist/interfaces/repo.d.ts.map +1 -0
- package/dist/interfaces/sour.d.ts +7 -0
- package/dist/interfaces/sour.d.ts.map +1 -0
- package/dist/interfaces/subm.d.ts +6 -0
- package/dist/interfaces/subm.d.ts.map +1 -0
- package/dist/kinship-translator/index.d.ts +11 -146
- package/dist/kinship-translator/index.d.ts.map +1 -0
- package/dist/kinship-translator/index.js +6 -9
- package/dist/kinship-translator/kinship-translator.basic.d.ts +30 -0
- package/dist/kinship-translator/kinship-translator.basic.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.d.ts +26 -0
- package/dist/kinship-translator/kinship-translator.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.de.d.ts +18 -0
- package/dist/kinship-translator/kinship-translator.de.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.en.d.ts +18 -0
- package/dist/kinship-translator/kinship-translator.en.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.es.d.ts +18 -0
- package/dist/kinship-translator/kinship-translator.es.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.fr.d.ts +18 -0
- package/dist/kinship-translator/kinship-translator.fr.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.hu.d.ts +19 -0
- package/dist/kinship-translator/kinship-translator.hu.d.ts.map +1 -0
- package/dist/kinship-translator/kinship-translator.interface.d.ts +19 -0
- package/dist/kinship-translator/kinship-translator.interface.d.ts.map +1 -0
- package/dist/kinship-translator/patterns.de.d.ts +2 -0
- package/dist/kinship-translator/patterns.de.d.ts.map +1 -0
- package/dist/kinship-translator/patterns.en.d.ts +2 -0
- package/dist/kinship-translator/patterns.en.d.ts.map +1 -0
- package/dist/kinship-translator/patterns.es.d.ts +2 -0
- package/dist/kinship-translator/patterns.es.d.ts.map +1 -0
- package/dist/kinship-translator/patterns.fr.d.ts +2 -0
- package/dist/kinship-translator/patterns.fr.d.ts.map +1 -0
- package/dist/kinship-translator/patterns.hu.d.ts +6 -0
- package/dist/kinship-translator/patterns.hu.d.ts.map +1 -0
- package/dist/kinship-translator/translators.d.ts +6 -0
- package/dist/kinship-translator/translators.d.ts.map +1 -0
- package/dist/kinship-translator/types.d.ts +9 -0
- package/dist/kinship-translator/types.d.ts.map +1 -0
- package/dist/structures/address.d.ts +14 -0
- package/dist/structures/address.d.ts.map +1 -0
- package/dist/structures/association.d.ts +13 -0
- package/dist/structures/association.d.ts.map +1 -0
- package/dist/structures/change-date.d.ts +8 -0
- package/dist/structures/change-date.d.ts.map +1 -0
- package/dist/structures/creation-date.d.ts +7 -0
- package/dist/structures/creation-date.d.ts.map +1 -0
- package/dist/structures/date.d.ts +9 -0
- package/dist/structures/date.d.ts.map +1 -0
- package/dist/structures/event-detail-structure.d.ts +25 -0
- package/dist/structures/event-detail-structure.d.ts.map +1 -0
- package/dist/structures/family.d.ts +34 -0
- package/dist/structures/family.d.ts.map +1 -0
- package/dist/structures/gedcom.d.ts +59 -0
- package/dist/structures/gedcom.d.ts.map +1 -0
- package/dist/structures/index.d.ts +27 -25
- package/dist/structures/index.d.ts.map +1 -0
- package/dist/structures/individual-event-detail-structure.d.ts +9 -0
- package/dist/structures/individual-event-detail-structure.d.ts.map +1 -0
- package/dist/structures/individual-event-structure.d.ts +83 -0
- package/dist/structures/individual-event-structure.d.ts.map +1 -0
- package/dist/structures/individual.d.ts +40 -0
- package/dist/structures/individual.d.ts.map +1 -0
- package/dist/structures/lds-ordinance-detail.d.ts +17 -0
- package/dist/structures/lds-ordinance-detail.d.ts.map +1 -0
- package/dist/structures/lds-spouse-sealing.d.ts +7 -0
- package/dist/structures/lds-spouse-sealing.d.ts.map +1 -0
- package/dist/structures/marriage-date.d.ts +11 -0
- package/dist/structures/marriage-date.d.ts.map +1 -0
- package/dist/structures/multimedia-link.d.ts +16 -0
- package/dist/structures/multimedia-link.d.ts.map +1 -0
- package/dist/structures/non-event.d.ts +12 -0
- package/dist/structures/non-event.d.ts.map +1 -0
- package/dist/structures/note.d.ts +16 -0
- package/dist/structures/note.d.ts.map +1 -0
- package/dist/structures/personal-name-pieces.d.ts +11 -0
- package/dist/structures/personal-name-pieces.d.ts.map +1 -0
- package/dist/structures/personal-name.d.ts +16 -0
- package/dist/structures/personal-name.d.ts.map +1 -0
- package/dist/structures/place.d.ts +20 -0
- package/dist/structures/place.d.ts.map +1 -0
- package/dist/structures/repository.d.ts +6 -0
- package/dist/structures/repository.d.ts.map +1 -0
- package/dist/structures/source-citation.d.ts +27 -0
- package/dist/structures/source-citation.d.ts.map +1 -0
- package/dist/structures/source-repository-citation.d.ts +13 -0
- package/dist/structures/source-repository-citation.d.ts.map +1 -0
- package/dist/structures/source.d.ts +28 -0
- package/dist/structures/source.d.ts.map +1 -0
- package/dist/types/ancestry-media.d.ts +65 -0
- package/dist/types/ancestry-media.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -69
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/settings.d.ts +12 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/types.d.ts +229 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/utils/cache.d.ts +26 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/common-creator.d.ts +13 -0
- package/dist/utils/common-creator.d.ts.map +1 -0
- package/dist/utils/date-formatter.d.ts +35 -0
- package/dist/utils/date-formatter.d.ts.map +1 -0
- package/dist/utils/get-all-prop.d.ts +4 -0
- package/dist/utils/get-all-prop.d.ts.map +1 -0
- package/dist/utils/get-family-with.d.ts +5 -0
- package/dist/utils/get-family-with.d.ts.map +1 -0
- package/dist/utils/get-places.d.ts +21 -0
- package/dist/utils/get-places.d.ts.map +1 -0
- package/dist/utils/get-product-details.d.ts +4 -0
- package/dist/utils/get-product-details.d.ts.map +1 -0
- package/dist/utils/get-raw-size.d.ts +2 -0
- package/dist/utils/get-raw-size.d.ts.map +1 -0
- package/dist/utils/index.d.ts +19 -19
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -10
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/media-utils.d.ts +13 -0
- package/dist/utils/media-utils.d.ts.map +1 -0
- package/dist/utils/name-formatter.d.ts +10 -0
- package/dist/utils/name-formatter.d.ts.map +1 -0
- package/dist/utils/nested-group.d.ts +4 -0
- package/dist/utils/nested-group.d.ts.map +1 -0
- package/dist/utils/ordinalize.d.ts +3 -0
- package/dist/utils/ordinalize.d.ts.map +1 -0
- package/dist/utils/parser.d.ts +22 -0
- package/dist/utils/parser.d.ts.map +1 -0
- package/dist/utils/place-parser.d.ts +16 -0
- package/dist/utils/place-parser.d.ts.map +1 -0
- package/dist/utils/place-translator.d.ts +6 -0
- package/dist/utils/place-translator.d.ts.map +1 -0
- package/dist/utils/place-types.d.ts +27 -0
- package/dist/utils/place-types.d.ts.map +1 -0
- package/dist/utils/range.d.ts +19 -0
- package/dist/utils/range.d.ts.map +1 -0
- package/package.json +12 -2
- package/dist/index-CzYZg44D.d.ts +0 -1705
- package/dist/place-parser-CJ3EbFmb.d.ts +0 -40
- package/dist/place-translator-Ci5rEY6p.d.ts +0 -90
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GedComType } from "../classes/gedcom";
|
|
2
|
+
export declare class GedcomRepl {
|
|
3
|
+
private rl;
|
|
4
|
+
private context;
|
|
5
|
+
constructor(tree: GedComType);
|
|
6
|
+
private setupHandlers;
|
|
7
|
+
private handleCommand;
|
|
8
|
+
private showHelp;
|
|
9
|
+
private handleFind;
|
|
10
|
+
private handleSelect;
|
|
11
|
+
private handleShow;
|
|
12
|
+
private handleGet;
|
|
13
|
+
private handleRelatives;
|
|
14
|
+
private handleValidate;
|
|
15
|
+
start(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=repl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/cli/repl.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAoEpD,qBAAa,UAAU;IACtB,OAAO,CAAC,EAAE,CAAqB;IAC/B,OAAO,CAAC,OAAO,CAAc;gBAEjB,IAAI,EAAE,UAAU;IAW5B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,aAAa;IAkDrB,OAAO,CAAC,QAAQ;IAoKhB,OAAO,CAAC,UAAU;IAoDlB,OAAO,CAAC,YAAY;IAqBpB,OAAO,CAAC,UAAU;IA0BlB,OAAO,CAAC,SAAS;IA4DjB,OAAO,CAAC,eAAe;IAoHvB,OAAO,CAAC,cAAc;IA6LtB,KAAK,IAAI,IAAI;CAOb"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
export { chalk };
|
|
3
|
+
/**
|
|
4
|
+
* Format a success message
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatSuccess(message: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Format a warning message
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatWarning(message: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Format an error message
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatError(message: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Format an info message
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatInfo(message: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Format a header
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatHeader(text: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Format a field label
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatLabel(label: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Format a value
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatValue(value: string | number | null | undefined): string;
|
|
31
|
+
/**
|
|
32
|
+
* Format an ID
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatId(id: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Format a count
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatCount(count: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* Format a date
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatDate(date: string | null | undefined): string;
|
|
43
|
+
/**
|
|
44
|
+
* Format a place
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatPlace(place: string | null | undefined): string;
|
|
47
|
+
/**
|
|
48
|
+
* Format a name
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatName(name: string | null | undefined): string;
|
|
51
|
+
/**
|
|
52
|
+
* Format a list item
|
|
53
|
+
*/
|
|
54
|
+
export declare function formatListItem(text: string, indent?: number): string;
|
|
55
|
+
/**
|
|
56
|
+
* Format a table row
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatTableRow(columns: string[], widths: number[]): string;
|
|
59
|
+
/**
|
|
60
|
+
* Format a table separator
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatTableSeparator(widths: number[]): string;
|
|
63
|
+
/**
|
|
64
|
+
* Pretty print JSON
|
|
65
|
+
*/
|
|
66
|
+
export declare function formatJson(data: unknown): string;
|
|
67
|
+
/**
|
|
68
|
+
* Format a progress indicator
|
|
69
|
+
*/
|
|
70
|
+
export declare function formatProgress(current: number, total: number): string;
|
|
71
|
+
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAK7E;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAKlE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAKpE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAOlE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,GAAG,MAAM,CAGvE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAE1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAKrE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a GEDCOM file
|
|
3
|
+
*/
|
|
4
|
+
export declare function readGedcomFile(filePath: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Handle CLI errors
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleError(error: unknown, context?: string): never;
|
|
9
|
+
/**
|
|
10
|
+
* Validate file path
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateFilePath(filePath: string | undefined, paramName: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Clean GEDCOM name by removing slashes
|
|
15
|
+
*/
|
|
16
|
+
export declare function cleanGedcomName(name: string | undefined | null): string;
|
|
17
|
+
/**
|
|
18
|
+
* Format lifespan string
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatLifespan(birthDate: string | null | undefined, deathDate: string | null | undefined): string;
|
|
21
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/helpers.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAWvD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAUnE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAMxF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAGvE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAIjH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GEDCOM Parsing Patterns
|
|
3
|
+
* Regular expressions for parsing GEDCOM files
|
|
4
|
+
*/
|
|
5
|
+
export declare const REF_LINE_REG: RegExp;
|
|
6
|
+
export declare const LINE_REG: RegExp;
|
|
7
|
+
export declare const ID_REG: RegExp;
|
|
8
|
+
export declare const ID_GETTER_REG: RegExp;
|
|
9
|
+
export declare const ID_SPLIT_REG: RegExp;
|
|
10
|
+
/**
|
|
11
|
+
* File size limits
|
|
12
|
+
*/
|
|
13
|
+
export declare const MAX_FILE_SIZE_TO_SYNC: number;
|
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,YAAY,QACqE,CAAC;AAC/F,eAAO,MAAM,QAAQ,QACsF,CAAC;AAC5G,eAAO,MAAM,MAAM,QAAqB,CAAC;AACzC,eAAO,MAAM,aAAa,QAAiC,CAAC;AAC5D,eAAO,MAAM,YAAY,QAAsB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,qBAAqB,QAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RelationType, PartnerType } from "../types/types";
|
|
2
|
+
import type { RequiredFilter, Filter } from "../types/types";
|
|
3
|
+
export declare const EVERY: Filter;
|
|
4
|
+
export declare const FEMALE: Filter;
|
|
5
|
+
export declare const MALE: Filter;
|
|
6
|
+
export declare const ADOPTED: RequiredFilter<"PEDI", RelationType>;
|
|
7
|
+
export declare const BIRTH: RequiredFilter<"PEDI", RelationType>;
|
|
8
|
+
export declare const FOSTER: RequiredFilter<"PEDI", RelationType>;
|
|
9
|
+
export declare const SEALING: RequiredFilter<"PEDI", RelationType>;
|
|
10
|
+
export declare const STEP: RequiredFilter<"PEDI", RelationType>;
|
|
11
|
+
export declare const BIOLOGICAL: RequiredFilter<"PEDI", RelationType>;
|
|
12
|
+
export declare const FRIEND: RequiredFilter<"PART", PartnerType>;
|
|
13
|
+
export declare const OTHER: RequiredFilter<"PART", PartnerType>;
|
|
14
|
+
export declare const PARTNER: RequiredFilter<"PART", PartnerType>;
|
|
15
|
+
export declare const SINGLE: RequiredFilter<"PART", PartnerType>;
|
|
16
|
+
export declare const SPOUSE: RequiredFilter<"PART", PartnerType>;
|
|
17
|
+
export declare const UNKOWN: RequiredFilter<"PART", PartnerType>;
|
|
18
|
+
//# sourceMappingURL=filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/constants/filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,YAAY,EACZ,WAAW,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAE3D,eAAO,MAAM,KAAK,EAAE,MAAW,CAAC;AAEhC,eAAO,MAAM,MAAM,EAAE,MAEpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAElB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAExD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAEvD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAExD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAErD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAE3D,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAErD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEvD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC"}
|
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* GEDCOM Parsing Patterns
|
|
6
|
-
* Regular expressions for parsing GEDCOM files
|
|
7
|
-
*/
|
|
8
|
-
declare const REF_LINE_REG: RegExp;
|
|
9
|
-
declare const LINE_REG: RegExp;
|
|
10
|
-
declare const ID_REG: RegExp;
|
|
11
|
-
declare const ID_GETTER_REG: RegExp;
|
|
12
|
-
declare const ID_SPLIT_REG: RegExp;
|
|
13
|
-
/**
|
|
14
|
-
* File size limits
|
|
15
|
-
*/
|
|
16
|
-
declare const MAX_FILE_SIZE_TO_SYNC: number;
|
|
17
|
-
|
|
18
|
-
declare const EVERY: Filter;
|
|
19
|
-
declare const FEMALE: Filter;
|
|
20
|
-
declare const MALE: Filter;
|
|
21
|
-
declare const ADOPTED: RequiredFilter<"PEDI", RelationType>;
|
|
22
|
-
declare const BIRTH: RequiredFilter<"PEDI", RelationType>;
|
|
23
|
-
declare const FOSTER: RequiredFilter<"PEDI", RelationType>;
|
|
24
|
-
declare const SEALING: RequiredFilter<"PEDI", RelationType>;
|
|
25
|
-
declare const STEP: RequiredFilter<"PEDI", RelationType>;
|
|
26
|
-
declare const BIOLOGICAL: RequiredFilter<"PEDI", RelationType>;
|
|
27
|
-
declare const FRIEND: RequiredFilter<"PART", PartnerType>;
|
|
28
|
-
declare const OTHER: RequiredFilter<"PART", PartnerType>;
|
|
29
|
-
declare const PARTNER: RequiredFilter<"PART", PartnerType>;
|
|
30
|
-
declare const SINGLE: RequiredFilter<"PART", PartnerType>;
|
|
31
|
-
declare const SPOUSE: RequiredFilter<"PART", PartnerType>;
|
|
32
|
-
declare const UNKOWN: RequiredFilter<"PART", PartnerType>;
|
|
33
|
-
|
|
34
|
-
declare const DEFAULT: Order;
|
|
35
|
-
declare const BIRTH_ASC: Order;
|
|
36
|
-
declare const BIRTH_DESC: Order;
|
|
37
|
-
declare const DEATH_ASC: Order;
|
|
38
|
-
declare const DEATH_DESC: Order;
|
|
39
|
-
declare const DATE_ASC: Order;
|
|
40
|
-
declare const DATE_DESC: Order;
|
|
41
|
-
declare const getNameDesc: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
|
|
42
|
-
declare const getNameAsc: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
|
|
43
|
-
declare const getBirthAsc: OrderIterator<IndiType, IndiKey>;
|
|
44
|
-
declare const getNameAscAndBirth: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
|
|
45
|
-
declare const getMarriageAsc: (person?: IndiKey, famType?: "FAMS" | "FAMC") => OrderIterator<IndiType, IndiKey>;
|
|
46
|
-
declare const getMarriageAscAndChildBirth: (person?: IndiKey) => OrderIterator<IndiType, IndiKey>;
|
|
47
|
-
declare const getMarriageAscAndBirth: (person?: IndiKey) => OrderIterator<IndiType, IndiKey>;
|
|
48
|
-
|
|
49
|
-
export { ADOPTED, BIOLOGICAL, BIRTH, BIRTH_ASC, BIRTH_DESC, DATE_ASC, DATE_DESC, DEATH_ASC, DEATH_DESC, DEFAULT, EVERY, FEMALE, FOSTER, FRIEND, ID_GETTER_REG, ID_REG, ID_SPLIT_REG, LINE_REG, MALE, MAX_FILE_SIZE_TO_SYNC, OTHER, PARTNER, REF_LINE_REG, SEALING, SINGLE, SPOUSE, STEP, UNKOWN, getBirthAsc, getMarriageAsc, getMarriageAscAndBirth, getMarriageAscAndChildBirth, getNameAsc, getNameAscAndBirth, getNameDesc };
|
|
1
|
+
export * from "./constants";
|
|
2
|
+
export * from "./filters";
|
|
3
|
+
export * from "./orders";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -2806,7 +2806,7 @@ var Indi = class extends Common {
|
|
|
2806
2806
|
title,
|
|
2807
2807
|
url,
|
|
2808
2808
|
contentType: type,
|
|
2809
|
-
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()
|
|
2809
|
+
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
2810
2810
|
};
|
|
2811
2811
|
}
|
|
2812
2812
|
})
|
|
@@ -2835,7 +2835,7 @@ var Indi = class extends Common {
|
|
|
2835
2835
|
const deathObj = this.get("DEAT.OBJE")?.toList().copy();
|
|
2836
2836
|
objeList?.merge(birthObj).merge(deathObj);
|
|
2837
2837
|
(this.get("FAMS")?.toValueList().values() ?? []).concat(this.get("FAMC")?.toValueList().values() ?? []).forEach((fam) => {
|
|
2838
|
-
objeList
|
|
2838
|
+
objeList?.merge(fam?.get("MARR.OBJE"));
|
|
2839
2839
|
});
|
|
2840
2840
|
objeList?.forEach((o, index) => {
|
|
2841
2841
|
if (!o) {
|
|
@@ -2861,7 +2861,7 @@ var Indi = class extends Common {
|
|
|
2861
2861
|
title,
|
|
2862
2862
|
url,
|
|
2863
2863
|
contentType: type,
|
|
2864
|
-
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()
|
|
2864
|
+
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
2865
2865
|
};
|
|
2866
2866
|
}
|
|
2867
2867
|
});
|
|
@@ -2959,14 +2959,11 @@ var Indi = class extends Common {
|
|
|
2959
2959
|
const sourList = this.get("SOUR")?.toList().copy();
|
|
2960
2960
|
sourList?.forEach((sour) => {
|
|
2961
2961
|
const sourObje = sour?.get("OBJE")?.toList();
|
|
2962
|
-
objeList
|
|
2962
|
+
objeList?.merge(sourObje);
|
|
2963
2963
|
});
|
|
2964
|
-
if (!objeList || objeList.length === 0) {
|
|
2965
|
-
return void 0;
|
|
2966
|
-
}
|
|
2967
2964
|
const rfn = this.get("RFN")?.toValue();
|
|
2968
2965
|
const geniId = rfn?.replace(/^geni:/, "") || "unknown";
|
|
2969
|
-
objeList
|
|
2966
|
+
objeList?.forEach((obje, index) => {
|
|
2970
2967
|
if (!obje) {
|
|
2971
2968
|
return;
|
|
2972
2969
|
}
|
|
@@ -3005,7 +3002,7 @@ var Indi = class extends Common {
|
|
|
3005
3002
|
return list;
|
|
3006
3003
|
}
|
|
3007
3004
|
const rfn = this.get("RFN")?.toValue();
|
|
3008
|
-
const treeId = rfn || "universal";
|
|
3005
|
+
const treeId = this.getUniversalTreeId() || rfn || "universal";
|
|
3009
3006
|
objeList.forEach((obje, index) => {
|
|
3010
3007
|
if (!obje) {
|
|
3011
3008
|
return;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IndiType } from "../classes/indi";
|
|
2
|
+
import type { OrderIterator, Order, IndiKey, NameOrder } from "../types/types";
|
|
3
|
+
export declare const DEFAULT: Order;
|
|
4
|
+
export declare const BIRTH_ASC: Order;
|
|
5
|
+
export declare const BIRTH_DESC: Order;
|
|
6
|
+
export declare const DEATH_ASC: Order;
|
|
7
|
+
export declare const DEATH_DESC: Order;
|
|
8
|
+
export declare const DATE_ASC: Order;
|
|
9
|
+
export declare const DATE_DESC: Order;
|
|
10
|
+
export declare const getNameDesc: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
|
|
11
|
+
export declare const getNameAsc: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
|
|
12
|
+
export declare const getBirthAsc: OrderIterator<IndiType, IndiKey>;
|
|
13
|
+
export declare const getNameAscAndBirth: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
|
|
14
|
+
export declare const getMarriageAsc: (person?: IndiKey, famType?: "FAMS" | "FAMC") => OrderIterator<IndiType, IndiKey>;
|
|
15
|
+
export declare const getMarriageAscAndChildBirth: (person?: IndiKey) => OrderIterator<IndiType, IndiKey>;
|
|
16
|
+
export declare const getMarriageAscAndBirth: (person?: IndiKey) => OrderIterator<IndiType, IndiKey>;
|
|
17
|
+
//# sourceMappingURL=orders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/constants/orders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG/E,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAwGF,eAAO,MAAM,WAAW,EAAE,CACzB,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAgBlC,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,CACxB,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAgBlC,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAqBxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,CAChC,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAUlC,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,CAC5B,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,KACrB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAsBlC,CAAC;AAEH,eAAO,MAAM,2BAA2B,EAAE,CACzC,MAAM,CAAC,EAAE,OAAO,KACZ,aAAa,CAAC,QAAQ,EAAE,OAAO,CAelC,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,CACpC,MAAM,CAAC,EAAE,OAAO,KACZ,aAAa,CAAC,QAAQ,EAAE,OAAO,CAclC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ICacheManager } from "../utils/cache";
|
|
2
|
+
/**
|
|
3
|
+
* Factory function type for creating cache manager instances.
|
|
4
|
+
* This allows the main project to inject custom cache implementations (e.g., IndexedDB).
|
|
5
|
+
*/
|
|
6
|
+
export type CacheManagerFactory = <T>(name: string, store: string, type: string, encrypted: boolean) => ICacheManager<T>;
|
|
7
|
+
/**
|
|
8
|
+
* Set a custom cache manager factory.
|
|
9
|
+
* Call this from the main project to inject IndexedDB or other cache implementations.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { setCacheManagerFactory } from '@treeviz/gedcom-parser/factories/cache-factory';
|
|
14
|
+
* import { getInstance } from './utils/indexed-db-manager';
|
|
15
|
+
*
|
|
16
|
+
* setCacheManagerFactory(getInstance);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const setCacheManagerFactory: (factory: CacheManagerFactory) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Get the current cache manager factory.
|
|
22
|
+
* Used internally by the cache utility.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getCacheManagerFactory: () => CacheManagerFactory;
|
|
25
|
+
/**
|
|
26
|
+
* Reset to default in-memory cache factory.
|
|
27
|
+
* Useful for testing or when switching between projects.
|
|
28
|
+
*/
|
|
29
|
+
export declare const resetCacheManagerFactory: () => void;
|
|
30
|
+
//# sourceMappingURL=cache-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-factory.d.ts","sourceRoot":"","sources":["../../src/factories/cache-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,EACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,OAAO,KACd,aAAa,CAAC,CAAC,CAAC,CAAC;AAkBtB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,mBAAmB,SAElE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAO,mBAEzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,YAEpC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Locale } from "date-fns";
|
|
2
|
+
/**
|
|
3
|
+
* Date locale provider function type.
|
|
4
|
+
* Returns the date-fns Locale object for the current language.
|
|
5
|
+
*/
|
|
6
|
+
export type DateLocaleProvider = () => Locale | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Set a custom date locale provider.
|
|
9
|
+
* This allows the main project or external projects to override the date locale logic.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { setDateLocaleProvider } from '@treeviz/gedcom-parser/factories/date-locale-factory';
|
|
14
|
+
* import { getDateFnsLocale } from './constants/ui-options';
|
|
15
|
+
*
|
|
16
|
+
* setDateLocaleProvider(getDateFnsLocale);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const setDateLocaleProvider: (provider: DateLocaleProvider) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Get the current date locale.
|
|
22
|
+
* Used internally by the Date class for formatting dates.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getDateLocale: () => Locale | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Reset to the default date locale provider.
|
|
27
|
+
* Useful for testing or when switching between projects.
|
|
28
|
+
*/
|
|
29
|
+
export declare const resetDateLocaleProvider: () => void;
|
|
30
|
+
//# sourceMappingURL=date-locale-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-locale-factory.d.ts","sourceRoot":"","sources":["../../src/factories/date-locale-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,MAAM,GAAG,SAAS,CAAC;AAO1D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,kBAAkB,SAEjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,MAAM,GAAG,SAGzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,YAEnC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* I18n provider factory for pluggable translation
|
|
3
|
+
* This allows the main project to inject its i18n instance
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* I18n provider function type.
|
|
7
|
+
* Mimics the i18next.t() function signature.
|
|
8
|
+
*/
|
|
9
|
+
export type I18nProvider = (key: string, options?: Record<string, unknown>) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Set a custom i18n provider.
|
|
12
|
+
* This allows the main project to inject its i18n translation function.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { setI18nProvider } from '@treeviz/gedcom-parser/factories/i18n-factory';
|
|
17
|
+
* import i18n from './translation/i18n';
|
|
18
|
+
*
|
|
19
|
+
* setI18nProvider((key, options) => i18n.t(key, options));
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const setI18nProvider: (provider: I18nProvider) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current i18n provider.
|
|
25
|
+
* Used internally for translations.
|
|
26
|
+
*/
|
|
27
|
+
export declare const getI18n: () => I18nProvider;
|
|
28
|
+
/**
|
|
29
|
+
* Reset to the default i18n provider.
|
|
30
|
+
* Useful for testing.
|
|
31
|
+
*/
|
|
32
|
+
export declare const resetI18nProvider: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Helper object that mimics i18next interface
|
|
35
|
+
* Usage: i18n.t(key, options)
|
|
36
|
+
*/
|
|
37
|
+
export declare const i18n: {
|
|
38
|
+
t: (key: string, options?: Record<string, unknown>) => string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=i18n-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-factory.d.ts","sourceRoot":"","sources":["../../src/factories/i18n-factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,MAAM,CAAC;AAOZ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,YAAY,SAErD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,QAAO,YAE1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAE7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI;aACP,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAElD,CAAC"}
|
|
@@ -1,202 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* import { setCacheManagerFactory } from '@treeviz/gedcom-parser/factories/cache-factory';
|
|
17
|
-
* import { getInstance } from './utils/indexed-db-manager';
|
|
18
|
-
*
|
|
19
|
-
* setCacheManagerFactory(getInstance);
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare const setCacheManagerFactory: (factory: CacheManagerFactory) => void;
|
|
23
|
-
/**
|
|
24
|
-
* Get the current cache manager factory.
|
|
25
|
-
* Used internally by the cache utility.
|
|
26
|
-
*/
|
|
27
|
-
declare const getCacheManagerFactory: () => CacheManagerFactory;
|
|
28
|
-
/**
|
|
29
|
-
* Reset to default in-memory cache factory.
|
|
30
|
-
* Useful for testing or when switching between projects.
|
|
31
|
-
*/
|
|
32
|
-
declare const resetCacheManagerFactory: () => void;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Date locale provider function type.
|
|
36
|
-
* Returns the date-fns Locale object for the current language.
|
|
37
|
-
*/
|
|
38
|
-
type DateLocaleProvider = () => Locale | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Set a custom date locale provider.
|
|
41
|
-
* This allows the main project or external projects to override the date locale logic.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* import { setDateLocaleProvider } from '@treeviz/gedcom-parser/factories/date-locale-factory';
|
|
46
|
-
* import { getDateFnsLocale } from './constants/ui-options';
|
|
47
|
-
*
|
|
48
|
-
* setDateLocaleProvider(getDateFnsLocale);
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
declare const setDateLocaleProvider: (provider: DateLocaleProvider) => void;
|
|
52
|
-
/**
|
|
53
|
-
* Get the current date locale.
|
|
54
|
-
* Used internally by the Date class for formatting dates.
|
|
55
|
-
*/
|
|
56
|
-
declare const getDateLocale: () => Locale | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* Reset to the default date locale provider.
|
|
59
|
-
* Useful for testing or when switching between projects.
|
|
60
|
-
*/
|
|
61
|
-
declare const resetDateLocaleProvider: () => void;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* I18n provider factory for pluggable translation
|
|
65
|
-
* This allows the main project to inject its i18n instance
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* I18n provider function type.
|
|
69
|
-
* Mimics the i18next.t() function signature.
|
|
70
|
-
*/
|
|
71
|
-
type I18nProvider = (key: string, options?: Record<string, unknown>) => string;
|
|
72
|
-
/**
|
|
73
|
-
* Set a custom i18n provider.
|
|
74
|
-
* This allows the main project to inject its i18n translation function.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```typescript
|
|
78
|
-
* import { setI18nProvider } from '@treeviz/gedcom-parser/factories/i18n-factory';
|
|
79
|
-
* import i18n from './translation/i18n';
|
|
80
|
-
*
|
|
81
|
-
* setI18nProvider((key, options) => i18n.t(key, options));
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
declare const setI18nProvider: (provider: I18nProvider) => void;
|
|
85
|
-
/**
|
|
86
|
-
* Get the current i18n provider.
|
|
87
|
-
* Used internally for translations.
|
|
88
|
-
*/
|
|
89
|
-
declare const getI18n: () => I18nProvider;
|
|
90
|
-
/**
|
|
91
|
-
* Reset to the default i18n provider.
|
|
92
|
-
* Useful for testing.
|
|
93
|
-
*/
|
|
94
|
-
declare const resetI18nProvider: () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Helper object that mimics i18next interface
|
|
97
|
-
* Usage: i18n.t(key, options)
|
|
98
|
-
*/
|
|
99
|
-
declare const i18n: {
|
|
100
|
-
t: (key: string, options?: Record<string, unknown>) => string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Kinship translator class constructor type
|
|
105
|
-
*/
|
|
106
|
-
type KinshipTranslatorConstructor = new (person1: IndiType, person2?: IndiType | IndiKey, lang?: Language, entirePath?: boolean, displayName?: "none" | "givenname" | "surname" | "all") => {
|
|
107
|
-
translate: <T extends boolean | undefined>(showMainPerson: boolean) => (T extends false | undefined ? string : Array<{
|
|
108
|
-
id?: IndiKey;
|
|
109
|
-
gen: number;
|
|
110
|
-
relative?: string;
|
|
111
|
-
absolute?: string;
|
|
112
|
-
}>) | undefined;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Set a custom kinship translator class.
|
|
116
|
-
* This allows the main project or external projects to override the kinship translation logic.
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* ```typescript
|
|
120
|
-
* import { setKinshipTranslatorClass } from '@treeviz/gedcom-parser/factories/kinship-factory';
|
|
121
|
-
* import MyCustomKinshipTranslator from './my-custom-kinship-translator';
|
|
122
|
-
*
|
|
123
|
-
* setKinshipTranslatorClass(MyCustomKinshipTranslator);
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
declare const setKinshipTranslatorClass: (TranslatorClass: KinshipTranslatorConstructor) => void;
|
|
127
|
-
/**
|
|
128
|
-
* Get the current kinship translator class.
|
|
129
|
-
* Used internally by the Indi class.
|
|
130
|
-
*/
|
|
131
|
-
declare const getKinshipTranslatorClass: () => KinshipTranslatorConstructor;
|
|
132
|
-
/**
|
|
133
|
-
* Reset to the default built-in kinship translator.
|
|
134
|
-
* Useful for testing or when switching between projects.
|
|
135
|
-
*/
|
|
136
|
-
declare const resetKinshipTranslatorClass: () => void;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Place Parser Provider Factory
|
|
140
|
-
* Allows consumer applications to provide their own place parsing implementation
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Place parser function type
|
|
145
|
-
* Receives a place string or array and returns parsed place parts
|
|
146
|
-
*/
|
|
147
|
-
type PlaceParserFunction = (place: string | (string | undefined)[]) => PlaceParts[];
|
|
148
|
-
/**
|
|
149
|
-
* Set the place parser provider
|
|
150
|
-
* @param parser - Custom place parser function
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* import { setPlaceParserProvider } from '@treeviz/gedcom-parser';
|
|
154
|
-
* import { getPlaceParts } from './my-place-parser';
|
|
155
|
-
*
|
|
156
|
-
* setPlaceParserProvider(getPlaceParts);
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
declare const setPlaceParserProvider: (parser: PlaceParserFunction | undefined) => void;
|
|
160
|
-
/**
|
|
161
|
-
* Get the current place parser provider
|
|
162
|
-
* @returns The current place parser function or undefined
|
|
163
|
-
*/
|
|
164
|
-
declare const getPlaceParserProvider: () => PlaceParserFunction | undefined;
|
|
165
|
-
/**
|
|
166
|
-
* Reset the place parser provider to default (undefined)
|
|
167
|
-
*/
|
|
168
|
-
declare const resetPlaceParserProvider: () => void;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Place Translator Provider Factory
|
|
172
|
-
* Allows consumer applications to provide their own place translation implementation
|
|
173
|
-
*/
|
|
174
|
-
/**
|
|
175
|
-
* Place translator function type
|
|
176
|
-
* Receives place string or array and optional parameters, returns translated string
|
|
177
|
-
* Compatible with main app's placeTranslator signature
|
|
178
|
-
*/
|
|
179
|
-
type PlaceTranslatorFunction = (place?: string | string[], level?: number, toReversed?: boolean) => string | undefined;
|
|
180
|
-
/**
|
|
181
|
-
* Set the place translator provider
|
|
182
|
-
* @param translator - Custom place translator function
|
|
183
|
-
* @example
|
|
184
|
-
* ```typescript
|
|
185
|
-
* import { setPlaceTranslatorProvider } from '@treeviz/gedcom-parser';
|
|
186
|
-
* import { placeTranslator } from './my-place-translator';
|
|
187
|
-
*
|
|
188
|
-
* setPlaceTranslatorProvider(placeTranslator);
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
declare const setPlaceTranslatorProvider: (translator: PlaceTranslatorFunction | undefined) => void;
|
|
192
|
-
/**
|
|
193
|
-
* Get the current place translator provider
|
|
194
|
-
* @returns The current place translator function or undefined
|
|
195
|
-
*/
|
|
196
|
-
declare const getPlaceTranslatorProvider: () => PlaceTranslatorFunction | undefined;
|
|
197
|
-
/**
|
|
198
|
-
* Reset the place translator provider to default (undefined)
|
|
199
|
-
*/
|
|
200
|
-
declare const resetPlaceTranslatorProvider: () => void;
|
|
201
|
-
|
|
202
|
-
export { type CacheManagerFactory, type DateLocaleProvider, type I18nProvider, type KinshipTranslatorConstructor, type PlaceParserFunction, type PlaceTranslatorFunction, getCacheManagerFactory, getDateLocale, getI18n, getKinshipTranslatorClass, getPlaceParserProvider, getPlaceTranslatorProvider, i18n, resetCacheManagerFactory, resetDateLocaleProvider, resetI18nProvider, resetKinshipTranslatorClass, resetPlaceParserProvider, resetPlaceTranslatorProvider, setCacheManagerFactory, setDateLocaleProvider, setI18nProvider, setKinshipTranslatorClass, setPlaceParserProvider, setPlaceTranslatorProvider };
|
|
1
|
+
export type { CacheManagerFactory } from "./cache-factory";
|
|
2
|
+
export type { DateLocaleProvider } from "./date-locale-factory";
|
|
3
|
+
export type { I18nProvider } from "./i18n-factory";
|
|
4
|
+
export type { KinshipTranslatorConstructor } from "./kinship-factory";
|
|
5
|
+
export type { PlaceParserFunction } from "./place-parser-provider";
|
|
6
|
+
export type { PlaceTranslatorFunction } from "./place-translator-provider";
|
|
7
|
+
export * from "./cache-factory";
|
|
8
|
+
export * from "./date-locale-factory";
|
|
9
|
+
export * from "./i18n-factory";
|
|
10
|
+
export * from "./kinship-factory";
|
|
11
|
+
export * from "./place-parser-provider";
|
|
12
|
+
export * from "./place-translator-provider";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factories/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC"}
|