extenso
Version:
Uma biblioteca avançada para escrever números por extenso (em português).
29 lines (28 loc) • 1.36 kB
TypeScript
import Currency from '../ts/interface/currency.interface';
import type { CurrencyCode, ExtensoScale } from '../types';
/**
* Writes the unit part of a currency amount
* @param unit - The unit part of the amount
* @param currency - The currency configuration
* @param scale - The scale to use (SHORT or LONG)
* @returns The unit part written in words with currency name
*/
export declare const writeUnit: (unit: string, currency: Currency, scale?: ExtensoScale) => string;
/**
* Writes the subunit part of a currency amount
* @param subunit - The subunit part of the amount
* @param currency - The currency configuration
* @returns The subunit part written in words with currency name
*/
export declare const writeSubunit: (subunit: string, currency: Currency) => string;
/**
* Writes a complete currency amount in words
* @param unit - The unit part of the amount
* @param subunit - The subunit part of the amount
* @param currencyOrCode - A supported currency code or a custom currency definition
* @param scale - The scale to use (SHORT or LONG)
* @returns The complete amount written in words with currency name
* @throws {Error} If an invalid currency code is provided
*/
declare const writeCurrency: (unit: string, subunit?: string, currencyOrCode?: CurrencyCode | Currency, scale?: ExtensoScale) => string;
export default writeCurrency;