import { type Maybe } from '../value/maybe.type'; /** * Whole dollar amounts, before the ','. */ export type WholeDollarAmount = number; /** * Dollar amount number. */ export type DollarAmount = number; /** * Dollars amount number per hour. */ export type DollarAmountPerHour = number; /** * Dollars amount number per day. */ export type DollarAmountPerDay = number; export type CentsAmount = number; export interface DollarsPair { dollars: WholeDollarAmount; cents: CentsAmount; } /** * Unit to affix to a dollar amount string. */ export type DollarAmountUnit = string; /** * String representing a dollar amount. * * Is formatted as a number with two decimal places. No unit is affixed. */ 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 A function that formats dollar amounts with the configured unit */ export declare function dollarAmountStringWithUnitFunction(unit?: U): DollarAmountStringWithUnitFunction;