ropods-cashify
Version:
Modern, lightweight currency conversion library with real-time exchange rates, INR support, and free API integration. Production-ready TypeScript library for RoPods organization with zero dependencies and comprehensive testing.
64 lines • 1.94 kB
TypeScript
import { Options } from './lib/options.js';
/**
* RoPodsCashify - Currency conversion library for RoPods organization
* Based on the original Cashify library with organizational enhancements
*/
export default class RoPodsCashify {
readonly options: Partial<Options>;
/**
* Get library information
* @return {Object} Library metadata
*/
static getInfo(): {
name: string;
version: string;
organization: string;
description: string;
};
/**
* @constructor
* @param {Object} [options] Conversion options.
*/
constructor(options: Partial<Options>);
/**
* Function, which converts currencies based on provided rates.
* Enhanced for RoPods organization requirements.
*
* @param {number | string} amount - Amount of money you want to convert.
* @param {Object} [options] - Conversion options.
* @return {number} Conversion result.
* * @example
* const rates = {
* GBP: 0.737,
* EUR: 0.851,
* USD: 1.00,
* INR: 86.42
* };
*
* const ropodsCashify = new RoPodsCashify({base: 'USD', rates});
*
* ropodsCashify.convert(10, {from: 'USD', to: 'INR'}); //=> 864.2
*/
convert(amount: number | string, options?: Partial<Options>): number;
/**
* Convert with live rates (placeholder for future implementation)
* @param {number | string} amount - Amount to convert
* @param {Object} options - Conversion options
* @returns {Promise<number>} Conversion result
*/
convertWithLiveRates(amount: number | string, options: {
from: string;
to: string;
base?: string;
}): Promise<number>;
/**
* Get information about supported free APIs
*/
static getSupportedFreeAPIs(): {
name: string;
url: string;
description: string;
noApiKey: boolean;
}[];
}
//# sourceMappingURL=cashify.d.ts.map