react-currency-localizer
Version:
A React hook to display prices in a user's local currency using HTTPS-compatible IP geolocation with robust validation and error handling
16 lines • 731 B
TypeScript
import { UseCurrencyConverterOptions, CurrencyResult } from '../types';
/**
* Custom React hook for converting prices to user's local currency
*
* Features:
* - Automatic IP-based geolocation detection
* - Manual currency override option
* - Intelligent caching (24h for geolocation, 1h for exchange rates)
* - Loading and error state management
* - Success/error callbacks
*
* @param options Configuration options for the currency converter
* @returns Object containing conversion results and state
*/
export declare const useCurrencyConverter: ({ basePrice, baseCurrency, apiKey, manualCurrency, onSuccess, onError, }: UseCurrencyConverterOptions) => CurrencyResult;
//# sourceMappingURL=useCurrencyConverter.d.ts.map