import type { ReactNode } from 'react'; /** * An average in currency, together with everything needed to say what it is * an average OF (AGL-3080). * * {@link MeasuredRate}'s contract in money, and it goes wrong the same way: * "$0.42 per recipient" is meaningless without the recipient count, and worse * than meaningless when the reader assumes a different one from the writer. * Minor units throughout, because the per-message figure is fractional by * nature and rounding it at the model would lose the thing being measured. */ export interface MeasuredMoney { /** Minor units per unit of the denominator. Fractional by nature. */ cents: number; numeratorCents: number; denominator: number; /** Reader-facing name of the denominator, e.g. `'delivered'`. */ denominatorLabel: string; /** Lowercase ISO code as it was recorded, e.g. `'usd'`. */ currency: string; } /** * A rate, together with everything needed to say what it is a rate OF. * * The producer decides whether a rate can honestly be taken; a `null` in * place of one of these is how it says no. Nothing here formats — `value` is * 0–1 and the display multiplies — so a model can be tested on the number * without a renderer, and this file cannot invent a denominator. */ export interface MeasuredRate { /** 0–1. Multiply for display; a producer never formats. */ value: number; numerator: number; denominator: number; /** Reader-facing name of the denominator, e.g. `'delivered'`. */ denominatorLabel: string; } /** * A rate, or `null` when one cannot honestly be taken. * * `null` on a zero or unrecorded denominator. Those are not the same as 0%: * a rate over nothing is undefined, and printing it as zero states a measured * failure where there was no measurement. */ export declare function measuredRate(numerator: number | null | undefined, denominator: number | null | undefined, denominatorLabel: string): MeasuredRate | null; /** A titled block. */ export declare function Section(props: { title: string; children: ReactNode; }): import("react").JSX.Element; export declare namespace Section { var displayName: string; } /** * One count, with the population it describes named underneath. * * `null` renders as an em dash and NOT as zero, which is the whole reason * this takes `number | null` rather than defaulting. */ export declare function Figure(props: { label: string; value: number | null; note: string; }): import("react").JSX.Element; export declare namespace Figure { var displayName: string; } /** A percentage to one decimal place. */ export declare function percent(value: number): string; /** * One rate, with its denominator spelled out on the same line. * * The denominator is rendered as `12 of 480 delivered` rather than as a * tooltip or a footnote, because a reader comparing two rates has to be able * to see they are over different populations without hovering anything. A * `null` rate draws the dash and no number at all. */ export declare function RateRow(props: { label: string; rate: MeasuredRate | null; }): import("react").JSX.Element; export declare namespace RateRow { var displayName: string; } /** * One amount of money, in the currency it was recorded in. * * NOT a figure primitive, and deliberately separate from {@link Figure}: it * carries a currency, and every surface that shows these refuses to sum two * of them into one number. A currency code the platform cannot format falls * back to the amount beside the code, which is still true, rather than * throwing inside a render. */ export declare function money(cents: number, currency: string): string; /** * One money figure, with the population it is averaged over named. * * The rule {@link RateRow} enforces for a percentage, applied to an average. * `null` draws the reason rather than a zero, for {@link Figure}'s reason. */ export declare function MoneyPerUnitRow(props: { label: string; figure: MeasuredMoney | null; }): import("react").JSX.Element; export declare namespace MoneyPerUnitRow { var displayName: string; } /** * One money total, with what it counts named underneath. * * {@link Figure}'s contract in currency: `null` draws a dash and never a * zero, because "no attribution has ever been recorded" and "this earned * nothing" lead a merchant to opposite conclusions about whether to send * another one. */ export declare function MoneyFigure(props: { label: string; cents: number | null; currency: string; note: string; }): import("react").JSX.Element; export declare namespace MoneyFigure { var displayName: string; }