/** * Humanized time. Three questions, three functions: how long is this * duration (`span`, or `coarseSpan` for one unit only), how long ago was * this instant (`ago` — and its raw-duration twin `since`), how long * until this instant (`until`). * * `ago` degrades by distance instead of stacking units: fresh instants are * relative ("now", "3m ago", "2h 15m ago"), older ones snap to the clock the * reader would check — "10:30" earlier today, "yst 22:15" yesterday, * "Mon 09:00" within a week, "07/28" beyond. Relative wording past a few * hours ("19h ago") makes the reader do calendar math; a clock time doesn't. * * Accepts `Date | ISO string | epoch ms | null | undefined` and renders "—" * for null/undefined, same contract as ./format. Epoch numbers are * MILLISECONDS only — a seconds heuristic would silently misread dates near * the boundary, and a wrong timestamp should scream, not shift by 1000×. * Weekday/date fallbacks are en-pinned like every formatter here. */ export type Dateish = Date | string | number | null | undefined; /** Duration in ms → "45s", "47m", "1h 40m", "2d 3h". Negative clamps to "0s". */ export declare function span(ms: number): string; /** * Duration in ms → its coarsest single unit: "45s", "47min", "3h", "2d". * For a line that has room for one number and no column to align it in * (a notification, a list row); reach for `span` when the remainder * matters. Minutes are spelled in full here because the value stands * alone with no neighbouring unit to read "m" against. */ export declare function coarseSpan(ms: number): string; /** Elapsed since an instant, as a bare duration: "47m", "1h 40m" (no "ago"). */ export declare function since(d: Dateish, now?: Dateish): string; /** * Past instant, humanized: "now" (<1m), "3m ago", "2h 15m ago" (<6h), then * clock time — "10:30" today, "yst 22:15" yesterday, "Mon 09:00" within 7 * days, "07/28" beyond. Future inputs render "now". */ export declare function ago(d: Dateish, now?: Dateish): string; /** Future instant, humanized: "now", "in 40m", "in 5h 12m", "in 3d 13h". */ export declare function until(d: Dateish, now?: Dateish): string; //# sourceMappingURL=time.d.ts.map