import type { Figures } from './figure'; /** * How long ago something happened, kept current while it is on screen. * * A list of events is the one place a venue's condition is legible without a * chart: somebody can see in the timestamps whether anything happened today, * which is a question a flat line answers ambiguously and a column of stale * relative times answers wrongly. So the figure is re-read on a timer — a row * that says "2m" for an hour is worse than one that says nothing, because it * reads as fresh. * * Which unit applies is arithmetic and is here. How the unit is written is a * fact about a language and belongs to `figure.ts`, which asks CLDR for it: * English writes `10s` and `1d`, French `10min` and `1j`, Russian `10 мин` with * the space it puts there. So there is no `s`, `m`, `h` or `d` in this file for * anyone to translate. */ /** The units a span is stated in, as `Figures.span` names them. */ export type Unit = 'second' | 'minute' | 'hour' | 'day'; /** * How long between two moments, as a count and the unit it is counted in. * * Both moments are milliseconds since the epoch or a `Date`, which is what * everything else in this package that takes a moment takes. A chain states its * timestamps in seconds; multiplying by a thousand at the call site is one * visible step, where a function taking one of each is a silent thousand-fold * error the first time the arguments are read in the wrong order. * * Never negative: a clock a little ahead of the reader's is not a thing that * happens in the future, it is a thing that happened just now. */ export declare function ago(at: Date | number, now: Date | number): readonly [number, Unit]; /** * One clock, however many moments are on the page. * * A moment is a cell, and a list of activity is fifty of them. A timer inside * each is fifty timers on fifty phases: the column re-reads at fifty different * instants, so a reader watching it sees the figures step raggedly one at a * time rather than the column moving at once. Everything drawing a moment is * drawing the same moment, so there is one reading of it. * * The timer starts with the first watcher and stops with the last, so a page * with no moment on it has nothing running. */ export declare const watch: (tell: (at: number) => void) => (() => void); /** * A moment, as the time since it, in a real `time` element. * * The element and not a text primitive, for the same reason `Code` is: `time` * is already semantic, `dateTime` carries the machine-readable moment for * anything parsing the page, and the primitive would lay the row's shortest * cell out as a flex box. * * The exact moment is on it as well, in the reader's own calendar rather than * in UTC — an abbreviation is for scanning and the tooltip is where somebody * goes when scanning was not enough. */ export declare function Ago({ at, figures }: { at: Date | number; figures: Figures; }): import("react").JSX.Element; //# sourceMappingURL=ago.d.ts.map