import LOCALES from './locales'; import { ConverterOptions, ToWordsOptions } from './types/to-word.type'; export { LOCALES }; export declare const DefaultConverterOptions: ConverterOptions; export declare const DefaultToWordsOptions: ToWordsOptions; export declare class ToWords { private options; private locale; /** * Initializes a new instance of the `ToWords` class with the specified options. * * @param {ToWordsOptions} options - Options for configuring locale and converter behavior. * * @example * ```ts * const toWords = new ToWords({ localeCode: 'en-US' }); * ``` */ constructor(options?: ToWordsOptions); /** * Returns the locale class based on the current locale code. * Throws an error if the locale is not found. * * @returns {ConstructorOf} The class constructor for the specified locale. * @throws Will throw an error if the locale code is invalid. * * @example * ```ts * const localeClass = toWords.getLocaleClass(); * ``` */ private getLocaleClass; /** * Returns an instance of the locale class for the specified locale code. * * @returns {InstanceType>} The instance of the locale interface. * * @example * ```ts * const localeInstance = toWords.getLocale(); * ``` */ private getLocale; /** * Converts a number to words, with options for handling currency and decimals. * * @param {number} number - The number to convert. * @param {ConverterOptions} options - Options for controlling the conversion. * @returns {string} The number in words. * * @throws Will throw an error if the number is invalid. * * @example * ```ts * const result = toWords.convert(123); * console.log(result); // "one hundred twenty-three" * ``` */ convert(number: number, options?: ConverterOptions): string; /** * Converts a number (without currency) to words. * * @param {number} number - The number to convert. * @returns {string[]} The array of words representing the number. * * @example * ```ts * const words = toWords.convertNumber(123); * console.log(words); // ['one', 'hundred', 'twenty-three'] * ``` */ private convertNumber; /** * Converts a number representing currency to words, including major and fractional units. * * @param {number} number - The number to convert. * @param {ConverterOptions} options - Conversion options for currency. * @returns {string[]} The array of words representing the currency. * * @example * ```ts * const words = toWords.convertCurrency(123.45); * console.log(words); // ['one', 'hundred', 'twenty-three', 'dollars', 'and', 'forty-five', 'cents'] * ``` */ private convertCurrency; /** * Recursively converts a number into words. * * @param {number} number - The number to convert. * @param {boolean} [trailing=false] - Whether to consider trailing digits. * @returns {string[]} The array of words representing the number. * * @example * ```ts * const words = toWords.convertInternal(123); * console.log(words); // ['one', 'hundred', 'twenty-three'] * ``` */ private convertInternal; private toFixed; private isFloat; private isValidNumber; private isNumberZero; }