/** * A decimal as an exact integer of `units` scaled by 10^-`scale`. Costs are compared across a * language boundary, so a binary float would make the comparison depend on representation: two * sides that agree on the value could disagree on the bytes. BigInt units never do. */ export interface DecimalValue { readonly units: bigint; readonly scale: number; } export declare class DecimalTextError extends Error { constructor(text: string); } export declare function isDecimalText(text: unknown): text is string; export declare function parseDecimal(text: string): DecimalValue; /** Renders with trailing fraction zeros stripped, matching the proxy's own decimal serialiser. */ export declare function decimalText(value: DecimalValue): string; export declare function subtractDecimal(left: DecimalValue, right: DecimalValue): DecimalValue; export declare function multiplyDecimal(left: DecimalValue, right: DecimalValue): DecimalValue; export declare function compareDecimal(left: DecimalValue, right: DecimalValue): number; export declare function absDecimal(value: DecimalValue): DecimalValue; export declare function maxDecimal(left: DecimalValue, right: DecimalValue): DecimalValue; /** * The one lossy step in the pipeline, isolated here on purpose: a journal cost arrives as a * JavaScript number and its shortest round-tripping decimal is the most that value can honestly * claim. Everything downstream of this call is exact. */ export declare function decimalFromNumber(value: number): DecimalValue;