@treeviz/gedcom-parser 1.0.1
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/LICENSE +21 -0
- package/README.md +954 -0
- package/dist/classes/common.d.ts +87 -0
- package/dist/classes/common.d.ts.map +1 -0
- package/dist/classes/common.js +481 -0
- package/dist/classes/date.d.ts +26 -0
- package/dist/classes/date.d.ts.map +1 -0
- package/dist/classes/date.js +176 -0
- package/dist/classes/fam.d.ts +19 -0
- package/dist/classes/fam.d.ts.map +1 -0
- package/dist/classes/fam.js +38 -0
- package/dist/classes/fams.d.ts +16 -0
- package/dist/classes/fams.d.ts.map +1 -0
- package/dist/classes/fams.js +41 -0
- package/dist/classes/gedcom.d.ts +89 -0
- package/dist/classes/gedcom.d.ts.map +1 -0
- package/dist/classes/gedcom.js +421 -0
- package/dist/classes/index.d.ts +19 -0
- package/dist/classes/index.d.ts.map +1 -0
- package/dist/classes/index.js +19 -0
- package/dist/classes/indi.d.ts +298 -0
- package/dist/classes/indi.d.ts.map +1 -0
- package/dist/classes/indi.js +2049 -0
- package/dist/classes/indis.d.ts +54 -0
- package/dist/classes/indis.d.ts.map +1 -0
- package/dist/classes/indis.js +439 -0
- package/dist/classes/list.d.ts +55 -0
- package/dist/classes/list.d.ts.map +1 -0
- package/dist/classes/list.js +440 -0
- package/dist/classes/name.d.ts +20 -0
- package/dist/classes/name.d.ts.map +1 -0
- package/dist/classes/name.js +48 -0
- package/dist/classes/note.d.ts +12 -0
- package/dist/classes/note.d.ts.map +1 -0
- package/dist/classes/note.js +46 -0
- package/dist/classes/obje.d.ts +12 -0
- package/dist/classes/obje.d.ts.map +1 -0
- package/dist/classes/obje.js +81 -0
- package/dist/classes/objes.d.ts +8 -0
- package/dist/classes/objes.d.ts.map +1 -0
- package/dist/classes/objes.js +13 -0
- package/dist/classes/repo.d.ts +11 -0
- package/dist/classes/repo.d.ts.map +1 -0
- package/dist/classes/repo.js +6 -0
- package/dist/classes/repos.d.ts +8 -0
- package/dist/classes/repos.d.ts.map +1 -0
- package/dist/classes/repos.js +13 -0
- package/dist/classes/sour.d.ts +11 -0
- package/dist/classes/sour.d.ts.map +1 -0
- package/dist/classes/sour.js +6 -0
- package/dist/classes/sours.d.ts +8 -0
- package/dist/classes/sours.d.ts.map +1 -0
- package/dist/classes/sours.js +13 -0
- package/dist/classes/subm.d.ts +10 -0
- package/dist/classes/subm.d.ts.map +1 -0
- package/dist/classes/subm.js +6 -0
- package/dist/classes/subms.d.ts +8 -0
- package/dist/classes/subms.d.ts.map +1 -0
- package/dist/classes/subms.js +13 -0
- package/dist/constants/constants.d.ts +14 -0
- package/dist/constants/constants.d.ts.map +1 -0
- package/dist/constants/constants.js +13 -0
- package/dist/constants/filters.d.ts +17 -0
- package/dist/constants/filters.d.ts.map +1 -0
- package/dist/constants/filters.js +44 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +4 -0
- package/dist/constants/orders.d.ts +17 -0
- package/dist/constants/orders.d.ts.map +1 -0
- package/dist/constants/orders.js +240 -0
- package/dist/factories/cache-factory.d.ts +30 -0
- package/dist/factories/cache-factory.d.ts.map +1 -0
- package/dist/factories/cache-factory.js +43 -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/date-locale-factory.js +34 -0
- package/dist/factories/i18n-factory.d.ts +40 -0
- package/dist/factories/i18n-factory.d.ts.map +1 -0
- package/dist/factories/i18n-factory.js +44 -0
- package/dist/factories/index.d.ts +5 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +5 -0
- package/dist/factories/kinship-factory.d.ts +38 -0
- package/dist/factories/kinship-factory.d.ts.map +1 -0
- package/dist/factories/kinship-factory.js +35 -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-parser-provider.js +35 -0
- package/dist/factories/place-translator-provider.d.ts +32 -0
- package/dist/factories/place-translator-provider.d.ts.map +1 -0
- package/dist/factories/place-translator-provider.js +35 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/interfaces/common.d.ts +43 -0
- package/dist/interfaces/common.d.ts.map +1 -0
- package/dist/interfaces/common.js +1 -0
- package/dist/interfaces/fam.d.ts +11 -0
- package/dist/interfaces/fam.d.ts.map +1 -0
- package/dist/interfaces/fam.js +1 -0
- package/dist/interfaces/fams.d.ts +9 -0
- package/dist/interfaces/fams.d.ts.map +1 -0
- package/dist/interfaces/fams.js +1 -0
- package/dist/interfaces/gedcom.d.ts +30 -0
- package/dist/interfaces/gedcom.d.ts.map +1 -0
- package/dist/interfaces/gedcom.js +1 -0
- package/dist/interfaces/index.d.ts +12 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/indi.d.ts +109 -0
- package/dist/interfaces/indi.d.ts.map +1 -0
- package/dist/interfaces/indi.js +1 -0
- package/dist/interfaces/indis.d.ts +31 -0
- package/dist/interfaces/indis.d.ts.map +1 -0
- package/dist/interfaces/indis.js +1 -0
- package/dist/interfaces/list.d.ts +52 -0
- package/dist/interfaces/list.d.ts.map +1 -0
- package/dist/interfaces/list.js +1 -0
- package/dist/interfaces/obje.d.ts +7 -0
- package/dist/interfaces/obje.d.ts.map +1 -0
- package/dist/interfaces/obje.js +1 -0
- package/dist/interfaces/repo.d.ts +7 -0
- package/dist/interfaces/repo.d.ts.map +1 -0
- package/dist/interfaces/repo.js +1 -0
- package/dist/interfaces/sour.d.ts +7 -0
- package/dist/interfaces/sour.d.ts.map +1 -0
- package/dist/interfaces/sour.js +1 -0
- package/dist/interfaces/subm.d.ts +6 -0
- package/dist/interfaces/subm.d.ts.map +1 -0
- package/dist/interfaces/subm.js +1 -0
- package/dist/kinship-translator/index.d.ts +11 -0
- package/dist/kinship-translator/index.d.ts.map +1 -0
- package/dist/kinship-translator/index.js +10 -0
- 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.basic.js +74 -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.de.js +180 -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.en.js +182 -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.es.js +181 -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.fr.js +181 -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.hu.js +226 -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/kinship-translator.interface.js +1 -0
- package/dist/kinship-translator/kinship-translator.js +103 -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.de.js +14 -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.en.js +14 -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.es.js +14 -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.fr.js +14 -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/patterns.hu.js +97 -0
- package/dist/kinship-translator/translators.d.ts +6 -0
- package/dist/kinship-translator/translators.d.ts.map +1 -0
- package/dist/kinship-translator/translators.js +5 -0
- package/dist/kinship-translator/types.d.ts +9 -0
- package/dist/kinship-translator/types.d.ts.map +1 -0
- package/dist/kinship-translator/types.js +1 -0
- package/dist/structures/address.d.ts +14 -0
- package/dist/structures/address.d.ts.map +1 -0
- package/dist/structures/address.js +1 -0
- package/dist/structures/association.d.ts +13 -0
- package/dist/structures/association.d.ts.map +1 -0
- package/dist/structures/association.js +1 -0
- package/dist/structures/change-date.d.ts +8 -0
- package/dist/structures/change-date.d.ts.map +1 -0
- package/dist/structures/change-date.js +1 -0
- package/dist/structures/creation-date.d.ts +7 -0
- package/dist/structures/creation-date.d.ts.map +1 -0
- package/dist/structures/creation-date.js +1 -0
- package/dist/structures/date.d.ts +9 -0
- package/dist/structures/date.d.ts.map +1 -0
- package/dist/structures/date.js +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/event-detail-structure.js +1 -0
- package/dist/structures/family.d.ts +34 -0
- package/dist/structures/family.d.ts.map +1 -0
- package/dist/structures/family.js +1 -0
- package/dist/structures/gedcom.d.ts +60 -0
- package/dist/structures/gedcom.d.ts.map +1 -0
- package/dist/structures/gedcom.js +1 -0
- package/dist/structures/index.d.ts +25 -0
- package/dist/structures/index.d.ts.map +1 -0
- package/dist/structures/index.js +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-detail-structure.js +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-event-structure.js +1 -0
- package/dist/structures/individual.d.ts +40 -0
- package/dist/structures/individual.d.ts.map +1 -0
- package/dist/structures/individual.js +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-ordinance-detail.js +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/lds-spouse-sealing.js +1 -0
- package/dist/structures/marriage-date.d.ts +11 -0
- package/dist/structures/marriage-date.d.ts.map +1 -0
- package/dist/structures/marriage-date.js +1 -0
- package/dist/structures/multimedia-link.d.ts +16 -0
- package/dist/structures/multimedia-link.d.ts.map +1 -0
- package/dist/structures/multimedia-link.js +1 -0
- package/dist/structures/non-event.d.ts +12 -0
- package/dist/structures/non-event.d.ts.map +1 -0
- package/dist/structures/non-event.js +1 -0
- package/dist/structures/note.d.ts +16 -0
- package/dist/structures/note.d.ts.map +1 -0
- package/dist/structures/note.js +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-pieces.js +1 -0
- package/dist/structures/personal-name.d.ts +16 -0
- package/dist/structures/personal-name.d.ts.map +1 -0
- package/dist/structures/personal-name.js +1 -0
- package/dist/structures/place.d.ts +20 -0
- package/dist/structures/place.d.ts.map +1 -0
- package/dist/structures/place.js +1 -0
- package/dist/structures/repository.d.ts +6 -0
- package/dist/structures/repository.d.ts.map +1 -0
- package/dist/structures/repository.js +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-citation.js +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-repository-citation.js +1 -0
- package/dist/structures/source.d.ts +28 -0
- package/dist/structures/source.d.ts.map +1 -0
- package/dist/structures/source.js +1 -0
- package/dist/types/ancestry-media.d.ts +65 -0
- package/dist/types/ancestry-media.d.ts.map +1 -0
- package/dist/types/ancestry-media.js +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/settings.d.ts +12 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +1 -0
- package/dist/types/types.d.ts +220 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +26 -0
- package/dist/utils/cache.d.ts +22 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +57 -0
- package/dist/utils/common-creator.d.ts +13 -0
- package/dist/utils/common-creator.d.ts.map +1 -0
- package/dist/utils/common-creator.js +72 -0
- package/dist/utils/date-formatter.d.ts +35 -0
- package/dist/utils/date-formatter.d.ts.map +1 -0
- package/dist/utils/date-formatter.js +207 -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-all-prop.js +5 -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-family-with.js +11 -0
- package/dist/utils/get-places.d.ts +21 -0
- package/dist/utils/get-places.d.ts.map +1 -0
- package/dist/utils/get-places.js +77 -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-product-details.js +6 -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/get-raw-size.js +3 -0
- package/dist/utils/index.d.ts +17 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +11 -0
- package/dist/utils/name-formatter.d.ts +10 -0
- package/dist/utils/name-formatter.d.ts.map +1 -0
- package/dist/utils/name-formatter.js +45 -0
- package/dist/utils/nested-group.d.ts +4 -0
- package/dist/utils/nested-group.d.ts.map +1 -0
- package/dist/utils/nested-group.js +34 -0
- package/dist/utils/ordinalize.d.ts +3 -0
- package/dist/utils/ordinalize.d.ts.map +1 -0
- package/dist/utils/ordinalize.js +104 -0
- package/dist/utils/parser.d.ts +17 -0
- package/dist/utils/parser.d.ts.map +1 -0
- package/dist/utils/parser.js +322 -0
- package/dist/utils/place-parser.d.ts +16 -0
- package/dist/utils/place-parser.d.ts.map +1 -0
- package/dist/utils/place-parser.js +46 -0
- package/dist/utils/place-translator.d.ts +6 -0
- package/dist/utils/place-translator.d.ts.map +1 -0
- package/dist/utils/place-translator.js +8 -0
- package/dist/utils/place-types.d.ts +27 -0
- package/dist/utils/place-types.d.ts.map +1 -0
- package/dist/utils/place-types.js +14 -0
- package/dist/utils/range.d.ts +19 -0
- package/dist/utils/range.d.ts.map +1 -0
- package/dist/utils/range.js +265 -0
- package/package.json +153 -0
|
@@ -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,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default date locale provider (returns undefined, date-fns will use default behavior)
|
|
3
|
+
*/
|
|
4
|
+
let dateLocaleProvider = () => undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Set a custom date locale provider.
|
|
7
|
+
* This allows the main project or external projects to override the date locale logic.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { setDateLocaleProvider } from '@treeviz/gedcom-parser/factories/date-locale-factory';
|
|
12
|
+
* import { getDateFnsLocale } from './constants/ui-options';
|
|
13
|
+
*
|
|
14
|
+
* setDateLocaleProvider(getDateFnsLocale);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export const setDateLocaleProvider = (provider) => {
|
|
18
|
+
dateLocaleProvider = provider;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get the current date locale.
|
|
22
|
+
* Used internally by the Date class for formatting dates.
|
|
23
|
+
*/
|
|
24
|
+
export const getDateLocale = () => {
|
|
25
|
+
const result = dateLocaleProvider();
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Reset to the default date locale provider.
|
|
30
|
+
* Useful for testing or when switching between projects.
|
|
31
|
+
*/
|
|
32
|
+
export const resetDateLocaleProvider = () => {
|
|
33
|
+
dateLocaleProvider = () => undefined;
|
|
34
|
+
};
|
|
@@ -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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* I18n provider factory for pluggable translation
|
|
3
|
+
* This allows the main project to inject its i18n instance
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Default i18n provider (returns the key itself as fallback)
|
|
7
|
+
*/
|
|
8
|
+
let i18nProvider = (key) => key;
|
|
9
|
+
/**
|
|
10
|
+
* Set a custom i18n provider.
|
|
11
|
+
* This allows the main project to inject its i18n translation function.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { setI18nProvider } from '@treeviz/gedcom-parser/factories/i18n-factory';
|
|
16
|
+
* import i18n from './translation/i18n';
|
|
17
|
+
*
|
|
18
|
+
* setI18nProvider((key, options) => i18n.t(key, options));
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const setI18nProvider = (provider) => {
|
|
22
|
+
i18nProvider = provider;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Get the current i18n provider.
|
|
26
|
+
* Used internally for translations.
|
|
27
|
+
*/
|
|
28
|
+
export const getI18n = () => {
|
|
29
|
+
return i18nProvider;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Reset to the default i18n provider.
|
|
33
|
+
* Useful for testing.
|
|
34
|
+
*/
|
|
35
|
+
export const resetI18nProvider = () => {
|
|
36
|
+
i18nProvider = (key) => key;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Helper object that mimics i18next interface
|
|
40
|
+
* Usage: i18n.t(key, options)
|
|
41
|
+
*/
|
|
42
|
+
export const i18n = {
|
|
43
|
+
t: (key, options) => i18nProvider(key, options),
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factories/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IndiType } from "../classes/indi";
|
|
2
|
+
import type { Language } from "../kinship-translator/types";
|
|
3
|
+
import type { IndiKey } from "../types/types";
|
|
4
|
+
/**
|
|
5
|
+
* Kinship translator class constructor type
|
|
6
|
+
*/
|
|
7
|
+
export type KinshipTranslatorConstructor = new (person1: IndiType, person2?: IndiType | IndiKey, lang?: Language, entirePath?: boolean, displayName?: "none" | "givenname" | "surname" | "all") => {
|
|
8
|
+
translate: <T extends boolean | undefined>(showMainPerson: boolean) => (T extends false | undefined ? string : Array<{
|
|
9
|
+
id?: IndiKey;
|
|
10
|
+
gen: number;
|
|
11
|
+
relative?: string;
|
|
12
|
+
absolute?: string;
|
|
13
|
+
}>) | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Set a custom kinship translator class.
|
|
17
|
+
* This allows the main project or external projects to override the kinship translation logic.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { setKinshipTranslatorClass } from '@treeviz/gedcom-parser/factories/kinship-factory';
|
|
22
|
+
* import MyCustomKinshipTranslator from './my-custom-kinship-translator';
|
|
23
|
+
*
|
|
24
|
+
* setKinshipTranslatorClass(MyCustomKinshipTranslator);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const setKinshipTranslatorClass: (TranslatorClass: KinshipTranslatorConstructor) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Get the current kinship translator class.
|
|
30
|
+
* Used internally by the Indi class.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getKinshipTranslatorClass: () => KinshipTranslatorConstructor;
|
|
33
|
+
/**
|
|
34
|
+
* Reset to the default built-in kinship translator.
|
|
35
|
+
* Useful for testing or when switching between projects.
|
|
36
|
+
*/
|
|
37
|
+
export declare const resetKinshipTranslatorClass: () => void;
|
|
38
|
+
//# sourceMappingURL=kinship-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kinship-factory.d.ts","sourceRoot":"","sources":["../../src/factories/kinship-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,KAC1C,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,EAC5B,IAAI,CAAC,EAAE,QAAQ,EACf,UAAU,CAAC,EAAE,OAAO,EACpB,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,KAAK,KAClD;IACJ,SAAS,EAAE,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,EACxC,cAAc,EAAE,OAAO,KAErB,CAAC,CAAC,SAAS,KAAK,GAAG,SAAS,GAC1B,MAAM,GACN,KAAK,CAAC;QACN,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC,GACJ,SAAS,CAAC;CACb,CAAC;AAQF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GACrC,iBAAiB,4BAA4B,SAG7C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,4BAE5C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,YAGvC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import KinshipTranslator from "../kinship-translator/kinship-translator";
|
|
2
|
+
/**
|
|
3
|
+
* Default kinship translator (uses the built-in translator)
|
|
4
|
+
*/
|
|
5
|
+
let KinshipTranslatorClass = KinshipTranslator;
|
|
6
|
+
/**
|
|
7
|
+
* Set a custom kinship translator class.
|
|
8
|
+
* This allows the main project or external projects to override the kinship translation logic.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { setKinshipTranslatorClass } from '@treeviz/gedcom-parser/factories/kinship-factory';
|
|
13
|
+
* import MyCustomKinshipTranslator from './my-custom-kinship-translator';
|
|
14
|
+
*
|
|
15
|
+
* setKinshipTranslatorClass(MyCustomKinshipTranslator);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const setKinshipTranslatorClass = (TranslatorClass) => {
|
|
19
|
+
KinshipTranslatorClass = TranslatorClass;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Get the current kinship translator class.
|
|
23
|
+
* Used internally by the Indi class.
|
|
24
|
+
*/
|
|
25
|
+
export const getKinshipTranslatorClass = () => {
|
|
26
|
+
return KinshipTranslatorClass;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Reset to the default built-in kinship translator.
|
|
30
|
+
* Useful for testing or when switching between projects.
|
|
31
|
+
*/
|
|
32
|
+
export const resetKinshipTranslatorClass = () => {
|
|
33
|
+
KinshipTranslatorClass =
|
|
34
|
+
KinshipTranslator;
|
|
35
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Place Parser Provider Factory
|
|
3
|
+
* Allows consumer applications to provide their own place parsing implementation
|
|
4
|
+
*/
|
|
5
|
+
import type { PlaceParts } from "../utils/place-parser";
|
|
6
|
+
/**
|
|
7
|
+
* Place parser function type
|
|
8
|
+
* Receives a place string or array and returns parsed place parts
|
|
9
|
+
*/
|
|
10
|
+
export type PlaceParserFunction = (place: string | (string | undefined)[]) => PlaceParts[];
|
|
11
|
+
/**
|
|
12
|
+
* Set the place parser provider
|
|
13
|
+
* @param parser - Custom place parser function
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { setPlaceParserProvider } from '@treeviz/gedcom-parser';
|
|
17
|
+
* import { getPlaceParts } from './my-place-parser';
|
|
18
|
+
*
|
|
19
|
+
* setPlaceParserProvider(getPlaceParts);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const setPlaceParserProvider: (parser: PlaceParserFunction | undefined) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current place parser provider
|
|
25
|
+
* @returns The current place parser function or undefined
|
|
26
|
+
*/
|
|
27
|
+
export declare const getPlaceParserProvider: () => PlaceParserFunction | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Reset the place parser provider to default (undefined)
|
|
30
|
+
*/
|
|
31
|
+
export declare const resetPlaceParserProvider: () => void;
|
|
32
|
+
//# sourceMappingURL=place-parser-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-parser-provider.d.ts","sourceRoot":"","sources":["../../src/factories/place-parser-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CACjC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,KAClC,UAAU,EAAE,CAAC;AAOlB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GAClC,QAAQ,mBAAmB,GAAG,SAAS,KACrC,IAEF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAO,mBAAmB,GAAG,SAE/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,IAE3C,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Place Parser Provider Factory
|
|
3
|
+
* Allows consumer applications to provide their own place parsing implementation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Default place parser provider (returns undefined, uses built-in parser)
|
|
7
|
+
*/
|
|
8
|
+
let placeParserProvider;
|
|
9
|
+
/**
|
|
10
|
+
* Set the place parser provider
|
|
11
|
+
* @param parser - Custom place parser function
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { setPlaceParserProvider } from '@treeviz/gedcom-parser';
|
|
15
|
+
* import { getPlaceParts } from './my-place-parser';
|
|
16
|
+
*
|
|
17
|
+
* setPlaceParserProvider(getPlaceParts);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const setPlaceParserProvider = (parser) => {
|
|
21
|
+
placeParserProvider = parser;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Get the current place parser provider
|
|
25
|
+
* @returns The current place parser function or undefined
|
|
26
|
+
*/
|
|
27
|
+
export const getPlaceParserProvider = () => {
|
|
28
|
+
return placeParserProvider;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Reset the place parser provider to default (undefined)
|
|
32
|
+
*/
|
|
33
|
+
export const resetPlaceParserProvider = () => {
|
|
34
|
+
placeParserProvider = undefined;
|
|
35
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Place Translator Provider Factory
|
|
3
|
+
* Allows consumer applications to provide their own place translation implementation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Place translator function type
|
|
7
|
+
* Receives place string or array and optional parameters, returns translated string
|
|
8
|
+
* Compatible with main app's placeTranslator signature
|
|
9
|
+
*/
|
|
10
|
+
export type PlaceTranslatorFunction = (place?: string | string[], level?: number, toReversed?: boolean) => string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Set the place translator provider
|
|
13
|
+
* @param translator - Custom place translator function
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { setPlaceTranslatorProvider } from '@treeviz/gedcom-parser';
|
|
17
|
+
* import { placeTranslator } from './my-place-translator';
|
|
18
|
+
*
|
|
19
|
+
* setPlaceTranslatorProvider(placeTranslator);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const setPlaceTranslatorProvider: (translator: PlaceTranslatorFunction | undefined) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current place translator provider
|
|
25
|
+
* @returns The current place translator function or undefined
|
|
26
|
+
*/
|
|
27
|
+
export declare const getPlaceTranslatorProvider: () => PlaceTranslatorFunction | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Reset the place translator provider to default (undefined)
|
|
30
|
+
*/
|
|
31
|
+
export declare const resetPlaceTranslatorProvider: () => void;
|
|
32
|
+
//# sourceMappingURL=place-translator-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-translator-provider.d.ts","sourceRoot":"","sources":["../../src/factories/place-translator-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACrC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EACzB,KAAK,CAAC,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,OAAO,KAChB,MAAM,GAAG,SAAS,CAAC;AAOxB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,GACtC,YAAY,uBAAuB,GAAG,SAAS,KAC7C,IAEF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QACpC,uBAAuB,GACvB,SAEF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAO,IAE/C,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Place Translator Provider Factory
|
|
3
|
+
* Allows consumer applications to provide their own place translation implementation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Default place translator provider (returns undefined, uses built-in translator)
|
|
7
|
+
*/
|
|
8
|
+
let placeTranslatorProvider;
|
|
9
|
+
/**
|
|
10
|
+
* Set the place translator provider
|
|
11
|
+
* @param translator - Custom place translator function
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { setPlaceTranslatorProvider } from '@treeviz/gedcom-parser';
|
|
15
|
+
* import { placeTranslator } from './my-place-translator';
|
|
16
|
+
*
|
|
17
|
+
* setPlaceTranslatorProvider(placeTranslator);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const setPlaceTranslatorProvider = (translator) => {
|
|
21
|
+
placeTranslatorProvider = translator;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Get the current place translator provider
|
|
25
|
+
* @returns The current place translator function or undefined
|
|
26
|
+
*/
|
|
27
|
+
export const getPlaceTranslatorProvider = () => {
|
|
28
|
+
return placeTranslatorProvider;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Reset the place translator provider to default (undefined)
|
|
32
|
+
*/
|
|
33
|
+
export const resetPlaceTranslatorProvider = () => {
|
|
34
|
+
placeTranslatorProvider = undefined;
|
|
35
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export * from "./utils/parser";
|
|
2
|
+
export { default } from "./utils/parser";
|
|
3
|
+
export { default as GedcomTree } from "./utils/parser";
|
|
4
|
+
export { setCacheManagerFactory, getCacheManagerFactory, resetCacheManagerFactory, type CacheManagerFactory, } from "./factories/cache-factory";
|
|
5
|
+
export { setKinshipTranslatorClass, getKinshipTranslatorClass, resetKinshipTranslatorClass, type KinshipTranslatorConstructor, } from "./factories/kinship-factory";
|
|
6
|
+
export { setDateLocaleProvider, getDateLocale, resetDateLocaleProvider, type DateLocaleProvider, } from "./factories/date-locale-factory";
|
|
7
|
+
export { setI18nProvider, getI18n, resetI18nProvider, type I18nProvider, } from "./factories/i18n-factory";
|
|
8
|
+
export { setPlaceParserProvider, getPlaceParserProvider, resetPlaceParserProvider, type PlaceParserFunction, } from "./factories/place-parser-provider";
|
|
9
|
+
export { setPlaceTranslatorProvider, getPlaceTranslatorProvider, resetPlaceTranslatorProvider, type PlaceTranslatorFunction, } from "./factories/place-translator-provider";
|
|
10
|
+
export type { ICacheManager } from "./utils/cache";
|
|
11
|
+
export { default as KinshipTranslator } from "./kinship-translator/kinship-translator";
|
|
12
|
+
export type { default as IKinshipTranslator } from "./kinship-translator/kinship-translator.interface";
|
|
13
|
+
export type { Language } from "./kinship-translator/types";
|
|
14
|
+
export * from "./types/types";
|
|
15
|
+
export * from "./classes/common";
|
|
16
|
+
export * from "./classes/gedcom";
|
|
17
|
+
export * from "./classes/indis";
|
|
18
|
+
export * from "./classes/fam";
|
|
19
|
+
export * from "./classes/fams";
|
|
20
|
+
export * from "./classes/sour";
|
|
21
|
+
export * from "./classes/sours";
|
|
22
|
+
export * from "./classes/repo";
|
|
23
|
+
export * from "./classes/repos";
|
|
24
|
+
export * from "./classes/subm";
|
|
25
|
+
export * from "./classes/subms";
|
|
26
|
+
export * from "./classes/note";
|
|
27
|
+
export * from "./classes/name";
|
|
28
|
+
export * from "./classes/date";
|
|
29
|
+
export * from "./classes/indi";
|
|
30
|
+
export * from "./classes/obje";
|
|
31
|
+
export * from "./classes/objes";
|
|
32
|
+
export * from "./classes/list";
|
|
33
|
+
export type { default as GedComInterface } from "./interfaces/gedcom";
|
|
34
|
+
export type { default as FamInterface } from "./interfaces/fam";
|
|
35
|
+
export type { IFamilies as FamsInterface } from "./interfaces/fams";
|
|
36
|
+
export type { default as RepoInterface } from "./interfaces/repo";
|
|
37
|
+
export type { default as SubmInterface } from "./interfaces/subm";
|
|
38
|
+
export type { default as ObjeInterface } from "./interfaces/obje";
|
|
39
|
+
export type { IIndividuals as IndisInterface } from "./interfaces/indis";
|
|
40
|
+
export type { default as IndiInterface } from "./interfaces/indi";
|
|
41
|
+
export type { default as CommonInterface } from "./interfaces/common";
|
|
42
|
+
export type { IList as ListInterface } from "./interfaces/list";
|
|
43
|
+
export type { default as SourInterface } from "./interfaces/sour";
|
|
44
|
+
export type * from "./structures/gedcom";
|
|
45
|
+
export type * from "./structures/individual";
|
|
46
|
+
export type * from "./structures/family";
|
|
47
|
+
export type * from "./structures/source";
|
|
48
|
+
export type * from "./structures/repository";
|
|
49
|
+
export type * from "./structures/note";
|
|
50
|
+
export type * from "./structures/date";
|
|
51
|
+
export type { default as IDateStructure } from "./structures/date";
|
|
52
|
+
export type * from "./structures/place";
|
|
53
|
+
export type * from "./structures/address";
|
|
54
|
+
export type * from "./structures/personal-name";
|
|
55
|
+
export type * from "./structures/personal-name-pieces";
|
|
56
|
+
export type * from "./structures/source-citation";
|
|
57
|
+
export type * from "./structures/event-detail-structure";
|
|
58
|
+
export type { default as IEventDetailStructure } from "./structures/event-detail-structure";
|
|
59
|
+
export type * from "./structures/individual-event-structure";
|
|
60
|
+
export type * from "./structures/individual-event-detail-structure";
|
|
61
|
+
export type * from "./structures/association";
|
|
62
|
+
export type * from "./structures/change-date";
|
|
63
|
+
export type * from "./structures/creation-date";
|
|
64
|
+
export type * from "./structures/multimedia-link";
|
|
65
|
+
export type * from "./structures/non-event";
|
|
66
|
+
export type * from "./structures/marriage-date";
|
|
67
|
+
export type * from "./structures/lds-ordinance-detail";
|
|
68
|
+
export type * from "./structures/lds-spouse-sealing";
|
|
69
|
+
export type * from "./structures/source-repository-citation";
|
|
70
|
+
export * from "./utils/cache";
|
|
71
|
+
export { getRawSize } from "./utils/get-raw-size";
|
|
72
|
+
export * from "./utils/date-formatter";
|
|
73
|
+
export * from "./utils/name-formatter";
|
|
74
|
+
export * from "./utils/place-parser";
|
|
75
|
+
export * from "./utils/get-places";
|
|
76
|
+
export * from "./utils/place-translator";
|
|
77
|
+
export { inRange, isIntersectedRange, splitRange, fromTuple, parseRangeBounds, isRangeContained, extractSplitPoints, generateSplitRanges, splitOverlappingRanges, findMatchingRangeForSplitRange, extractSeparationYears, } from "./utils/range";
|
|
78
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,mBAAmB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,4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AC9C,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,mCAAmC,CAAC;AACvD,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,yCAAyC,CAAC;AAG7D,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EACN,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Parser
|
|
2
|
+
export * from "./utils/parser";
|
|
3
|
+
export { default } from "./utils/parser";
|
|
4
|
+
export { default as GedcomTree } from "./utils/parser";
|
|
5
|
+
// Factories - Pluggable dependencies
|
|
6
|
+
export { setCacheManagerFactory, getCacheManagerFactory, resetCacheManagerFactory, } from "./factories/cache-factory";
|
|
7
|
+
export { setKinshipTranslatorClass, getKinshipTranslatorClass, resetKinshipTranslatorClass, } from "./factories/kinship-factory";
|
|
8
|
+
export { setDateLocaleProvider, getDateLocale, resetDateLocaleProvider, } from "./factories/date-locale-factory";
|
|
9
|
+
export { setI18nProvider, getI18n, resetI18nProvider, } from "./factories/i18n-factory";
|
|
10
|
+
export { setPlaceParserProvider, getPlaceParserProvider, resetPlaceParserProvider, } from "./factories/place-parser-provider";
|
|
11
|
+
export { setPlaceTranslatorProvider, getPlaceTranslatorProvider, resetPlaceTranslatorProvider, } from "./factories/place-translator-provider";
|
|
12
|
+
// Kinship translator
|
|
13
|
+
export { default as KinshipTranslator } from "./kinship-translator/kinship-translator";
|
|
14
|
+
// Settings
|
|
15
|
+
export * from "./types/types";
|
|
16
|
+
// Classes - export everything from each class
|
|
17
|
+
export * from "./classes/common";
|
|
18
|
+
export * from "./classes/gedcom";
|
|
19
|
+
export * from "./classes/indis";
|
|
20
|
+
export * from "./classes/fam";
|
|
21
|
+
export * from "./classes/fams";
|
|
22
|
+
export * from "./classes/sour";
|
|
23
|
+
export * from "./classes/sours";
|
|
24
|
+
export * from "./classes/repo";
|
|
25
|
+
export * from "./classes/repos";
|
|
26
|
+
export * from "./classes/subm";
|
|
27
|
+
export * from "./classes/subms";
|
|
28
|
+
export * from "./classes/note";
|
|
29
|
+
export * from "./classes/name";
|
|
30
|
+
export * from "./classes/date";
|
|
31
|
+
export * from "./classes/indi";
|
|
32
|
+
export * from "./classes/obje";
|
|
33
|
+
export * from "./classes/objes";
|
|
34
|
+
export * from "./classes/list";
|
|
35
|
+
// Utils - commonly used utilities
|
|
36
|
+
export * from "./utils/cache";
|
|
37
|
+
export { getRawSize } from "./utils/get-raw-size";
|
|
38
|
+
export * from "./utils/date-formatter";
|
|
39
|
+
export * from "./utils/name-formatter";
|
|
40
|
+
export * from "./utils/place-parser";
|
|
41
|
+
export * from "./utils/get-places";
|
|
42
|
+
export * from "./utils/place-translator";
|
|
43
|
+
// Range utilities are already exported from types/types
|
|
44
|
+
export { inRange, isIntersectedRange, splitRange, fromTuple, parseRangeBounds, isRangeContained, extractSplitPoints, generateSplitRanges, splitOverlappingRanges, findMatchingRangeForSplitRange, extractSeparationYears, } from "./utils/range";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Common } from "../classes/common";
|
|
2
|
+
import { type List } from "../classes/list";
|
|
3
|
+
import { type IdType, type MultiTag } from "../types/types";
|
|
4
|
+
export type CommonWild = Partial<Record<`_${string}`, Common>>;
|
|
5
|
+
export interface ConvertOptions {
|
|
6
|
+
original?: boolean;
|
|
7
|
+
obje?: {
|
|
8
|
+
standardize?: boolean;
|
|
9
|
+
override?: boolean;
|
|
10
|
+
namespace?: string | number;
|
|
11
|
+
};
|
|
12
|
+
super?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface ICommon<P = string, I extends IdType = IdType> {
|
|
15
|
+
set value(value: P | undefined);
|
|
16
|
+
get value(): P | undefined;
|
|
17
|
+
isListable: boolean;
|
|
18
|
+
refType?: MultiTag;
|
|
19
|
+
id?: I;
|
|
20
|
+
removeValue: () => void;
|
|
21
|
+
set: <T extends Common | List = Common | List>(name: MultiTag, value: T) => T | undefined;
|
|
22
|
+
get: <T extends Common | List = Common | List>(name: MultiTag) => T | undefined;
|
|
23
|
+
remove: (name: MultiTag) => void;
|
|
24
|
+
getIf: <T extends Common | List = Common | List>(name: MultiTag, condition: string, name2: MultiTag) => T | undefined;
|
|
25
|
+
assign: <T extends Common | List = Common | List>(name: MultiTag, value: T) => T | undefined;
|
|
26
|
+
toString: () => string;
|
|
27
|
+
toValue: () => P | undefined;
|
|
28
|
+
exportValue: () => P | undefined;
|
|
29
|
+
toProp: (tag: MultiTag) => Common<P, I> | undefined;
|
|
30
|
+
toList: () => List;
|
|
31
|
+
toValueList: () => List;
|
|
32
|
+
toJson: (tag?: MultiTag, options?: ConvertOptions) => string;
|
|
33
|
+
toObject: (tag?: MultiTag, options?: ConvertOptions) => Record<string, string | undefined | ({
|
|
34
|
+
value?: string;
|
|
35
|
+
} & Record<string, unknown>) | Array<string | undefined | ({
|
|
36
|
+
value?: string;
|
|
37
|
+
} & Record<string, unknown>)>>;
|
|
38
|
+
toGedcomLines: (tag?: MultiTag, level?: number, options?: ConvertOptions) => string[];
|
|
39
|
+
toGedcom: (tag?: MultiTag, level?: number, options?: ConvertOptions) => string;
|
|
40
|
+
fromGedcom: (value: string) => void;
|
|
41
|
+
}
|
|
42
|
+
export default ICommon;
|
|
43
|
+
//# sourceMappingURL=common.d.ts.map
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C,CACH,CAAC;IAEF,aAAa,EAAE,CACd,GAAG,CAAC,EAAE,QAAQ,EACd,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,KACpB,MAAM,EAAE,CAAC;IAEd,QAAQ,EAAE,CACT,GAAG,CAAC,EAAE,QAAQ,EACd,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,KACpB,MAAM,CAAC;IAEZ,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Common } from "../classes/common";
|
|
2
|
+
import { type Individuals } from "../classes/indis";
|
|
3
|
+
import { type FamKey } from "../types/types";
|
|
4
|
+
interface IFam extends Common<string, FamKey> {
|
|
5
|
+
_IS_ORPHAN_FAMILY?: Common<"Y" | "N">;
|
|
6
|
+
getChildren: () => Individuals;
|
|
7
|
+
getHusband: () => Individuals;
|
|
8
|
+
getWife: () => Individuals;
|
|
9
|
+
}
|
|
10
|
+
export default IFam;
|
|
11
|
+
//# sourceMappingURL=fam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fam.d.ts","sourceRoot":"","sources":["../../src/interfaces/fam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,UAAU,IAAK,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAEtC,WAAW,EAAE,MAAM,WAAW,CAAC;IAE/B,UAAU,EAAE,MAAM,WAAW,CAAC;IAE9B,OAAO,EAAE,MAAM,WAAW,CAAC;CAC3B;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FamType } from "../classes/fam";
|
|
2
|
+
import { type Individuals } from "../classes/indis";
|
|
3
|
+
import { type FamKey } from "../types/types";
|
|
4
|
+
import { type IList } from "./list";
|
|
5
|
+
export interface IFamilies extends IList<FamKey, FamType> {
|
|
6
|
+
getParents: () => Individuals;
|
|
7
|
+
getChildren: () => Individuals;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=fams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fams.d.ts","sourceRoot":"","sources":["../../src/interfaces/fams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,UAAU,EAAE,MAAM,WAAW,CAAC;IAE9B,WAAW,EAAE,MAAM,WAAW,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|