export type TimeAgoFormatter = (value: T, isPast: boolean) => string; export type TimeAgoUnitNamesDefault = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'; export type TimeAgeFullDateFormatter = (date: Date) => string; export type TimeAgoMessagesBuiltIn = { justNow: string; past: string | TimeAgoFormatter; future: string | TimeAgoFormatter; invalid: string; }; export type TimeAgoMessages = TimeAgoMessagesBuiltIn & Record>; export type FormatTimeAgoOptions = { /** * Maximum unit (of diff in milliseconds) to display the full date instead of relative * * @defaultValue undefined */ max?: UnitNames | number; /** * Formatter for full date */ fullDateFormatter?: TimeAgeFullDateFormatter; /** * Messages for formatting the string */ messages?: TimeAgoMessages; /** * Minimum display time unit (default is minute) * * @defaultValue false */ showSecond?: boolean; /** * Rounding method to apply. * * @defaultValue 'round' */ rounding?: 'round' | 'ceil' | 'floor' | number; /** * Custom units */ units?: TimeAgoUnit[]; }; export type TimeAgoUnit = { max: number; value: number; name: Unit; }; export declare const DEFAULT_MESSAGES: TimeAgoMessages; export declare function formatTimeAgo(from: Date, options?: FormatTimeAgoOptions, now?: Date | number): string;