type CardinalConverterOptions = { includeDecimals?: boolean; }; /** * Converts a numeric value into its Italian cardinal word representation. * * This function accepts a number and returns its Italian word representation * as a cardinal number. Optionally, it can include the decimal part in the result. * The valid range for the input number is -999999999999 to 999999999999. * * @param {number} number - The numeric value to convert. Must be a valid finite number. * @param {CardinalConverterOptions} options - Configuration options. * Default is `{ includeDecimals: false }`. * @param {boolean} [options.includeDecimals=false] * - Whether to include the decimal part in the result. * * @returns {string} The Italian cardinal word representation of the input number. * * @throws {Error} * Throws an error if the input is not a valid number. * @throws {Error} * Throws an error if the input is greater than 999999999999 or lower than -999999999999. * * @example * cardinalConverter(1); // 'uno' * cardinalConverter(90); // 'novanta' * cardinalConverter(709); // 'settecentonove' * cardinalConverter(1000.05, { includeDecimals: true }); // 'mille/05' * cardinalConverter(9, { includeDecimals: true }); // 'nove/00' * cardinalConverter(-1); // 'meno uno' * cardinalConverter(Infinity); // 'infinito' * cardinalConverter(NaN); // Throws Error: "not a number" */ declare const cardinalConverter: (number: number, options?: CardinalConverterOptions) => string; type OrdinalConverterOptions = { female?: boolean; plural?: boolean; }; /** * Converts a number into its Italian word representation in ordinal form. * * @param {number} number * A positive integer or Infinity. Must be a valid number (not NaN), less than * or equal to 999,999,999,999. * Infinity is represented as "infinitesimo". * @param {OrdinalConverterOptions} options * Configuration options for the conversion. * - `options.female` (optional): If `true`, returns the representation in feminine form. * - `options.plural` (optional): If `true`, returns the representation in plural form. * * Both `female` and `plural` can be used together. * * @returns {string} * The Italian word representing the ordinal number. * Example: * - 1 -> "primo", * - 10 -> "decimo", * - Infinity -> "infinitesimo". * * @throws {Error} Throws an error if: * - The number is NaN. * - The number is greater than 999,999,999,999. * - The number is negative. * * @example * // Basic usage: * ordinalConverter(1); // 'primo' * ordinalConverter(10); // 'decimo' * ordinalConverter(63); // 'sessantatreesimo' * * // Special case: * ordinalConverter(Infinity); // 'infinitesimo' * * // Feminine form: * ordinalConverter(1, { female: true }); // 'prima' * ordinalConverter(15, { female: true }); // 'quindicesima' * ordinalConverter(109, { female: true }); // 'centonovesima' * * // Plural form: * ordinalConverter(1, { plural: true }); // 'primi' * ordinalConverter(18, { plural: true }); // 'diciottesimi' * ordinalConverter(89, { plural: true }); // 'ottantanovesimi' * * // Feminine plural form: * ordinalConverter(1, { plural: true, female: true }); // 'prime' * ordinalConverter(70, { plural: true, female: true }); // 'settantesime' * ordinalConverter(110, { plural: true, female: true }); // 'centodecime' * * @description * This function converts numbers into their ordinal form in Italian, handling: * - Standard ordinal forms. * - Feminine and/or plural variations. * - Special case for Infinity. * - Error handling for invalid inputs. * * Note: * - The `female` and `plural` options modify only the suffix of the word * (e.g., "a" for feminine or "i/e" for plural forms). * - For large numbers or unexpected inputs, ensure proper validation before usage. */ declare const ordinalConverter: (number: number, options?: OrdinalConverterOptions) => string; /** * Converts an Arabic numeral into its Roman numeral representation. * * This function converts a given Arabic number (integer) into its equivalent * Roman numeral format. It supports numbers within the range of 1 to 3999, * inclusive. * * @param {number} number - The Arabic numeral to convert. Must be an integer between 1 and 3999. * @returns {string} The Roman numeral representation of the input number. * @throws {Error} Throws an error if the input is not a valid number. * @throws {Error} Throws an error if the number is less than 1 or greater than 3999. * * @example * romanConverter(1); // 'I' * romanConverter(79); // 'LXXIX' * romanConverter(2317); // 'MMCCCXVII' * romanConverter(NaN); // Throws Error: "not a number" * romanConverter(0); // Throws Error: "lower than 1" * romanConverter(4000); // Throws Error: "greater than 3999" * romanConverter(Infinity); // 'infinitum' */ declare const romanConverter: (number: number) => string; /** * Converts a Roman numeral into its Arabic numeral representation. * * This function takes a valid Roman numeral string and converts it into its * equivalent Arabic number (integer). It supports standard Roman numeral notation. * Invalid inputs, including unsupported characters or improper formatting, will * trigger an error. * * @param {string} romanNumber - The Roman numeral to convert. Must be a valid Roman numeral. * @returns {number} The Arabic numeral representation of the input Roman numeral. * @throws {Error} - Throws an error if the input string is not a valid Roman numeral. * * @example * arabicConverter('MD'); // 1500 * arabicConverter('CDXC'); // 490 * arabicConverter('MCMXC'); // 1990 * arabicConverter('infinitum'); // Infinity * arabicConverter('ABC'); // Throws Error: "invalid roman number" * arabicConverter(''); // Throws Error: "invalid roman number" */ declare const arabicConverter: (romanNumber: string) => number; /** * Converts an Italian word representation of a number into its numeric value. * * @param {string} word * The Italian word representing a number, which may include ordinals, decimals, or negative values. * Special values like "infinito" (Infinity) are also supported. * * @returns {number} * The numeric value corresponding to the word, or NaN if the input cannot be converted. * Returns Infinity for words like "infinito". * * @example * italianConverter('uno'); // 1 * italianConverter('novantasette'); // 97 * italianConverter('un milione tredicimila'); // 1013000 * italianConverter('zeresimo'); // 0 * italianConverter('prima'); // 1 * italianConverter('quattrocentotredicesime'); // 413 * italianConverter('venti/40'); // 20.40 * italianConverter('infinitesimi'); // Infinity * * @description * This function processes an Italian word representing a number, handling cases like: * - Removing spaces and conjunctions (e.g., "un milione e cento"). * - Supporting negative numbers (e.g., "meno due"). * - Parsing decimal numbers in formats like "venti/40". * - Handling ordinal forms like "prima" or "quindicesimo". * - Recognizing "infinito" and related words as Infinity. * * Note: * - Case sensitivity is handled (input is converted to lowercase internally). * - The function expects well-formed input; unexpected input may yield NaN. */ declare const italianConverter: (word: string) => number; export { CardinalConverterOptions, OrdinalConverterOptions, arabicConverter, cardinalConverter, italianConverter, ordinalConverter, romanConverter };