n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
67 lines (66 loc) • 2.52 kB
TypeScript
/**
* Biblical Hebrew (Israel) language converter
*
* CLDR: hbo-IL | Biblical/Ancient Hebrew
*
* Key features:
* - Gender agreement (masculine default, feminine via option)
* - 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 = {
/**
* - Grammatical gender
*/
gender?: ('masculine' | 'feminine');
/**
* - Custom conjunction word
*/
andWord?: string;
};
/**
* @typedef {object} CardinalOptions
* @property {('masculine'|'feminine')} [gender] - Grammatical gender
* @property {string} [andWord] - Custom conjunction word
*/
/** @type {Required<CardinalOptions>} */
export declare const cardinalDefaults: Required<CardinalOptions>;
/** @type {{ gender: ReadonlyArray<Required<CardinalOptions>['gender']> }} */
export declare const cardinalValues: {
gender: ReadonlyArray<Required<CardinalOptions>['gender']>;
};
/**
* Converts a numeric value to Biblical Hebrew words.
* @param {number | string | bigint} value - The numeric value to convert
* @param {CardinalOptions} [options] - Optional configuration
* @returns {string} The number in Biblical Hebrew words
*/
declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
/**
* Converts a numeric value to Biblical Hebrew ordinal words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The ordinal in Biblical 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 Biblical Hebrew Shekel currency words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The currency in Biblical 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 };