/** * Scale-aware Joule formatter and parser. * * Rules (Req 7.7): * - ≥ 1 J → render in J, up to 6 decimal places (trailing zeros trimmed * unless `opts.trim === false`). * - ≥ 1 mJ → render in mJ (3 µJ = 1 mJ = 1_000 µJ). * - otherwise → render in µJ with no decimal point. * * All arithmetic is bigint — `Number()` is NEVER used on µJ amounts. * `parseJoule` is the exact inverse of `formatJoule` for round-trip fidelity. * * @see joule-resource-credits spec, Requirement 7.7 */ export interface IFormatJouleOptions { /** * Trim trailing decimal zeros from fractional parts. * Defaults to `true`. */ trim?: boolean; } /** * Format a µJ bigint amount as a human-readable string at the most * appropriate scale (J, mJ, or µJ). * * Negative amounts render with a leading `-`. * * @example * formatJoule(2_500_000n) // '2.5 J' * formatJoule(1_500n) // '1.5 mJ' * formatJoule(42n) // '42 µJ' */ export declare function formatJoule(microJoules: bigint, opts?: IFormatJouleOptions): string; /** * Parse a string produced by `formatJoule` back into µJ as a bigint. * * This is the exact inverse of `formatJoule` with default options (trim=true). * Designed for test round-trips and serialization boundaries only; * UI display layers should call `formatJoule` exclusively. * * @throws {Error} if the string cannot be parsed. */ export declare function parseJoule(formatted: string): bigint; //# sourceMappingURL=formatJoule.d.ts.map