/** * The handful of figures a surface opens with, in a row across the top. * * A person arriving at a venue, a treasury or a proposal wants to know the size * of the thing before they read anything in it, and four figures answer that * faster than two drawings do. * * The point of the component is the fourth state. An entry has a figure, or is * still being read, or the reading failed, or the answer is genuinely nothing — * and only the last of those is a zero. One dash drawn for all four is the same * surface that reports an empty venue when its indexer is down. */ /** * What is known about one figure. * * The same three constructors a table's rows have, for the same reason: a read * that failed and a read that came back with nothing are one value in any * client that keeps a string and a flag. `it: null` is the answer that is * genuinely nothing, and `failed` carries a reason and cannot be spelled as an * empty string — which is what puts the flatten-to-zero mistake out of reach. */ export type Figure = { at: 'reading'; } | { at: 'failed'; why: string; } | { at: 'read'; it: string | null; }; export interface Stat { /** What the figure is, in the fewest words that stay unambiguous. */ name: string; of: Figure; /** What changed, as a proportion, where a change is a thing this figure * has. The sign picks the mark and the hue; `say.percent` writes it. */ change?: number | null; } /** * What a tally says that it cannot work out. * * Three words and one formatter. A figure is written by whoever read it and * arrives as text; these are the rest of the line, and they belong to a * language rather than to a component — `today` is `сегодня`, and the sign of a * percentage goes where the reader's own rules put it. */ export interface Said { /** What a change is measured over, set mid-line — "today". */ since: string; /** Where a reading failed. Not the same mark as a figure of nothing. */ missing: string; /** Where the answer is genuinely nothing. */ none: string; /** A proportion, as this reader's percentage. `figures().percent` is one. */ percent(of: number): string; } /** * What the figure did, and over what. * * The period is part of the line rather than a heading over the row: five * entries reading five different quantities all move over the same day, and the * word is what says which day. * * Zero is achromatic. Green because it is not negative reports a flat day as a * good one — but quiet under a plain figure reads as a figure that failed, so * it takes the plain weight and says nothing with hue. */ export declare function Change({ of, say }: { of: number; say: Said; }): import("react").JSX.Element; /** * What an entry puts where the figure goes. * * Four states and four different words. A dash for a reading that failed would * be the same mark as a figure of nothing, which is the substitution this * component exists to avoid. * * The ellipsis stays a mark. It says the same thing in every language, and a * catalog entry holding one character is an entry a translator can only get * wrong. */ export declare const said: (of: Figure, say: Said) => string; /** * The reasons, each said once. * * Four entries that all failed because one request went unanswered, each saying * so under itself, is the same sentence four times across the top of a screen — * louder than the figures it replaced, and no more informative than one of * them. Where the reasons genuinely differ, each is still stated. */ export declare const reasons: (of: readonly Stat[]) => string[]; export declare function Tally({ of, say, columns, }: { of: readonly Stat[]; say: Said; /** * How many across. * * A fact about the screen rather than about the figures, so a screen that has * measured its own says so. A row over a venue is one row and its count IS * the figures in it; six figures about one asset stand three across two rows, * which is an arrangement six figures do not imply and nothing here could * derive. Unsaid, the count is still the figures. */ columns?: number; }): import("react").JSX.Element; //# sourceMappingURL=tally.d.ts.map