gedcom-ts 2026.5.3 → 2026.5.4
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/CHANGELOG.md +30 -0
- package/README.md +87 -20
- package/dist/booklet/booklet-date-en.d.ts +9 -0
- package/dist/booklet/booklet-date-factory.d.ts +21 -0
- package/dist/booklet/booklet-date-fr.d.ts +1 -0
- package/dist/booklet/booklet-date.d.ts +6 -0
- package/dist/booklet/booklet-estimate.d.ts +4 -3
- package/dist/booklet/booklet-gender-core.d.ts +3 -0
- package/dist/booklet/booklet-gender-data.d.ts +9 -0
- package/dist/booklet/booklet-gender.d.ts +8 -9
- package/dist/booklet/booklet-locale-helpers.d.ts +4 -0
- package/dist/booklet/booklet-locale-loader.d.ts +27 -0
- package/dist/booklet/booklet-locale-modules-source.d.ts +1 -0
- package/dist/booklet/booklet-locale-modules.d.ts +5 -0
- package/dist/booklet/booklet-locale.d.ts +15 -0
- package/dist/booklet/booklet-logo-loader.d.ts +8 -0
- package/dist/booklet/booklet-logo.d.ts +1 -5
- package/dist/booklet/booklet-messages-data.d.ts +15 -0
- package/dist/booklet/booklet-messages-types.d.ts +46 -0
- package/dist/booklet/booklet-messages.d.ts +7 -0
- package/dist/booklet/booklet-narrative-en.d.ts +10 -0
- package/dist/booklet/booklet-narrative-engine.d.ts +17 -0
- package/dist/booklet/booklet-narrative-fr.d.ts +10 -0
- package/dist/booklet/booklet-narrative-i18n.d.ts +44 -0
- package/dist/booklet/booklet-narrative-locales.d.ts +3 -0
- package/dist/booklet/booklet-narrative.d.ts +5 -8
- package/dist/booklet/booklet-pdf-bidi.d.ts +5 -0
- package/dist/booklet/booklet-pdf-content-text.d.ts +11 -0
- package/dist/booklet/booklet-pdf-font-runtime.d.ts +8 -0
- package/dist/booklet/booklet-pdf-font-runtime.node.d.ts +3 -0
- package/dist/booklet/booklet-pdf-font-sources.d.ts +6 -0
- package/dist/booklet/booklet-pdf-font.d.ts +14 -0
- package/dist/booklet/booklet-pdf-fontkit.d.ts +6 -0
- package/dist/booklet/booklet-pdf-text.d.ts +24 -0
- package/dist/booklet/booklet-pdf.d.ts +13 -0
- package/dist/booklet/booklet-person.d.ts +6 -3
- package/dist/booklet/booklet-place-en.d.ts +16 -0
- package/dist/booklet/booklet-place-factory.d.ts +28 -0
- package/dist/booklet/booklet-place.d.ts +13 -0
- package/dist/booklet/booklet-structure.d.ts +3 -2
- package/dist/booklet/booklet-timeline-canvas.d.ts +2 -9
- package/dist/booklet/booklet-timeline-loader.d.ts +6 -0
- package/dist/booklet/booklet-timeline-metrics.d.ts +8 -0
- package/dist/booklet/feature-chunks/booklet-logo-draw.d.ts +15 -0
- package/dist/booklet/feature-chunks/booklet-timeline-raster.d.ts +3 -0
- package/dist/booklet/font-chunks/booklet-font-subset-chars.d.ts +2 -0
- package/dist/booklet/font-chunks/booklet-pdf-font-bytes-ar.d.ts +2 -0
- package/dist/booklet/font-chunks/booklet-pdf-font-bytes-he.d.ts +2 -0
- package/dist/booklet/font-chunks/booklet-pdf-font-bytes-zh-ext.d.ts +2 -0
- package/dist/booklet/font-chunks/booklet-pdf-font-bytes-zh.d.ts +2 -0
- package/dist/booklet/index.d.ts +11 -3
- package/dist/booklet/locale-chunks/booklet-locale-ar.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-de.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-en.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-es.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-fr.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-he.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-it.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-nl.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-pl.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-pt.d.ts +3 -0
- package/dist/booklet/locale-chunks/booklet-locale-zh.d.ts +3 -0
- package/dist/booklet.cjs +1 -1
- package/dist/booklet.mjs +1 -1
- package/dist/feature-chunks/booklet-logo-draw.cjs +1 -0
- package/dist/feature-chunks/booklet-logo-draw.mjs +1 -0
- package/dist/feature-chunks/booklet-timeline-raster.cjs +1 -0
- package/dist/feature-chunks/booklet-timeline-raster.mjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-ar.cjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-ar.mjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-he.cjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-he.mjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-zh-ext.cjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-zh-ext.mjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-zh.cjs +1 -0
- package/dist/font-chunks/booklet-pdf-font-bytes-zh.mjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/locale-chunks/booklet-locale-ar.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-ar.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-de.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-de.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-en.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-en.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-es.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-es.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-fr.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-fr.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-he.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-he.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-it.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-it.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-nl.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-nl.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-pl.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-pl.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-pt.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-pt.mjs +1 -0
- package/dist/locale-chunks/booklet-locale-zh.cjs +1 -0
- package/dist/locale-chunks/booklet-locale-zh.mjs +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +104 -3
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import type { BookletLocale } from './booklet-locale';
|
|
1
2
|
import type { BookletPersonEntry } from './booklet-person';
|
|
2
3
|
import type { BookletChapter, BookletDetailLevel, BookletFamilyUnit } from './booklet-structure';
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
5
|
-
|
|
6
|
-
export declare function
|
|
7
|
-
/** Portrait condensé : un paragraphe fluide, nom cité une fois. */
|
|
8
|
-
export declare function buildPersonSummaryNarrative(entry: BookletPersonEntry): string;
|
|
9
|
-
/** Portrait détaillé : peu de paragraphes, sans redondance naissance/décès. */
|
|
10
|
-
export declare function buildPersonDetailedNarratives(entry: BookletPersonEntry): readonly string[];
|
|
4
|
+
export declare function buildChapterIntroNarrative(chapter: BookletChapter, locale?: BookletLocale): string;
|
|
5
|
+
export declare function buildFamilyNarrative(family: BookletFamilyUnit, detailLevel: BookletDetailLevel, locale?: BookletLocale): readonly string[];
|
|
6
|
+
export declare function buildPersonSummaryNarrative(entry: BookletPersonEntry, locale?: BookletLocale): string;
|
|
7
|
+
export declare function buildPersonDetailedNarratives(entry: BookletPersonEntry, locale?: BookletLocale): readonly string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BookletLocale } from './booklet-locale';
|
|
2
|
+
/** Reorders mixed RTL/LTR text for pdf-lib (LTR drawText positions). */
|
|
3
|
+
export declare function toPdfVisualLine(text: string, locale?: BookletLocale): string;
|
|
4
|
+
/** Applies Arabic joining forms (Presentation Forms-B) before PDF drawText. */
|
|
5
|
+
export declare function shapeScriptForPdf(text: string, locale?: BookletLocale): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BookletLocale } from './booklet-locale';
|
|
2
|
+
import type { BookletPersonEntry } from './booklet-person';
|
|
3
|
+
import type { BookletChapter, BookletDetailLevel } from './booklet-structure';
|
|
4
|
+
export interface BookletPdfContentMeta {
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly scopeLabel: string;
|
|
7
|
+
readonly referenceName?: string;
|
|
8
|
+
readonly personCount: number;
|
|
9
|
+
}
|
|
10
|
+
/** All strings embedded in a booklet PDF (for runtime font subsetting). */
|
|
11
|
+
export declare function collectBookletPdfContentText(entries: readonly BookletPersonEntry[], meta: BookletPdfContentMeta, chapters: readonly BookletChapter[], detailLevel: BookletDetailLevel, locale?: BookletLocale): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BookletLocale } from './booklet-locale';
|
|
2
|
+
/** CJK / fullwidth codepoints routed to the Unicode PDF font. */
|
|
3
|
+
export declare function isUnicodePdfScriptChar(ch: string): boolean;
|
|
4
|
+
export declare function missingUnicodeFontChars(contentText: string, locale: BookletLocale, extraCovered?: string): string;
|
|
5
|
+
export declare function fetchFullBookletFont(locale: BookletLocale): Promise<Uint8Array>;
|
|
6
|
+
/** Larger zh subset (UI + common Han); lazy-loaded when the static chunk misses GEDCOM glyphs. */
|
|
7
|
+
export declare function loadZhExtendedPdfFontBytes(): Promise<Uint8Array>;
|
|
8
|
+
export declare function clearBookletFullFontCache(): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Full Noto sources for runtime PDF font subsetting (same URLs as scripts/prepare-booklet-fonts.mjs). */
|
|
2
|
+
export declare const BOOKLET_FULL_FONT_URLS: {
|
|
3
|
+
readonly zh: "https://cdn.jsdelivr.net/gh/notofonts/noto-cjk@main/Sans/SubsetOTF/SC/NotoSansSC-Regular.otf";
|
|
4
|
+
readonly ar: "https://cdn.jsdelivr.net/gh/notofonts/noto-fonts@main/hinted/ttf/NotoSansArabic/NotoSansArabic-Regular.ttf";
|
|
5
|
+
readonly he: "https://cdn.jsdelivr.net/gh/notofonts/noto-fonts@main/hinted/ttf/NotoSansHebrew/NotoSansHebrew-Regular.ttf";
|
|
6
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BookletLocale } from './booklet-locale';
|
|
2
|
+
/** Locales whose PDF body text needs a Unicode-capable font (StandardFonts are Latin-1 only). */
|
|
3
|
+
export declare function localeNeedsUnicodePdfFont(locale?: BookletLocale): boolean;
|
|
4
|
+
/** Registers preloaded font bytes (host app explicit chunk import). */
|
|
5
|
+
export declare function registerBookletPdfFontBytes(locale: BookletLocale, bytes: Uint8Array): void;
|
|
6
|
+
/** Clears cached font bytes (tests / forced reload). */
|
|
7
|
+
export declare function clearBookletPdfFontCache(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Lazy-loads subset Noto font bytes for zh / ar / he (separate chunks, not in the main bundle).
|
|
10
|
+
* Pass `override` to replace the built-in font.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadBookletPdfFontBytes(locale?: BookletLocale, override?: Uint8Array, contentText?: string): Promise<Uint8Array | undefined>;
|
|
13
|
+
/** Returns cached bundled font bytes when already loaded. */
|
|
14
|
+
export declare function bundledBookletPdfFontBytes(locale?: BookletLocale): Uint8Array | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Injects fontkit from the host app (required when @pdf-lib/fontkit is an external). */
|
|
2
|
+
export declare function registerPdfFontkit(fontkit: unknown): void;
|
|
3
|
+
/** Loads @pdf-lib/fontkit only when embedding TTF/OTF (zh / ar / he). */
|
|
4
|
+
export declare function loadPdfFontkit(): Promise<unknown>;
|
|
5
|
+
/** Clears cached fontkit module (tests). */
|
|
6
|
+
export declare function clearPdfFontkitCache(): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PDFFont, PDFPage } from 'pdf-lib';
|
|
2
|
+
import { rgb } from 'pdf-lib';
|
|
3
|
+
import type { BookletLocale } from './booklet-locale';
|
|
4
|
+
import { type PdfTextOptions } from './booklet-pdf';
|
|
5
|
+
export interface PdfFontPair {
|
|
6
|
+
readonly latin: PDFFont;
|
|
7
|
+
readonly latinBold: PDFFont;
|
|
8
|
+
readonly script?: PDFFont;
|
|
9
|
+
}
|
|
10
|
+
export interface TextRun {
|
|
11
|
+
readonly text: string;
|
|
12
|
+
readonly script: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Split text into Latin (Helvetica / WinAnsi) vs script (Noto) runs. */
|
|
15
|
+
export declare function splitPdfTextRuns(text: string): TextRun[];
|
|
16
|
+
export declare function usesScriptFont(text: string): boolean;
|
|
17
|
+
export interface PdfDrawPart {
|
|
18
|
+
readonly text: string;
|
|
19
|
+
readonly script: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Bidi reorder (RTL locales), split fonts, shape Arabic — ready for pdf-lib drawText. */
|
|
22
|
+
export declare function preparePdfDrawParts(text: string, locale: BookletLocale | undefined, textOptions?: PdfTextOptions): PdfDrawPart[];
|
|
23
|
+
export declare function measureMixedTextWidth(text: string, fonts: PdfFontPair, size: number, bold?: boolean, textOptions?: PdfTextOptions, locale?: BookletLocale): number;
|
|
24
|
+
export declare function drawMixedTextLine(page: PDFPage, text: string, xStart: number, y: number, fonts: PdfFontPair, size: number, color: ReturnType<typeof rgb>, alignRtl: boolean, bold?: boolean, textOptions?: PdfTextOptions, locale?: BookletLocale): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type DrawGedcomTsLogoOptions } from './booklet-logo';
|
|
2
2
|
import type { BookletPersonEntry } from './booklet-person';
|
|
3
3
|
import { type BookletTimelineStyle } from './booklet-timeline';
|
|
4
|
+
import type { BookletLocale } from './booklet-locale';
|
|
4
5
|
import { type BookletDetailLevel } from './booklet-structure';
|
|
5
6
|
export interface BookletPdfMeta {
|
|
6
7
|
readonly title: string;
|
|
@@ -11,12 +12,24 @@ export interface BookletPdfMeta {
|
|
|
11
12
|
export interface BookletPdfOptions {
|
|
12
13
|
readonly detailLevel: BookletDetailLevel;
|
|
13
14
|
readonly timelineStyle: BookletTimelineStyle;
|
|
15
|
+
/** Booklet narrative language (default English). */
|
|
16
|
+
readonly locale?: BookletLocale;
|
|
14
17
|
/**
|
|
15
18
|
* Logo gedcom-ts sur la page de couverture (vecteur, inclus dans le paquet).
|
|
16
19
|
* Défaut : affiché. `false` pour masquer ; sinon options passées à `drawGedcomTsLogoOnPage`.
|
|
17
20
|
*/
|
|
18
21
|
readonly coverLogo?: boolean | DrawGedcomTsLogoOptions;
|
|
22
|
+
/**
|
|
23
|
+
* Optional TTF/OTF font bytes for Unicode scripts (Arabic, Hebrew, Chinese, etc.).
|
|
24
|
+
* When omitted, Noto fonts are fetched automatically for `zh`, `ar`, and `he`.
|
|
25
|
+
*/
|
|
26
|
+
readonly unicodeFont?: Uint8Array;
|
|
27
|
+
}
|
|
28
|
+
export interface PdfTextOptions {
|
|
29
|
+
/** Keep non-Latin characters (requires a Unicode-capable PDF font). */
|
|
30
|
+
readonly preserveUnicode?: boolean;
|
|
19
31
|
}
|
|
32
|
+
export declare function preparePdfText(text: string, options?: PdfTextOptions): string;
|
|
20
33
|
export declare function toPdfText(text: string): string;
|
|
21
34
|
export declare function generateGenealogyBookletPdf(entries: readonly BookletPersonEntry[], meta: BookletPdfMeta, options: BookletPdfOptions): Promise<Uint8Array>;
|
|
22
35
|
export declare function downloadBookletPdf(bytes: Uint8Array, filename: string): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Person } from "../commons/Person";
|
|
2
2
|
import type { ReadGed } from "../import/ReadGed";
|
|
3
3
|
import type { BookletSex } from './booklet-gender';
|
|
4
|
+
import type { BookletLocale } from './booklet-locale';
|
|
4
5
|
export type { BookletSex } from './booklet-gender';
|
|
5
6
|
export interface BookletRelationRef {
|
|
6
7
|
readonly indi: number;
|
|
@@ -33,10 +34,10 @@ export interface BookletPersonEntry {
|
|
|
33
34
|
readonly unions: readonly BookletUnionEntry[];
|
|
34
35
|
}
|
|
35
36
|
export declare function personDisplayName(person: Person): string;
|
|
36
|
-
export declare function personDatesLabel(person: Person): string;
|
|
37
|
+
export declare function personDatesLabel(person: Person, locale?: BookletLocale): string;
|
|
37
38
|
export declare function bookletSexFromPerson(person: Person): BookletSex;
|
|
38
|
-
export declare function buildBookletPersonEntry(person: Person, ged: ReadGed, sosa: number | null): BookletPersonEntry;
|
|
39
|
-
export declare function sortBookletEntries(entries: BookletPersonEntry[]): BookletPersonEntry[];
|
|
39
|
+
export declare function buildBookletPersonEntry(person: Person, ged: ReadGed, sosa: number | null, locale?: BookletLocale): BookletPersonEntry;
|
|
40
|
+
export declare function sortBookletEntries(entries: BookletPersonEntry[], locale?: BookletLocale): BookletPersonEntry[];
|
|
40
41
|
export type BookletScope = 'all' | 'from-reference';
|
|
41
42
|
export interface BookletCollectOptions {
|
|
42
43
|
readonly scope: BookletScope;
|
|
@@ -44,5 +45,7 @@ export interface BookletCollectOptions {
|
|
|
44
45
|
readonly referencePerson: Person | null;
|
|
45
46
|
/** Limite de génération SOSA (1 = racine seulement). Ignoré si « tout l’arbre ». */
|
|
46
47
|
readonly maxGeneration?: number | null;
|
|
48
|
+
/** Booklet narrative language (default English). */
|
|
49
|
+
readonly locale?: BookletLocale;
|
|
47
50
|
}
|
|
48
51
|
export declare function collectBookletPersons(options: BookletCollectOptions): BookletPersonEntry[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ParsedPlace {
|
|
2
|
+
readonly city: string | null;
|
|
3
|
+
readonly country: string | null;
|
|
4
|
+
readonly raw: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function parsePlaceLabel(label: string): ParsedPlace | null;
|
|
7
|
+
export declare function placeCore(label: string): string;
|
|
8
|
+
export declare function afterDateLocation(dateLabel: string, placeLabel: string): string;
|
|
9
|
+
export declare function atLocation(placeLabel: string): string;
|
|
10
|
+
export declare function birthDeathLocationPhrases(birthDate: string, birthPlace: string, deathDate: string, deathPlace: string): {
|
|
11
|
+
readonly birth: string;
|
|
12
|
+
readonly death: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function lifeRangeLocation(birthPlace: string, deathPlace: string): string;
|
|
15
|
+
export declare function marriageWhenWhere(dateLabel: string, placeLabel: string): string | null;
|
|
16
|
+
export declare function embedMarriageWhenWhere(label: string | null | undefined): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BookletDateModule } from './booklet-date-factory';
|
|
2
|
+
export interface ParsedPlace {
|
|
3
|
+
readonly city: string | null;
|
|
4
|
+
readonly country: string | null;
|
|
5
|
+
readonly raw: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BookletPlaceConfig {
|
|
8
|
+
readonly countryPrefixes: readonly string[];
|
|
9
|
+
readonly countryPhrase: (country: string) => string;
|
|
10
|
+
readonly locationPhrase: (core: string) => string;
|
|
11
|
+
readonly lifeRangeSame: (core: string) => string;
|
|
12
|
+
readonly lifeRangeFromTo: (from: string, to: string) => string;
|
|
13
|
+
readonly lifeRangeSingle: (core: string) => string;
|
|
14
|
+
}
|
|
15
|
+
export interface BookletPlaceModule {
|
|
16
|
+
parsePlaceLabel(label: string): ParsedPlace | null;
|
|
17
|
+
placeCore(label: string): string;
|
|
18
|
+
afterDateLocation(dateLabel: string, placeLabel: string): string;
|
|
19
|
+
atLocation(placeLabel: string): string;
|
|
20
|
+
birthDeathLocationPhrases(birthDate: string, birthPlace: string, deathDate: string, deathPlace: string): {
|
|
21
|
+
readonly birth: string;
|
|
22
|
+
readonly death: string;
|
|
23
|
+
};
|
|
24
|
+
lifeRangeLocation(birthPlace: string, deathPlace: string): string;
|
|
25
|
+
marriageWhenWhere(dateLabel: string, placeLabel: string): string | null;
|
|
26
|
+
embedMarriageWhenWhere(label: string | null | undefined): string;
|
|
27
|
+
}
|
|
28
|
+
export declare function createBookletPlaceModule(date: BookletDateModule, config: BookletPlaceConfig): BookletPlaceModule;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BookletLocale } from "./booklet-locale";
|
|
2
|
+
export type { ParsedPlace } from "./booklet-place-factory";
|
|
3
|
+
export declare function parsePlaceLabel(label: string, locale?: BookletLocale): import("./booklet-place-factory").ParsedPlace;
|
|
4
|
+
export declare function placeCore(label: string, locale?: BookletLocale): string;
|
|
5
|
+
export declare function afterDateLocation(dateLabel: string, placeLabel: string, locale?: BookletLocale): string;
|
|
6
|
+
export declare function atLocation(placeLabel: string, locale?: BookletLocale): string;
|
|
7
|
+
export declare function birthDeathLocationPhrases(birthDate: string, birthPlace: string, deathDate: string, deathPlace: string, locale?: BookletLocale): {
|
|
8
|
+
readonly birth: string;
|
|
9
|
+
readonly death: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function lifeRangeLocation(birthPlace: string, deathPlace: string, locale?: BookletLocale): string;
|
|
12
|
+
export declare function marriageWhenWhere(dateLabel: string, placeLabel: string, locale?: BookletLocale): string;
|
|
13
|
+
export declare function embedMarriageWhenWhere(label: string | null | undefined, locale?: BookletLocale): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BookletPersonEntry, BookletRelationRef } from './booklet-person';
|
|
2
|
+
import type { BookletLocale } from './booklet-locale';
|
|
2
3
|
export type BookletDetailLevel = 'summary' | 'detailed';
|
|
3
4
|
export type { BookletRelationRef };
|
|
4
5
|
export interface BookletFamilyUnit {
|
|
@@ -18,6 +19,6 @@ export interface BookletTocEntry {
|
|
|
18
19
|
readonly title: string;
|
|
19
20
|
readonly page: number;
|
|
20
21
|
}
|
|
21
|
-
export declare function groupBookletIntoChapters(entries: readonly BookletPersonEntry[]): BookletChapter[];
|
|
22
|
+
export declare function groupBookletIntoChapters(entries: readonly BookletPersonEntry[], locale?: BookletLocale): BookletChapter[];
|
|
22
23
|
export declare function partnerNamesLabel(partners: readonly BookletRelationRef[]): string;
|
|
23
|
-
export declare function childrenNamesLabel(children: readonly BookletRelationRef[], max?: number): string;
|
|
24
|
+
export declare function childrenNamesLabel(children: readonly BookletRelationRef[], max?: number, locale?: BookletLocale): string;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
/** Hauteur du PNG (px) pour N lignes de frise. */
|
|
4
|
-
export declare function timelineCanvasHeightPx(rowCount: number, continuationNote?: boolean): number;
|
|
5
|
-
/** Hauteur en points PDF après mise à l'échelle dans le livret. */
|
|
6
|
-
export declare function timelineScaledPdfHeight(rowCount: number, pdfMaxWidth: number, continuationNote?: boolean): number;
|
|
7
|
-
/** Nombre maximal de lignes dont la frise tient dans la hauteur PDF disponible. */
|
|
8
|
-
export declare function maxTimelineRowsForPdfHeight(availablePt: number, pdfMaxWidth: number, continuationNote?: boolean): number;
|
|
9
|
-
export declare function rasterizeGenerationTimelinePng(layout: GenerationTimelineLayout, pageNote?: string): Promise<Uint8Array>;
|
|
1
|
+
export { TIMELINE_CANVAS_WIDTH, maxTimelineRowsForPdfHeight, timelineCanvasHeightPx, timelineScaledPdfHeight, } from './booklet-timeline-metrics';
|
|
2
|
+
export { ensureBookletTimelineRaster, clearBookletTimelineRasterCache, rasterizeGenerationTimelinePng, } from './booklet-timeline-loader';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BookletLocale } from './booklet-locale';
|
|
2
|
+
import type { GenerationTimelineLayout } from './booklet-timeline';
|
|
3
|
+
export declare function clearBookletTimelineRasterCache(): void;
|
|
4
|
+
/** Loads canvas timeline rasterization (only when `timelineStyle === 'canvas'`). */
|
|
5
|
+
export declare function ensureBookletTimelineRaster(): Promise<void>;
|
|
6
|
+
export declare function rasterizeGenerationTimelinePng(layout: GenerationTimelineLayout, pageNote?: string, locale?: BookletLocale): Promise<Uint8Array>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Layout metrics for canvas timelines (no canvas / PNG code). */
|
|
2
|
+
export declare const TIMELINE_CANVAS_WIDTH = 920;
|
|
3
|
+
/** Hauteur du PNG (px) pour N lignes de frise. */
|
|
4
|
+
export declare function timelineCanvasHeightPx(rowCount: number, continuationNote?: boolean): number;
|
|
5
|
+
/** Hauteur en points PDF après mise à l'échelle dans le livret. */
|
|
6
|
+
export declare function timelineScaledPdfHeight(rowCount: number, pdfMaxWidth: number, continuationNote?: boolean): number;
|
|
7
|
+
/** Nombre maximal de lignes dont la frise tient dans la hauteur PDF disponible. */
|
|
8
|
+
export declare function maxTimelineRowsForPdfHeight(availablePt: number, pdfMaxWidth: number, continuationNote?: boolean): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PDFPage, RGB } from 'pdf-lib';
|
|
2
|
+
import { GEDCOM_TS_LOGO_PATHS, GEDCOM_TS_LOGO_VIEWBOX } from '../gedcom-ts-logo.paths';
|
|
3
|
+
export { GEDCOM_TS_LOGO_PATHS, GEDCOM_TS_LOGO_VIEWBOX };
|
|
4
|
+
export interface GedcomTsLogoLayout {
|
|
5
|
+
readonly bottomY: number;
|
|
6
|
+
readonly height: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DrawGedcomTsLogoOptions {
|
|
9
|
+
readonly pageWidth?: number;
|
|
10
|
+
readonly maxWidth?: number;
|
|
11
|
+
readonly bottomY?: number;
|
|
12
|
+
readonly color?: RGB;
|
|
13
|
+
}
|
|
14
|
+
/** Dessine le logo gedcom-ts en vecteur SVG sur la page (pdf-lib drawSvgPath). */
|
|
15
|
+
export declare function drawGedcomTsLogoOnPage(page: PDFPage, options?: DrawGedcomTsLogoOptions): GedcomTsLogoLayout;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BookletLocale } from '../booklet-locale';
|
|
2
|
+
import { type GenerationTimelineLayout } from '../booklet-timeline';
|
|
3
|
+
export declare function rasterizeGenerationTimelinePng(layout: GenerationTimelineLayout, pageNote?: string, locale?: BookletLocale): Promise<Uint8Array>;
|
package/dist/booklet/index.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
export { buildBookletPersonEntry, bookletSexFromPerson, collectBookletPersons, personDisplayName, sortBookletEntries, type BookletCollectOptions, type BookletPersonEntry, type BookletRelationRef, type BookletScope, type BookletSex, type BookletUnionEntry, } from './booklet-person';
|
|
2
|
+
export { DEFAULT_BOOKLET_LOCALE, BOOKLET_LOCALES, BOOKLET_LOCALES_IMPLEMENTED, BOOKLET_RTL_LOCALES, resolveBookletLocale, isBookletLocale, isBookletLocaleRtl, bookletTextDirection, bookletLocaleCompareTag, bookletLocaleToBcp47, type BookletLocale, } from './booklet-locale';
|
|
2
3
|
export { personGenderWords, pluralS, pluralPick } from './booklet-gender';
|
|
4
|
+
export { unknownDateLabel, onDate, lifeDateRange, seesDayOn, isYearOnlyDate } from './booklet-date';
|
|
3
5
|
export { buildChapterIntroNarrative, buildFamilyNarrative, buildPersonDetailedNarratives, buildPersonSummaryNarrative, } from './booklet-narrative';
|
|
4
6
|
export { buildGenerationTimeline, chapterSupportsTimeline, timelineRowCount, type BookletTimelineStyle, type GenerationTimelineLayout, } from './booklet-timeline';
|
|
5
7
|
export { bookletSizeAdvice, estimateBookletSize, estimateTimelineSliceCount } from './booklet-estimate';
|
|
6
|
-
export { rasterizeGenerationTimelinePng } from './booklet-timeline-canvas';
|
|
7
|
-
export { BOOKLET_BRAND_RGB, defaultCoverLogoOptions,
|
|
8
|
+
export { ensureBookletTimelineRaster, clearBookletTimelineRasterCache, rasterizeGenerationTimelinePng, TIMELINE_CANVAS_WIDTH, maxTimelineRowsForPdfHeight, timelineCanvasHeightPx, timelineScaledPdfHeight, } from './booklet-timeline-canvas';
|
|
9
|
+
export { BOOKLET_BRAND_RGB, defaultCoverLogoOptions, type DrawGedcomTsLogoOptions, type GedcomTsLogoLayout, } from './booklet-logo';
|
|
10
|
+
export { ensureBookletLogo, clearBookletLogoCache, drawGedcomTsLogoOnPage, getGedcomTsLogoPaths, getGedcomTsLogoViewbox, } from './booklet-logo-loader';
|
|
8
11
|
export { groupBookletIntoChapters, partnerNamesLabel, type BookletChapter, type BookletDetailLevel, type BookletFamilyUnit, type BookletTocEntry, } from './booklet-structure';
|
|
9
|
-
export {
|
|
12
|
+
export { bundledBookletPdfFontBytes, clearBookletPdfFontCache, loadBookletPdfFontBytes, localeNeedsUnicodePdfFont, registerBookletPdfFontBytes, } from './booklet-pdf-font';
|
|
13
|
+
export { ensureBookletLocale, clearBookletLocaleCache, isBookletLocaleLoaded, type BookletLocaleBundle, } from './booklet-locale-loader';
|
|
14
|
+
export { getBookletMessages, loadBookletMessages, actTypeLabel, } from './booklet-messages';
|
|
15
|
+
export { drawMixedTextLine, measureMixedTextWidth, splitPdfTextRuns, type PdfFontPair, } from './booklet-pdf-text';
|
|
16
|
+
export { downloadBookletPdf, generateGenealogyBookletPdf, preparePdfText, toPdfText, type BookletPdfMeta, type BookletPdfOptions, type PdfTextOptions, } from './booklet-pdf';
|
|
17
|
+
export { registerPdfFontkit } from './booklet-pdf-fontkit';
|