@frank-auth/react
Version:
Flexible and customizable React UI components for Frank Authentication
101 lines • 5.99 kB
TypeScript
import { XID } from '../types';
export declare const formatDate: (date: Date | string | number, options?: Intl.DateTimeFormatOptions, locale?: string) => string;
export declare const formatDateTime: (date: Date | string | number, options?: Intl.DateTimeFormatOptions, locale?: string) => string;
export declare const formatTime: (date: Date | string | number, options?: Intl.DateTimeFormatOptions, locale?: string) => string;
export declare const formatRelativeTime: (date: Date | string | number, locale?: string) => string;
export declare const formatDuration: (milliseconds: number) => string;
export declare const formatTimeAgo: (date: Date | string | number) => string;
export declare const formatNumber: (value: number, options?: Intl.NumberFormatOptions, locale?: string) => string;
export declare const formatCurrency: (amount: number, currency?: string, locale?: string) => string;
export declare const formatPercentage: (value: number, decimals?: number, locale?: string) => string;
export declare const formatFileSize: (bytes: number) => string;
export declare const formatCompactNumber: (value: number, locale?: string) => string;
export declare const formatName: (firstName?: string, lastName?: string) => string;
export declare const formatInitials: (name: string) => string;
export declare const formatDisplayName: (user: {
firstName?: string;
lastName?: string;
username?: string;
emailAddress?: string;
}) => string;
export declare const formatEmail: (email: string) => string;
export declare const formatPhoneNumber: (phone: string, format?: "international" | "national" | "e164") => string;
export declare const maskEmail: (email: string) => string;
export declare const maskPhoneNumber: (phone: string) => string;
export declare const truncateText: (text: string, maxLength: number, suffix?: string) => string;
export declare const truncateMiddle: (text: string, maxLength: number, separator?: string) => string;
export declare const formatTextCase: (text: string, format: "camel" | "pascal" | "snake" | "kebab" | "sentence" | "title" | "upper" | "lower") => string;
export declare const formatId: (id: XID) => string;
export declare const formatTokenPreview: (token: string) => string;
export declare const formatAddress: (address: {
street?: string;
city?: string;
state?: string;
postalCode?: string;
country?: string;
}) => string;
export declare const formatList: (items: string[], options?: {
style?: "long" | "short" | "narrow";
type?: "conjunction" | "disjunction";
locale?: string;
}) => string;
export declare const formatJSON: (obj: any, indent?: number, maxDepth?: number) => string;
export declare const formatJSONCompact: (obj: any) => string;
export declare const formatDomain: (url: string) => string;
export declare const formatURL: (url: string) => string;
export declare const formatHexColor: (color: string) => string;
export declare const formatRGBColor: (r: number, g: number, b: number) => string;
export declare const formatRGBAColor: (r: number, g: number, b: number, a: number) => string;
export declare const formatValidationError: (field: string, rule: string, value?: any) => string;
export declare function getTitleAlignment(align: 'left' | 'center' | 'right'): string;
export declare const FormatUtils: {
formatDate: (date: Date | string | number, options?: Intl.DateTimeFormatOptions, locale?: string) => string;
formatDateTime: (date: Date | string | number, options?: Intl.DateTimeFormatOptions, locale?: string) => string;
formatTime: (date: Date | string | number, options?: Intl.DateTimeFormatOptions, locale?: string) => string;
formatRelativeTime: (date: Date | string | number, locale?: string) => string;
formatDuration: (milliseconds: number) => string;
formatTimeAgo: (date: Date | string | number) => string;
formatNumber: (value: number, options?: Intl.NumberFormatOptions, locale?: string) => string;
formatCurrency: (amount: number, currency?: string, locale?: string) => string;
formatPercentage: (value: number, decimals?: number, locale?: string) => string;
formatFileSize: (bytes: number) => string;
formatCompactNumber: (value: number, locale?: string) => string;
formatName: (firstName?: string, lastName?: string) => string;
formatInitials: (name: string) => string;
formatDisplayName: (user: {
firstName?: string;
lastName?: string;
username?: string;
emailAddress?: string;
}) => string;
formatEmail: (email: string) => string;
formatPhoneNumber: (phone: string, format?: "international" | "national" | "e164") => string;
maskEmail: (email: string) => string;
maskPhoneNumber: (phone: string) => string;
truncateText: (text: string, maxLength: number, suffix?: string) => string;
truncateMiddle: (text: string, maxLength: number, separator?: string) => string;
formatTextCase: (text: string, format: "camel" | "pascal" | "snake" | "kebab" | "sentence" | "title" | "upper" | "lower") => string;
formatId: (id: XID) => string;
formatTokenPreview: (token: string) => string;
formatAddress: (address: {
street?: string;
city?: string;
state?: string;
postalCode?: string;
country?: string;
}) => string;
formatList: (items: string[], options?: {
style?: "long" | "short" | "narrow";
type?: "conjunction" | "disjunction";
locale?: string;
}) => string;
formatJSON: (obj: any, indent?: number, maxDepth?: number) => string;
formatJSONCompact: (obj: any) => string;
formatDomain: (url: string) => string;
formatURL: (url: string) => string;
formatHexColor: (color: string) => string;
formatRGBColor: (r: number, g: number, b: number) => string;
formatRGBAColor: (r: number, g: number, b: number, a: number) => string;
formatValidationError: (field: string, rule: string, value?: any) => string;
};
//# sourceMappingURL=format.d.ts.map