export type QuantityInput = number | number[]; /** * Matches the existing quantity equality tolerance so decimal round-trips can be canonicalized safely. */ export declare const QUANTITY_SIMPLIFY_EPSILON = 0.0001; /** * Rounds a quantity to the persisted precision used by pricing records. * * @param amount The quantity to round. * @returns The rounded quantity. */ export declare function roundQuantity(amount: number): number; /** * Checks if two quantities are approximately equal. * * @param firstQuantity The first quantity. * @param secondQuantity The second quantity. * @returns True when the quantities are within the quantity epsilon. */ export declare function sameQuantity(firstQuantity: number, secondQuantity: number): boolean; /** * Gets the denominator of a quantity. * * @param quantity The quantity to get the denominator of. * @returns The denominator of the quantity. */ export declare function getQuantityDenominator(quantity: number): number; /** * Sums quantities through Fraction arithmetic and rounds only at the boundary. * * @param quantities The quantities to sum. * @returns The persisted quantity sum. */ export declare function sumQuantities(...quantities: QuantityInput[]): number; /** * Calculates the total quantity by summing up the given quantities. * * @param quantities The quantities to be summed up. * @param startQuantity The starting quantity for the calculation. * @returns The persisted total quantity. */ export declare function calculateTotalQuantity(quantities: number[], startQuantity?: number): number; /** * Multiplies a quantity by a scalar through Fraction arithmetic. * * @param quantity The quantity to multiply. * @param scalar The multiplier. * @returns The persisted product. */ export declare function multiplyQuantity(quantity: number, scalar: number): number; /** * Divides one quantity-like number by another through Fraction arithmetic. * * @param numerator The numerator. * @param denominator The denominator. * @returns The persisted quotient, or zero when the denominator resolves to zero. */ export declare function divideQuantity(numerator: number, denominator: number): number;