/** Per-bucket English defaults, overridable the same "no i18n, but * overridable via an options object" way ``/ * ``'s `label-plural` already establish. */ export interface RecencyLabels{today?:string;yesterday?:string;previousWeek?:string;older?:string;}export interface GroupByRecencyOptions{ /** Extracts the timestamp to bucket `item` by. Defaults to assuming `item` * itself *is* a `Date` — the simplest possible default for the common * case of grouping a plain array of dates. A returned `number` is treated * as a standard JS epoch-milliseconds value (`Date.prototype.getTime()`'s * own unit) — not a microsecond-epoch `time` type some backends use; a * caller bridging from such data converts in its own `getTimestamp` * callback. */ getTimestamp?:(item:T)=>Date|number|string; /** The "current" instant bucket boundaries are computed relative to. * Defaults to `new Date()`. Overridable for deterministic tests (and for * a caller that wants to bucket relative to something other than the * actual current instant, e.g. a fixed "as of" report time). */ now?:Date; /** Overrides for one or more of the four bucket labels. Any label left * unset keeps its English default. */ labels?:RecencyLabels;}export interface RecencyBucket{label:string;items:T[];} /** * Buckets `items` into Today / Yesterday / Previous 7 Days / Older, using * calendar-day boundaries in the local timezone — "yesterday" means the * previous calendar date, not "24-48 hours ago". Mirrors the bucketing a * chat sidebar's conversation-history list commonly groups by (this * library's own `` is the intended consumer, though * this function is deliberately DOM/component-free — plain data in, plain * data out). * * Only buckets that end up with at least one item are included in the * returned array, in Today/Yesterday/Previous-7-Days/Older order; each * bucket's items keep their original relative order from `items` (never * re-sorted). Two edge cases with no dedicated bucket of their own: a * timestamp dated in the future relative to `now` lands in `Today` — the * most-recent bucket available, since there's no "upcoming" bucket to put it * in instead. A timestamp that fails to parse lands in `Older` instead — it * carries no "this is recent" signal at all, so the oldest/catch-all bucket * is the more honest home for it than the newest one. */ export declare function groupByRecency(items:T[],options?:GroupByRecencyOptions):RecencyBucket[];