/** * Spanish (United States) language converter * * CLDR: es-US | Spanish as used in the United States * * Uses the short scale numbering system (like US English): * - 10⁶ = millón * - 10⁹ = billón (billion) * - 10¹² = trillón (trillion) * * Spanish-specific rules: * - Gender agreement: uno/una, veintiuno/veintiuna, hundreds * - Special twenties: veinte, veintiuno, veintidós, ... veintinueve * - "y" conjunction: treinta y uno (only 30-99 with ones) * - "cien" for exact 100, "ciento" otherwise ("ciento" is invariable; only 200-900 agree) * - Irregular hundreds: quinientos, setecientos, novecientos * - Apocopation: "uno" shortens to "un" before a masculine noun, and a scale * word or currency noun is exactly that — "veintiún mil", "treinta y un * millones", "veintiún dólares". A multiplier of exactly 1 is dropped before * "mil" ("mil", not "un mil") but kept before "millón" ("un millón"). */ export declare const cardinalMax: bigint; export declare const ordinalMax: bigint; export declare const currencyMax: bigint; export type CardinalOptions = { /** * - Grammatical gender */ gender?: ('masculine' | 'feminine'); }; /** * @typedef {object} CardinalOptions * @property {('masculine'|'feminine')} [gender] - Grammatical gender */ /** @type {Required} */ export declare const cardinalDefaults: Required; /** @type {{ gender: ReadonlyArray['gender']> }} */ export declare const cardinalValues: { gender: ReadonlyArray['gender']>; }; /** * Converts a numeric value to Spanish words (US short scale). * @param {number | string | bigint} value - The numeric value to convert * @param {CardinalOptions} [options] - Optional configuration * @returns {string} The number in Spanish words * @throws {TypeError} If value is not a valid numeric type * @throws {Error} If value is not a valid number format * @example * toCardinal(21) // 'veintiuno' * toCardinal(21, {gender: 'feminine'}) // 'veintiuna' * toCardinal(1000000000) // 'un billón' */ declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string; export type OrdinalOptions = { /** * - Grammatical gender */ gender?: ('masculine' | 'feminine'); }; /** * @typedef {object} OrdinalOptions * @property {('masculine'|'feminine')} [gender] - Grammatical gender */ /** @type {Required} */ export declare const ordinalDefaults: Required; /** @type {{ gender: ReadonlyArray['gender']> }} */ export declare const ordinalValues: { gender: ReadonlyArray['gender']>; }; /** * Converts a numeric value to Spanish ordinal words. * @param {number | string | bigint} value - The positive integer to convert * @param {OrdinalOptions} [options] - Optional configuration * @returns {string} The number in Spanish ordinal words * @throws {TypeError} If value is not a valid numeric type * @throws {Error} If value is not a positive integer * @example * toOrdinal(1) // 'primero' * toOrdinal(1, { gender: 'feminine' }) // 'primera' * toOrdinal(21) // 'vigésimo primero' */ declare function toOrdinal(value: number | string | bigint, options?: OrdinalOptions): string; export type CurrencyOptions = { /** * - Use "con" between dollars and cents */ and?: boolean; /** * - ISO 4217 currency code to name the amount in */ currency?: import('./utils/currency-vocab.js').EsCurrency; }; /** * @typedef {object} CurrencyOptions * @property {boolean} [and] - Use "con" between dollars and cents * @property {import('./utils/currency-vocab.js').EsCurrency} [currency] - ISO 4217 currency code to name the amount in */ /** @type {Required} */ export declare const currencyDefaults: Required; /** @type {{ currency: ReadonlyArray['currency']> }} */ export declare const currencyValues: { currency: ReadonlyArray['currency']>; }; /** * Converts a numeric value to US Dollar currency words in Spanish. * * US Dollar uses masculine gender for dólares (el dólar) * and masculine for centavos (el centavo). * @param {number | string | bigint} value - The currency amount to convert * @param {CurrencyOptions} [options] - Optional configuration * @returns {string} The amount in Spanish US Dollar currency words * @throws {TypeError} If value is not a valid numeric type * @throws {Error} If value is not a valid number format * @example * toCurrency(42.50) // 'cuarenta y dos dólares con cincuenta centavos' * toCurrency(1) // 'un dólar' * toCurrency(0.99) // 'noventa y nueve centavos' * toCurrency(42.50, { and: false }) // 'cuarenta y dos dólares cincuenta centavos' */ declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string; export { toCardinal, toOrdinal, toCurrency };