UNPKG

@gaignoux/currency

Version:

A way to get all currency information from around the world.

69 lines (68 loc) 2.6 kB
import { TCurrency, TCurrencyCode, TCurrencyLocalCode } from '../types'; /** * Gets the currency symbol based on the currency code. * @param code The currency code. * @returns The currency symbol. */ export declare const getCurrencySymbol: (code: TCurrencyCode) => string; /** * Gets the currency name based on the currency code. * @param code The currency code. * @returns The name of the currency. */ export declare const getCurrencyName: (code: TCurrencyCode) => string; /** * Gets the country associated with a currency based on the currency code. * @param code The currency code. * @returns The country associated with the currency. */ export declare const getCurrencyCountry: (code: TCurrencyCode) => string; /** * Gets the locale code associated with a currency or an array of them based on the locale code. * @param locale The locale code. * @returns The currency code associated with the locale or an array of them. */ export declare const getCurrencyLocaleCode: (locale: TCurrencyLocalCode) => string | string[]; /** * Gets the currency symbol or an array of them based on the locale code. * @param locale The locale code. * @returns The currency symbol associated with the locale or an array of them. */ export declare const getCurrencySymbolByLocale: (locale: TCurrencyLocalCode) => string | string[]; /** * Gets the currency symbol based on the country. * @param country The country associated with the currency. * @returns The currency symbol associated with the country. */ export declare const getCurrencySymbolByCountry: (country: string) => string; /** * Gets all available currency codes. * @returns A list of all currency codes. */ export declare const getAllCodes: () => string[]; /** * Gets all available currency names. * @returns A list of all currency names. */ export declare const getAllNames: () => string[]; /** * Gets all available currency symbols. * @returns A list of all currency symbols. */ export declare const getAllSymbols: () => string[]; /** * Gets all available locale codes. * @returns A list of all locale codes. */ export declare const getAllLocales: () => string[]; /** * Gets all available locale codes. * @returns A list of all locale codes. */ export declare const getAllCountries: () => string[]; /** * Gets an object containing complete information about a currency based on the currency code. * @param code The currency code. * @returns An object containing the name, symbol, locale code, and country associated with the currency. */ export declare const getCurrencyObject: (code: TCurrencyCode) => TCurrency;