import { type Maybe } from '../value/maybe.type'; /** * Whole dollar amounts, before the ','. * * @semanticType * @semanticTopic currency * @semanticTopic numeric */ export type WholeDollarAmount = number; /** * Dollar amount number. * * @semanticType * @semanticTopic currency * @semanticTopic numeric */ export type DollarAmount = number; /** * Dollars amount number per hour. * * @semanticType * @semanticTopic currency * @semanticTopic numeric */ export type DollarAmountPerHour = number; /** * Dollars amount number per day. * * @semanticType * @semanticTopic currency * @semanticTopic numeric */ export type DollarAmountPerDay = number; /** * Amount in whole cents. * * @semanticType * @semanticTopic currency * @semanticTopic numeric */ export type CentsAmount = number; export interface DollarsPair { dollars: WholeDollarAmount; cents: CentsAmount; } /** * Unit to affix to a dollar amount string. * * @semanticType * @semanticTopic currency * @semanticTopic string */ export type DollarAmountUnit = string; /** * String representing a dollar amount. * * Is formatted as a number with two decimal places. No unit is affixed. * * @semanticType * @semanticTopic currency * @semanticTopic string */ export type DollarAmountString = string; /** * String representing a dollar amount with a unit prefix. */ export type DollarAmountStringWithUnit = `${U}${DollarAmountString}`; export declare const DOLLAR_AMOUNT_STRING_REGEX: RegExp; /** * Dollar amounts are to two decimal places. */ export declare const DOLLAR_AMOUNT_PRECISION = 2; /** * Checks whether the input string matches the expected dollar amount format (e.g., "12.50" or "$12.50"). * * @param value - String to test. * @returns `true` if the string matches the dollar amount regex. */ export declare function isDollarAmountString(value: string): boolean; /** * Formats a number as a dollar amount string with exactly two decimal places. * * Truncates (does not round) excess precision: e.g., 1.115 becomes "1.11". Returns "0.00" for null/undefined. * * @param number - The dollar amount to format. * @returns Formatted string with two decimal places (e.g., "12.50") */ export declare function dollarAmountString(number: Maybe): string; /** * Function that formats the input number as a dollar amount string with a unit. * * @param unit * @returns */ export type DollarAmountStringWithUnitFunction = ((amount: DollarAmount) => DollarAmountStringWithUnit) & { readonly unit: U; }; /** * Creates a function that formats dollar amounts as strings with a unit prefix (e.g., "$12.50"). * * @param unit - The unit prefix to prepend; defaults to "$". * @returns Formats dollar amounts with the configured unit. * * @dbxUtil * @dbxUtilCategory number * @dbxUtilKind factory * @dbxUtilTags number, dollar, currency, format, factory, unit * @dbxUtilRelated dollar-amount-string * * @__NO_SIDE_EFFECTS__ */ export declare function dollarAmountStringWithUnitFunction(unit?: U): DollarAmountStringWithUnitFunction;