UNPKG

gedcom-ts

Version:

TypeScript GEDCOM toolkit for browser apps: import .ged/.zip, edit typed genealogy data, and export GEDCOM or GEDZIP.

32 lines (31 loc) 1.4 kB
import type { BookletChapter } from './booklet-structure'; export type BookletTimelineStyle = 'off' | 'canvas'; export type TimelineMarkerKind = 'birth' | 'death' | 'marriage'; export interface TimelineMarker { readonly year: number; readonly kind: TimelineMarkerKind; } export interface TimelineRow { readonly name: string; readonly shortName: string; readonly birthYear: number | null; readonly deathYear: number | null; readonly markers: readonly TimelineMarker[]; readonly hasLifeSpan: boolean; } export interface GenerationTimelineLayout { readonly chapterTitle: string; readonly yearMin: number; readonly yearMax: number; readonly tickStep: number; readonly tickYears: readonly number[]; readonly rows: readonly TimelineRow[]; readonly overflowCount: number; readonly pageCount: number; } export declare function chapterSupportsTimeline(chapter: BookletChapter): boolean; export declare function parseYearFromDate(date: string): number | null; export declare function timelineRowCount(chapter: BookletChapter): number; export declare function buildGenerationTimeline(chapter: BookletChapter, rowStart?: number, rowCount?: number): GenerationTimelineLayout | null; /** Position X normalisée 0–1 dans la plage [yearMin, yearMax]. */ export declare function timelineXNorm(year: number, yearMin: number, yearMax: number): number;