/** * React 版本的格式化工具 * 无 Vue 依赖,纯函数实现 */ export interface FormatOptions { [key: string]: any; currency?: string; precision?: number; notation?: "compact" | "scientific" | "engineering"; pattern?: string; binary?: boolean; country?: string; mask?: boolean; separator?: string; maxLength?: number; suffix?: string; statusMap?: Record; delimiter?: string; } export type FormatType = "currency" | "number" | "percent" | "compact" | "scientific" | "ordinal" | "chineseNumber" | "timestamp" | "date" | "dateCustom" | "relativeTime" | "duration" | "age" | "fileSize" | "networkSpeed" | "phone" | "phoneMask" | "landline" | "emailMask" | "idCard" | "bankCard" | "ipAddress" | "macAddress" | "truncate" | "capitalize" | "titleCase" | "kebabCase" | "camelCase" | "snakeToCamel" | "camelToSnake" | "stripHtml" | "usernameMask" | "status" | "gender" | "url" | "color" | "array"; export declare const formatCurrency: (value: any, currency?: string, options?: FormatOptions) => string; export declare const formatNumber: (value: any, options?: FormatOptions) => string; export declare const formatPercent: (value: any, precision?: number) => string; export declare const formatCompact: (value: any, notation?: "compact" | "scientific" | "engineering") => string; export declare const formatDate: (value: any, options?: FormatOptions) => string; export declare const formatDateCustom: (value: any, pattern?: string) => string; export declare const formatTimestamp: (value: any, pattern?: string) => string; export declare const formatRelativeTime: (value: any) => string; export declare const formatDuration: (seconds: any) => string; export declare const formatAge: (birthDate: any) => string; export declare const formatFileSize: (bytes: any, precision?: number, binary?: boolean) => string; export declare const formatPhone: (phone: any, country?: string) => string; export declare const formatPhoneMask: (phone: any) => string; export declare const formatEmailMask: (email: any) => string; export declare const formatIdCard: (idCard: any, mask?: boolean) => string; export declare const formatBankCard: (cardNumber: any, mask?: boolean) => string; export declare const formatUsernameMask: (username: any) => string; export declare const formatTruncate: (text: any, maxLength?: number, suffix?: string) => string; export declare const formatCapitalize: (text: any) => string; export declare const formatArray: (value: any, delimiter?: string) => string; export declare const formatGender: (value: any) => string; export declare const formatStatus: (value: any, statusMap?: Record) => string; export declare const formatStripHtml: (value: any) => string; /** * 根据类型格式化值 */ export declare function formatByType(value: any, formatType: FormatType | string, options?: FormatOptions): string; export default formatByType; //# sourceMappingURL=ReactFormatter.d.ts.map