export type RelativeTimeFormat = "relative" | "absolute" | "date"; export type DateInput = Date | string | number; export interface TimeFormatOptions { /** The clock to compare against. Defaults to the current time. */ now?: DateInput | undefined; /** IANA time zone. Defaults to the viewer's. Ignored when `utc` is set. */ timeZone?: string | undefined; /** Show and compute times in UTC, and say so. */ utc?: boolean | undefined; } export declare function toDate(input: DateInput): Date; /** A readable name for a time zone: "Oslo time", "UTC". */ export declare function timeZoneLabel(timeZone: string | undefined): string; /** * "Just now", "48 min ago", "2 hours ago", "Yesterday", "3 days ago", * "2 weeks ago", "1 month ago", "2 years ago"; future times read "In 5 min", * "In 3 hours", "Tomorrow", "In 5 days". Sentence case for standalone labels; * use `inSentence` to lowercase the leading word. */ export declare function formatRelativeTime(input: DateInput, options?: TimeFormatOptions): string; /** * The one absolute format: "Mon 28 Sep, 08:00". Same-day and adjacent days * read "Today, 14:00", "Tomorrow, 09:00", "Yesterday, 17:30"; other years add * the year: "Tue 30 Mar 2027, 09:00". UTC times end in " UTC". */ export declare function formatAbsoluteTime(input: DateInput, options?: TimeFormatOptions): string; /** * Lowercases the leading word of a label for use inside a sentence: * "Yesterday" becomes "yesterday", "Today, 14:00" becomes "today, 14:00". * Weekdays, months and numbers keep their case. */ export declare function inSentence(label: string): string; /** A date without the time: "14 Aug", or "31 Mar 2027" in another year. */ export declare function formatDate(input: DateInput, options?: TimeFormatOptions): string; /** * The shortest unambiguous label for an upcoming time, for a dense row: the * clock alone later today ("14:20"), the weekday within the coming week * ("Thu 09:00"), otherwise the date ("16 Oct", "3 Jan 2027"). Use * `formatAbsoluteTime` wherever there is room for the full label. */ export declare function formatShortTime(input: DateInput, options?: TimeFormatOptions): string; /** The exact time for tooltips, always with the year and zone: "Wed 23 Sep 2026, 11:12 Oslo time". */ export declare function formatExactTime(input: DateInput, options?: TimeFormatOptions): string; /** Shared clock for quota expiry and the accompanying time labels. */ export declare function useMinuteNow(): number; /** * Defaults for times rendered inside a container. List rows turn `focusable` * off: the row is the tab stop, and the time still shows its tooltip on hover. */ export declare const RelativeTimeDefaultsContext: import("react").Context<{ focusable: boolean; }>; export interface RelativeTimeProps extends TimeFormatOptions { /** The moment to show. */ date: DateInput; /** "relative" (default), "absolute" or "date". The tooltip always shows the exact time. */ format?: RelativeTimeFormat | undefined; /** * Text before the time, for example "Updated". Part of the label, not the * tooltip. Implies `inSentence`. */ prefix?: string | undefined; /** Lowercase the leading word, for times inside running text. */ inSentence?: boolean | undefined; /** Show the exact time in a tooltip. Default true. */ tooltip?: boolean | undefined; /** * A tab stop so keyboard users can open the tooltip. Defaults to true, or to * the container's default (false inside list rows). */ focusable?: boolean | undefined; className?: string | undefined; } export declare function RelativeTime({ date, format, prefix, inSentence: inSentenceProp, tooltip, focusable: focusableProp, now, timeZone, utc, className, }: RelativeTimeProps): import("react").JSX.Element | null;