expo-finance-kit
Version:
Native Expo module for Apple FinanceKit - Access financial data from Apple Card and other accounts
87 lines • 2.96 kB
TypeScript
/**
* Formatting utilities for Expo Finance Kit
* Provides consistent formatting for financial data
*/
import { Transaction, Account } from '../ExpoFinanceKit.types';
/**
* Formats a currency amount
* @param amount - Amount to format
* @param currencyCode - ISO currency code
* @param options - Formatting options
* @returns Formatted currency string
*/
export declare function formatCurrency(amount: number, currencyCode?: string, options?: Intl.NumberFormatOptions): string;
/**
* Formats a date for display
* @param date - Date to format (timestamp or Date object)
* @param format - Format style ('short', 'medium', 'long', 'full')
* @returns Formatted date string
*/
export declare function formatDate(date: number | Date, format?: 'short' | 'medium' | 'long' | 'full'): string;
/**
* Formats a relative date (e.g., "2 days ago")
* @param date - Date to format (timestamp or Date object)
* @returns Relative date string
*/
export declare function formatRelativeDate(date: number | Date): string;
/**
* Formats a transaction for display
* @param transaction - Transaction to format
* @returns Formatted transaction object
*/
export declare function formatTransaction(transaction: Transaction): {
displayAmount: string;
displayDate: string;
displayMerchant: string;
displayCategory: string;
};
/**
* Formats merchant category code to human-readable string
* @param mcc - Merchant category code
* @returns Category name
*/
export declare function formatMerchantCategory(mcc?: number): string;
/**
* Formats an account name for display
* @param account - Account to format
* @returns Formatted account name
*/
export declare function formatAccountName(account: Account): string;
/**
* Formats a percentage
* @param value - Value to format (0-1 scale)
* @param decimals - Number of decimal places
* @returns Formatted percentage string
*/
export declare function formatPercentage(value: number, decimals?: number): string;
/**
* Formats a number with commas
* @param value - Number to format
* @returns Formatted number string
*/
export declare function formatNumber(value: number): string;
/**
* Abbreviates large numbers (e.g., 1.2K, 3.4M)
* @param value - Number to abbreviate
* @returns Abbreviated string
*/
export declare function abbreviateNumber(value: number): string;
/**
* Formats a time duration
* @param milliseconds - Duration in milliseconds
* @returns Formatted duration string
*/
export declare function formatDuration(milliseconds: number): string;
/**
* Formats a balance change
* @param currentBalance - Current balance
* @param previousBalance - Previous balance
* @param currencyCode - Currency code
* @returns Formatted balance change
*/
export declare function formatBalanceChange(currentBalance: number, previousBalance: number, currencyCode: string): {
amount: string;
percentage: string;
isPositive: boolean;
};
//# sourceMappingURL=formatters.d.ts.map