/** * Common formatting utilities for the microfrontend architecture * * These utilities provide consistent formatting across all microfrontends * for dates, currencies, numbers, and text. */ /** * Format a number as currency * @param amount - The amount to format * @param currency - The currency code (default: 'USD') * @param locale - The locale for formatting (default: 'en-US') */ export declare function formatCurrency(amount: number, currency?: string, locale?: string): string; /** * Format currency in compact notation (e.g., $1.5M, $500K) */ export declare function formatCurrencyCompact(amount: number, currency?: string): string; type DateFormat = 'short' | 'medium' | 'long'; /** * Format a date string or Date object * @param date - The date to format * @param format - The format style: 'short', 'medium', or 'long' * @param locale - The locale for formatting (default: 'en-US') */ export declare function formatDate(date: string | Date, format?: DateFormat, locale?: string): string; /** * Format a date with time * @param date - The date to format * @param includeSeconds - Whether to include seconds * @param locale - The locale for formatting */ export declare function formatDateTime(date: string | Date, includeSeconds?: boolean, locale?: string): string; /** * Format a date as relative time (e.g., "5 minutes ago") */ export declare function formatRelativeTime(date: string | Date): string; /** * Format duration between two dates */ export declare function formatDuration(startDate: string | Date, endDate: string | Date): string; /** * Format time only (e.g., "3:45 PM") */ export declare function formatTime(date: string | Date, locale?: string): string; /** * Format a number with optional decimal places */ export declare function formatNumber(value: number, decimals?: number, locale?: string): string; /** * Format a number as a percentage */ export declare function formatPercentage(value: number, decimals?: number): string; /** * Format bytes to human readable format */ export declare function formatBytes(bytes: number, decimals?: number): string; /** * Format a number in compact notation (e.g., 1.5K, 2.3M) */ export declare function formatCompactNumber(value: number, locale?: string): string; /** * Format a number with ordinal suffix (e.g., 1st, 2nd, 3rd) */ export declare function formatOrdinal(n: number): string; /** * Truncate text to a maximum length with ellipsis */ export declare function truncateText(text: string, maxLength: number, ellipsis?: string): string; /** * Capitalize the first letter of a string */ export declare function capitalizeFirst(text: string): string; /** * Capitalize the first letter of each word */ export declare function capitalizeWords(text: string): string; /** * Convert a string to slug format */ export declare function slugify(text: string): string; /** * Convert a string to camelCase */ export declare function toCamelCase(text: string): string; /** * Convert a string to PascalCase */ export declare function toPascalCase(text: string): string; /** * Pluralize a word based on count */ export declare function pluralize(word: string, count: number, plural?: string): string; /** * Format a list of items with Oxford comma */ export declare function formatList(items: string[], conjunction?: string): string; export {}; //# sourceMappingURL=format.d.ts.map