import type { V2Format } from './format.util'; import type { ShareWire } from '../types/share.type'; export type ShareRow = Record; /** Percentages and the centre total write whole values or one decimal. */ export type ShareFormat = Extract; /** A row of the data, as the table lists it (before any grouping). */ export type ShareEntry = { label: string; /** A finite number, or `null` when the cell is missing or not a number. */ value: number | null; /** Share of the total when the value is drawn; `null` otherwise. */ percent: number | null; }; /** A part drawn in the figure. */ export type SharePart = { label: string; value: number; percent: number; }; /** A row of the legend: the drawn parts, or every row when none is drawable. */ export type ShareLegendItem = { label: string; value: number | null; percent: number | null; }; export type ShareModel = { variant: ShareWire['variant']; /** Every row, in data order, for "Ver como tabla". */ entries: ShareEntry[]; /** Drawn parts: finite values > 0, largest first, grouped into «Otros». */ parts: SharePart[]; legend: ShareLegendItem[]; /** Sum of the drawn values; 0 when nothing is drawn. */ total: number; format: ShareFormat; }; /** * Percentages to one decimal that add up to exactly 100,0 (largest remainder * method, in tenths). Equal remainders go to the later part. Empty when the * total is not positive. */ export declare const splitPercentages: (values: readonly number[]) => number[]; /** * Turns rows into what the view draws. Reads only the wire's `x` and `y` * (own properties), keeps every row for the table and draws only finite * values > 0, largest first, with the tail grouped into «Otros». */ export declare const buildShareModel: (wire: Pick, rows: readonly ShareRow[]) => ShareModel;