import { type RefObject } from "react"; export interface DaySection { /** Section heading text, taken from the matching `DaySectionLabels` entry. */ label: string; /** Rows in this bucket, in input order. */ rows: T[]; } export interface ConsecutiveGroup { /** The shared key for the run, or null for a row that was not merged. */ key: string | null; /** Adjacent rows in the run, in input order. */ rows: T[]; } export interface DaySectionLabels { /** Heading for rows dated on the current calendar day. */ today: string; /** Heading for rows dated on the previous calendar day. */ yesterday: string; /** Heading for every older row. */ earlier: string; } export declare const DEFAULT_DAY_LABELS: DaySectionLabels; /** * Buckets rows into Today/Yesterday/Earlier, input order preserved within each bucket. * `now` defaults to the wall clock; pass it to pin "today" in tests or a fixed-date view. */ export declare function sectionizeByDay(rows: T[], getTime: (row: T) => number | string | Date, labels?: DaySectionLabels, now?: number | Date): DaySection[]; /** Merges only adjacent rows sharing a key; a null/undefined key never merges with anything. */ export declare function groupConsecutive(rows: T[], getKey: (row: T) => string | null | undefined): ConsecutiveGroup[]; /** 5 -> "5"; 150 with max 99 -> "99+". Negative/NaN input is clamped to 0. */ export declare function formatCount(value: number, max?: number): string; export interface RelativeTimeLabels { /** Text shown for ages under one minute. */ justNow: string; /** Receives whole minutes (1 to 59) and returns the label. */ minutesAgo: (count: number) => string; /** Receives whole hours (1 to 23) and returns the label. */ hoursAgo: (count: number) => string; /** Receives whole days (1 to 6) and returns the label; older times use a short date. */ daysAgo: (count: number) => string; } export declare const DEFAULT_RELATIVE_TIME_LABELS: RelativeTimeLabels; /** Overrides for the English wording and the date locale of `formatRelativeTime`. */ export interface RelativeTimeOptions { /** Replaces the English "Just now" / "5m ago" / "3h ago" / "2d ago" wording. */ labels?: RelativeTimeLabels; /** BCP 47 tag for the short date shown past a week; defaults to "en-US". */ locale?: string; } /** "Just now" / "5m ago" / "3h ago" / "2d ago"; falls back to a short date past a week. */ export declare function formatRelativeTime(value: number | string | Date, now?: number | Date, { labels, locale }?: RelativeTimeOptions): string; /** Minimum panel height and bottom gutter for `useAnchoredPanelHeight`. */ export interface AnchoredPanelHeightOptions { /** Smallest height in px the panel may measure to. Defaults to 280. */ min?: number; /** Space in px kept between the panel's bottom edge and the viewport bottom. Defaults to 24. */ gutter?: number; } /** The tickets/hrms formula: max(min, viewport bottom edge - panel top - gutter), remeasured on resize. */ export declare function useAnchoredPanelHeight(ref: RefObject, options?: AnchoredPanelHeightOptions): number;