/** * Spanish (Spain) language converter * * CLDR: es-ES | Spanish as used in Spain * * Uses the European long scale numbering system: * - 10⁶ = millón * - 10⁹ = mil millones (thousand millions) * - 10¹² = billón * * 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/cienta" otherwise * - Irregular hundreds: quinientos, setecientos, novecientos * - "un" before millón (not "uno"), omit before mil */ 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. * * This is the main public API. It accepts any valid numeric input * (number, string, or bigint) and handles parsing internally. * @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(1000000) // 'un milló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. * * Spanish ordinals agree in gender with the noun they modify. * Only positive integers are valid for ordinals. * @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' * toOrdinal(100) // 'centésimo' */ declare function toOrdinal(value: number | string | bigint, options?: OrdinalOptions): string; export type CurrencyOptions = { /** * - Use "con" between euros and cents */ and?: boolean; }; /** * @typedef {object} CurrencyOptions * @property {boolean} [and] - Use "con" between euros and cents */ /** @type {Required} */ export declare const currencyDefaults: Required; /** * Converts a numeric value to Spanish Euro currency words. * * Spanish currency uses masculine gender for euros (el euro) * and masculine for céntimos (el céntimo). * @param {number | string | bigint} value - The currency amount to convert * @param {CurrencyOptions} [options] - Optional configuration * @returns {string} The amount in Spanish 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 euros con cincuenta céntimos' * toCurrency(1) // 'un euro' * toCurrency(0.99) // 'noventa y nueve céntimos' * toCurrency(42.50, { and: false }) // 'cuarenta y dos euros cincuenta céntimos' */ declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string; export { toCardinal, toOrdinal, toCurrency };