/** * Date generator and legacy date template adapters. * * This module intentionally does not depend on moment.js. It uses the * portable date runtime in src/date so the same parsing/formatting rules * can be implemented in Python and Java later. */ import { type DatePrecision, type PlainDateTime } from '../date/index.js'; import type { AttrMap } from '../processor/attrs.js'; import type { Generator } from './generator.js'; export interface DateGenAttrs { readonly value?: string | undefined; readonly from?: string | undefined; readonly to?: string | undefined; readonly range?: string | undefined; /** How far each row advances on a walked axis: `2`, `15m`, `1h30m`, `3mo`. */ readonly step?: string | undefined; /** Which weekdays a walked axis keeps: `mon..fri`, `sun,wed`. */ readonly weekdays?: string | undefined; readonly format?: string | undefined; readonly local?: string | undefined; readonly oldest?: string | number | undefined; readonly youngest?: string | number | undefined; readonly precision?: string | undefined; } /** * @param instantsOut when given, receives the epoch millis behind each rendered * cell — the value the generator actually produced, before `format=` turned it * into one locale's spelling of it. A column another one measures from asks for * this; everything else passes nothing and the array is never built. */ export declare function dateGenerator(attrs: DateGenAttrs, locale: string, now: number, instantsOut?: (number | undefined)[]): Generator; /** * A date range as a walkable axis: how many steps it holds, and what the k-th is. * * `size` is undefined for an OPEN axis — `from=` with no end. That is the case * the first design missed: requiring an end meant working out what date the * millionth day falls on in order to write it down, when the end is simply * `start + count × step`. An open axis never wraps, because there is nothing to * wrap at. * * The range is never expanded into a list. A century stepped by the second is * three billion values and the streaming engine promises bounded memory whatever * the config says — so each date is `start + k × step`, measured from the START * rather than accumulated, which is what keeps a clamped February from dragging * every later month back with it. */ export declare function dateAxis(attrs: DateGenAttrs, locale: string, now: number): { size: number | undefined; at: (k: number) => string; valueAt: (k: number) => PlainDateTime; }; export declare function parsePrecision(raw: string | undefined, fallback?: DatePrecision): DatePrecision; /** * `person.b_day` template source. Exported so the template resolver can * register it directly in its static registry — see * templates/resolver.ts. (Previously wired via a side-effect import; the * explicit export removes that fragility.) */ export declare function renderBDay(prng: () => number, attrs: AttrMap, locale: string, now: number): string; /** * `date.range` template source. Exported for the same reason as * {@link renderBDay} — direct registration in templates/resolver.ts. */ export declare function renderDateRange(prng: () => number, attrs: AttrMap, locale: string, now: number): string; //# sourceMappingURL=date.d.ts.map