import { FormatOptions } from './constants.js'; /** * Convert milliseconds to a human-readable duration. * @param ms - milliseconds * @param options - formatting options */ export declare function formatDuration(ms: number, options?: FormatOptions): string; /** * Return a human-readable "time ago" string. * @param date - past or future date * @param options - formatting options */ export declare function timeAgo(date: Date, options?: FormatOptions): string; /** * Format a date to a human-readable time string * @param date - date to format * @param format - format type */ export declare function formatTime(date: Date, format?: '12h' | '24h' | 'iso'): string; /** * Parse a duration string like "1h 30m" into milliseconds * @param duration - duration string (e.g., "1h 30m", "2d", "45s") */ export declare function parseDuration(duration: string): number; /** * Format a date using a pattern string * @param date - date to format * @param pattern - format pattern (e.g., "YYYY-MM-DD", "MMM D, YYYY") * * Supported tokens: * - YYYY: 4-digit year * - YY: 2-digit year * - MMMM: Full month name (January) * - MMM: Short month name (Jan) * - MM: Month with leading zero (01-12) * - M: Month (1-12) * - DDDD: Full day name (Monday) * - DDD: Short day name (Mon) * - DD: Day with leading zero (01-31) * - D: Day (1-31) * - HH: Hours 24h with leading zero (00-23) * - H: Hours 24h (0-23) * - hh: Hours 12h with leading zero (01-12) * - h: Hours 12h (1-12) * - mm: Minutes with leading zero (00-59) * - ss: Seconds with leading zero (00-59) * - SSS: Milliseconds (000-999) * - A: AM/PM * - a: am/pm */ export declare function formatDate(date: Date, pattern: string): string; /** * Format a relative time string (e.g., "in 2 days", "3 hours ago") * @param date - target date * @param baseDate - base date (default: now) */ export declare function formatRelativeTime(date: Date, baseDate?: Date): string; /** * Format a date range (e.g., "Jan 5 - Jan 10, 2025") * @param start - start date * @param end - end date * @param options - formatting options */ export declare function formatDateRange(start: Date, end: Date, options?: { separator?: string; includeTime?: boolean; format?: 'short' | 'medium' | 'long'; }): string; /** * Format a number as an ordinal (1st, 2nd, 3rd, etc.) * @param n - number to format */ export declare function formatOrdinal(n: number): string; /** * Format a day of month as an ordinal (1st, 2nd, 3rd, etc.) * @param date - date to format */ export declare function formatDayOrdinal(date: Date): string; /** * Format a duration in a compact form (e.g., "02:30:45") * @param ms - milliseconds * @param showHours - always show hours even if 0 */ export declare function formatDurationCompact(ms: number, showHours?: boolean): string; /** * Format a date/time for display in a calendar * @param date - date to format */ export declare function formatCalendarDate(date: Date): string; //# sourceMappingURL=format.d.ts.map