n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
58 lines (57 loc) • 2.15 kB
TypeScript
/**
* Modern Hebrew (Israel) language converter
*
* CLDR: he-IL | Modern Hebrew as used in Israel
*
* Key features:
* - Feminine grammatical forms (default in Modern Hebrew)
* - Dual forms for 2, 200, 2000
* - Special 1-9 thousands construct state
* - "ו" (ve) conjunction rules vary by position
* - Per-digit decimal reading
*/
export declare const cardinalMax: bigint;
export declare const ordinalMax: bigint;
export declare const currencyMax: bigint;
export type CardinalOptions = {
/**
* - Custom conjunction word
*/
andWord?: string;
};
/**
* @typedef {object} CardinalOptions
* @property {string} [andWord] - Custom conjunction word
*/
/** @type {Required<CardinalOptions>} */
export declare const cardinalDefaults: Required<CardinalOptions>;
/**
* Converts a numeric value to Modern Hebrew words.
* @param {number | string | bigint} value - The numeric value to convert
* @param {CardinalOptions} [options] - Optional configuration
* @returns {string} The number in Modern Hebrew words
*/
declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
/**
* Converts a numeric value to Hebrew ordinal words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The ordinal in Hebrew words
* @throws {TypeError} If value is not a valid numeric type
* @throws {Error} If value is not a positive integer
* @example
* toOrdinal(1) // 'ראשון'
* toOrdinal(21) // 'עשרים וראשון'
*/
declare function toOrdinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Hebrew New Israeli Shekel currency words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The currency in Hebrew words
* @throws {TypeError} If value is not a valid numeric type
* @throws {Error} If value is not a valid number format
* @example
* toCurrency(1) // 'שקל אחד'
* toCurrency(2.50) // 'שניים שקלים חמישים אגורות'
*/
declare function toCurrency(value: number | string | bigint): string;
export { toCardinal, toOrdinal, toCurrency };