import type { DateInput, SupportedLocale, LocaleConfig, RelativeTimeOptions } from './types.js'; /** * Register a custom locale configuration */ export declare function registerLocale(config: LocaleConfig): void; /** * Get locale configuration, with fallback to base language or English */ export declare function getLocaleConfig(locale: SupportedLocale): LocaleConfig; /** * Get list of all registered locales */ export declare function getSupportedLocales(): SupportedLocale[]; /** * Format relative time in the specified locale */ export declare function formatRelativeTime(date: DateInput, options?: RelativeTimeOptions): string; /** * Format date in locale-specific format */ export declare function formatDateLocale(date: DateInput, locale?: SupportedLocale, style?: 'short' | 'medium' | 'long' | 'full'): string; /** * Format time in locale-specific format */ export declare function formatTimeLocale(date: DateInput, locale?: SupportedLocale, style?: 'short' | 'medium' | 'long' | 'full'): string; /** * Format both date and time in locale-specific format */ export declare function formatDateTimeLocale(date: DateInput, locale?: SupportedLocale, dateStyle?: 'short' | 'medium' | 'long' | 'full', timeStyle?: 'short' | 'medium' | 'long' | 'full'): string; /** * Get localized month names */ export declare function getMonthNames(locale?: SupportedLocale, short?: boolean): string[]; /** * Get localized day names */ export declare function getDayNames(locale?: SupportedLocale, short?: boolean): string[]; /** * Get the first day of week for a locale (0 = Sunday, 1 = Monday, etc.) */ export declare function getFirstDayOfWeek(locale?: SupportedLocale): number; /** * Check if a locale is supported */ export declare function isLocaleSupported(locale: string): locale is SupportedLocale; /** * Get the best matching locale from a list of preferences */ export declare function getBestMatchingLocale(preferences: string[], fallback?: SupportedLocale): SupportedLocale; /** * Auto-detect locale from browser or system (if available) */ export declare function detectLocale(fallback?: SupportedLocale): SupportedLocale; /** * Convert a relative time string from one locale to another * Attempts to parse the relative time and reformat in target locale */ export declare function convertRelativeTime(relativeTimeString: string, fromLocale: SupportedLocale, toLocale: SupportedLocale): string | null; /** * Detect the locale of a formatted relative time string * Returns the most likely locale or null if detection fails */ export declare function detectLocaleFromRelativeTime(relativeTimeString: string): SupportedLocale | null; /** * Convert a date format pattern from one locale's convention to another */ export declare function convertFormatPattern(pattern: string, fromLocale: SupportedLocale, toLocale: SupportedLocale, style?: 'short' | 'medium' | 'long' | 'full'): string; /** * Convert a formatted date string from one locale to another * Attempts to parse the date and reformat in target locale */ export declare function convertFormattedDate(formattedDate: string, fromLocale: SupportedLocale, toLocale: SupportedLocale, targetStyle?: 'short' | 'medium' | 'long' | 'full'): string | null; /** * Bulk convert an array of relative time strings to a different locale */ export declare function convertRelativeTimeArray(relativeTimeStrings: string[], fromLocale: SupportedLocale, toLocale: SupportedLocale): (string | null)[]; /** * Get format pattern differences between two locales */ export declare function compareLocaleFormats(locale1: SupportedLocale, locale2: SupportedLocale): { dateFormats: Record; timeFormats: Record; weekStartsOn: { locale1: number; locale2: number; }; }; /** * Get week information for a locale * @param locale - locale code * @returns Object with firstDay, weekend days, and minimalDays */ export declare function getWeekInfo(locale: SupportedLocale): { firstDay: number; weekend: number[]; minimalDays: number; }; /** * Get the day the week starts on for a locale * @param locale - locale code * @returns 0-6 (0 = Sunday, 1 = Monday, etc.) */ export declare function getLocaleWeekStartsOn(locale: SupportedLocale): number; /** * Get the weekend days for a locale * @param locale - locale code * @returns Array of day numbers (0 = Sunday, 6 = Saturday) */ export declare function getLocaleWeekendDays(locale: SupportedLocale): number[]; /** * Thin wrapper around Intl.DateTimeFormat * @param date - date to format * @param options - Intl.DateTimeFormatOptions * @param locale - locale string (defaults to system locale) */ export declare function intlFormat(date: Date, options?: Intl.DateTimeFormatOptions, locale?: string): string; /** * Format only the date part in ISO format (YYYY-MM-DD) * @param date - date to format */ export declare function formatISODate(date: Date): string; /** * Format only the time part in ISO format (HH:mm:ss) * @param date - date to format * @param includeMs - include milliseconds */ export declare function formatISOTime(date: Date, includeMs?: boolean): string; /** * Format distance between two dates without approximation words like "about" or "almost" * Returns exact values like "5 days" instead of "about 5 days" * @param date - the date * @param baseDate - the base date to compare against (defaults to now) * @param options - formatting options */ export declare function formatDistanceStrict(date: Date, baseDate?: Date, options?: { locale?: SupportedLocale; unit?: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'; roundingMethod?: 'floor' | 'ceil' | 'round'; addSuffix?: boolean; }): string; //# sourceMappingURL=locale.d.ts.map