export type PeriodSecondsAtAge = (tMa: number) => (number | null); /** * @typedef {(tMa: number) => (number | null)} PeriodSecondsAtAge */ /** * @param {{ * ageAnchorYear: number, * tropicalYearJ2000Seconds: number, * isDeepTime: () => boolean, * gridMinYear?: number, * gridMaxYear?: number, * gridStepYears?: number, * gridAnchorYear?: number, * maxCacheEntries?: number, * checkpoints?: { chains?: Record } | null, * }} deps — ageAnchorYear is the year whose age is 0 in the period * functions' t_Ma coordinate (startmodelYear = 2000.5, the certified * convention); tropicalYearJ2000Seconds is the length of ONE tick of the * year axis the integrator is fed — the linear SI-year label, each tick * exactly one J2000 tropical year of seconds — so it is the integrand's * weight in BOTH branches (measured: the deep branch had once weighted * each tick by the tropical year OF DATE, adding that year's deep-time * drift to every lunar count — ~5° of Moon at ±100 kyr, ~1.3 orbits at * 1 Ma — although the tick itself never changes length; the owner's call: * a plain correctness fix, the tick already is an SI tick); * isDeepTime is read PER CALL so the engine's runtime toggle works. */ export function createChainCycleIntegrator({ ageAnchorYear, tropicalYearJ2000Seconds, isDeepTime, gridMinYear, gridMaxYear, gridStepYears, gridAnchorYear, maxCacheEntries, checkpoints, }: { ageAnchorYear: number; tropicalYearJ2000Seconds: number; isDeepTime: () => boolean; gridMinYear?: number; gridMaxYear?: number; gridStepYears?: number; gridAnchorYear?: number; maxCacheEntries?: number; checkpoints?: { chains?: Record; } | null; }): { cyclesBetween: (periodFnSeconds: PeriodSecondsAtAge, yearA: number, yearB: number) => number | null; nameChain: (name: string, periodFnSeconds: PeriodSecondsAtAge) => void; recordSegmentPrefixes: (periodFnSeconds: PeriodSecondsAtAge, limitYears: number | { past: number; future: number; }) => { fwd: number[]; bwd: number[]; segmentYears: number; } | null; seatStatus: () => Record; coarseSegmentYears: number; coarseLimitYears: number; };